Monday, August 24, 2009

HOW TO CUT A VIDEO USING FFMPEG?

Hope most of you are working in Social networking websites and video blogging websites.

Cutting a particular portion of a video from the source video file is little tricky and will create long delay in the process.

More over all the tools available in the market are too expensive and not having all the features like some free tool.

I prefer to use one of the free tool since it is having all the capability like the paid tool.

One of the best tool i came across was FFMPEG. It is a gift for Online video editors.
Yes its amazing performance and options really make you mad.

Now we are going to see how to cut a flv video, Which means we are going to split a particular portion of a FLV video into a new file (Which we are going to use in our site)


The simple command for Cutting the video is
ffmpeg -sameq -ss [start_seconds] /
-t [duration_seconds] -i [input_file] [outputfile]



Now we will see what are those arguments.

-ss position (Seek to given time position in seconds. “hh:mm:ss[.xxx]” )

-t duration (Set the recording time in seconds. “hh:mm:ss[.xxx]”)

-i filename (input filename)

-sameq (Use same video quality as source (implies VBR))


Here is a sample usage
ffmpeg -sameq -ss 00:00:20 -t 00:00:40 -i flv_video.flv out_flv.flv


Enjoy :)