A long recording is often easier to handle in pieces — uploading within a platform’s size limit, sharing one chapter at a time, or processing chunks in parallel. FFmpeg can split a single video into multiple parts without re-encoding, so the output is identical in quality to the source and finishes in seconds. This guide covers automatic splitting by fixed time intervals, cutting out one specific part, and the keyframe rules you need to know to avoid surprises. Estimated time: 8 minutes.
Tested with: FFmpeg 8.1
What You’ll Learn
- Splitting into fixed-length parts with the segment muxer
- Why
-reset_timestamps 1matters - Cutting out a single part by start time and duration
- Keyframe accuracy and why cuts land where they do
- Splitting at exact times (with re-encoding) when you need frame accuracy
- Troubleshooting and FAQ
1. Split into Fixed-Length Parts (Segment Muxer)
To cut a video into back-to-back 60-second parts, use the segment muxer:
ffmpeg -i input.mp4 -c copy -f segment -segment_time 60 -reset_timestamps 1 output_%03d.mp4
This writes output_000.mp4, output_001.mp4, output_002.mp4, … each roughly 60 seconds long.
-c copy… no re-encoding; lossless and fast-f segment… use the segment muxer-segment_time 60… target length per part in seconds-reset_timestamps 1… restart each part’s timestamps at zerooutput_%03d.mp4… the%03dbecomes a zero-padded counter (000, 001, …)
| Option | Meaning |
|---|---|
-f segment | Activate the segment muxer |
-segment_time | Target seconds per output part |
-reset_timestamps 1 | Each part starts its clock at 0 |
%03d | Auto-incrementing 3-digit file index |
The
%03dpattern is why this command is shown as plain text rather than a runnable block — the counter is filled in by FFmpeg at run time.
2. Why -reset_timestamps 1 Matters
Without -reset_timestamps 1, each part keeps the original timestamps from the source. So output_001.mp4 would start at 60 seconds instead of 0, and many players show a long blank gap before playback begins.
With -reset_timestamps 1, every part begins at 00:00:00, so each file plays cleanly on its own. Leave it on unless you have a specific reason not to.
3. Cut Out a Single Part by Start and Duration
If you only need one slice — say the first 60 seconds — you do not need the segment muxer. Seek to the start and set a duration:
ffmpeg -ss 00:00:00 -t 60 -i input.mp4 -c copy output_part1.mp4
-ss 00:00:00… start position (here, the beginning)-t 60… take 60 seconds from that point-c copy… lossless copy
To grab a later slice, change the start time, for example the chunk from 2:00 to 3:00:
ffmpeg -ss 00:02:00 -t 60 -i input.mp4 -c copy output_part2.mp4
For a deeper look at start/end cutting and the -to flag, see the trimming guide.
4. Keyframe Accuracy — Why Cuts Land Where They Do
When you split with -c copy, FFmpeg can only cut at keyframes (also called I-frames). It cannot split inside a group of pictures without re-encoding. The segment muxer, in particular, splits at the keyframe at or after each requested time, so a part may start a little later than the time you asked for.
| Approach | Cut accuracy | Speed | Quality |
|---|---|---|---|
-c copy (stream copy) | Snaps to keyframe | Very fast | Lossless |
| Re-encode | Frame-exact | Slower | Re-encoded |
This means a 60-second segment might actually be 58 or 62 seconds, depending on where keyframes fall. For most uses that is fine. When you need the cut to land on an exact frame, re-encode (next section). See the FFmpeg Seeking wiki for the underlying behavior.
5. Split at Exact Times (Re-encoding)
When frame accuracy matters more than speed, drop -c copy and let FFmpeg re-encode. The split point can then be any frame:
ffmpeg -ss 00:00:30 -t 30 -i input.mp4 -c:v libx264 -crf 18 -c:a aac output_exact.mp4
- Without
-c copy, FFmpeg decodes and re-encodes, so it can start exactly at 00:00:30 -crf 18… high quality (lower is better quality, larger file)
The trade-off is time and a re-encode pass, but the cut is frame-perfect.
6. Troubleshooting
Issue 1: Parts start with a few black or frozen frames
Cause: Stream copy began before a keyframe, so the decoder had no full frame to display yet. Fix: Accept the keyframe snap, or re-encode for an exact start (section 5).
Issue 2: Each part seems to start at the wrong time
Cause: -reset_timestamps 1 was omitted, so parts kept their original timestamps.
Fix: Add -reset_timestamps 1 to the segment command (section 1).
Issue 3: Only one output file is produced
Cause: The output filename had no %03d pattern, so every segment overwrote the same file.
Fix: Include %03d (or similar) in the output name so each part gets a unique index.
FAQ
Q1. Does splitting reduce quality?
A. Not with -c copy — the bitstream is copied unchanged. Only the re-encode method in section 5 alters the video.
Q2. Can I split by file size instead of time?
A. Yes. The segment muxer supports -segment_time (by time) and related options; time-based splitting is the most reliable. For size limits, split by a time that you know stays under the cap.
Q3. Why is my 60-second segment actually 62 seconds?
A. With -c copy, FFmpeg snaps to the nearest keyframe, so segment lengths vary slightly. Re-encode (section 5) if you need exact lengths.
Q4. Can I split a video and join parts back later? A. Yes. Splitting and concatenating are inverse operations. See the concatenation guide to recombine parts.
Q5. Does this work for MKV or MOV?
A. Yes. The segment muxer works across containers; just give the output a matching extension (e.g. output_%03d.mkv).
Related Articles
Tested with FFmpeg 8.1 — verified with our command-check script Primary sources: ffmpeg.org/ffmpeg-formats.html#segment / trac.ffmpeg.org/wiki/Seeking