Convert video files to FLV using FFMPEG command
FFMPEG is a most popular command line tool to convert media files such as audio, video and images from one format to another. We are going to learn ffmpeg command usage to convert other media format to current most popular streaming FLV format. FFMPEG is cross platform tool and does not require any Gui, support several command line options to control your conversion. The other video format can not be played directly in web browser. A right way to publish your videos for viewing in a browser is using FLV wide acceptable format.
How to convert / FFMPEG usage command
Convert other video format to FLV
ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320×240 video.flv
-i input file name
-ar audio sampling rate in Hz
-ab audio bit rate in kbit/s
-f output format
-s output dimension
Convert other video to FLV with metadata
This require flvtool2 tool to be installed on your box.
ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320×240 - | flvtool2 -U stdin video.flv
Convert FLV vidoe to jpg image sequence
This command used to extract frame image sequence.
ffmpeg -i video.flv -an -r 1 -y -s 320×240 video%d.jpg
-i Input file name
-an disable audio
-r fps
-y overwrite file
-s output dimension
Convert particular frame to jpg
Return one particular jpeg image of the frame based on start and end time.
ffmpeg -i video.flv -an -ss 00:00:03 -t 00:00:01 -r 1 -y -s 320×240 video%d.jpg
-ss record start time
-t record end time last for
Return first frame of video as jpeg image.
ffmpeg -i video.flv -vcodec png -vframes 1 -an -f rawvideo -s 320×240 video%d.jpg
Read Related Post
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



March 12th, 2008 at 1:53 am
hi
i follwed the steps of compiling FFmpeg for windows and it works fine whithout errors
put whine i type the convert commant
(ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320×240 video.flv)
i have this message
‘ffmpeg’ is not recognized as an internal or external command,
operable program or batch file.
??????
March 12th, 2008 at 2:01 am
This simply mean ffmpeg command not available within the environment path. Please try command with full path of ffmpeg like (c:\ffmpeg\ffmpeg.exe -i video.avi -ar 22050 -ab 32 -f flv -s 320×240 video.flv) or you can add ffmpeg path in environment path setting under windows.
Hope this help you.
Bala Krishna
March 12th, 2008 at 3:00 am
thanks for replay but
(
The system cannot find the path specified)
i searched the c:\
and i didn’t find any ffmpeg.exe
just i found the folder?
May 13th, 2008 at 9:43 pm
hi dear i am using this uber uploader on linux uploading is gone mysql daainseration we are doing i have seen all commands to convert files but i want t know that inwhich file of uberuploader we need to plance these files.
thanks
May 14th, 2008 at 1:57 am
Hi Sandeep,
Uber uploader only used to upload files on your server with progress bar. you need to write these command on file on which you are transferring control after upload finish. Usually, this file name and path defined in uber config file. look at uber config file in cgi-bin directory with .pbm extension.
Thanks
August 27th, 2008 at 11:26 pm
we have implemented this concept . but the problem retains in the clarity of the video … the original video which we have played in windows media player is 100% video size and it looks good…
after we have converted to flv and played it in flash player… it has been tampered…
we suspect the ffmpeg is capturing the video file with fullscreen mode of windows media player , because when we
played the original video with full screen mode in windows media player , the output of the video was blurred.
could you please tell me how to overcome this issue.
August 29th, 2008 at 6:00 pm
hello,
Iam converting the .mov fie to .flv file.
But the problem is, it can not be convert to flv .No output comes.
Just an empty page come.
I checked my php.ini.the FFMPEG must be enabled.
Iam using the following code for conversion.
function converttoflv( $in, $out )
{
$cmd = exec(”ffmpeg -i $in -deinterlace -ar 44100 -r 25 -qmin 3 -qmax 6 $out”);
}
Please I need the quick and Kind reply as soon as possible…
Thanks and regards
Manikandan.T