FFmpeg usage command

2007-8-6 Update: Based on the my own FLV conversion knowledge, I have started a Web 2.0 service call – VCASMO. It is a video + PowerPoint online presentation platform.

Convert other video to FLV
ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 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
You have to install flvtool2, too, see my previous post
ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 - | flvtool2 -U stdin video.flv

Convert FLV to jpg sequence
ffmpeg -i video.flv -an -r 1 -y -s 320x240 video%d.jpg
-i Input file name
-an disable audio
-r fps
-y overwrite file
-s output dimension

Convert particular frame to jpg
ffmpeg -i video.flv -an -ss 00:00:03 -t 00:00:01 -r 1 -y -s 320x240 video%d.jpg
-ss record start time
-t record end time last for
So if you want to save frame 4 (00:00:04) -ss 00:00:03 -t 00:00:01. Note: it is count from 00:00:00. Even you want to save one jpg, you still need to use %d for naming, it is strange that I grab one frame for one second, it will return two identical jpg files for me

Related Article

Other Reference

68 replies on “FFmpeg usage command”

  1. Is there a way to convert a sequence of images to video ? Or even better have a sequence of images and audio wrapped together as video ?

    I’ve using ffmpeg for FLV and Mp3 encoding but wondering if its possible to do the mentioned above 🙂

  2. Hello Luar,

    Thanks so much for your distillation of the seemingly daunting ffmpeg program. It works a treat for avi to flv. I’m now attempting to convert a .flm file to .flv, or any format I can, as an intermediate step, and then to .flv. Do you know if this is possible?

  3. I want to take 30 frames from a 46:23 min movie (25 fps)
    How can I manipulate the -r switch to do this?

  4. 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


  5. Hi, your guide about ffmpeg solved just a part of my problem (about 50%).

    Now I’m trying to create an flv file using just a jpeg file as frame.

    If I use this command:

    ffmpeg -i img.jpg movie.flv

    I obviously obtain an flv file made by 1 frame. How can I repeat that image to have a 30 seconds movie? Can you help me please?


  6. Hello,
    I saw you guys are talking aboout converting different kind of video files in FLV. The best way to do it is to get a verified software and to upload your video to a server. Then an encoding software can do the rest and all you need to do is to login into an account and download the new generated file. Various video extensions can be encoded.

  7. Thanks so much for your post! Very helpful.

    When converting from asf/wmv to flv I did get some errors that worried me like “output buffer too small” followed by “Audio encoding failed”, but the audio seemed to work just fine and according to a couple Google queries these specific errors can be safely ignored.

    Thanks again!

  8. [root@130 ~]# php -r ‘phpinfo();’ | grep ffmpeg
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/ffmpeg.so’ – /usr/lib/php/modules/ffmpeg.so: undefined symbol: img_resample in Unknown on line 0

  9. Well after a long run i got the solution

    this error means your ffmpeg-php rpm is corrupted so i have just uninstall the previous all rpms of ffmpeg-php.

    step 1
    see how many rpms are there for ffmpeg-php on you system by this comand
    rpm -qa | grep php

    then uninstall the only ones having php-ffmpeg one by one

    rpm -e php-ffmpeg-0.5.1-2.fc8.remi –nodeps

    then WGET new one from here


    rpm -ivh ffmpeg-php-0.5.1-1.fc7.remi.i386.rpm

    install it and it will work fine

  10. i am using the following for converting avi to flv file
    ” -i ” + video.avi + ” -s 480*360 -deinterlace -ab 32 -r 15 -ar 22050 -ac 1 ” + mpg.flv;
    it is converting avi file which is less than 1 MB but it is not converting 3-4 MB file.

  11. Hi, Anyone can guide be how to be able to seek videos upload. I can upload and convert from mpg to flv fine, I have updated the metadata with flvtool2 and now i can see the duration. But I can seek when playing the video.. Please need some help. Thanks

  12. Got it to work.

    exec(‘ffmpeg -i ‘.$uploadfile.’ -f flv -s 1280×720 -r 15 -g 30 ‘.$new_flv.”);
    exec(‘ffmpeg -i ‘.$uploadfile.’ -f mjpeg -ss 20 -vframes 1 -s 554×400 -an ‘.$new_image_path.”);

    exec(‘flvtool2 -U ‘.$new_flv.”);

  13. Pingback: Flash games

Comments are closed.