How to Split Videos in Multiple Parts using FFmpeg

1 November 2022 | 2 min read
Casper Kloppenburg

Prerequisites

FFmpeg is a free and open-source video editing tool capable of trimming, cropping, concatenating, muxing, and transcoding almost any type of media file you throw at it.

It's also a very robust solution for implementing video automation, as we use it extensively in our own video editing API. For this tutorial we'll use FFmpeg 5.1.2, but any recent version will do.

Split into parts of a specified duration

The following command splits a video file into separate files of a given duration. In this case, we are extracting a video into three separate files, each of 15 seconds:

$ ffmpeg -i input.mp4 -ss 00:00 -t 00:15 part1.mp4 -ss 00:15 -t 00:15 part2.mp4 -ss 00:30 -t 00:15 part3.mp4
  • The -ss 00:15 argument indicates where each part should begin.
  • The -t 00:15 argument specifies the length of each part.

Split at a given time

Similar to above, we can split a video file at a given point. Here's how to split a video exactly 1 minute from the start, resulting in two separate clips:

$ ffmpeg -i input.mp4 -t 01:00 part1.mp4 -ss 01:00 part2.mp4
  • The -t 01:00 argument specifies that part1.mp4 should be 1 minute long. Because no start time is specified, it starts at 00:00.
  • The -ss 01:00 argument specifies that part2.mp4 should start at the 1-minute mark. Since no duration is specified, it is stretched to the end of the input file.

Start automating today

Start with a full-featured trial with 50 credits, no credit card required.
Get started for free