Split Large Video Files with FFmpeg on Linux

This article provides a straightforward guide on how to slice large video files into smaller, manageable chunks using FFmpeg via the Linux command line. You will learn how to split videos by specifying exact time durations, cutting specific time segments, and leveraging fast seeking to process files without losing quality or re-encoding.


Splitting by Fixed Time Duration

If you want to break a long video into multiple segments of equal length (for example, every 10 minutes), the -f segment muxer is the most efficient tool for the job.

ffmpeg -i input.mp4 -c copy -map 0 -segment_time 00:10:00 -f segment output_%03d.mp4

Extracting a Specific Time Segment

When you only need a single specific clip out of a larger file, you can define the exact start time and duration or end time.

Method A: Using Duration

ffmpeg -ss 00:01:30 -i input.mp4 -t 00:05:00 -c copy output_clip.mp4

Method B: Using an End Time

ffmpeg -ss 00:01:30 -i input.mp4 -to 00:06:30 -c copy output_clip.mp4

Handling Keyframe Mismatches

Using -c copy is fast because it doesn’t re-encode, but it relies on existing keyframes (I-frames). If you split a video at a second that doesn’t land on a keyframe, the video might freeze or show a black screen for a few seconds at the beginning of the chunk.

If precision is more important to you than speed, force FFmpeg to re-encode the video by removing the stream copy command:

ffmpeg -ss 00:01:30 -i input.mp4 -to 00:06:30 -c:v libx264 -c:a aac output_precise.mp4

By omitting -c copy and explicitly defining codecs like -c:v libx264 (for video) and -c:a aac (for audio), FFmpeg will cut exactly at the requested timestamp and generate brand-new keyframes at the split points.