# FFmpeg trim-cut handoff checklist: probe I-frames, -c copy on a keyframe, prove first frame and duration Published: 2026-11-11 (Asia/Shanghai) Companion review: https://toolbrivio.com/articles/ffmpeg-trim-cut-handoff-review.html You already have a finished or rough-cut MP4. You need to drop the heads and tails, or pull a section, before you hand the file to an NLE, a platform, or the next editor. Prefer stream copy when the in-point sits on a keyframe. If it sits mid-GOP, copy can still exit 0 with the wrong start or a hidden lead-in. Probe the I-frames, make the cut, then prove the first frame and the duration. This is the working checklist, not another benchmark. The companion FFmpeg trim-cut handoff review holds the comparison tables, trap stills, and community links. A GUI for the same job is covered in our LosslessCut interview-cut review (https://toolbrivio.com/articles/losslesscut-interview-cut-review.html); this page stays on the CLI. Test record: November 11, 2026 (Asia/Shanghai), FFmpeg/ffprobe 7.1.5-0+deb13u1 on Debian GNU/Linux 13. All fixtures are a local lavfi testsrc2 card with a fixed GOP and burned-in T=/F= timecode, not a real interview tape, NLE export, or platform upload. Numbers below are lab examples, not size targets for your footage. verification.txt: **30/30 PASS**. ## 1. Write the trim handoff contract - [ ] Agree the in-point, the duration or out-point, and whether the receiver will accept a stream copy or needs a frame-accurate re-encode. Keep the original MP4; write a new file. - [ ] Decide the path up front. Copy is the fast path only when the in-point is on (or you can move it to) an I-frame. Mid-GOP starts that must hit an exact frame need a re-encode. Do not treat this lavfi lab as an NLE or platform certificate. - [ ] Record local tool versions and run a short trial before cutting a whole batch. ```sh ffmpeg -version ffprobe -version ``` ## 2. Probe I-frames and the source clock ```sh ffprobe -v error -count_frames -show_streams -show_format -of json source-fixed-gop.mp4 > source-probe.json ffprobe -v error -select_streams v:0 -show_frames \ -show_entries frame=pts_time,pkt_pts_time,pict_type,key_frame,width,height \ -of csv=p=0 source-fixed-gop.mp4 ``` - [ ] Record codec, size, frame rate, duration, bytes, and every I-frame time. Our lab source `source-fixed-gop.mp4` was H.264 640x360 30 fps **300** frames, a fixed GOP with I-frames at **0.000000, 2.000000, 4.000000, 6.000000, 8.000000**, AAC stereo 48 kHz, duration **10.000000** s, **1,830,062** B. Each frame is burned with T= and F= (F=120 is 4.000 s, F=150 is 5.000 s, F=180 is 6.000 s, and F=210 is 7.000 s). - [ ] FAIL a copy plan that skips the I-frame list. The r/ffmpeg trim-without-re-encoding thread (https://www.reddit.com/r/ffmpeg/comments/1qag2ug/trimming_video_without_reencoding/) and the Super User frame-cut answer (https://superuser.com/questions/1021053/how-to-cut-video-files-by-frame) start from the same rule: copy is clean at a GOP boundary. ## 3. Copy on (or near) an I-frame ```sh ffmpeg -ss 4.000 -i source-fixed-gop.mp4 -t 2.000 -c copy pass-copy-on-iframe.mp4 printf "EXIT=%s\n" "$?" ``` Put `-ss` before `-i`, then `-t`, then `-c copy`. Pick a new output filename. Without `-y`, FFmpeg asks before overwriting. - [ ] Primary PASS on our fixture: EXIT 0, H.264 640x360 30/1, format duration **2.066667** s (**0.066667** s longer than the requested 2.000 s), **62** frames (the request was 60), AAC audio 2.016000 s, first frame an I-frame at 0.000000 burned **T=00:00:04.000 F=120**, **382,077** B. - [ ] Do not log this as an exact 2.000000 s clip or as the same bytes as the source (1,830,062 B). Copy can overshoot the out-point by a packet or two. The Super User start-to-end cut thread (https://superuser.com/questions/377343/cut-part-from-video-file-from-start-position-to-end-position-with-ffmpeg) is this path: input `-ss` plus `-t` plus copy. ## 4. Mid-GOP: default copy vs make_zero vs libx264 Now start at 5.000 s, one second into the GOP that begins at 4.000, and still ask for 2.000 s (source 5.000 to 7.000). ```sh ffmpeg -ss 5.000 -i source-fixed-gop.mp4 -t 2.000 -c copy ctl-midgop-copy.mp4 ffmpeg -ss 5.000 -i source-fixed-gop.mp4 -t 2.000 -c copy -avoid_negative_ts make_zero ctl-midgop-copy-make-zero.mp4 ffmpeg -ss 5.000 -i source-fixed-gop.mp4 -t 2.000 -c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p -c:a copy ctl-midgop-reencode-ss-before.mp4 ffmpeg -i source-fixed-gop.mp4 -ss 5.000 -t 2.000 -c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p -c:a aac -b:a 128k ctl-midgop-reencode-ss-after.mp4 printf "EXIT=%s\n" "$?" ``` - [ ] Default mid-GOP copy: EXIT 0. Format duration reads **2.066992** s, which looks close, and the first presented frame is burned **T=00:00:05.000 F=150**. The container disagrees: nb_frames **92** / nb_read_frames **62**, first packet PTS **-1.000000**, **561,042** B. An MP4 edit list hid the 4.000-5.000 s packets for decode. We did not import this file into an NLE, so we cannot say how a timeline would treat that edit list. - [ ] Add `-avoid_negative_ts make_zero` and that lead-in is no longer hidden. EXIT 0. Video duration becomes **3.066667** s with all **92** frames presented. The first frame is now burned **T=00:00:04.000 F=120**. Format duration is **3.140690** s, start_time **0.074023**. Size is **561,054** B, 12 bytes more than the default copy, not the same file. - [ ] libx264 precise cut: both re-encodes start on the requested 5.000 s card and run **60** frames. Input `-ss` (audio copy) wrote video **2.000000** s at **369,059** B, format **2.019000** s. Output `-ss` (audio re-encoded AAC 128k) wrote format and video **2.000000** s at **351,724** B. Both first frames are burned **T=00:00:05.000 F=150**. The two first-frame PNGs match each other and, after a CRF 18 pass, do not match source-t5.png. This is the frame-accurate path. It is also a new encode, not a copy. The r/ffmpeg thread on -ss and -t not being frame-accurate (https://www.reddit.com/r/ffmpeg/comments/1bywr8z/cutting_with_ss_and_t_is_not_frameaccurate/), the Super User mix-copy-and-encode question (https://superuser.com/questions/1570180/can-i-mix-copy-and-encode-in-one-operation-to-have-an-accurate-and-fast-cut), and the Stack Overflow precise-trim thread (https://stackoverflow.com/questions/72033739/how-to-precisely-trim-a-video) are this job class. ## 5. Prove the cut ```sh ffprobe -v error -count_frames -show_streams -show_format -of json out.mp4 > out-probe.json ffprobe -v error -select_streams v:0 -show_entries packet=pts_time,dts_time,flags,duration_time,size -of csv=p=0 out.mp4 ffmpeg -i out.mp4 -frames:v 1 -update 1 out-first.png ``` - [ ] PASS only after the requested interval, format duration, video duration, nb_frames vs nb_read_frames, first packet PTS, and the burned-in first frame agree with the contract. Matching the source byte size is not required; none of our outputs equal **1,830,062** B. - [ ] EXIT 0 alone is not a cut proof. Every PASS, control, and trap in this lab exited 0. ## 6. Stop on EXIT 0 traps ```sh ffmpeg -i source-fixed-gop.mp4 -ss 5.000 -t 2.000 -c copy trap-ss-after-copy.mp4 ffmpeg -ss 5.000 -i source-fixed-gop.mp4 -ss 2.000 -t 2.000 -c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p -c:a aac -b:a 128k trap-double-ss-reencode.mp4 ffmpeg -ss 4.000 -i source-fixed-gop.mp4 -to 6.000 -c copy trap-to-after-input-ss.mp4 printf "EXIT=%s\n" "$?" ``` - [ ] FAIL `-ss` after `-i` still with `-c copy`. EXIT 0. Format duration **2.053667** s, start **0.013000**. Video duration **1.066667** s, start_time **1.000000**, **32** frames. Audio **2.005333** s from 0.013000. The first video frame is an I-frame at PTS 1.000000, burned **T=00:00:06.000 F=180**, the next keyframe, not 5.000. File size **226,073** B. A player that starts audio at 0.013 s has no video until 1.000 s and typically holds that first I-frame. The FFmpeg Seeking wiki (https://trac.ffmpeg.org/wiki/Seeking) and the Super User -ss and keyframes thread (https://superuser.com/questions/1847624/ffmpeg-ss-option-and-keyframes) describe this class of output seek plus copy. We link the official wiki URL; this lab did not load the live trac page. - [ ] FAIL stacked `-ss` (input 5.000 plus output 2.000) then a libx264 re-encode. EXIT 0. Format and video duration look tidy: **2.000000** s, **60** frames, **361,815** B. The first frame is burned **T=00:00:07.000 F=210**. The two `-ss` values added (5+2=7). The Seeking wiki calls this combined seeking. The clip looks perfect if you only read duration. - [ ] FAIL `-to` after an input `-ss` with no `-copyts`. If you meant source 4.000 to 6.000, that should have been a 2 s clip. Input `-ss` resets the timeline to zero, so `-to 6.000` is a 6 s out-point. EXIT 0. Duration **6.000000** s, **180** frames, **1,088,108** B. The first frame is still T=00:00:04.000. The file runs toward the end of the 10 s source. The Super User start-to-end thread documents the same reset; `-t` is duration, and `-to` stays on the source clock only with `-copyts`. ## 7. Open the trial in the receiving tool - [ ] HOLD until the NLE or platform that will actually receive the file plays a short trial. NLE timeline import, including whether an editor honors the MP4 edit list, and platform upload previews were not run in our lab. - [ ] Play the clip and look at the first frame, not only the duration readout. Our burned-in cards cannot stand in for a real interview tape. Export duration quirks in the GUI path are in the LosslessCut export duration audit (https://toolbrivio.com/articles/losslesscut-export-duration-audit.html); we did not re-test that GUI here. ## 8. Attach the proof and sign off - [ ] Keep the source and output filenames, tool versions, full command, exit code, I-frame list, requested vs output duration, nb_frames vs nb_read_frames, first packet PTS, first-frame still, and byte sizes together. Include receiver acceptance or leave delivery on HOLD. - [ ] PASS only after the first frame and duration match the contract. FAIL on mid-GOP copy sold as a frame-accurate cut, `-ss` after `-i` still copy, stacked `-ss`, or `-to` after an input `-ss` without `-copyts`. HOLD on untested GUI, NLE, GPU, and platform paths. Run the same checks on each remaining file, not only the first trial. ## Evidence checkpoints Use these as lab examples, not size targets for your own footage. Source: **1,830,062** B, **10.000000** s, **300** frames. PASS copy on I-frame: format **2.066667** s, **62** frames, **382,077** B. Mid-GOP default copy: format **2.066992** s, nb_frames **92** / nb_read_frames **62**, first packet PTS **-1.000000**, **561,042** B. make_zero: video **3.066667** s, **92** frames, **561,054** B. libx264 input `-ss`: video **2.000000** s / **60** frames / **369,059** B. libx264 output `-ss`: **2.000000** s / **60** frames / **351,724** B. Trap `-ss` after `-i` still copy: **226,073** B, first frame T=00:00:06.000. Trap stacked `-ss`: **361,815** B, first frame T=00:00:07.000. Trap `-to` after input `-ss`: **6.000000** s / **180** frames / **1,088,108** B. verification.txt: **30/30 PASS**. Trace: evidence/ffmpeg-trim-cut-handoff/NOTES.md records the source, PASS, control, and trap matrices. run-lab.sh records the commands. summary-probes.json and probes/ hold stream fields; sizes-bytes.txt holds exact bytes; exit-codes.txt and logs/ record encoder outcomes; verification.txt shows 30/30 checks passed. Pulling a soundtrack out of a finished MP4 is covered in the extract-audio review. We did not re-test extract-audio, rotate, scale+fps, or replace-audio here. ## Download the checklist Keep this file with the probes and fill in each box before delivery. For the control runs, trap stills, and community links, return to the companion review. ## FAQ ### Does -c copy on a keyframe give an exact 2.000 s clip? No. Our -ss 4.000 -t 2.000 -c copy run exited 0 at 382,077 B. Format duration was 2.066667 s (0.066667 s longer than requested) with 62 frames, not 60. The first frame was clean at T=00:00:04.000 F=120. Copy can overshoot the out-point by a packet or two. ### Why did a mid-GOP copy look like 2 s but carry 92 packets? Default input -ss 5.000 -t 2.000 -c copy exited 0 at 561,042 B. Format duration read 2.066992 s and the first presented frame was T=00:00:05.000 F=150, but ffprobe reported nb_frames 92 / nb_read_frames 62, and the first packet PTS was -1.000000. An MP4 edit list hid the 4.000-5.000 s lead-in. ### What does -avoid_negative_ts make_zero do to that mid-GOP copy? The same command plus -avoid_negative_ts make_zero exited 0 at 561,054 B, 12 bytes more than the default copy, not the same file. Video duration became 3.066667 s with all 92 frames presented. The first frame was T=00:00:04.000 F=120, one second early. ### Why is EXIT 0 not proof the cut is correct? All three traps exited 0. -ss after -i with -c copy started video at T=00:00:06.000 F=180 (226,073 B). Stacked -ss then re-encode landed at T=00:00:07.000 F=210 (361,815 B). Input -ss 4.000 plus -to 6.000 without -copyts wrote 6.000000 s / 180 frames / 1,088,108 B. ### What still needs a HOLD after the probes pass? LosslessCut, Avidemux, and Smart Cut GUIs; NLE timeline import, including whether an editor honors the MP4 edit list; GPU/NVENC; batch GUIs; and platform upload previews were not tested in this lavfi lab. Leave those on HOLD until checked. ## Honest limits Not tested: LosslessCut, Avidemux, or commercial Smart Cut GUIs; NLE timeline import (including whether an editor honors the MP4 edit list); GPU/NVENC; batch GUI tools; platform upload previews. Fixtures were lavfi/synthetic. This checklist does not certify those paths. No deep retests of extract-audio, rotate, scale+fps, replace-audio, Shorts crop/pad, concat, burn-in, thumbnail, or delivery CRF workflows are included.