Trim video file using ffmpeg

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

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
Enter the characters shown in the image.
Are you a robot?
Address

OpenSourceCook.in
"Natraj"  Bungalow,
Colony No.7,  Sr.No. 38.
(Lane Behind Sai Baba Mandir)
Kale Borate Nagar, Hadapsar,
Pune - 411028.
Get Directions