April 22, 2008

FFMPEG Notes

FFmpeg Howto

Generic Syntax

 ffmpeg [[infile options][`-i' infile]]... {[outfile options] outfile}... 

Note : As a general rule, options are applied to the next specified file. Therefore, order is important and you can have the same option on the command line multiple times. Each occurrence is then applied to the next input or output file.

Main Options

-ab \<int\> : Set audio bitrate in bit/s ( default = 64k ).

-acodec \<string\> : Force audio codec.

 :   aac : AAC-LC ac3 : AC3 ( Dolby Digital ) copy : Copy raw codec
   data as is. mp2 : MPEG Audio Layer II mp3 : MPEG Audio Layer III
   pcm\_s16le : Uncompressed 16-bit PCM Audio
 
-an : Disable audio.
 
-ar \<int\> : Set audio sampling frequency in Hz ( default = 44100 Hz).

-aspect \<string or float\> : Set aspect ratio ( 4:3, 16:9, 1.3333,1.7777 ).

-async \<int\> : Audio sync method. Audio will be stretched or
squeezed to match the timestamps. The parameter is the maximum samples
per second by which the audio is changed. -async 1 is a special case
where only the start of the audio stream is corrected without any
later correction. 
 
-b \<int\> : Set video bitrate in bit/s ( default = 200k ).

-bf \<int\> : Set number of B-frames ( supported for MPEG-1, MPEG-2 and MPEG-4 ).

-b\_strategy \<boolean\> : Strategy to choose between I/P/B-frames ( 0 = off / 1 = on ).

-bufsize \<int\> : Set rate control buffer size ( in bits ).

-cmp \<string or int\> : Full pel motion estimation compare function.

 :   sad ( 0 ) : Sum of absolute differences, fast ( default ). sse ( 1 ) : Sum of squared errors. satd ( 2 ) : Sum of absolute Hadamard transformed differences. dct ( 3 ) : Sum of absolute DCT transformed differences. psnr ( 4 ) : Sum of squared quantization errors ( avoid, low quality ). bit ( 5 ) : Number of bits needed for the block. rd ( 6 ) : Rate distortion optimal, slow. zero ( 7 ) : 0. vsad ( 8 ) : Sum of absolute vertical differences. vsse ( 9 ) : Sum of squared vertical differences. nsse ( 10 ) : Noise preserving sum of squared differences. w53 ( 11 ) : 5/3 wavelet ( only used in Snow ). w97 ( 12 ) : 9/7 wavelet ( only used in Snow ). dctmax ( 13 ) chroma ( 14 )

-coder \<string or int\> :

:   vlc ( 0 ) : Variable length coder / huffman coder. ac ( 1 ) :
  Arithmetic coder. raw ( 2 ) : Raw ( no encoding ). rle ( 3 ) :
  Run-length coder. deflate ( 4 ) : Deflate-based coder.

-cropbottom \<int\> : Set bottom crop band size ( in pixels ).

-cropleft \<int\> : Set left crop band size ( in pixels ).

-cropright \<int\> : Set right crop band size ( in pixels ).

-croptop \<int\> : Set top crop band size ( in pixels ).

-deinterlace : Deinterlace pictures.

-dc \<int\> : Intra DC precision.

-f \<string\> : Force file
Tags: Video transcoding