How to Split Video into 10 Second Segments in FFmpeg

This article provides a quick and practical guide on how to use the FFmpeg segment muxer to split a video file into equal 10-second parts. You will learn the exact command-line syntax for both fast splitting (stream copying) and precise splitting (re-encoding), along with an explanation of how each parameter works to ensure your output files are properly formatted.

To split a video using FFmpeg, you can choose between two primary methods depending on whether you need speed or frame-accurate precision.

Because video files compress data using keyframes, splitting a video at an exact timestamp often requires forcing a keyframe at those specific intervals. Re-encoding the video ensures that each 10-second segment starts exactly on time.

Run the following command in your terminal:

ffmpeg -i input.mp4 -force_key_frames "expr:gte(t,n_forced*10)" -f segment -segment_time 10 -reset_timestamps 1 output_%03d.mp4

Method 2: Fast Splitting (Without Re-encoding)

If you want to split the video instantly without waiting for re-encoding, you can copy the video and audio streams directly. Note that this method may result in segments that are slightly longer or shorter than 10 seconds, as FFmpeg can only split the video on existing keyframes.

Run this command for the fast copy method:

ffmpeg -i input.mp4 -c copy -f segment -segment_time 10 -reset_timestamps 1 output_%03d.mp4

Command Parameter Breakdown