Posted: . At: 10:49 AM. This was 5 years ago. Post ID: 13034
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How to cut a section out of a video with ffmpeg.


Cropping a section of a video and saving it without reencoding is very simple, the example below shows how to use ffmpeg to cut out a section of video and then save it to a separate file.

This example will cut out a clip starting 12 minutes into the video and 13 minutes long.

4.4 Wed Mar 27 jason@Yog-Sothoth 0: $ ffmpeg -i 'Game.of.Thrones.S06E07.720p.HDTV.x264-AVS.mkv' -ss 00:12:00 -t 00:13:00 -c:v copy -c:a copy output.mkv

This example cuts A clip 14 minutes into the video, 20 seconds long and saves it to a separate file.

4.4 Wed Mar 27 jason@Yog-Sothoth 0: $ ffmpeg -i 'Game.of.Thrones.S06E07.720p.HDTV.x264-AVS.mkv' -ss 00:14:00 -t 00:00:20 -c:v copy -c:a copy output.mkv

The -ss 00:14:00 parameter tells ffmpeg when to start cutting the clip.

The -t 00:00:20 parameter tells ffmpeg how long the clip will be. In this case, it is 20 seconds.

This parameter: -c:v copy -c:a copy, tells fffmpeg to just copy the video format to the new clip and not to reencode it at all.

This is how easy it is to cut clips out of a video using the command line, this is pretty accurate and works very well for clipping out a vid for Youtube or video editing.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.