Seamless stitch
Problem: with first/last-frame generation a clip does not end exactly on its end image, while the next clip starts exactly on it. A plain concat therefore jumps (typical measurement: frame-to-frame change of 11 to 16 at each seam against about 4 elsewhere), and the end of a clip often slows or settles.
python3 <video-clip-judge skill folder>/clipkit.py seams --clips c1.mp4 c2.mp4 c3.mp4 --out film.mp4 --report seams.json [--window 36]
Needs ffmpeg, python3 and numpy. Re-encode the clips to the same size, fps and audio first, for example 1280x720, 24 fps, 48 kHz AAC, normalising loudness to about -20 LUFS in the same ffmpeg call (Veo clips are quiet).
How it chooses
For every seam it compares each of the last window frames of A with each of the first window frames of B (192x108 grayscale, mean absolute pixel difference) and adds a speed-continuity term, a motion-direction term and a small penalty for frames thrown away. B's matched frame is dropped (it equals A's) and playback continues from the next one. Video is concatenated by frame with no fades; audio gets an 80 ms triangular crossfade.
Typical result: seam pixel gap 11 to 16 before, 4 to 6 after; no frame-to-frame spike above 8.6 in the whole film; each seam trims about 7 frames of A's tail.
Check after stitching (required)
- In the report,
pixshould be well underbaseline_pix. Ifpixstays above about 8, the clips are not the same picture there: regenerate or add a cutaway, do not blend. - Run
video-clip-judgeon each INPUT clip first. Stitching does not fix ghosting inside a clip. - Compare the largest frame-to-frame change of the output with the typical value, and look at each seam as an 8 fps tile sheet.
- Known limit: a hard cut at the best-matching frame removes the jump but cannot fix a change of look between clips (clothing colour) or a wrong action.