You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: trim and concat stream-copy keep hidden frames from before 'start' (trimmed content still ships in the file) #203
trim is the obvious tool for removing the first few seconds of a clip, often because something sensitive was on screen. With -c copy the output still contains those frames. It plays from start, but the earlier GOP is kept in the file and hidden behind an MP4 edit list. Any player or tool that ignores edit lists (-ignore_editlist 1, some web uploaders, frame extractors) shows them. concat, which also stream-copies, carries the hidden frames into the joined file.
Capture sets no keyframe interval (resolveQuality, src/utils/targets.ts:161-166), so x264's default keyint 250 applies. That is up to about 8 s of hidden frames at 30 fps, or 25 s at 10 fps.
Repro (ffmpeg 8.1.1, synthetic 20 s clip): trim start=7, duration=3. The file plays 3.17 s but holds 302 video packets (about 10 s), and -ignore_editlist 1 decodes all 302 frames.
A concat of two such trims held 394 packets for 185 visible frames.
The tool description says only "cut points snap to the nearest keyframe". It does not warn that earlier content stays in the file.
Suggested approach
Add exact: true (re-encode, as clip does) and make it the default. Alternatively, when start > 0, re-encode only the leading partial GOP (smart cut).
Set a keyframe interval at capture (for example -g = 2 s worth of frames) so copy-trims stay cheap and close to the cut point.
Document clearly that copy mode keeps earlier data in the file.
Done when
A copy-free default trim contains no packets before start (integration test that counts packets with -ignore_editlist 1).
concat inherits no hidden frames from its inputs.
The tool descriptions explain the copy versus exact trade-off.
Activity
fix: full-target capture, % in output paths, odd compress width, exac…