Seth Woolley's Man Viewer

ffmpeg(1) - ffmpeg - FFmpeg video converter - man 1 ffmpeg

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

FFMPEG(1)                                                            FFMPEG(1)

       ffmpeg - FFmpeg video converter

       ffmpeg [[options][-i input_file]]... {[options] output_file}...

       If no input file(1,n) is given, audio/video grabbing is done.

       As a general rule, options are applied to the next specified file. For
       example, if(3,n) you give the -b 64 option, it sets the video bitrate of the
       next file. Format option may be needed for raw(3x,7,8,3x cbreak) input files.

       By default, ffmpeg tries to convert as losslessly as possible: it uses
       the same audio and video parameter for the outputs as the one specified
       for the inputs.

       Main options

       -L  show license

       -h  show help

           show available formats, codecs, protocols, ...

       -f fmt
           force format

       -i filename
           input file(1,n) name

       -y  overwrite output files

       -t duration
           set(7,n,1 builtins) the recording time(1,2,n) in(1,8) seconds. "hh:mm:ss[.xxx]" syntax is also

       -title string(3,n)
           set(7,n,1 builtins) the title

       -author string(3,n)
           set(7,n,1 builtins) the author

       -copyright string(3,n)
           set(7,n,1 builtins) the copyright

       -comment string(3,n)
           set(7,n,1 builtins) the comment

       -hq activate high quality settings

       Video Options

       -b bitrate
           set(7,n,1 builtins) the video bitrate in(1,8) kbit/s (default = 200 kb/s)

       -r fps
           set(7,n,1 builtins) frame rate (default = 25)

       -s size
           set(7,n,1 builtins) frame size. The format is WxH (default 160x128).  The following
           abbreviations are recognized:



           cif 352x288


       -aspect aspect
           set(7,n,1 builtins) aspect ratio (4:3, 16:9 or 1.3333, 1.7777)

       -croptop size
           set(7,n,1 builtins) top crop band size (in(1,8) pixels)

       -cropbottom size
           set(7,n,1 builtins) bottom crop band size (in(1,8) pixels)

       -cropleft size
           set(7,n,1 builtins) left crop band size (in(1,8) pixels)

       -cropright size
           set(7,n,1 builtins) right crop band size (in(1,8) pixels)

       -vn disable video recording

       -bt tolerance
           set(7,n,1 builtins) video bitrate tolerance (in(1,8) kbit/s)

       -maxrate bitrate
           set(7,n,1 builtins) max video bitrate tolerance (in(1,8) kbit/s)

       -minrate bitrate
           set(7,n,1 builtins) min video bitrate tolerance (in(1,8) kbit/s)

       -bufsize size
           set(7,n,1 builtins) ratecontrol buffere size (in(1,8) kbit)

       -vcodec codec
           force video codec to codec. Use the "copy" special value to tell
           that the raw(3x,7,8,3x cbreak) codec data must be copied as is.

           use same video quality as source (implies VBR)

       -pass n
           select(2,7,2 select_tut) the pass number (1 or 2). It is useful to do two pass encod-
           ing. The statistics of the video are recorded in(1,8) the first pass and
           the video at the exact requested bit rate is generated in(1,8) the sec-
           ond pass.

       -passlogfile file(1,n)
           select(2,7,2 select_tut) two pass log file(1,n) name to file(1,n).

       Advanced Video Options

       -g gop_size
           set(7,n,1 builtins) the group of picture size

           use only intra frames

       -qscale q
           use fixed video quantiser scale (VBR)

       -qmin q
           min video quantiser scale (VBR)

       -qmax q
           max video quantiser scale (VBR)

       -qdiff q
           max difference between the quantiser scale (VBR)

       -qblur blur
           video quantiser scale blur (VBR)

       -qcomp compression
           video quantiser scale compression (VBR)

       -rc_init_cplx complexity
           initial complexity for 1-pass encoding(3,n)

       -b_qfactor factor(1,6)
           qp factor(1,6) between p and b frames

       -i_qfactor factor(1,6)
           qp factor(1,6) between p and i frames

       -b_qoffset offset
           qp offset between p and b frames

       -i_qoffset offset
           qp offset between p and i frames

       -rc_eq equation
           set(7,n,1 builtins) rate control equation. Default is "tex^qComp".

       -rc_override override
           rate control override for specific intervals

       -me method
           set(7,n,1 builtins) motion estimation method to method. Available methods are (from
           lower to best quality):

               Try just the (0, 0) vector.

               (default method)

               exhaustive search (slow and marginally better than epzs)

       -dct_algo algo
           set(7,n,1 builtins) dct algorithm to algo. Available values are:

           0   FF_DCT_AUTO (default)

           1   FF_DCT_FASTINT

           2   FF_DCT_INT

           3   FF_DCT_MMX

           4   FF_DCT_MLIB

           5   FF_DCT_ALTIVEC

       -idct_algo algo
           set(7,n,1 builtins) idct algorithm to algo. Available values are:

           0   FF_IDCT_AUTO (default)

           1   FF_IDCT_INT

           2   FF_IDCT_SIMPLE

           3   FF_IDCT_SIMPLEMMX

           4   FF_IDCT_LIBMPEG2MMX

           5   FF_IDCT_PS2

           6   FF_IDCT_MLIB

           7   FF_IDCT_ARM

           8   FF_IDCT_ALTIVEC

           9   FF_IDCT_SH4

           10  FF_IDCT_SIMPLEARM

       -er n
           set(7,n,1 builtins) error(8,n) resilience to n.

           1   FF_ER_CAREFULL (default)

           2   FF_ER_COMPLIANT

           3   FF_ER_AGGRESSIVE

           4   FF_ER_VERY_AGGRESSIVE

       -ec bit_mask
           set(7,n,1 builtins) error(8,n) concealment to bit_mask. bit_mask is a bit mask of the
           following values:

           1   FF_EC_GUESS_MVS (default=enabled)

           2   FF_EC_DEBLOCK (default=enabled)

       -bf frames
           use 'frames' B frames (supported for MPEG-1, MPEG-2 and MPEG-4)

       -mbd mode
           macroblock decision

           0   FF_MB_DECISION_SIMPLE: use mb_cmp (cannot change it yet in(1,8) ffm-

           1   FF_MB_DECISION_BITS: chooses the one which needs the fewest

           2   FF_MB_DECISION_RD: rate distoration

           use four motion vector by macroblock (only MPEG-4)

           use data partitioning (only MPEG-4)

       -bug param
           workaround not auto(5,8) detected encoder bugs

       -strict strictness
           how strictly to follow the standarts

           enable Advanced intra coding (h263+)

           enable Unlimited Motion Vector (h263+)

           deinterlace pictures

           calculate PSNR of compressed frames

           dump video coding statistics to vstats_HHMMSS.log.

       -vhook module
           insert video processing module. module contains the module name and
           its parameters separated by spaces.

       Audio Options

       -ab bitrate
           set(7,n,1 builtins) audio bitrate (in(1,8) kbit/s)

       -ar freq
           set(7,n,1 builtins) the audio sampling freq (default = 44100 Hz)

       -ab bitrate
           set(7,n,1 builtins) the audio bitrate in(1,8) kbit/s (default = 64)

       -ac channels
           set(7,n,1 builtins) the number of audio channels (default = 1)

       -an disable audio recording

       -acodec codec
           force audio codec to codec. Use the "copy" special value to tell
           that the raw(3x,7,8,3x cbreak) codec data must be copied as is.

       Audio/Video grab options

       -vd device
           set(7,n,1 builtins) video grab device (e.g. /dev/video0)

       -vc channel
           set(7,n,1 builtins) video grab channel (DV1394 only)

       -tvstd standard
           set(7,n,1 builtins) television standard (NTSC, PAL (SECAM))

           set(7,n,1 builtins) DV1394 grab

       -ad device
           set(7,n,1 builtins) audio device (e.g. /dev/dsp)

       Advanced options

       -map file:stream
           set(7,n,1 builtins) input stream mapping

           print specific debug info(1,5,n)

           add timings for benchmarking

           dump each input packet

           only use bit exact algorithms (for codec testing)

       -ps size
           set(7,n,1 builtins) packet size in(1,8) bits

       -re read(2,n,1 builtins) input at native frame rate. Mainly used to simulate a grab

           loop over the input stream. Currently it works only for image
           streams. This option is used for ffserver automatic testing.

       FFmpeg formula evaluator

       When evaluating a rate control string(3,n), FFmpeg uses an internal formula

       The following binary operators are available: "+", "-", "*", "/", "^".

       The following unary operators are available: "+", "-", "(...)".

       The following functions are available:

       max(x, y)
       min(x, y)
       gt(x, y)
       lt(x, y)
       eq(x, y)

       The following constants are available:


       Video and Audio grabbing

       FFmpeg can use a video4linux compatible video source and any Open Sound
       System audio source:

               ffmpeg /tmp/out.mpg

       Note that you must activate the right video source and channel before
       launching ffmpeg. You can use any TV viewer such as xawtv
       (<>) by Gerd Knorr which I find very good. You
       must also set(7,n,1 builtins) correctly the audio recording levels with a standard

       Video and Audio file(1,n) format conversion

       * ffmpeg can use any supported file(1,n) format and protocol as input:


       * You can input from YUV files:

               ffmpeg -i /tmp/test%d.Y /tmp/out.mpg

       It will use the files:

               /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
               /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...

       The Y files use twice the resolution of the U and V files. They are raw(3x,7,8,3x cbreak)
       files, without header. They can be generated by all decent video
       decoders. You must specify the size of the image with the -s option if(3,n)
       ffmpeg cannot guess it.

       * You can input from a RAW YUV420P file:

               ffmpeg -i /tmp/test.yuv /tmp/out.avi

       The RAW YUV420P is a file(1,n) containing RAW YUV planar, for each frame
       first come the Y plane followed by U and V planes, which are half ver-
       tical and horizontal resolution.

       * You can output to a RAW YUV420P file:

               ffmpeg -i mydivx.avi -o hugefile.yuv

       * You can set(7,n,1 builtins) several input files and output files:

               ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg

       Convert the audio file(1,n) a.wav and the raw(3x,7,8,3x cbreak) yuv video file(1,n) a.yuv to mpeg
       file(1,n) a.mpg

       * You can also do audio and video conversions at the same time:

               ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2

       Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG

       * You can encode to several formats at the same time(1,2,n) and define a map-
       ping from input stream to output streams:

               ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0

       Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '-map
       file:index' specify which input stream is used for each output stream,
       in(1,8) the order of the definition of output streams.

       * You can transcode decrypted VOBs

               ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi

       This is a typical DVD ripper example, input from a VOB file(1,n), output to
       an AVI file(1,n) with MPEG-4 video and MP3 audio, note that in(1,8) this command
       we use B frames so the MPEG-4 stream is DivX5 compatible, GOP size is
       300 that means an INTRA frame every 10 seconds for 29.97 fps input
       video.  Also the audio stream is MP3 encoded so you need LAME support
       which is enabled using "--enable-mp3lame" when configuring.  The map-
       ping is particularly useful for DVD transcoding to get the desired
       audio language.

       NOTE: to see the supported input formats, use "ffmpeg -formats".

       ffserver(1), ffplay(1) and the html documentation of ffmpeg.

       Fabrice Bellard

                                  2003-09-16                         FFMPEG(1)

References for this manual (incoming links)