You give it the takes of one shot in order and the image each was sent; you get each
take graded so its first frame matches the frame before the cut, the graded last frame
to open the next take on, and the colour jump at every cut. A model renders 5 to 15 s; a
locked-off 20 s shot is four takes, each opening on the last frame of the one before.
Chained without help, each cut steps visibly, as if a light in the room changed, and the
sequence drifts darker or warmer as it goes. To animate one still, use
guide-animate-a-shot; when the shot can cut to another angle instead, cut.
What breaks a chain, and the fix
| What you see | Why | Fix |
|---|---|---|
| The lighting steps at every cut | A video model's first frame is its own re-rendering of the image it was sent, a few grey levels darker or shifted (the model's leaf has its number). The take before ended on the original, so the cut steps. | correct grades each take so frame 0 matches what it was sent. |
| The sequence gets darker or warmer shot after shot | Each take recovers only part of the shift (or drifts on its own), and the next take starts from that frame. | Open the next take on the graded last frame, so no shift is carried; --anchor eases each take back to the first still's level. |
| Every cut zooms or shifts a few px | The model crops or rescales what it's sent to fit its own canvas. | Size every opening the way the model's leaf says, from the raw take's last frame at its own size, once. |
| The camera creeps in across the chain | Models push in slowly even when told the camera is locked; it never shows at a cut, but four 768P takes ended 20–30% tighter than the still. | Keep chains short; check each take's last frame against the still with python-measure-layout-drift, and re-render a take that crept. Pinning the still as the last frame too is untested. |
| People re-pose at the cut | Some models hold the room on frame 0 and re-pose the people. | Cut only where the picture can change (the model's leaf says whether it does this). |
| Every take has its own music, noise or murmur | The model scores each take. | Turn its sound off or prompt for silence (the model's leaf), and lay one sound bed under the whole shot. |
| The cut lands mid-word or mid-gesture | A take is cut where its length runs out, not where the action rests. | Plan the cuts, and give each take a tail to cut in (Where to cut). |
| The shot runs long | Takes come back a little past the length asked (5.17 s for 5). | Cut each take at its planned frame and open the next on that frame; cut the whole shot to length at the end. |
Where to cut
Plan the cut points before rendering, then make each take reach its cut with a little to spare.
- Cut where the picture rests. The next take starts from its opening frame and eases into motion, so a cut reads best where the outgoing take is near still: between actions, after a gesture lands, in a breath.
- With speech, cut in a pause: after a sentence first, otherwise where the speaker
changes, never inside a word. Find the pauses on the track itself (
python-find-speech-pauses, orpython-plan-lipsync-chunksfor a long track, which snaps them to the frame grid). Leave about 0.2 s of the pause on each side of the cut, so neither take starts or ends on a mouth already moving (guide-lipsync-video, Cut windows). - Render a tail. Ask for each take about 0.5 to 1 s longer than its segment. Pick the
cut frame inside that tail, at the rest or pause, export it (
ffmpeg-frame-exact-trimgives the exact frame), prepare it for the model, and open the next take on it. Grade the next take against that frame, not the take's last frame. Without a tail, the cut falls wherever the take happened to end. - Only where frame 0 holds the people. Some models hold the room on frame 0 but
re-pose the people (H3 Max reference-to-video:
h3-max-reference-to-video). There grading fixes the brightness, not the jump: cut on an angle change or under a full-frame graphic instead. - The head is the cut frame. Don't trim the start of a chained take: its frame 0 is the frame the last take was cut on, so trimming it reopens the jump. Trim only the first take's head and the last take's tail.
- A short dissolve of a few frames at each seam hides a residual step of a few tenths
of L*. A H3 lip-sync chunk join uses 5 frames for its ~1% zoom differences
(
python-assemble-lipsync-chunks). Between a frame and its own re-render it costs nothing.
The colour and framing numbers here come from four-take chains of a locked-off shot with no dialogue. The speech advice comes from H3 lip-sync chunks, which reopen on a pinned pose rather than the cut frame. Chained dialogue itself hasn't been tested yet.
Inputs
- The takes, untrimmed, exactly as they came back, and the image each was sent.
- For
--anchor: the first still, the one take 1 opened on.
Run it
Write references/chain-takes.md's script into the job's scripts/ as
chain_takes.py, unchanged, and run it with exec python. Render and grade in turn,
each take opening on the graded last frame of the one before:
exec python scripts/chain_takes.py correct --take video/raw/s1_a.mp4 --sent stills/s1_open.png \
--anchor stills/s1_open.png --out video/graded/s1.mp4 --last stills/s2_open_raw.png
Prepare s2_open_raw.png for the model as its leaf says (frame size, padding), send that
as take 2's first frame, then grade take 2 with --sent the graded last frame it opened
on, and so on. Join the graded takes end to end (ffmpeg concat) and check the cuts:
exec python scripts/chain_takes.py cuts --takes video/graded/s1.mp4 video/graded/s2.mp4 video/graded/s3.mp4
exec python scripts/chain_takes.py measure --takes video/raw/s1_a.mp4 --sent stills/s1_open.png
Takes already rendered from raw last frames grade the same way after the fact: pass each
take's --sent as the graded last frame of the take before. For two takes of one setup
cut together (not chained), grade the incoming take with --sent the outgoing take's
last frame.
correctshifts every channel by a constant: the model's shift is close to uniform (gain within about 1% of 1, the same in dark and light areas), so an offset fixes it without re-grading contrast. Means are taken over the central 80%, so a few px of crop don't matter.- Where people re-pose or move at a cut, measure on what stayed put:
--static 0.6keeps the 60% of pixels whose brightness changed least between the two frames, and--region x0,y0,x1,y1(fractions of the frame) measures only there, a wall or the set. Both work onmeasure,correctandcuts. On a cut into a page-turn graded 4 grey levels down,--static 0.6recovered 3.4 to 3.8 per channel. --anchoreases the offset across the take so its last frame matches the still's level. Only for a shot whose framing and content stay put: on a take that pushed in or where a person crosses the frame it grades the content change. Leave it off there; the cuts still match.- The graded take is written at the take's size with its sound copied, H.264 at CRF 12, tagged BT.709.
What you get
JSON on stdout:
correct:start_offset_rgbandend_offset_rgb, the grey levels added at frame 0 and at the last frame (R, G, B). Two to six per channel is typical; above about 15 means the take didn't open on its image, not a colour shift.cuts: per take,cut_dL(the jump in L* from the take before's last frame to its first) anddrift_from_first_dLagainst the first take's frame 0.measure: per take,frame0_offset_rgbandframe0_dL, and the last frame against the image sent.
Check it
cut_dLunder about 0.3 at every cut: ordinary frame-to-frame change in a still room is 0.05 to 0.3. Ungraded chains measured 1.2 to 1.8 at every cut, seen as a light changing.drift_from_first_dLwithin about 1 across the shot with--anchor.- Play the joined shot at full size around each cut, and check the framing with
python-measure-layout-drift: a colour match doesn't hide a zoom.


