Splitting Video with FFmpeg: Lossless Cuts Versus Exact Segment Lengths

Using FFmpeg's segment muxer with stream copy (-c copy) gives a fast, lossless split at chosen timestamps. However, stream copy can only cut on keyframes, so a requested fixed segment length such as 2 seconds will not be exact and parts will drift. For precise lengths, the video must be re-encoded with keyframes forced at each boundary, which also yields a short leftover final part when the frame count does not divide evenly. The author's tests on a 10-second clip show that -reset_timestamps 1 should always be used to avoid timestamp confusion, and that splitting with separate -t and -ss copy commands can duplicate frames around the cut point. The article provides a Python helper that checks keyframes and scene cuts and verifies that the split frame counts sum to the source.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in