FFmpeg is a very fast video and audio converter. It can also grab from a live audio/video source.
FFmpeg can also convert from any sample rate to any other, and resize video on the fly with a high quality polyphase filter.
FFMPEG Command Syntax:
The generic syntax is:
ffmpeg [[input options][`-i' input]]... {[output options] output}...
Main options of FFMPEG Command:
- -h : Show complete help when using in command prompt.
- -i : Input file name on which ffmpeg commands operates.
- -y: Owerrite output file normally used in grabbing thumbnails from input source.
- -t: Set the recording time in seconds. hh:mm:ss.
- -fs: Limit the size of output file.
- -ss: Seek to given time position in seconds. hh:mm:ss.
- -title : set the title on the source.
- -author: set the author information on the source.
- -copyright: set the copy right information on the source.
- -target : Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ... ). All the format options (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
ffmpeg -i test.avi -target vcd test.mpg
- -dframes : Set the number of data frames to record.
Video Options of FFMPEG Command:
- -b : Set the video bitrate in bit/s (default = 200 kb/s).
- -vframes: Set the number of video frames to record.
- -r : Frame per second, Set frame rate (Hz value, fraction or abbreviation), (default = 25).
- -s: Set frame size. The format is `wxh' (ffserver default = 160x128, ffmpeg default = same as source). The following abbreviations are recognized: sqcif=128x96, qcif =176x144, cif =352x288, 4cif=704x576.
- -aspect : set the aspect ratio. (4:3, 16:9 or 1.3333, 1.7777).
- -vn: Disable video recording.
- -bt: Set video bitrate tolerance (in bit/s).
- -maxrate: Set max video bitrate tolerance (in bit/s).
- -minrate : Set min video bitrate tolerance (in bit/s).
- -bufsize : Set rate control buffer size (in bits).
- -vcodec: Force video codec to codec.
- -sameq: Use same video quality as source (implies VBR).
Audio Options of FFMPEG Command:
- -aframes: Set the number of audio frames to record.
- -ar: Set the audio sampling frequency (default = 44100 Hz).
- -ab: Set the audio bitrate in bit/s (default = 64k).
- -ac: Set the number of audio channels (default = 1).
- -an: Disable audio recording.
- -acodec: Force audio codec to codec.
- -newaudio: Add a new audio track to the output file. If you want to specify parameters, do so before -newaudio (-acodec, -ab, etc..). Mapping will be done automatically, if the number of output streams is equal to the number of input streams, else it will pick the first one that matches. You can override the mapping using -map as usual. Example:
ffmpeg -i file.mpg -vcodec copy
-acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
For more FFMPEG Commands, please visit ffmpeg.mplayerhq.hu/ffmpeg-doc.html .
Examples:
You can use these options to create FFMPEG Commands that you can use on command prompts to perform many operations on your source file.
e.g converting any format video to flv format use:
In command prompt type:
ffmpeg -i test.mp4 -acodec mp3 -ar 22050 -ab 32 -f flv -s 320x240 test.flv