Trim video file using ffmpeg

  • Posted on: 16 April 2021
  • By: dexter

Today almost everyone need to cut or edit a video some other time. You can use ffmpeg for the same. 

It is an interesting command line utility and can do a lot of stuff.

Here we will see how we can simply cut a part of a video.

What we have:   foo,mp4   our video file of 10 minutes length.

We want to chop of some extra part from the end, say we just want the video from the begining till the 9th Minute.

The command:

ffmpeg -i foo.mp4  -ss 00:00:00 -to 00:09:00  -c copy -choppedfoo.mp4

Here:

ffmpeg is the command

-i assigns input file i.e. foo.mp4

-ss starting time in hh:mm:ss  we are setting this to 00:00:00

-to end time in hh:mm:ss we are setting this to 00:09:00

-c copy sets the output to be simply copied without any changes to encoding etc

Lastly the file name to which the output is to be stored.

 

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.