www.pudn.com > h264..rar > ffmpeg.1


.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "FFMPEG 1"
.TH FFMPEG 1 "2004-04-16" " " " "
.SH "NAME"
ffmpeg \- FFmpeg video converter
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
ffmpeg [[options][\fB\-i\fR \fIinput_file\fR]]... {[options] \fIoutput_file\fR}...
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
If no input file is given, audio/video grabbing is done.
.PP
As a general rule, options are applied to the next specified
file. For example, if you give the \fB\-b 64\fR option, it sets the video
bitrate of the next file. Format option may be needed for raw input
files.
.PP
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.
.SH "OPTIONS"
.IX Header "OPTIONS"
.Sh "Main options"
.IX Subsection "Main options"
.IP "\fB\-L\fR" 4
.IX Item "-L"
show license
.IP "\fB\-h\fR" 4
.IX Item "-h"
show help
.IP "\fB\-formats\fR" 4
.IX Item "-formats"
show available formats, codecs, protocols, ...
.IP "\fB\-f fmt\fR" 4
.IX Item "-f fmt"
force format
.IP "\fB\-i filename\fR" 4
.IX Item "-i filename"
input file name
.IP "\fB\-y\fR" 4
.IX Item "-y"
overwrite output files
.IP "\fB\-t duration\fR" 4
.IX Item "-t duration"
set the recording time in seconds. \f(CW\*(C`hh:mm:ss[.xxx]\*(C'\fR syntax is also
supported.
.IP "\fB\-ss position\fR" 4
.IX Item "-ss position"
seek to given time position. \f(CW\*(C`hh:mm:ss[.xxx]\*(C'\fR syntax is also
supported.
.IP "\fB\-title string\fR" 4
.IX Item "-title string"
set the title
.IP "\fB\-author string\fR" 4
.IX Item "-author string"
set the author
.IP "\fB\-copyright string\fR" 4
.IX Item "-copyright string"
set the copyright
.IP "\fB\-comment string\fR" 4
.IX Item "-comment string"
set the comment
.IP "\fB\-target type\fR" 4
.IX Item "-target type"
specify target file type (\*(L"vcd\*(R", \*(L"svcd\*(R" or \*(L"dvd\*(R"). All the format
options (bitrate, codecs, buffer sizes) are automatically set by this
option. You can just type:
.Sp
.Vb 1
\&        ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
.Ve
.IP "\fB\-hq\fR" 4
.IX Item "-hq"
activate high quality settings
.Sh "Video Options"
.IX Subsection "Video Options"
.IP "\fB\-b bitrate\fR" 4
.IX Item "-b bitrate"
set the video bitrate in kbit/s (default = 200 kb/s)
.IP "\fB\-r fps\fR" 4
.IX Item "-r fps"
set frame rate (default = 25)
.IP "\fB\-s size\fR" 4
.IX Item "-s size"
set frame size. The format is \fBWxH\fR (default 160x128).  The
following abbreviations are recognized:
.RS 4
.IP "\fBsqcif\fR" 4
.IX Item "sqcif"
128x96
.IP "\fBqcif\fR" 4
.IX Item "qcif"
176x144
.IP "\fBcif\fR" 4
.IX Item "cif"
352x288
.IP "\fB4cif\fR" 4
.IX Item "4cif"
704x576
.RE
.RS 4
.RE
.IP "\fB\-aspect aspect\fR" 4
.IX Item "-aspect aspect"
set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
.IP "\fB\-croptop size\fR" 4
.IX Item "-croptop size"
set top crop band size (in pixels)
.IP "\fB\-cropbottom size\fR" 4
.IX Item "-cropbottom size"
set bottom crop band size (in pixels)
.IP "\fB\-cropleft size\fR" 4
.IX Item "-cropleft size"
set left crop band size (in pixels)
.IP "\fB\-cropright size\fR" 4
.IX Item "-cropright size"
set right crop band size (in pixels)
.IP "\fB\-padtop size\fR" 4
.IX Item "-padtop size"
set top pad band size (in pixels)
.IP "\fB\-padbottom size\fR" 4
.IX Item "-padbottom size"
set bottom pad band size (in pixels)
.IP "\fB\-padleft size\fR" 4
.IX Item "-padleft size"
set left pad band size (in pixels)
.IP "\fB\-padright size\fR" 4
.IX Item "-padright size"
set right pad band size (in pixels)
.IP "\fB\-padcolor color\fR" 4
.IX Item "-padcolor color"
set right pad band size (hex). The value for pad color is expressed 
as a six digit hexidecimal number where the first two digits represent red, 
middle two digits green and last two digits blue. Defaults to 000000 (black)
.IP "\fB\-vn\fR" 4
.IX Item "-vn"
disable video recording
.IP "\fB\-bt tolerance\fR" 4
.IX Item "-bt tolerance"
set video bitrate tolerance (in kbit/s)
.IP "\fB\-maxrate bitrate\fR" 4
.IX Item "-maxrate bitrate"
set max video bitrate tolerance (in kbit/s)
.IP "\fB\-minrate bitrate\fR" 4
.IX Item "-minrate bitrate"
set min video bitrate tolerance (in kbit/s)
.IP "\fB\-bufsize size\fR" 4
.IX Item "-bufsize size"
set ratecontrol buffere size (in kbit)
.IP "\fB\-vcodec codec\fR" 4
.IX Item "-vcodec codec"
force video codec to \fIcodec\fR. Use the \f(CW\*(C`copy\*(C'\fR special value to
tell that the raw codec data must be copied as is.
.IP "\fB\-sameq\fR" 4
.IX Item "-sameq"
use same video quality as source (implies \s-1VBR\s0)
.IP "\fB\-pass n\fR" 4
.IX Item "-pass n"
select the pass number (1 or 2). It is useful to do two pass
encoding. The statistics of the video are recorded in the first pass and
the video at the exact requested bit rate is generated in the second
pass.
.IP "\fB\-passlogfile file\fR" 4
.IX Item "-passlogfile file"
select two pass log file name to \fIfile\fR.
.Sh "Advanced Video Options"
.IX Subsection "Advanced Video Options"
.IP "\fB\-g gop_size\fR" 4
.IX Item "-g gop_size"
set the group of picture size
.IP "\fB\-intra\fR" 4
.IX Item "-intra"
use only intra frames
.IP "\fB\-qscale q\fR" 4
.IX Item "-qscale q"
use fixed video quantiser scale (\s-1VBR\s0)
.IP "\fB\-qmin q\fR" 4
.IX Item "-qmin q"
min video quantiser scale (\s-1VBR\s0)
.IP "\fB\-qmax q\fR" 4
.IX Item "-qmax q"
max video quantiser scale (\s-1VBR\s0)
.IP "\fB\-qdiff q\fR" 4
.IX Item "-qdiff q"
max difference between the quantiser scale (\s-1VBR\s0)
.IP "\fB\-qblur blur\fR" 4
.IX Item "-qblur blur"
video quantiser scale blur (\s-1VBR\s0)
.IP "\fB\-qcomp compression\fR" 4
.IX Item "-qcomp compression"
video quantiser scale compression (\s-1VBR\s0)
.IP "\fB\-rc_init_cplx complexity\fR" 4
.IX Item "-rc_init_cplx complexity"
initial complexity for 1\-pass encoding
.IP "\fB\-b_qfactor factor\fR" 4
.IX Item "-b_qfactor factor"
qp factor between p and b frames
.IP "\fB\-i_qfactor factor\fR" 4
.IX Item "-i_qfactor factor"
qp factor between p and i frames
.IP "\fB\-b_qoffset offset\fR" 4
.IX Item "-b_qoffset offset"
qp offset between p and b frames
.IP "\fB\-i_qoffset offset\fR" 4
.IX Item "-i_qoffset offset"
qp offset between p and i frames
.IP "\fB\-rc_eq equation\fR" 4
.IX Item "-rc_eq equation"
set rate control equation. Default is \f(CW\*(C`tex^qComp\*(C'\fR.
.IP "\fB\-rc_override override\fR" 4
.IX Item "-rc_override override"
rate control override for specific intervals
.IP "\fB\-me method\fR" 4
.IX Item "-me method"
set motion estimation method to \fImethod\fR. Available methods are
(from lower to best quality):
.RS 4
.IP "\fBzero\fR" 4
.IX Item "zero"
Try just the (0, 0) vector.
.IP "\fBphods\fR" 4
.IX Item "phods"
.PD 0
.IP "\fBlog\fR" 4
.IX Item "log"
.IP "\fBx1\fR" 4
.IX Item "x1"
.IP "\fBepzs\fR" 4
.IX Item "epzs"
.PD
(default method)
.IP "\fBfull\fR" 4
.IX Item "full"
exhaustive search (slow and marginally better than epzs)
.RE
.RS 4
.RE
.IP "\fB\-dct_algo algo\fR" 4
.IX Item "-dct_algo algo"
set dct algorithm to \fIalgo\fR. Available values are:
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
\&\s-1FF_DCT_AUTO\s0 (default)
.IP "\fB1\fR" 4
.IX Item "1"
\&\s-1FF_DCT_FASTINT\s0
.IP "\fB2\fR" 4
.IX Item "2"
\&\s-1FF_DCT_INT\s0
.IP "\fB3\fR" 4
.IX Item "3"
\&\s-1FF_DCT_MMX\s0
.IP "\fB4\fR" 4
.IX Item "4"
\&\s-1FF_DCT_MLIB\s0
.IP "\fB5\fR" 4
.IX Item "5"
\&\s-1FF_DCT_ALTIVEC\s0
.RE
.RS 4
.RE
.IP "\fB\-idct_algo algo\fR" 4
.IX Item "-idct_algo algo"
set idct algorithm to \fIalgo\fR. Available values are:
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
\&\s-1FF_IDCT_AUTO\s0 (default)
.IP "\fB1\fR" 4
.IX Item "1"
\&\s-1FF_IDCT_INT\s0          
.IP "\fB2\fR" 4
.IX Item "2"
\&\s-1FF_IDCT_SIMPLE\s0       
.IP "\fB3\fR" 4
.IX Item "3"
\&\s-1FF_IDCT_SIMPLEMMX\s0    
.IP "\fB4\fR" 4
.IX Item "4"
\&\s-1FF_IDCT_LIBMPEG2MMX\s0  
.IP "\fB5\fR" 4
.IX Item "5"
\&\s-1FF_IDCT_PS2\s0          
.IP "\fB6\fR" 4
.IX Item "6"
\&\s-1FF_IDCT_MLIB\s0         
.IP "\fB7\fR" 4
.IX Item "7"
\&\s-1FF_IDCT_ARM\s0          
.IP "\fB8\fR" 4
.IX Item "8"
\&\s-1FF_IDCT_ALTIVEC\s0      
.IP "\fB9\fR" 4
.IX Item "9"
\&\s-1FF_IDCT_SH4\s0          
.IP "\fB10\fR" 4
.IX Item "10"
\&\s-1FF_IDCT_SIMPLEARM\s0    
.RE
.RS 4
.RE
.IP "\fB\-er n\fR" 4
.IX Item "-er n"
set error resilience to \fIn\fR.
.RS 4
.IP "\fB1\fR" 4
.IX Item "1"
\&\s-1FF_ER_CAREFULL\s0 (default)
.IP "\fB2\fR" 4
.IX Item "2"
\&\s-1FF_ER_COMPLIANT\s0
.IP "\fB3\fR" 4
.IX Item "3"
\&\s-1FF_ER_AGGRESSIVE\s0
.IP "\fB4\fR" 4
.IX Item "4"
\&\s-1FF_ER_VERY_AGGRESSIVE\s0
.RE
.RS 4
.RE
.IP "\fB\-ec bit_mask\fR" 4
.IX Item "-ec bit_mask"
set error concealment to \fIbit_mask\fR. \fIbit_mask\fR is a bit mask of
the following values:
.RS 4
.IP "\fB1\fR" 4
.IX Item "1"
\&\s-1FF_EC_GUESS_MVS\s0 (default=enabled)
.IP "\fB2\fR" 4
.IX Item "2"
\&\s-1FF_EC_DEBLOCK\s0 (default=enabled)
.RE
.RS 4
.RE
.IP "\fB\-bf frames\fR" 4
.IX Item "-bf frames"
use 'frames' B frames (supported for \s-1MPEG\-1\s0, \s-1MPEG\-2\s0 and \s-1MPEG\-4\s0)
.IP "\fB\-mbd mode\fR" 4
.IX Item "-mbd mode"
macroblock decision
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
\&\s-1FF_MB_DECISION_SIMPLE:\s0 use mb_cmp (cannot change it yet in ffmpeg)
.IP "\fB1\fR" 4
.IX Item "1"
\&\s-1FF_MB_DECISION_BITS:\s0 chooses the one which needs the fewest bits
.IP "\fB2\fR" 4
.IX Item "2"
\&\s-1FF_MB_DECISION_RD:\s0 rate distoration
.RE
.RS 4
.RE
.IP "\fB\-4mv\fR" 4
.IX Item "-4mv"
use four motion vector by macroblock (only \s-1MPEG\-4\s0)
.IP "\fB\-part\fR" 4
.IX Item "-part"
use data partitioning (only \s-1MPEG\-4\s0)
.IP "\fB\-bug param\fR" 4
.IX Item "-bug param"
workaround not auto detected encoder bugs
.IP "\fB\-strict strictness\fR" 4
.IX Item "-strict strictness"
how strictly to follow the standarts
.IP "\fB\-aic\fR" 4
.IX Item "-aic"
enable Advanced intra coding (h263+)
.IP "\fB\-umv\fR" 4
.IX Item "-umv"
enable Unlimited Motion Vector (h263+)
.IP "\fB\-deinterlace\fR" 4
.IX Item "-deinterlace"
deinterlace pictures
.IP "\fB\-interlace\fR" 4
.IX Item "-interlace"
force interlacing support in encoder (only \s-1MPEG\-2\s0 and \s-1MPEG\-4\s0). Use this option
if your input file is interlaced and if you want to keep the interlaced
format for minimum losses. The alternative is to deinterlace the input
stream with \fB\-deinterlace\fR, but deinterlacing introduces more
losses.
.IP "\fB\-psnr\fR" 4
.IX Item "-psnr"
calculate \s-1PSNR\s0 of compressed frames
.IP "\fB\-vstats\fR" 4
.IX Item "-vstats"
dump video coding statistics to \fIvstats_HHMMSS.log\fR.
.IP "\fB\-vhook module\fR" 4
.IX Item "-vhook module"
insert video processing \fImodule\fR. \fImodule\fR contains the module
name and its parameters separated by spaces.
.Sh "Audio Options"
.IX Subsection "Audio Options"
.IP "\fB\-ab bitrate\fR" 4
.IX Item "-ab bitrate"
set audio bitrate (in kbit/s)
.IP "\fB\-ar freq\fR" 4
.IX Item "-ar freq"
set the audio sampling freq (default = 44100 Hz)
.IP "\fB\-ab bitrate\fR" 4
.IX Item "-ab bitrate"
set the audio bitrate in kbit/s (default = 64)
.IP "\fB\-ac channels\fR" 4
.IX Item "-ac channels"
set the number of audio channels (default = 1)
.IP "\fB\-an\fR" 4
.IX Item "-an"
disable audio recording
.IP "\fB\-acodec codec\fR" 4
.IX Item "-acodec codec"
force audio codec to \fIcodec\fR. Use the \f(CW\*(C`copy\*(C'\fR special value to
tell that the raw codec data must be copied as is.
.Sh "Audio/Video grab options"
.IX Subsection "Audio/Video grab options"
.IP "\fB\-vd device\fR" 4
.IX Item "-vd device"
set video grab device (e.g. \fI/dev/video0\fR)
.IP "\fB\-vc channel\fR" 4
.IX Item "-vc channel"
set video grab channel (\s-1DV1394\s0 only)
.IP "\fB\-tvstd standard\fR" 4
.IX Item "-tvstd standard"
set television standard (\s-1NTSC\s0, \s-1PAL\s0 (\s-1SECAM\s0))
.IP "\fB\-dv1394\fR" 4
.IX Item "-dv1394"
set \s-1DV1394\s0 grab
.IP "\fB\-ad device\fR" 4
.IX Item "-ad device"
set audio device (e.g. \fI/dev/dsp\fR)
.Sh "Advanced options"
.IX Subsection "Advanced options"
.IP "\fB\-map file:stream\fR" 4
.IX Item "-map file:stream"
set input stream mapping
.IP "\fB\-debug\fR" 4
.IX Item "-debug"
print specific debug info
.IP "\fB\-benchmark\fR" 4
.IX Item "-benchmark"
add timings for benchmarking
.IP "\fB\-hex\fR" 4
.IX Item "-hex"
dump each input packet
.IP "\fB\-bitexact\fR" 4
.IX Item "-bitexact"
only use bit exact algorithms (for codec testing)
.IP "\fB\-ps size\fR" 4
.IX Item "-ps size"
set packet size in bits
.IP "\fB\-re\fR" 4
.IX Item "-re"
read input at native frame rate. Mainly used to simulate a grab device.
.IP "\fB\-loop\fR" 4
.IX Item "-loop"
loop over the input stream. Currently it works only for image
streams. This option is used for ffserver automatic testing.
.Sh "FFmpeg formula evaluator"
.IX Subsection "FFmpeg formula evaluator"
When evaluating a rate control string, FFmpeg uses an internal formula
evaluator. 
.PP
The following binary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR,
\&\f(CW\*(C`*\*(C'\fR, \f(CW\*(C`/\*(C'\fR, \f(CW\*(C`^\*(C'\fR.
.PP
The following unary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR,
\&\f(CW\*(C`(...)\*(C'\fR.
.PP
The following functions are available:
.IP "\fIsinh(x)\fR" 4
.IX Item "sinh(x)"
.PD 0
.IP "\fIcosh(x)\fR" 4
.IX Item "cosh(x)"
.IP "\fItanh(x)\fR" 4
.IX Item "tanh(x)"
.IP "\fIsin(x)\fR" 4
.IX Item "sin(x)"
.IP "\fIcos(x)\fR" 4
.IX Item "cos(x)"
.IP "\fItan(x)\fR" 4
.IX Item "tan(x)"
.IP "\fIexp(x)\fR" 4
.IX Item "exp(x)"
.IP "\fIlog(x)\fR" 4
.IX Item "log(x)"
.IP "\fIsquish(x)\fR" 4
.IX Item "squish(x)"
.IP "\fIgauss(x)\fR" 4
.IX Item "gauss(x)"
.IP "\fIabs(x)\fR" 4
.IX Item "abs(x)"
.IP "\fImax(x, y)\fR" 4
.IX Item "max(x, y)"
.IP "\fImin(x, y)\fR" 4
.IX Item "min(x, y)"
.IP "\fIgt(x, y)\fR" 4
.IX Item "gt(x, y)"
.IP "\fIlt(x, y)\fR" 4
.IX Item "lt(x, y)"
.IP "\fIeq(x, y)\fR" 4
.IX Item "eq(x, y)"
.IP "\fIbits2qp(bits)\fR" 4
.IX Item "bits2qp(bits)"
.IP "\fIqp2bits(qp)\fR" 4
.IX Item "qp2bits(qp)"
.PD
.PP
The following constants are available:
.IP "\fI\s-1PI\s0\fR" 4
.IX Item "PI"
.PD 0
.IP "\fIE\fR" 4
.IX Item "E"
.IP "\fIiTex\fR" 4
.IX Item "iTex"
.IP "\fIpTex\fR" 4
.IX Item "pTex"
.IP "\fItex\fR" 4
.IX Item "tex"
.IP "\fImv\fR" 4
.IX Item "mv"
.IP "\fIfCode\fR" 4
.IX Item "fCode"
.IP "\fIiCount\fR" 4
.IX Item "iCount"
.IP "\fImcVar\fR" 4
.IX Item "mcVar"
.IP "\fIvar\fR" 4
.IX Item "var"
.IP "\fIisI\fR" 4
.IX Item "isI"
.IP "\fIisP\fR" 4
.IX Item "isP"
.IP "\fIisB\fR" 4
.IX Item "isB"
.IP "\fIavgQP\fR" 4
.IX Item "avgQP"
.IP "\fIqComp\fR" 4
.IX Item "qComp"
.IP "\fIavgIITex\fR" 4
.IX Item "avgIITex"
.IP "\fIavgPITex\fR" 4
.IX Item "avgPITex"
.IP "\fIavgPPTex\fR" 4
.IX Item "avgPPTex"
.IP "\fIavgBPTex\fR" 4
.IX Item "avgBPTex"
.IP "\fIavgTex\fR" 4
.IX Item "avgTex"
.PD
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.Sh "Video and Audio grabbing"
.IX Subsection "Video and Audio grabbing"
FFmpeg can use a video4linux compatible video source and any Open Sound
System audio source:
.PP
.Vb 1
\&        ffmpeg /tmp/out.mpg
.Ve
.PP
Note that you must activate the right video source and channel before
launching ffmpeg. You can use any \s-1TV\s0 viewer such as xawtv
(<\fBhttp://bytesex.org/xawtv/\fR>) by Gerd Knorr which I find very
good. You must also set correctly the audio recording levels with a
standard mixer.
.Sh "Video and Audio file format conversion"
.IX Subsection "Video and Audio file format conversion"
* ffmpeg can use any supported file format and protocol as input: 
.PP
Examples:
.PP
* You can input from \s-1YUV\s0 files:
.PP
.Vb 1
\&        ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
.Ve
.PP
It will use the files: 
.PP
.Vb 2
\&        /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
\&        /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
.Ve
.PP
The Y files use twice the resolution of the U and V files. They are
raw files, without header. They can be generated by all decent video
decoders. You must specify the size of the image with the \fB\-s\fR option
if ffmpeg cannot guess it.
.PP
* You can input from a \s-1RAW\s0 \s-1YUV420P\s0 file:
.PP
.Vb 1
\&        ffmpeg -i /tmp/test.yuv /tmp/out.avi
.Ve
.PP
The \s-1RAW\s0 \s-1YUV420P\s0 is a file containing \s-1RAW\s0 \s-1YUV\s0 planar, for each frame first
come the Y plane followed by U and V planes, which are half vertical and
horizontal resolution.
.PP
* You can output to a \s-1RAW\s0 \s-1YUV420P\s0 file:
.PP
.Vb 1
\&        ffmpeg -i mydivx.avi -o hugefile.yuv
.Ve
.PP
* You can set several input files and output files:
.PP
.Vb 1
\&        ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
.Ve
.PP
Convert the audio file a.wav and the raw yuv video file a.yuv
to mpeg file a.mpg
.PP
* You can also do audio and video conversions at the same time:
.PP
.Vb 1
\&        ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
.Ve
.PP
Convert the sample rate of a.wav to 22050 Hz and encode it to \s-1MPEG\s0 audio.
.PP
* You can encode to several formats at the same time and define a
mapping from input stream to output streams:
.PP
.Vb 1
\&        ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
.Ve
.PP
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 the order of the definition of output streams.
.PP
* You can transcode decrypted VOBs
.PP
.Vb 1
\&        ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
.Ve
.PP
This is a typical \s-1DVD\s0 ripper example, input from a \s-1VOB\s0 file, output
to an \s-1AVI\s0 file with \s-1MPEG\-4\s0 video and \s-1MP3\s0 audio, note that in this
command we use B frames so the \s-1MPEG\-4\s0 stream is DivX5 compatible, \s-1GOP\s0
size is 300 that means an \s-1INTRA\s0 frame every 10 seconds for 29.97 fps
input video.  Also the audio stream is \s-1MP3\s0 encoded so you need \s-1LAME\s0
support which is enabled using \f(CW\*(C`\-\-enable\-mp3lame\*(C'\fR when
configuring.  The mapping is particularly useful for \s-1DVD\s0 transcoding
to get the desired audio language.
.PP
\&\s-1NOTE:\s0 to see the supported input formats, use \f(CW\*(C`ffmpeg \-formats\*(C'\fR.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIffserver\fR\|(1), \fIffplay\fR\|(1) and the html documentation of \fIffmpeg\fR.
.SH "AUTHOR"
.IX Header "AUTHOR"
Fabrice Bellard