Eased punch-in on a screen recording
Give it a screen recording, the piece's time span and two or three crop rectangles on
the screen (in source pixels). You get the piece rendered at the output size with a
smooth push or pan between those rectangles. Use it for zooms on real footage; a
compositor camera over layers you built is hn4a-compositor-in-scene-titles, and an
animated crop on a compositor video layer doesn't work (hn4a-compositor-motion-graphics).
Inputs
- The recording and the piece's start and end.
- A fixed region around the screen window, with the output's aspect (1.125 for a 1080×960 half of a 9:16 split screen).
- Keyframes: fractions of the piece (0, 0.6, 1) → a crop rectangle inside the region. Read the rectangles off frames at the piece's start and end, cropped to the screen window with a 100 px grid and source-pixel labels.
Run it
- Crop the region and upscale it 2× with lanczos. The upscale is what keeps the move smooth: zoompan on the source pixels steps visibly.
zoompanwithd=1(one output frame per input frame) ands=the output size. Zoom = region width ÷ crop width;xandyare the crop's position inside the region, doubled for the upscale.- Ease between keyframes with a smoothstep on the output frame number
on:p = (on/N − f0)/(f1 − f0),e = p·p·(3 − 2p), then interpolate the rectangle withe. Write the expressions from a small Python script per piece rather than by hand. - Hold the last key when a graphic must land on a still frame.
Tips and traps
- One move a piece, calm: one drift and one push, never a chase.
- Keep text legible: no crop narrower than about 300 source pixels for UI text.
- Pages scroll mid-piece. Frame loosely enough to survive it, or end the move before the scroll.
- A static punch-in on a whole UI window is unreadable on a phone. Push onto one element.
Check it
ffprobe the frame count against the piece's duration × fps, and a contact sheet at
the start, middle and end of each move to confirm it lands on the element.


