Splitting a video file in sections using ffmpeg at cli

Consider a file named ‘x.mp4′. Let’s suppose the video file is wrapped in a MPEG-4 container coded with H.264 and AAC audio.

To split the file and keep the file in the most commonly used MPEG-4 container, we could use the following command:

ffmpeg -ss 00:04:00 -i x.mp4 -to 00:10:00 -c copy x_part1.mp4

The above command has a starting point at the fourth minute in the video (00:04:00) and it has an ending point at the tenth minute (00:10:00).

Let’s suppose we would like to cut off a specific section of the video from a point until the end of it, we could use:

ffmpeg -ss 00:12:00 -i x.mp4 -c copy x_part2.mp4

The above command will create a new video that starts from the 12th minute of the original file uptil the end of it.

Comments

Add a comment…

No comments, yet.

Be the first to comment.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *