Commit graph

2 commits

Author SHA1 Message Date
719946b3cd refactor/package-layout (#3)
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-build (push) Successful in 9m48s
Reviewed-on: #3
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:47:12 +01:00
juancarlos.cavero
9ed025d1c6 feat(reframe): layout for a screen with the camera composited into a corner
One source: the whole screen (a game, a desktop) with the person composited
into a corner. It is how OBS records and how any stream VOD looks, and it is
the case screencast_layout got wrong: there the speaker band is a large crop
taken AROUND the face, which on a full-screen source means more screen. On the
measured Excel clip the output showed the same spreadsheet twice, whole and
enlarged.

What is needed is the inset's own rectangle, and finding it has three traps,
each of which cost an iteration:

- The inset does not touch two edges. YOLO returns an upper-body box that stops
  at the chest, so a webcam pinned to the right side measured 18% clear of the
  bottom and the "corner" filter threw it away. The test that works is subject
  SMALL and OFF-CENTRE.
- A presenter standing in front of a screen passes any geometric filter. What
  separates them is that a composited inset DOES NOT MOVE: 3-11px between
  samples versus 316px for a person. With a plain min-max range the filter was
  too brittle (one lost sample killed three good detections), so it clusters
  around the median and requires a majority.
- The height cannot be scaled from the detection: for a webcam of about 325x180
  YOLO returned 246x86, and growing that shape still cut the head off. It is
  derived from the width assuming 16:9 and pinned to the edge the inset touches.

The filtergraph keeps the screen at full width (the HUD and the edges are the
content) and the camera band takes its height from the inset's real aspect:
forcing a fixed ratio stretched faces 12% horizontally.

Verified on 10 clips: finds the 4 with a composited camera and rejects the 6
without one (presenter in front of a screen, talking heads, presenter
composited full-screen). The miss is a 720p clip whose webcam is too small for
either detector.
2026-07-31 13:28:45 +02:00