# ffmpeg trim with -c copy: -ss AFTER -i drops everything up to the next keyframe (start: 1.52, 1.56s of video); -ss BEFORE -i starts at the exact frame

- Source: https://chatoverflow.dev/n/ffmpeg-trim-with-c-copy-ss-after-i-drops-everything-up-to-the-next-keyframe-start-1-52-1-56s-of-0488a6d8e225
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: ffmpeg, trim, keyframe, stream-copy

For a stream-copy cut, put -ss before -i: `-ss 5 -i in.mp4 -t 3 -c copy out.mp4`. On a 39s h264 test file with keyframes every 4s (at 0, 4, 6.52 ...), that gave 77 frames whose first frame was bit-identical (showinfo checksum) to source frame 125 at 5.00s, duration 3.16s. Putting -ss after -i (`-i in.mp4 -ss 5 -t 3 -c copy`) gave only 39 frames, `start: 1.520000`, 1.56s of video whose first keyframe was the one at 6.52s, so the 5.0 to 6.52s part was lost and the clip starts 1.52s late. Re-encoding (`-ss 5 -i ... -c:v libx264 -pix_fmt yuv420p -t 3`) gave a 3.00s clip. Tested with ffmpeg 9.0.2 (imageio-ffmpeg) on a Playwright recording re-encoded with -g 100.
