view ffmpeg/doc/ffmpeg-all.1 @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
line wrap: on
line source
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.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.  \*(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-
.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\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.el \{\
.    de IX
..
.\}
.\"
.\" 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-ALL 1"
.TH FFMPEG-ALL 1 "2013-04-21" " " " "
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
ffmpeg \- ffmpeg video converter
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
ffmpeg [\fIglobal_options\fR] {[\fIinput_file_options\fR] \-i \fIinput_file\fR} ... {[\fIoutput_file_options\fR] \fIoutput_file\fR} ...
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBffmpeg\fR is a very fast video and audio converter that can also grab from
a live audio/video source. It can also convert between arbitrary sample
rates and resize video on the fly with a high quality polyphase filter.
.PP
\&\fBffmpeg\fR reads from an arbitrary number of input \*(L"files\*(R" (which can be regular
files, pipes, network streams, grabbing devices, etc.), specified by the
\&\f(CW\*(C`\-i\*(C'\fR option, and writes to an arbitrary number of output \*(L"files\*(R", which are
specified by a plain output filename. Anything found on the command line which
cannot be interpreted as an option is considered to be an output filename.
.PP
Each input or output file can, in principle, contain any number of streams of
different types (video/audio/subtitle/attachment/data). The allowed number and/or
types of streams may be limited by the container format. Selecting which
streams from which inputs will go into which output is either done automatically
or with the \f(CW\*(C`\-map\*(C'\fR option (see the Stream selection chapter).
.PP
To refer to input files in options, you must use their indices (0\-based). E.g.
the first input file is \f(CW0\fR, the second is \f(CW1\fR, etc. Similarly, streams
within a file are referred to by their indices. E.g. \f(CW\*(C`2:3\*(C'\fR refers to the
fourth stream in the third input file. Also see the Stream specifiers chapter.
.PP
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.
Exceptions from this rule are the global options (e.g. verbosity level),
which should be specified first.
.PP
Do not mix input and output files \*(-- first specify all input files, then all
output files. Also do not mix options which belong to different files. All
options apply \s-1ONLY\s0 to the next input or output file and are reset between files.
.IP "\(bu" 4
To set the video bitrate of the output file to 64 kbit/s:
.Sp
.Vb 1
\&        ffmpeg \-i input.avi \-b:v 64k \-bufsize 64k output.avi
.Ve
.IP "\(bu" 4
To force the frame rate of the output file to 24 fps:
.Sp
.Vb 1
\&        ffmpeg \-i input.avi \-r 24 output.avi
.Ve
.IP "\(bu" 4
To force the frame rate of the input file (valid for raw formats only)
to 1 fps and the frame rate of the output file to 24 fps:
.Sp
.Vb 1
\&        ffmpeg \-r 1 \-i input.m2v \-r 24 output.avi
.Ve
.PP
The format option may be needed for raw input files.
.SH "DETAILED DESCRIPTION"
.IX Header "DETAILED DESCRIPTION"
The transcoding process in \fBffmpeg\fR for each output can be described by
the following diagram:
.PP
.Vb 5
\&         _\|_\|_\|_\|_\|_\|_              _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_               _\|_\|_\|_\|_\|_\|_\|_\|_              _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_            _\|_\|_\|_\|_\|_\|_\|_
\&        |       |            |              |             |         |            |              |          |        |
\&        | input |  demuxer   | encoded data |   decoder   | decoded |  encoder   | encoded data |  muxer   | output |
\&        | file  | \-\-\-\-\-\-\-\-\-> | packets      |  \-\-\-\-\-\-\-\-\-> | frames  | \-\-\-\-\-\-\-\-\-> | packets      | \-\-\-\-\-\-\-> | file   |
\&        |_\|_\|_\|_\|_\|_\|_|            |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_|             |_\|_\|_\|_\|_\|_\|_\|_\|_|            |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_|          |_\|_\|_\|_\|_\|_\|_\|_|
.Ve
.PP
\&\fBffmpeg\fR calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them. When there are
multiple input files, \fBffmpeg\fR tries to keep them synchronized by
tracking lowest timestamp on any active input stream.
.PP
Encoded packets are then passed to the decoder (unless streamcopy is selected
for the stream, see further for a description). The decoder produces
uncompressed frames (raw video/PCM audio/...) which can be processed further by
filtering (see next section). After filtering, the frames are passed to the
encoder, which encodes them and outputs encoded packets. Finally those are
passed to the muxer, which writes the encoded packets to the output file.
.SS "Filtering"
.IX Subsection "Filtering"
Before encoding, \fBffmpeg\fR can process raw audio and video frames using
filters from the libavfilter library. Several chained filters form a filter
graph. \fBffmpeg\fR distinguishes between two types of filtergraphs:
simple and complex.
.PP
\fISimple filtergraphs\fR
.IX Subsection "Simple filtergraphs"
.PP
Simple filtergraphs are those that have exactly one input and output, both of
the same type. In the above diagram they can be represented by simply inserting
an additional step between decoding and encoding:
.PP
.Vb 5
\&         _\|_\|_\|_\|_\|_\|_\|_\|_                        _\|_\|_\|_\|_\|_\|_\|_\|_\|_              _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&        |         |                      |          |            |              |
\&        | decoded |  simple filtergraph  | filtered |  encoder   | encoded data |
\&        | frames  | \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> | frames   | \-\-\-\-\-\-\-\-\-> | packets      |
\&        |_\|_\|_\|_\|_\|_\|_\|_\|_|                      |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|            |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
.Ve
.PP
Simple filtergraphs are configured with the per-stream \fB\-filter\fR option
(with \fB\-vf\fR and \fB\-af\fR aliases for video and audio respectively).
A simple filtergraph for video can look for example like this:
.PP
.Vb 4
\&         _\|_\|_\|_\|_\|_\|_        _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_        _\|_\|_\|_\|_\|_\|_        _\|_\|_\|_\|_        _\|_\|_\|_\|_\|_\|_\|_
\&        |       |      |             |      |       |      |     |      |        |
\&        | input | \-\-\-> | deinterlace | \-\-\-> | scale | \-\-\-> | fps | \-\-\-> | output |
\&        |_\|_\|_\|_\|_\|_\|_|      |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_|      |_\|_\|_\|_\|_\|_\|_|      |_\|_\|_\|_\|_|      |_\|_\|_\|_\|_\|_\|_\|_|
.Ve
.PP
Note that some filters change frame properties but not frame contents. E.g. the
\&\f(CW\*(C`fps\*(C'\fR filter in the example above changes number of frames, but does not
touch the frame contents. Another example is the \f(CW\*(C`setpts\*(C'\fR filter, which
only sets timestamps and otherwise passes the frames unchanged.
.PP
\fIComplex filtergraphs\fR
.IX Subsection "Complex filtergraphs"
.PP
Complex filtergraphs are those which cannot be described as simply a linear
processing chain applied to one stream. This is the case, for example, when the graph has
more than one input and/or output, or when output stream type is different from
input. They can be represented with the following diagram:
.PP
.Vb 10
\&         _\|_\|_\|_\|_\|_\|_\|_\|_
\&        |         |
\&        | input 0 |\e                    _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&        |_\|_\|_\|_\|_\|_\|_\|_\|_| \e                  |          |
\&                     \e   _\|_\|_\|_\|_\|_\|_\|_\|_    /| output 0 |
\&                      \e |         |  / |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
\&         _\|_\|_\|_\|_\|_\|_\|_\|_     \e| complex | /
\&        |         |     |         |/
\&        | input 1 |\-\-\-\->| filter  |\e
\&        |_\|_\|_\|_\|_\|_\|_\|_\|_|     |         | \e   _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&                       /| graph   |  \e |          |
\&                      / |         |   \e| output 1 |
\&         _\|_\|_\|_\|_\|_\|_\|_\|_   /  |_\|_\|_\|_\|_\|_\|_\|_\|_|    |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
\&        |         | /
\&        | input 2 |/
\&        |_\|_\|_\|_\|_\|_\|_\|_\|_|
.Ve
.PP
Complex filtergraphs are configured with the \fB\-filter_complex\fR option.
Note that this option is global, since a complex filtergraph, by its nature,
cannot be unambiguously associated with a single stream or file.
.PP
The \fB\-lavfi\fR option is equivalent to \fB\-filter_complex\fR.
.PP
A trivial example of a complex filtergraph is the \f(CW\*(C`overlay\*(C'\fR filter, which
has two video inputs and one video output, containing one video overlaid on top
of the other. Its audio counterpart is the \f(CW\*(C`amix\*(C'\fR filter.
.SS "Stream copy"
.IX Subsection "Stream copy"
Stream copy is a mode selected by supplying the \f(CW\*(C`copy\*(C'\fR parameter to the
\&\fB\-codec\fR option. It makes \fBffmpeg\fR omit the decoding and encoding
step for the specified stream, so it does only demuxing and muxing. It is useful
for changing the container format or modifying container-level metadata. The
diagram above will, in this case, simplify to this:
.PP
.Vb 5
\&         _\|_\|_\|_\|_\|_\|_              _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_            _\|_\|_\|_\|_\|_\|_\|_
\&        |       |            |              |          |        |
\&        | input |  demuxer   | encoded data |  muxer   | output |
\&        | file  | \-\-\-\-\-\-\-\-\-> | packets      | \-\-\-\-\-\-\-> | file   |
\&        |_\|_\|_\|_\|_\|_\|_|            |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_|          |_\|_\|_\|_\|_\|_\|_\|_|
.Ve
.PP
Since there is no decoding or encoding, it is very fast and there is no quality
loss. However, it might not work in some cases because of many factors. Applying
filters is obviously also impossible, since filters work on uncompressed data.
.SH "STREAM SELECTION"
.IX Header "STREAM SELECTION"
By default, \fBffmpeg\fR includes only one stream of each type (video, audio, subtitle)
present in the input files and adds them to each output file.  It picks the
\&\*(L"best\*(R" of each based upon the following criteria: for video, it is the stream
with the highest resolution, for audio, it is the stream with the most channels, for
subtitles, it is the first subtitle stream. In the case where several streams of
the same type rate equally, the stream with the lowest index is chosen.
.PP
You can disable some of those defaults by using the \f(CW\*(C`\-vn/\-an/\-sn\*(C'\fR options. For
full manual control, use the \f(CW\*(C`\-map\*(C'\fR option, which disables the defaults just
described.
.SH "OPTIONS"
.IX Header "OPTIONS"
All the numerical options, if not specified otherwise, accept a string
representing a number as input, which may be followed by one of the \s-1SI\s0
unit prefixes, for example: 'K', 'M', or 'G'.
.PP
If 'i' is appended to the \s-1SI\s0 unit prefix, the complete prefix will be
interpreted as a unit prefix for binary multiplies, which are based on
powers of 1024 instead of powers of 1000. Appending 'B' to the \s-1SI\s0 unit
prefix multiplies the value by 8. This allows using, for example:
\&'\s-1KB\s0', 'MiB', 'G' and 'B' as number suffixes.
.PP
Options which do not take arguments are boolean options, and set the
corresponding value to true. They can be set to false by prefixing
the option name with \*(L"no\*(R". For example using \*(L"\-nofoo\*(R"
will set the boolean option with name \*(L"foo\*(R" to false.
.SS "Stream specifiers"
.IX Subsection "Stream specifiers"
Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
are used to precisely specify which stream(s) a given option belongs to.
.PP
A stream specifier is a string generally appended to the option name and
separated from it by a colon. E.g. \f(CW\*(C`\-codec:a:1 ac3\*(C'\fR contains the
\&\f(CW\*(C`a:1\*(C'\fR stream specifier, which matches the second audio stream. Therefore, it
would select the ac3 codec for the second audio stream.
.PP
A stream specifier can match several streams, so that the option is applied to all
of them. E.g. the stream specifier in \f(CW\*(C`\-b:a 128k\*(C'\fR matches all audio
streams.
.PP
An empty stream specifier matches all streams. For example, \f(CW\*(C`\-codec copy\*(C'\fR
or \f(CW\*(C`\-codec: copy\*(C'\fR would copy all the streams without reencoding.
.PP
Possible forms of stream specifiers are:
.IP "\fIstream_index\fR" 4
.IX Item "stream_index"
Matches the stream with this index. E.g. \f(CW\*(C`\-threads:1 4\*(C'\fR would set the
thread count for the second stream to 4.
.IP "\fIstream_type\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4
.IX Item "stream_type[:stream_index]"
\&\fIstream_type\fR is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
\&'d' for data, and 't' for attachments. If \fIstream_index\fR is given, then it matches
stream number \fIstream_index\fR of this type. Otherwise, it matches all
streams of this type.
.IP "\fBp:\fR\fIprogram_id\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4
.IX Item "p:program_id[:stream_index]"
If \fIstream_index\fR is given, then it matches the stream with number \fIstream_index\fR
in the program with the id \fIprogram_id\fR. Otherwise, it matches all streams in the
program.
.IP "\fB#\fR\fIstream_id\fR" 4
.IX Item "#stream_id"
Matches the stream by a format-specific \s-1ID\s0.
.SS "Generic options"
.IX Subsection "Generic options"
These options are shared amongst the ff* tools.
.IP "\fB\-L\fR" 4
.IX Item "-L"
Show license.
.IP "\fB\-h, \-?, \-help, \-\-help [\fR\fIarg\fR\fB]\fR" 4
.IX Item "-h, -?, -help, --help [arg]"
Show help. An optional parameter may be specified to print help about a specific
item.
.Sp
Possible values of \fIarg\fR are:
.RS 4
.IP "\fBdecoder=\fR\fIdecoder_name\fR" 4
.IX Item "decoder=decoder_name"
Print detailed information about the decoder named \fIdecoder_name\fR. Use the
\&\fB\-decoders\fR option to get a list of all decoders.
.IP "\fBencoder=\fR\fIencoder_name\fR" 4
.IX Item "encoder=encoder_name"
Print detailed information about the encoder named \fIencoder_name\fR. Use the
\&\fB\-encoders\fR option to get a list of all encoders.
.IP "\fBdemuxer=\fR\fIdemuxer_name\fR" 4
.IX Item "demuxer=demuxer_name"
Print detailed information about the demuxer named \fIdemuxer_name\fR. Use the
\&\fB\-formats\fR option to get a list of all demuxers and muxers.
.IP "\fBmuxer=\fR\fImuxer_name\fR" 4
.IX Item "muxer=muxer_name"
Print detailed information about the muxer named \fImuxer_name\fR. Use the
\&\fB\-formats\fR option to get a list of all muxers and demuxers.
.IP "\fBfilter=\fR\fIfilter_name\fR" 4
.IX Item "filter=filter_name"
Print detailed information about the filter name \fIfilter_name\fR. Use the
\&\fB\-filters\fR option to get a list of all filters.
.RE
.RS 4
.RE
.IP "\fB\-version\fR" 4
.IX Item "-version"
Show version.
.IP "\fB\-formats\fR" 4
.IX Item "-formats"
Show available formats.
.IP "\fB\-codecs\fR" 4
.IX Item "-codecs"
Show all codecs known to libavcodec.
.Sp
Note that the term 'codec' is used throughout this documentation as a shortcut
for what is more correctly called a media bitstream format.
.IP "\fB\-decoders\fR" 4
.IX Item "-decoders"
Show available decoders.
.IP "\fB\-encoders\fR" 4
.IX Item "-encoders"
Show all available encoders.
.IP "\fB\-bsfs\fR" 4
.IX Item "-bsfs"
Show available bitstream filters.
.IP "\fB\-protocols\fR" 4
.IX Item "-protocols"
Show available protocols.
.IP "\fB\-filters\fR" 4
.IX Item "-filters"
Show available libavfilter filters.
.IP "\fB\-pix_fmts\fR" 4
.IX Item "-pix_fmts"
Show available pixel formats.
.IP "\fB\-sample_fmts\fR" 4
.IX Item "-sample_fmts"
Show available sample formats.
.IP "\fB\-layouts\fR" 4
.IX Item "-layouts"
Show channel names and standard channel layouts.
.IP "\fB\-loglevel [repeat+]\fR\fIloglevel\fR \fB| \-v [repeat+]\fR\fIloglevel\fR" 4
.IX Item "-loglevel [repeat+]loglevel | -v [repeat+]loglevel"
Set the logging level used by the library.
Adding \*(L"repeat+\*(R" indicates that repeated log output should not be compressed
to the first line and the \*(L"Last message repeated n times\*(R" line will be
omitted. \*(L"repeat\*(R" can also be used alone.
If \*(L"repeat\*(R" is used alone, and with no prior loglevel set, the default
loglevel will be used. If multiple loglevel parameters are given, using
\&'repeat' will not change the loglevel.
\&\fIloglevel\fR is a number or a string containing one of the following values:
.RS 4
.IP "\fBquiet\fR" 4
.IX Item "quiet"
Show nothing at all; be silent.
.IP "\fBpanic\fR" 4
.IX Item "panic"
Only show fatal errors which could lead the process to crash, such as
and assert failure. This is not currently used for anything.
.IP "\fBfatal\fR" 4
.IX Item "fatal"
Only show fatal errors. These are errors after which the process absolutely
cannot continue after.
.IP "\fBerror\fR" 4
.IX Item "error"
Show all errors, including ones which can be recovered from.
.IP "\fBwarning\fR" 4
.IX Item "warning"
Show all warnings and errors. Any message related to possibly
incorrect or unexpected events will be shown.
.IP "\fBinfo\fR" 4
.IX Item "info"
Show informative messages during processing. This is in addition to
warnings and errors. This is the default value.
.IP "\fBverbose\fR" 4
.IX Item "verbose"
Same as \f(CW\*(C`info\*(C'\fR, except more verbose.
.IP "\fBdebug\fR" 4
.IX Item "debug"
Show everything, including debugging information.
.RE
.RS 4
.Sp
By default the program logs to stderr, if coloring is supported by the
terminal, colors are used to mark errors and warnings. Log coloring
can be disabled setting the environment variable
\&\fB\s-1AV_LOG_FORCE_NOCOLOR\s0\fR or \fB\s-1NO_COLOR\s0\fR, or can be forced setting
the environment variable \fB\s-1AV_LOG_FORCE_COLOR\s0\fR.
The use of the environment variable \fB\s-1NO_COLOR\s0\fR is deprecated and
will be dropped in a following FFmpeg version.
.RE
.IP "\fB\-report\fR" 4
.IX Item "-report"
Dump full command line and console output to a file named
\&\f(CW\*(C`\f(CIprogram\f(CW\-\f(CIYYYYMMDD\f(CW\-\f(CIHHMMSS\f(CW.log\*(C'\fR in the current
directory.
This file can be useful for bug reports.
It also implies \f(CW\*(C`\-loglevel verbose\*(C'\fR.
.Sp
Setting the environment variable \f(CW\*(C`FFREPORT\*(C'\fR to any value has the
same effect. If the value is a ':'\-separated key=value sequence, these
options will affect the report; options values must be escaped if they
contain special characters or the options delimiter ':' (see the
``Quoting and escaping'' section in the ffmpeg-utils manual). The
following option is recognized:
.RS 4
.IP "\fBfile\fR" 4
.IX Item "file"
set the file name to use for the report; \f(CW%p\fR is expanded to the name
of the program, \f(CW%t\fR is expanded to a timestamp, \f(CW\*(C`%%\*(C'\fR is expanded
to a plain \f(CW\*(C`%\*(C'\fR
.RE
.RS 4
.Sp
Errors in parsing the environment variable are not fatal, and will not
appear in the report.
.RE
.IP "\fB\-cpuflags flags (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-cpuflags flags (global)"
Allows setting and clearing cpu flags. This option is intended
for testing. Do not use it unless you know what you're doing.
.Sp
.Vb 3
\&        ffmpeg \-cpuflags \-sse+mmx ...
\&        ffmpeg \-cpuflags mmx ...
\&        ffmpeg \-cpuflags 0 ...
.Ve
.Sp
Possible flags for this option are:
.RS 4
.IP "\fBx86\fR" 4
.IX Item "x86"
.RS 4
.PD 0
.IP "\fBmmx\fR" 4
.IX Item "mmx"
.IP "\fBmmxext\fR" 4
.IX Item "mmxext"
.IP "\fBsse\fR" 4
.IX Item "sse"
.IP "\fBsse2\fR" 4
.IX Item "sse2"
.IP "\fBsse2slow\fR" 4
.IX Item "sse2slow"
.IP "\fBsse3\fR" 4
.IX Item "sse3"
.IP "\fBsse3slow\fR" 4
.IX Item "sse3slow"
.IP "\fBssse3\fR" 4
.IX Item "ssse3"
.IP "\fBatom\fR" 4
.IX Item "atom"
.IP "\fBsse4.1\fR" 4
.IX Item "sse4.1"
.IP "\fBsse4.2\fR" 4
.IX Item "sse4.2"
.IP "\fBavx\fR" 4
.IX Item "avx"
.IP "\fBxop\fR" 4
.IX Item "xop"
.IP "\fBfma4\fR" 4
.IX Item "fma4"
.IP "\fB3dnow\fR" 4
.IX Item "3dnow"
.IP "\fB3dnowext\fR" 4
.IX Item "3dnowext"
.IP "\fBcmov\fR" 4
.IX Item "cmov"
.RE
.RS 4
.RE
.IP "\fB\s-1ARM\s0\fR" 4
.IX Item "ARM"
.RS 4
.IP "\fBarmv5te\fR" 4
.IX Item "armv5te"
.IP "\fBarmv6\fR" 4
.IX Item "armv6"
.IP "\fBarmv6t2\fR" 4
.IX Item "armv6t2"
.IP "\fBvfp\fR" 4
.IX Item "vfp"
.IP "\fBvfpv3\fR" 4
.IX Item "vfpv3"
.IP "\fBneon\fR" 4
.IX Item "neon"
.RE
.RS 4
.RE
.IP "\fBPowerPC\fR" 4
.IX Item "PowerPC"
.RS 4
.IP "\fBaltivec\fR" 4
.IX Item "altivec"
.RE
.RS 4
.RE
.IP "\fBSpecific Processors\fR" 4
.IX Item "Specific Processors"
.RS 4
.IP "\fBpentium2\fR" 4
.IX Item "pentium2"
.IP "\fBpentium3\fR" 4
.IX Item "pentium3"
.IP "\fBpentium4\fR" 4
.IX Item "pentium4"
.IP "\fBk6\fR" 4
.IX Item "k6"
.IP "\fBk62\fR" 4
.IX Item "k62"
.IP "\fBathlon\fR" 4
.IX Item "athlon"
.IP "\fBathlonxp\fR" 4
.IX Item "athlonxp"
.IP "\fBk8\fR" 4
.IX Item "k8"
.RE
.RS 4
.RE
.RE
.RS 4
.RE
.IP "\fB\-opencl_options options (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-opencl_options options (global)"
.PD
Set OpenCL environment options. This option is only available when
FFmpeg has been compiled with \f(CW\*(C`\-\-enable\-opencl\*(C'\fR.
.Sp
\&\fIoptions\fR must be a list of \fIkey\fR=\fIvalue\fR option pairs
separated by ':'. See the ``OpenCL Options'' section in the
ffmpeg-utils manual for the list of supported options.
.SS "AVOptions"
.IX Subsection "AVOptions"
These options are provided directly by the libavformat, libavdevice and
libavcodec libraries. To see the list of available AVOptions, use the
\&\fB\-help\fR option. They are separated into two categories:
.IP "\fBgeneric\fR" 4
.IX Item "generic"
These options can be set for any container, codec or device. Generic options
are listed under AVFormatContext options for containers/devices and under
AVCodecContext options for codecs.
.IP "\fBprivate\fR" 4
.IX Item "private"
These options are specific to the given container, device or codec. Private
options are listed under their corresponding containers/devices/codecs.
.PP
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
an \s-1MP3\s0 file, use the \fBid3v2_version\fR private option of the \s-1MP3\s0
muxer:
.PP
.Vb 1
\&        ffmpeg \-i input.flac \-id3v2_version 3 out.mp3
.Ve
.PP
All codec AVOptions are obviously per-stream, so the chapter on stream
specifiers applies to them
.PP
Note \fB\-nooption\fR syntax cannot be used for boolean AVOptions,
use \fB\-option 0\fR/\fB\-option 1\fR.
.PP
Note2 old undocumented way of specifying per-stream AVOptions by prepending
v/a/s to the options name is now obsolete and will be removed soon.
.SS "Main options"
.IX Subsection "Main options"
.IP "\fB\-f\fR \fIfmt\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "-f fmt (input/output)"
Force input or output file format. The format is normally auto detected for input
files and guessed from the file extension for output files, so this option is not
needed in most cases.
.IP "\fB\-i\fR \fIfilename\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "-i filename (input)"
input file name
.IP "\fB\-y (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-y (global)"
Overwrite output files without asking.
.IP "\fB\-n (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-n (global)"
Do not overwrite output files, and exit immediately if a specified
output file already exists.
.IP "\fB\-c[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-c[:stream_specifier] codec (input/output,per-stream)"
.PD 0
.IP "\fB\-codec[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-codec[:stream_specifier] codec (input/output,per-stream)"
.PD
Select an encoder (when used before an output file) or a decoder (when used
before an input file) for one or more streams. \fIcodec\fR is the name of a
decoder/encoder or a special value \f(CW\*(C`copy\*(C'\fR (output only) to indicate that
the stream is not to be re-encoded.
.Sp
For example
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map 0 \-c:v libx264 \-c:a copy OUTPUT
.Ve
.Sp
encodes all video streams with libx264 and copies all audio streams.
.Sp
For each stream, the last matching \f(CW\*(C`c\*(C'\fR option is applied, so
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map 0 \-c copy \-c:v:1 libx264 \-c:a:137 libvorbis OUTPUT
.Ve
.Sp
will copy all the streams except the second video, which will be encoded with
libx264, and the 138th audio, which will be encoded with libvorbis.
.IP "\fB\-t\fR \fIduration\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-t duration (output)"
Stop writing the output after its duration reaches \fIduration\fR.
\&\fIduration\fR may be a number in seconds, or in \f(CW\*(C`hh:mm:ss[.xxx]\*(C'\fR form.
.Sp
\&\-to and \-t are mutually exclusive and \-t has priority.
.IP "\fB\-to\fR \fIposition\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-to position (output)"
Stop writing the output at \fIposition\fR.
\&\fIposition\fR may be a number in seconds, or in \f(CW\*(C`hh:mm:ss[.xxx]\*(C'\fR form.
.Sp
\&\-to and \-t are mutually exclusive and \-t has priority.
.IP "\fB\-fs\fR \fIlimit_size\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-fs limit_size (output)"
Set the file size limit, expressed in bytes.
.IP "\fB\-ss\fR \fIposition\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "-ss position (input/output)"
When used as an input option (before \f(CW\*(C`\-i\*(C'\fR), seeks in this input file to
\&\fIposition\fR. When used as an output option (before an output filename),
decodes but discards input until the timestamps reach \fIposition\fR. This is
slower, but more accurate.
.Sp
\&\fIposition\fR may be either in seconds or in \f(CW\*(C`hh:mm:ss[.xxx]\*(C'\fR form.
.IP "\fB\-itsoffset\fR \fIoffset\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "-itsoffset offset (input)"
Set the input time offset in seconds.
\&\f(CW\*(C`[\-]hh:mm:ss[.xxx]\*(C'\fR syntax is also supported.
The offset is added to the timestamps of the input files.
Specifying a positive offset means that the corresponding
streams are delayed by \fIoffset\fR seconds.
.IP "\fB\-timestamp\fR \fItime\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-timestamp time (output)"
Set the recording timestamp in the container.
The syntax for \fItime\fR is:
.Sp
.Vb 1
\&        now|([(YYYY\-MM\-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...])|(HHMMSS[.m...]))[Z|z])
.Ve
.Sp
If the value is \*(L"now\*(R" it takes the current time.
Time is local time unless 'Z' or 'z' is appended, in which case it is
interpreted as \s-1UTC\s0.
If the year-month-day part is not specified it takes the current
year-month-day.
.IP "\fB\-metadata[:metadata_specifier]\fR \fIkey\fR\fB=\fR\fIvalue\fR \fB(\fR\fIoutput,per\-metadata\fR\fB)\fR" 4
.IX Item "-metadata[:metadata_specifier] key=value (output,per-metadata)"
Set a metadata key/value pair.
.Sp
An optional \fImetadata_specifier\fR may be given to set metadata
on streams or chapters. See \f(CW\*(C`\-map_metadata\*(C'\fR documentation for
details.
.Sp
This option overrides metadata set with \f(CW\*(C`\-map_metadata\*(C'\fR. It is
also possible to delete metadata by using an empty value.
.Sp
For example, for setting the title in the output file:
.Sp
.Vb 1
\&        ffmpeg \-i in.avi \-metadata title="my title" out.flv
.Ve
.Sp
To set the language of the first audio stream:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-metadata:s:a:1 language=eng OUTPUT
.Ve
.IP "\fB\-target\fR \fItype\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-target type (output)"
Specify target file type (\f(CW\*(C`vcd\*(C'\fR, \f(CW\*(C`svcd\*(C'\fR, \f(CW\*(C`dvd\*(C'\fR, \f(CW\*(C`dv\*(C'\fR,
\&\f(CW\*(C`dv50\*(C'\fR). \fItype\fR may be prefixed with \f(CW\*(C`pal\-\*(C'\fR, \f(CW\*(C`ntsc\-\*(C'\fR or
\&\f(CW\*(C`film\-\*(C'\fR to use the corresponding standard. All the format options
(bitrate, codecs, buffer sizes) are then set automatically. You can just type:
.Sp
.Vb 1
\&        ffmpeg \-i myfile.avi \-target vcd /tmp/vcd.mpg
.Ve
.Sp
Nevertheless you can specify additional options as long as you know
they do not conflict with the standard, as in:
.Sp
.Vb 1
\&        ffmpeg \-i myfile.avi \-target vcd \-bf 2 /tmp/vcd.mpg
.Ve
.IP "\fB\-dframes\fR \fInumber\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-dframes number (output)"
Set the number of data frames to record. This is an alias for \f(CW\*(C`\-frames:d\*(C'\fR.
.IP "\fB\-frames[:\fR\fIstream_specifier\fR\fB]\fR \fIframecount\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-frames[:stream_specifier] framecount (output,per-stream)"
Stop writing to the stream after \fIframecount\fR frames.
.IP "\fB\-q[:\fR\fIstream_specifier\fR\fB]\fR \fIq\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-q[:stream_specifier] q (output,per-stream)"
.PD 0
.IP "\fB\-qscale[:\fR\fIstream_specifier\fR\fB]\fR \fIq\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-qscale[:stream_specifier] q (output,per-stream)"
.PD
Use fixed quality scale (\s-1VBR\s0). The meaning of \fIq\fR is
codec-dependent.
.IP "\fB\-filter[:\fR\fIstream_specifier\fR\fB]\fR \fIfiltergraph\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-filter[:stream_specifier] filtergraph (output,per-stream)"
Create the filtergraph specified by \fIfiltergraph\fR and use it to
filter the stream.
.Sp
\&\fIfiltergraph\fR is a description of the filtergraph to apply to
the stream, and must have a single input and a single output of the
same type of the stream. In the filtergraph, the input is associated
to the label \f(CW\*(C`in\*(C'\fR, and the output to the label \f(CW\*(C`out\*(C'\fR. See
the ffmpeg-filters manual for more information about the filtergraph
syntax.
.Sp
See the \-filter_complex option if you
want to create filtergraphs with multiple inputs and/or outputs.
.IP "\fB\-filter_script[:\fR\fIstream_specifier\fR\fB]\fR \fIfilename\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-filter_script[:stream_specifier] filename (output,per-stream)"
This option is similar to \fB\-filter\fR, the only difference is that its
argument is the name of the file from which a filtergraph description is to be
read.
.IP "\fB\-pre[:\fR\fIstream_specifier\fR\fB]\fR \fIpreset_name\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-pre[:stream_specifier] preset_name (output,per-stream)"
Specify the preset for matching stream(s).
.IP "\fB\-stats (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-stats (global)"
Print encoding progress/statistics. It is on by default, to explicitly
disable it you need to specify \f(CW\*(C`\-nostats\*(C'\fR.
.IP "\fB\-progress\fR \fIurl\fR \fB(\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-progress url (global)"
Send program-friendly progress information to \fIurl\fR.
.Sp
Progress information is written approximately every second and at the end of
the encoding process. It is made of "\fIkey\fR=\fIvalue\fR" lines. \fIkey\fR
consists of only alphanumeric characters. The last key of a sequence of
progress information is always \*(L"progress\*(R".
.IP "\fB\-stdin\fR" 4
.IX Item "-stdin"
Enable interaction on standard input. On by default unless standard input is
used as an input. To explicitly disable interaction you need to specify
\&\f(CW\*(C`\-nostdin\*(C'\fR.
.Sp
Disabling interaction on standard input is useful, for example, if
ffmpeg is in the background process group. Roughly the same result can
be achieved with \f(CW\*(C`ffmpeg ... < /dev/null\*(C'\fR but it requires a
shell.
.IP "\fB\-debug_ts (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-debug_ts (global)"
Print timestamp information. It is off by default. This option is
mostly useful for testing and debugging purposes, and the output
format may change from one version to another, so it should not be
employed by portable scripts.
.Sp
See also the option \f(CW\*(C`\-fdebug ts\*(C'\fR.
.IP "\fB\-attach\fR \fIfilename\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-attach filename (output)"
Add an attachment to the output file. This is supported by a few formats
like Matroska for e.g. fonts used in rendering subtitles. Attachments
are implemented as a specific type of stream, so this option will add
a new stream to the file. It is then possible to use per-stream options
on this stream in the usual way. Attachment streams created with this
option will be created after all the other streams (i.e. those created
with \f(CW\*(C`\-map\*(C'\fR or automatic mappings).
.Sp
Note that for Matroska you also have to set the mimetype metadata tag:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-attach DejaVuSans.ttf \-metadata:s:2 mimetype=application/x\-truetype\-font out.mkv
.Ve
.Sp
(assuming that the attachment stream will be third in the output file).
.IP "\fB\-dump_attachment[:\fR\fIstream_specifier\fR\fB]\fR \fIfilename\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4
.IX Item "-dump_attachment[:stream_specifier] filename (input,per-stream)"
Extract the matching attachment stream into a file named \fIfilename\fR. If
\&\fIfilename\fR is empty, then the value of the \f(CW\*(C`filename\*(C'\fR metadata tag
will be used.
.Sp
E.g. to extract the first attachment to a file named 'out.ttf':
.Sp
.Vb 1
\&        ffmpeg \-dump_attachment:t:0 out.ttf \-i INPUT
.Ve
.Sp
To extract all attachments to files determined by the \f(CW\*(C`filename\*(C'\fR tag:
.Sp
.Vb 1
\&        ffmpeg \-dump_attachment:t "" \-i INPUT
.Ve
.Sp
Technical note \*(-- attachments are implemented as codec extradata, so this
option can actually be used to extract extradata from any stream, not just
attachments.
.SS "Video Options"
.IX Subsection "Video Options"
.IP "\fB\-vframes\fR \fInumber\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-vframes number (output)"
Set the number of video frames to record. This is an alias for \f(CW\*(C`\-frames:v\*(C'\fR.
.IP "\fB\-r[:\fR\fIstream_specifier\fR\fB]\fR \fIfps\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-r[:stream_specifier] fps (input/output,per-stream)"
Set frame rate (Hz value, fraction or abbreviation).
.Sp
As an input option, ignore any timestamps stored in the file and instead
generate timestamps assuming constant frame rate \fIfps\fR.
.Sp
As an output option, duplicate or drop input frames to achieve constant output
frame rate \fIfps\fR.
.IP "\fB\-s[:\fR\fIstream_specifier\fR\fB]\fR \fIsize\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-s[:stream_specifier] size (input/output,per-stream)"
Set frame size.
.Sp
As an input option, this is a shortcut for the \fBvideo_size\fR private
option, recognized by some demuxers for which the frame size is either not
stored in the file or is configurable \*(-- e.g. raw video or video grabbers.
.Sp
As an output option, this inserts the \f(CW\*(C`scale\*(C'\fR video filter to the
\&\fIend\fR of the corresponding filtergraph. Please use the \f(CW\*(C`scale\*(C'\fR filter
directly to insert it at the beginning or some other place.
.Sp
The format is \fBwxh\fR (default \- same as source).
.IP "\fB\-aspect[:\fR\fIstream_specifier\fR\fB]\fR \fIaspect\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-aspect[:stream_specifier] aspect (output,per-stream)"
Set the video display aspect ratio specified by \fIaspect\fR.
.Sp
\&\fIaspect\fR can be a floating point number string, or a string of the
form \fInum\fR:\fIden\fR, where \fInum\fR and \fIden\fR are the
numerator and denominator of the aspect ratio. For example \*(L"4:3\*(R",
\&\*(L"16:9\*(R", \*(L"1.3333\*(R", and \*(L"1.7777\*(R" are valid argument values.
.Sp
If used together with \fB\-vcodec copy\fR, it will affect the aspect ratio
stored at container level, but not the aspect ratio stored in encoded
frames, if it exists.
.IP "\fB\-vn (\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-vn (output)"
Disable video recording.
.IP "\fB\-vcodec\fR \fIcodec\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-vcodec codec (output)"
Set the video codec. This is an alias for \f(CW\*(C`\-codec:v\*(C'\fR.
.IP "\fB\-pass[:\fR\fIstream_specifier\fR\fB]\fR \fIn\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-pass[:stream_specifier] n (output,per-stream)"
Select the pass number (1 or 2). It is used to do two-pass
video encoding. The statistics of the video are recorded in the first
pass into a log file (see also the option \-passlogfile),
and in the second pass that log file is used to generate the video
at the exact requested bitrate.
On pass 1, you may just deactivate audio and set output to null,
examples for Windows and Unix:
.Sp
.Vb 2
\&        ffmpeg \-i foo.mov \-c:v libxvid \-pass 1 \-an \-f rawvideo \-y NUL
\&        ffmpeg \-i foo.mov \-c:v libxvid \-pass 1 \-an \-f rawvideo \-y /dev/null
.Ve
.IP "\fB\-passlogfile[:\fR\fIstream_specifier\fR\fB]\fR \fIprefix\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-passlogfile[:stream_specifier] prefix (output,per-stream)"
Set two-pass log file name prefix to \fIprefix\fR, the default file name
prefix is ``ffmpeg2pass''. The complete file name will be
\&\fI\s-1PREFIX\-N\s0.log\fR, where N is a number specific to the output
stream
.IP "\fB\-vlang\fR \fIcode\fR" 4
.IX Item "-vlang code"
Set the \s-1ISO\s0 639 language code (3 letters) of the current video stream.
.IP "\fB\-vf\fR \fIfiltergraph\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-vf filtergraph (output)"
Create the filtergraph specified by \fIfiltergraph\fR and use it to
filter the stream.
.Sp
This is an alias for \f(CW\*(C`\-filter:v\*(C'\fR, see the \-filter option.
.SS "Advanced Video Options"
.IX Subsection "Advanced Video Options"
.IP "\fB\-pix_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIformat\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-pix_fmt[:stream_specifier] format (input/output,per-stream)"
Set pixel format. Use \f(CW\*(C`\-pix_fmts\*(C'\fR to show all the supported
pixel formats.
If the selected pixel format can not be selected, ffmpeg will print a
warning and select the best pixel format supported by the encoder.
If \fIpix_fmt\fR is prefixed by a \f(CW\*(C`+\*(C'\fR, ffmpeg will exit with an error
if the requested pixel format can not be selected, and automatic conversions
inside filtergraphs are disabled.
If \fIpix_fmt\fR is a single \f(CW\*(C`+\*(C'\fR, ffmpeg selects the same pixel format
as the input (or graph output) and automatic conversions are disabled.
.IP "\fB\-sws_flags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "-sws_flags flags (input/output)"
Set SwScaler flags.
.IP "\fB\-vdt\fR \fIn\fR" 4
.IX Item "-vdt n"
Discard threshold.
.IP "\fB\-rc_override[:\fR\fIstream_specifier\fR\fB]\fR \fIoverride\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-rc_override[:stream_specifier] override (output,per-stream)"
Rate control override for specific intervals, formatted as \*(L"int,int,int\*(R"
list separated with slashes. Two first values are the beginning and
end frame numbers, last one is quantizer to use if positive, or quality
factor if negative.
.IP "\fB\-deinterlace\fR" 4
.IX Item "-deinterlace"
Deinterlace pictures.
This option is deprecated since the deinterlacing is very low quality.
Use the yadif filter with \f(CW\*(C`\-filter:v yadif\*(C'\fR.
.IP "\fB\-ilme\fR" 4
.IX Item "-ilme"
Force interlacing support in encoder (\s-1MPEG\-2\s0 and \s-1MPEG\-4\s0 only).
Use this option if your input file is interlaced and 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 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\-vstats_file\fR \fIfile\fR" 4
.IX Item "-vstats_file file"
Dump video coding statistics to \fIfile\fR.
.IP "\fB\-top[:\fR\fIstream_specifier\fR\fB]\fR \fIn\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-top[:stream_specifier] n (output,per-stream)"
top=1/bottom=0/auto=\-1 field first
.IP "\fB\-dc\fR \fIprecision\fR" 4
.IX Item "-dc precision"
Intra_dc_precision.
.IP "\fB\-vtag\fR \fIfourcc/tag\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-vtag fourcc/tag (output)"
Force video tag/fourcc. This is an alias for \f(CW\*(C`\-tag:v\*(C'\fR.
.IP "\fB\-qphist (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-qphist (global)"
Show \s-1QP\s0 histogram
.IP "\fB\-vbsf\fR \fIbitstream_filter\fR" 4
.IX Item "-vbsf bitstream_filter"
Deprecated see \-bsf
.IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB]\fR \fItime\fR\fB[,\fR\fItime\fR\fB...] (\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-force_key_frames[:stream_specifier] time[,time...] (output,per-stream)"
.PD 0
.IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB] expr:\fR\fIexpr\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-force_key_frames[:stream_specifier] expr:expr (output,per-stream)"
.PD
Force key frames at the specified timestamps, more precisely at the first
frames after each specified time.
.Sp
If the argument is prefixed with \f(CW\*(C`expr:\*(C'\fR, the string \fIexpr\fR
is interpreted like an expression and is evaluated for each frame. A
key frame is forced in case the evaluation is non-zero.
.Sp
If one of the times is "\f(CW\*(C`chapters\*(C'\fR[\fIdelta\fR]", it is expanded into
the time of the beginning of all chapters in the file, shifted by
\&\fIdelta\fR, expressed as a time in seconds.
This option can be useful to ensure that a seek point is present at a
chapter mark or any other designated place in the output file.
.Sp
For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
before the beginning of every chapter:
.Sp
.Vb 1
\&        \-force_key_frames 0:05:00,chapters\-0.1
.Ve
.Sp
The expression in \fIexpr\fR can contain the following constants:
.RS 4
.IP "\fBn\fR" 4
.IX Item "n"
the number of current processed frame, starting from 0
.IP "\fBn_forced\fR" 4
.IX Item "n_forced"
the number of forced frames
.IP "\fBprev_forced_n\fR" 4
.IX Item "prev_forced_n"
the number of the previous forced frame, it is \f(CW\*(C`NAN\*(C'\fR when no
keyframe was forced yet
.IP "\fBprev_forced_t\fR" 4
.IX Item "prev_forced_t"
the time of the previous forced frame, it is \f(CW\*(C`NAN\*(C'\fR when no
keyframe was forced yet
.IP "\fBt\fR" 4
.IX Item "t"
the time of the current processed frame
.RE
.RS 4
.Sp
For example to force a key frame every 5 seconds, you can specify:
.Sp
.Vb 1
\&        \-force_key_frames expr:gte(t,n_forced*5)
.Ve
.Sp
To force a key frame 5 seconds after the time of the last forced one,
starting from second 13:
.Sp
.Vb 1
\&        \-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
.Ve
.Sp
Note that forcing too many keyframes is very harmful for the lookahead
algorithms of certain encoders: using fixed-GOP options or similar
would be more efficient.
.RE
.IP "\fB\-copyinkf[:\fR\fIstream_specifier\fR\fB] (\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-copyinkf[:stream_specifier] (output,per-stream)"
When doing stream copy, copy also non-key frames found at the
beginning.
.SS "Audio Options"
.IX Subsection "Audio Options"
.IP "\fB\-aframes\fR \fInumber\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-aframes number (output)"
Set the number of audio frames to record. This is an alias for \f(CW\*(C`\-frames:a\*(C'\fR.
.IP "\fB\-ar[:\fR\fIstream_specifier\fR\fB]\fR \fIfreq\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-ar[:stream_specifier] freq (input/output,per-stream)"
Set the audio sampling frequency. For output streams it is set by
default to the frequency of the corresponding input stream. For input
streams this option only makes sense for audio grabbing devices and raw
demuxers and is mapped to the corresponding demuxer options.
.IP "\fB\-aq\fR \fIq\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-aq q (output)"
Set the audio quality (codec-specific, \s-1VBR\s0). This is an alias for \-q:a.
.IP "\fB\-ac[:\fR\fIstream_specifier\fR\fB]\fR \fIchannels\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4
.IX Item "-ac[:stream_specifier] channels (input/output,per-stream)"
Set the number of audio channels. For output streams it is set by
default to the number of input audio channels. For input streams
this option only makes sense for audio grabbing devices and raw demuxers
and is mapped to the corresponding demuxer options.
.IP "\fB\-an (\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-an (output)"
Disable audio recording.
.IP "\fB\-acodec\fR \fIcodec\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "-acodec codec (input/output)"
Set the audio codec. This is an alias for \f(CW\*(C`\-codec:a\*(C'\fR.
.IP "\fB\-sample_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIsample_fmt\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-sample_fmt[:stream_specifier] sample_fmt (output,per-stream)"
Set the audio sample format. Use \f(CW\*(C`\-sample_fmts\*(C'\fR to get a list
of supported sample formats.
.IP "\fB\-af\fR \fIfiltergraph\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-af filtergraph (output)"
Create the filtergraph specified by \fIfiltergraph\fR and use it to
filter the stream.
.Sp
This is an alias for \f(CW\*(C`\-filter:a\*(C'\fR, see the \-filter option.
.SS "Advanced Audio options:"
.IX Subsection "Advanced Audio options:"
.IP "\fB\-atag\fR \fIfourcc/tag\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-atag fourcc/tag (output)"
Force audio tag/fourcc. This is an alias for \f(CW\*(C`\-tag:a\*(C'\fR.
.IP "\fB\-absf\fR \fIbitstream_filter\fR" 4
.IX Item "-absf bitstream_filter"
Deprecated, see \-bsf
.IP "\fB\-guess_layout_max\fR \fIchannels\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4
.IX Item "-guess_layout_max channels (input,per-stream)"
If some input channel layout is not known, try to guess only if it
corresponds to at most the specified number of channels. For example, 2
tells to \fBffmpeg\fR to recognize 1 channel as mono and 2 channels as
stereo but not 6 channels as 5.1. The default is to always try to guess. Use
0 to disable all guessing.
.SS "Subtitle options:"
.IX Subsection "Subtitle options:"
.IP "\fB\-slang\fR \fIcode\fR" 4
.IX Item "-slang code"
Set the \s-1ISO\s0 639 language code (3 letters) of the current subtitle stream.
.IP "\fB\-scodec\fR \fIcodec\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "-scodec codec (input/output)"
Set the subtitle codec. This is an alias for \f(CW\*(C`\-codec:s\*(C'\fR.
.IP "\fB\-sn (\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-sn (output)"
Disable subtitle recording.
.IP "\fB\-sbsf\fR \fIbitstream_filter\fR" 4
.IX Item "-sbsf bitstream_filter"
Deprecated, see \-bsf
.SS "Advanced Subtitle options:"
.IX Subsection "Advanced Subtitle options:"
.IP "\fB\-fix_sub_duration\fR" 4
.IX Item "-fix_sub_duration"
Fix subtitles durations. For each subtitle, wait for the next packet in the
same stream and adjust the duration of the first to avoid overlap. This is
necessary with some subtitles codecs, especially \s-1DVB\s0 subtitles, because the
duration in the original packet is only a rough estimate and the end is
actually marked by an empty subtitle frame. Failing to use this option when
necessary can result in exaggerated durations or muxing failures due to
non-monotonic timestamps.
.Sp
Note that this option will delay the output of all data until the next
subtitle packet is decoded: it may increase memory consumption and latency a
lot.
.IP "\fB\-canvas_size\fR \fIsize\fR" 4
.IX Item "-canvas_size size"
Set the size of the canvas used to render subtitles.
.SS "Advanced options"
.IX Subsection "Advanced options"
.IP "\fB\-map [\-]\fR\fIinput_file_id\fR\fB[:\fR\fIstream_specifier\fR\fB][,\fR\fIsync_file_id\fR\fB[:\fR\fIstream_specifier\fR\fB]] |\fR \fI[linklabel]\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]] | [linklabel] (output)"
Designate one or more input streams as a source for the output file. Each input
stream is identified by the input file index \fIinput_file_id\fR and
the input stream index \fIinput_stream_id\fR within the input
file. Both indices start at 0. If specified,
\&\fIsync_file_id\fR:\fIstream_specifier\fR sets which input stream
is used as a presentation sync reference.
.Sp
The first \f(CW\*(C`\-map\*(C'\fR option on the command line specifies the
source for output stream 0, the second \f(CW\*(C`\-map\*(C'\fR option specifies
the source for output stream 1, etc.
.Sp
A \f(CW\*(C`\-\*(C'\fR character before the stream identifier creates a \*(L"negative\*(R" mapping.
It disables matching streams from already created mappings.
.Sp
An alternative \fI[linklabel]\fR form will map outputs from complex filter
graphs (see the \fB\-filter_complex\fR option) to the output file.
\&\fIlinklabel\fR must correspond to a defined output link label in the graph.
.Sp
For example, to map \s-1ALL\s0 streams from the first input file to output
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map 0 output
.Ve
.Sp
For example, if you have two audio streams in the first input file,
these streams are identified by \*(L"0:0\*(R" and \*(L"0:1\*(R". You can use
\&\f(CW\*(C`\-map\*(C'\fR to select which streams to place in an output file. For
example:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map 0:1 out.wav
.Ve
.Sp
will map the input stream in \fI\s-1INPUT\s0\fR identified by \*(L"0:1\*(R" to
the (single) output stream in \fIout.wav\fR.
.Sp
For example, to select the stream with index 2 from input file
\&\fIa.mov\fR (specified by the identifier \*(L"0:2\*(R"), and stream with
index 6 from input \fIb.mov\fR (specified by the identifier \*(L"1:6\*(R"),
and copy them to the output file \fIout.mov\fR:
.Sp
.Vb 1
\&        ffmpeg \-i a.mov \-i b.mov \-c copy \-map 0:2 \-map 1:6 out.mov
.Ve
.Sp
To select all video and the third audio stream from an input file:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map 0:v \-map 0:a:2 OUTPUT
.Ve
.Sp
To map all the streams except the second audio, use negative mappings
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map 0 \-map \-0:a:1 OUTPUT
.Ve
.Sp
Note that using this option disables the default mappings for this output file.
.IP "\fB\-map_channel [\fR\fIinput_file_id\fR\fB.\fR\fIstream_specifier\fR\fB.\fR\fIchannel_id\fR\fB|\-1][:\fR\fIoutput_file_id\fR\fB.\fR\fIstream_specifier\fR\fB]\fR" 4
.IX Item "-map_channel [input_file_id.stream_specifier.channel_id|-1][:output_file_id.stream_specifier]"
Map an audio channel from a given input to an output. If
\&\fIoutput_file_id\fR.\fIstream_specifier\fR is not set, the audio channel will
be mapped on all the audio streams.
.Sp
Using \*(L"\-1\*(R" instead of
\&\fIinput_file_id\fR.\fIstream_specifier\fR.\fIchannel_id\fR will map a muted
channel.
.Sp
For example, assuming \fI\s-1INPUT\s0\fR is a stereo audio file, you can switch the
two audio channels with the following command:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map_channel 0.0.1 \-map_channel 0.0.0 OUTPUT
.Ve
.Sp
If you want to mute the first channel and keep the second:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map_channel \-1 \-map_channel 0.0.1 OUTPUT
.Ve
.Sp
The order of the \*(L"\-map_channel\*(R" option specifies the order of the channels in
the output stream. The output channel layout is guessed from the number of
channels mapped (mono if one \*(L"\-map_channel\*(R", stereo if two, etc.). Using \*(L"\-ac\*(R"
in combination of \*(L"\-map_channel\*(R" makes the channel gain levels to be updated if
input and output channel layouts don't match (for instance two \*(L"\-map_channel\*(R"
options and \*(L"\-ac 6\*(R").
.Sp
You can also extract each channel of an input to specific outputs; the following
command extracts two channels of the \fI\s-1INPUT\s0\fR audio stream (file 0, stream 0)
to the respective \fI\s-1OUTPUT_CH0\s0\fR and \fI\s-1OUTPUT_CH1\s0\fR outputs:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-map_channel 0.0.0 OUTPUT_CH0 \-map_channel 0.0.1 OUTPUT_CH1
.Ve
.Sp
The following example splits the channels of a stereo input into two separate
streams, which are put into the same output file:
.Sp
.Vb 1
\&        ffmpeg \-i stereo.wav \-map 0:0 \-map 0:0 \-map_channel 0.0.0:0.0 \-map_channel 0.0.1:0.1 \-y out.ogg
.Ve
.Sp
Note that currently each output stream can only contain channels from a single
input stream; you can't for example use \*(L"\-map_channel\*(R" to pick multiple input
audio channels contained in different streams (from the same or different files)
and merge them into a single output stream. It is therefore not currently
possible, for example, to turn two separate mono streams into a single stereo
stream. However splitting a stereo stream into two single channel mono streams
is possible.
.Sp
If you need this feature, a possible workaround is to use the \fIamerge\fR
filter. For example, if you need to merge a media (here \fIinput.mkv\fR) with 2
mono audio streams into one single stereo channel audio stream (and keep the
video stream), you can use the following command:
.Sp
.Vb 1
\&        ffmpeg \-i input.mkv \-filter_complex "[0:1] [0:2] amerge" \-c:a pcm_s16le \-c:v copy output.mkv
.Ve
.IP "\fB\-map_metadata[:\fR\fImetadata_spec_out\fR\fB]\fR \fIinfile\fR\fB[:\fR\fImetadata_spec_in\fR\fB] (\fR\fIoutput,per\-metadata\fR\fB)\fR" 4
.IX Item "-map_metadata[:metadata_spec_out] infile[:metadata_spec_in] (output,per-metadata)"
Set metadata information of the next output file from \fIinfile\fR. Note that
those are file indices (zero-based), not filenames.
Optional \fImetadata_spec_in/out\fR parameters specify, which metadata to copy.
A metadata specifier can have the following forms:
.RS 4
.IP "\fIg\fR" 4
.IX Item "g"
global metadata, i.e. metadata that applies to the whole file
.IP "\fIs\fR\fB[:\fR\fIstream_spec\fR\fB]\fR" 4
.IX Item "s[:stream_spec]"
per-stream metadata. \fIstream_spec\fR is a stream specifier as described
in the Stream specifiers chapter. In an input metadata specifier, the first
matching stream is copied from. In an output metadata specifier, all matching
streams are copied to.
.IP "\fIc\fR\fB:\fR\fIchapter_index\fR" 4
.IX Item "c:chapter_index"
per-chapter metadata. \fIchapter_index\fR is the zero-based chapter index.
.IP "\fIp\fR\fB:\fR\fIprogram_index\fR" 4
.IX Item "p:program_index"
per-program metadata. \fIprogram_index\fR is the zero-based program index.
.RE
.RS 4
.Sp
If metadata specifier is omitted, it defaults to global.
.Sp
By default, global metadata is copied from the first input file,
per-stream and per-chapter metadata is copied along with streams/chapters. These
default mappings are disabled by creating any mapping of the relevant type. A negative
file index can be used to create a dummy mapping that just disables automatic copying.
.Sp
For example to copy metadata from the first stream of the input file to global metadata
of the output file:
.Sp
.Vb 1
\&        ffmpeg \-i in.ogg \-map_metadata 0:s:0 out.mp3
.Ve
.Sp
To do the reverse, i.e. copy global metadata to all audio streams:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-map_metadata:s:a 0:g out.mkv
.Ve
.Sp
Note that simple \f(CW0\fR would work as well in this example, since global
metadata is assumed by default.
.RE
.IP "\fB\-map_chapters\fR \fIinput_file_index\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-map_chapters input_file_index (output)"
Copy chapters from input file with index \fIinput_file_index\fR to the next
output file. If no chapter mapping is specified, then chapters are copied from
the first input file with at least one chapter. Use a negative file index to
disable any chapter copying.
.IP "\fB\-benchmark (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-benchmark (global)"
Show benchmarking information at the end of an encode.
Shows \s-1CPU\s0 time used and maximum memory consumption.
Maximum memory consumption is not supported on all systems,
it will usually display as 0 if not supported.
.IP "\fB\-benchmark_all (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-benchmark_all (global)"
Show benchmarking information during the encode.
Shows \s-1CPU\s0 time used in various steps (audio/video encode/decode).
.IP "\fB\-timelimit\fR \fIduration\fR \fB(\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-timelimit duration (global)"
Exit after ffmpeg has been running for \fIduration\fR seconds.
.IP "\fB\-dump (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-dump (global)"
Dump each input packet to stderr.
.IP "\fB\-hex (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-hex (global)"
When dumping packets, also dump the payload.
.IP "\fB\-re (\fR\fIinput\fR\fB)\fR" 4
.IX Item "-re (input)"
Read input at native frame rate. Mainly used to simulate a grab device.
By default \fBffmpeg\fR attempts to read the input(s) as fast as possible.
This option will slow down the reading of the input(s) to the native frame rate
of the input(s). It is useful for real-time output (e.g. live streaming). If
your input(s) is coming from some other live streaming source (through \s-1HTTP\s0 or
\&\s-1UDP\s0 for example) the server might already be in real-time, thus the option will
likely not be required. On the other hand, this is meaningful if your input(s)
is a file you are trying to push in real-time.
.IP "\fB\-loop_input\fR" 4
.IX Item "-loop_input"
Loop over the input stream. Currently it works only for image
streams. This option is used for automatic FFserver testing.
This option is deprecated, use \-loop 1.
.IP "\fB\-loop_output\fR \fInumber_of_times\fR" 4
.IX Item "-loop_output number_of_times"
Repeatedly loop output for formats that support looping such as animated \s-1GIF\s0
(0 will loop the output infinitely).
This option is deprecated, use \-loop.
.IP "\fB\-vsync\fR \fIparameter\fR" 4
.IX Item "-vsync parameter"
Video sync method.
For compatibility reasons old values can be specified as numbers.
Newly added values will have to be specified as strings always.
.RS 4
.IP "\fB0, passthrough\fR" 4
.IX Item "0, passthrough"
Each frame is passed with its timestamp from the demuxer to the muxer.
.IP "\fB1, cfr\fR" 4
.IX Item "1, cfr"
Frames will be duplicated and dropped to achieve exactly the requested
constant frame rate.
.IP "\fB2, vfr\fR" 4
.IX Item "2, vfr"
Frames are passed through with their timestamp or dropped so as to
prevent 2 frames from having the same timestamp.
.IP "\fBdrop\fR" 4
.IX Item "drop"
As passthrough but destroys all timestamps, making the muxer generate
fresh timestamps based on frame-rate.
.IP "\fB\-1, auto\fR" 4
.IX Item "-1, auto"
Chooses between 1 and 2 depending on muxer capabilities. This is the
default method.
.RE
.RS 4
.Sp
Note that the timestamps may be further modified by the muxer, after this.
For example, in the case that the format option \fBavoid_negative_ts\fR
is enabled.
.Sp
With \-map you can select from which stream the timestamps should be
taken. You can leave either video or audio unchanged and sync the
remaining stream(s) to the unchanged one.
.RE
.IP "\fB\-async\fR \fIsamples_per_second\fR" 4
.IX Item "-async samples_per_second"
Audio sync method. \*(L"Stretches/squeezes\*(R" the audio stream 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.
.Sp
Note that the timestamps may be further modified by the muxer, after this.
For example, in the case that the format option \fBavoid_negative_ts\fR
is enabled.
.Sp
This option has been deprecated. Use the \f(CW\*(C`aresample\*(C'\fR audio filter instead.
.IP "\fB\-copyts\fR" 4
.IX Item "-copyts"
Do not process input timestamps, but keep their values without trying
to sanitize them. In particular, do not remove the initial start time
offset value.
.Sp
Note that, depending on the \fBvsync\fR option or on specific muxer
processing (e.g. in case the format option \fBavoid_negative_ts\fR
is enabled) the output timestamps may mismatch with the input
timestamps even when this option is selected.
.IP "\fB\-copytb\fR \fImode\fR" 4
.IX Item "-copytb mode"
Specify how to set the encoder timebase when stream copying.  \fImode\fR is an
integer numeric value, and can assume one of the following values:
.RS 4
.IP "\fB1\fR" 4
.IX Item "1"
Use the demuxer timebase.
.Sp
The time base is copied to the output encoder from the corresponding input
demuxer. This is sometimes required to avoid non monotonically increasing
timestamps when copying video streams with variable frame rate.
.IP "\fB0\fR" 4
.IX Item "0"
Use the decoder timebase.
.Sp
The time base is copied to the output encoder from the corresponding input
decoder.
.IP "\fB\-1\fR" 4
.IX Item "-1"
Try to make the choice automatically, in order to generate a sane output.
.RE
.RS 4
.Sp
Default value is \-1.
.RE
.IP "\fB\-shortest (\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-shortest (output)"
Finish encoding when the shortest input stream ends.
.IP "\fB\-dts_delta_threshold\fR" 4
.IX Item "-dts_delta_threshold"
Timestamp discontinuity delta threshold.
.IP "\fB\-muxdelay\fR \fIseconds\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "-muxdelay seconds (input)"
Set the maximum demux-decode delay.
.IP "\fB\-muxpreload\fR \fIseconds\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "-muxpreload seconds (input)"
Set the initial demux-decode delay.
.IP "\fB\-streamid\fR \fIoutput-stream-index\fR\fB:\fR\fInew-value\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "-streamid output-stream-index:new-value (output)"
Assign a new stream-id value to an output stream. This option should be
specified prior to the output filename to which it applies.
For the situation where multiple output files exist, a streamid
may be reassigned to a different value.
.Sp
For example, to set the stream 0 \s-1PID\s0 to 33 and the stream 1 \s-1PID\s0 to 36 for
an output mpegts file:
.Sp
.Vb 1
\&        ffmpeg \-i infile \-streamid 0:33 \-streamid 1:36 out.ts
.Ve
.IP "\fB\-bsf[:\fR\fIstream_specifier\fR\fB]\fR \fIbitstream_filters\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4
.IX Item "-bsf[:stream_specifier] bitstream_filters (output,per-stream)"
Set bitstream filters for matching streams. \fIbitstream_filters\fR is
a comma-separated list of bitstream filters. Use the \f(CW\*(C`\-bsfs\*(C'\fR option
to get the list of bitstream filters.
.Sp
.Vb 1
\&        ffmpeg \-i h264.mp4 \-c:v copy \-bsf:v h264_mp4toannexb \-an out.h264
\&
\&        
\&        ffmpeg \-i file.mov \-an \-vn \-bsf:s mov2textsub \-c:s copy \-f rawvideo sub.txt
.Ve
.IP "\fB\-tag[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec_tag\fR \fB(\fR\fIper-stream\fR\fB)\fR" 4
.IX Item "-tag[:stream_specifier] codec_tag (per-stream)"
Force a tag/fourcc for matching streams.
.IP "\fB\-timecode\fR \fIhh\fR\fB:\fR\fImm\fR\fB:\fR\fIss\fR\fB\s-1SEP\s0\fR\fIff\fR" 4
.IX Item "-timecode hh:mm:ssSEPff"
Specify Timecode for writing. \fI\s-1SEP\s0\fR is ':' for non drop timecode and ';'
(or '.') for drop.
.Sp
.Vb 1
\&        ffmpeg \-i input.mpg \-timecode 01:02:03.04 \-r 30000/1001 \-s ntsc output.mpg
.Ve
.IP "\fB\-filter_complex\fR \fIfiltergraph\fR \fB(\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-filter_complex filtergraph (global)"
Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
outputs. For simple graphs \*(-- those with one input and one output of the same
type \*(-- see the \fB\-filter\fR options. \fIfiltergraph\fR is a description of
the filtergraph, as described in the ``Filtergraph syntax'' section of the
ffmpeg-filters manual.
.Sp
Input link labels must refer to input streams using the
\&\f(CW\*(C`[file_index:stream_specifier]\*(C'\fR syntax (i.e. the same as \fB\-map\fR
uses). If \fIstream_specifier\fR matches multiple streams, the first one will be
used. An unlabeled input will be connected to the first unused input stream of
the matching type.
.Sp
Output link labels are referred to with \fB\-map\fR. Unlabeled outputs are
added to the first output file.
.Sp
Note that with this option it is possible to use only lavfi sources without
normal input files.
.Sp
For example, to overlay an image over video
.Sp
.Vb 2
\&        ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aq[0:v][1:v]overlay[out]\*(Aq \-map
\&        \*(Aq[out]\*(Aq out.mkv
.Ve
.Sp
Here \f(CW\*(C`[0:v]\*(C'\fR refers to the first video stream in the first input file,
which is linked to the first (main) input of the overlay filter. Similarly the
first video stream in the second input is linked to the second (overlay) input
of overlay.
.Sp
Assuming there is only one video stream in each input file, we can omit input
labels, so the above is equivalent to
.Sp
.Vb 2
\&        ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aqoverlay[out]\*(Aq \-map
\&        \*(Aq[out]\*(Aq out.mkv
.Ve
.Sp
Furthermore we can omit the output label and the single output from the filter
graph will be added to the output file automatically, so we can simply write
.Sp
.Vb 1
\&        ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aqoverlay\*(Aq out.mkv
.Ve
.Sp
To generate 5 seconds of pure red video using lavfi \f(CW\*(C`color\*(C'\fR source:
.Sp
.Vb 1
\&        ffmpeg \-filter_complex \*(Aqcolor=c=red\*(Aq \-t 5 out.mkv
.Ve
.IP "\fB\-lavfi\fR \fIfiltergraph\fR \fB(\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-lavfi filtergraph (global)"
Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
outputs. Equivalent to \fB\-filter_complex\fR.
.IP "\fB\-filter_complex_script\fR \fIfilename\fR \fB(\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-filter_complex_script filename (global)"
This option is similar to \fB\-filter_complex\fR, the only difference is that
its argument is the name of the file from which a complex filtergraph
description is to be read.
.PP
As a special exception, you can use a bitmap subtitle stream as input: it
will be converted into a video with the same size as the largest video in
the file, or 720x576 if no video is present. Note that this is an
experimental and temporary solution. It will be removed once libavfilter has
proper support for subtitles.
.PP
For example, to hardcode subtitles on top of a DVB-T recording stored in
MPEG-TS format, delaying the subtitles by 1 second:
.PP
.Vb 3
\&        ffmpeg \-i input.ts \-filter_complex \e
\&          \*(Aq[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay\*(Aq \e
\&          \-sn \-map \*(Aq#0x2dc\*(Aq output.mkv
.Ve
.PP
(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
.SS "Preset files"
.IX Subsection "Preset files"
A preset file contains a sequence of \fIoption\fR=\fIvalue\fR pairs,
one for each line, specifying a sequence of options which would be
awkward to specify on the command line. Lines starting with the hash
('#') character are ignored and are used to provide comments. Check
the \fIpresets\fR directory in the FFmpeg source tree for examples.
.PP
Preset files are specified with the \f(CW\*(C`vpre\*(C'\fR, \f(CW\*(C`apre\*(C'\fR,
\&\f(CW\*(C`spre\*(C'\fR, and \f(CW\*(C`fpre\*(C'\fR options. The \f(CW\*(C`fpre\*(C'\fR option takes the
filename of the preset instead of a preset name as input and can be
used for any kind of codec. For the \f(CW\*(C`vpre\*(C'\fR, \f(CW\*(C`apre\*(C'\fR, and
\&\f(CW\*(C`spre\*(C'\fR options, the options specified in a preset file are
applied to the currently selected codec of the same type as the preset
option.
.PP
The argument passed to the \f(CW\*(C`vpre\*(C'\fR, \f(CW\*(C`apre\*(C'\fR, and \f(CW\*(C`spre\*(C'\fR
preset options identifies the preset file to use according to the
following rules:
.PP
First ffmpeg searches for a file named \fIarg\fR.ffpreset in the
directories \fI\f(CI$FFMPEG_DATADIR\fI\fR (if set), and \fI\f(CI$HOME\fI/.ffmpeg\fR, and in
the datadir defined at configuration time (usually \fIPREFIX/share/ffmpeg\fR)
or in a \fIffpresets\fR folder along the executable on win32,
in that order. For example, if the argument is \f(CW\*(C`libvpx\-1080p\*(C'\fR, it will
search for the file \fIlibvpx\-1080p.ffpreset\fR.
.PP
If no such file is found, then ffmpeg will search for a file named
\&\fIcodec_name\fR\-\fIarg\fR.ffpreset in the above-mentioned
directories, where \fIcodec_name\fR is the name of the codec to which
the preset file options will be applied. For example, if you select
the video codec with \f(CW\*(C`\-vcodec libvpx\*(C'\fR and use \f(CW\*(C`\-vpre 1080p\*(C'\fR,
then it will search for the file \fIlibvpx\-1080p.ffpreset\fR.
.SH "TIPS"
.IX Header "TIPS"
.IP "\(bu" 4
For streaming at very low bitrate application, use a low frame rate
and a small \s-1GOP\s0 size. This is especially true for RealVideo where
the Linux player does not seem to be very fast, so it can miss
frames. An example is:
.Sp
.Vb 1
\&        ffmpeg \-g 3 \-r 3 \-t 10 \-b:v 50k \-s qcif \-f rv10 /tmp/b.rm
.Ve
.IP "\(bu" 4
The parameter 'q' which is displayed while encoding is the current
quantizer. The value 1 indicates that a very good quality could
be achieved. The value 31 indicates the worst quality. If q=31 appears
too often, it means that the encoder cannot compress enough to meet
your bitrate. You must either increase the bitrate, decrease the
frame rate or decrease the frame size.
.IP "\(bu" 4
If your computer is not fast enough, you can speed up the
compression at the expense of the compression ratio. You can use
\&'\-me zero' to speed up motion estimation, and '\-g 0' to disable
motion estimation completely (you have only I\-frames, which means it
is about as good as \s-1JPEG\s0 compression).
.IP "\(bu" 4
To have very low audio bitrates, reduce the sampling frequency
(down to 22050 Hz for \s-1MPEG\s0 audio, 22050 or 11025 for \s-1AC\-3\s0).
.IP "\(bu" 4
To have a constant quality (but a variable bitrate), use the option
\&'\-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
quality).
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.SS "Preset files"
.IX Subsection "Preset files"
A preset file contains a sequence of \fIoption=value\fR pairs, one for
each line, specifying a sequence of options which can be specified also on
the command line. Lines starting with the hash ('#') character are ignored and
are used to provide comments. Empty lines are also ignored. Check the
\&\fIpresets\fR directory in the FFmpeg source tree for examples.
.PP
Preset files are specified with the \f(CW\*(C`pre\*(C'\fR option, this option takes a
preset name as input.  FFmpeg searches for a file named \fIpreset_name\fR.avpreset in
the directories \fI\f(CI$AVCONV_DATADIR\fI\fR (if set), and \fI\f(CI$HOME\fI/.ffmpeg\fR, and in
the data directory defined at configuration time (usually \fI\f(CI$PREFIX\fI/share/ffmpeg\fR)
in that order.  For example, if the argument is \f(CW\*(C`libx264\-max\*(C'\fR, it will
search for the file \fIlibx264\-max.avpreset\fR.
.SS "Video and Audio grabbing"
.IX Subsection "Video and Audio grabbing"
If you specify the input format and device then ffmpeg can grab video
and audio directly.
.PP
.Vb 1
\&        ffmpeg \-f oss \-i /dev/dsp \-f video4linux2 \-i /dev/video0 /tmp/out.mpg
.Ve
.PP
Or with an \s-1ALSA\s0 audio source (mono input, card id 1) instead of \s-1OSS:\s0
.PP
.Vb 1
\&        ffmpeg \-f alsa \-ac 1 \-i hw:1 \-f video4linux2 \-i /dev/video0 /tmp/out.mpg
.Ve
.PP
Note that you must activate the right video source and channel before
launching ffmpeg with any \s-1TV\s0 viewer such as
<\fBhttp://linux.bytesex.org/xawtv/\fR> by Gerd Knorr. You also
have to set the audio recording levels correctly with a
standard mixer.
.SS "X11 grabbing"
.IX Subsection "X11 grabbing"
Grab the X11 display with ffmpeg via
.PP
.Vb 1
\&        ffmpeg \-f x11grab \-s cif \-r 25 \-i :0.0 /tmp/out.mpg
.Ve
.PP
0.0 is display.screen number of your X11 server, same as
the \s-1DISPLAY\s0 environment variable.
.PP
.Vb 1
\&        ffmpeg \-f x11grab \-s cif \-r 25 \-i :0.0+10,20 /tmp/out.mpg
.Ve
.PP
0.0 is display.screen number of your X11 server, same as the \s-1DISPLAY\s0 environment
variable. 10 is the x\-offset and 20 the y\-offset for the grabbing.
.SS "Video and Audio file format conversion"
.IX Subsection "Video and Audio file format conversion"
Any supported file format and protocol can serve as input to ffmpeg:
.PP
Examples:
.IP "\(bu" 4
You can use \s-1YUV\s0 files as input:
.Sp
.Vb 1
\&        ffmpeg \-i /tmp/test%d.Y /tmp/out.mpg
.Ve
.Sp
It will use the files:
.Sp
.Vb 2
\&        /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
\&        /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
.Ve
.Sp
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.
.IP "\(bu" 4
You can input from a raw \s-1YUV420P\s0 file:
.Sp
.Vb 1
\&        ffmpeg \-i /tmp/test.yuv /tmp/out.avi
.Ve
.Sp
test.yuv is a file containing raw \s-1YUV\s0 planar data. Each frame is composed
of the Y plane followed by the U and V planes at half vertical and
horizontal resolution.
.IP "\(bu" 4
You can output to a raw \s-1YUV420P\s0 file:
.Sp
.Vb 1
\&        ffmpeg \-i mydivx.avi hugefile.yuv
.Ve
.IP "\(bu" 4
You can set several input files and output files:
.Sp
.Vb 1
\&        ffmpeg \-i /tmp/a.wav \-s 640x480 \-i /tmp/a.yuv /tmp/a.mpg
.Ve
.Sp
Converts the audio file a.wav and the raw \s-1YUV\s0 video file a.yuv
to \s-1MPEG\s0 file a.mpg.
.IP "\(bu" 4
You can also do audio and video conversions at the same time:
.Sp
.Vb 1
\&        ffmpeg \-i /tmp/a.wav \-ar 22050 /tmp/a.mp2
.Ve
.Sp
Converts a.wav to \s-1MPEG\s0 audio at 22050 Hz sample rate.
.IP "\(bu" 4
You can encode to several formats at the same time and define a
mapping from input stream to output streams:
.Sp
.Vb 1
\&        ffmpeg \-i /tmp/a.wav \-map 0:a \-b:a 64k /tmp/a.mp2 \-map 0:a \-b:a 128k /tmp/b.mp2
.Ve
.Sp
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '\-map
file:index' specifies which input stream is used for each output
stream, in the order of the definition of output streams.
.IP "\(bu" 4
You can transcode decrypted VOBs:
.Sp
.Vb 1
\&        ffmpeg \-i snatch_1.vob \-f avi \-c:v mpeg4 \-b:v 800k \-g 300 \-bf 2 \-c:a libmp3lame \-b:a 128k snatch.avi
.Ve
.Sp
This is a typical \s-1DVD\s0 ripping example; the input is a \s-1VOB\s0 file, the
output 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, and
\&\s-1GOP\s0 size is 300 which means one intra frame every 10 seconds for 29.97fps
input video. Furthermore, the audio stream is MP3\-encoded so you need
to enable \s-1LAME\s0 support by passing \f(CW\*(C`\-\-enable\-libmp3lame\*(C'\fR to configure.
The mapping is particularly useful for \s-1DVD\s0 transcoding
to get the desired audio language.
.Sp
\&\s-1NOTE:\s0 To see the supported input formats, use \f(CW\*(C`ffmpeg \-formats\*(C'\fR.
.IP "\(bu" 4
You can extract images from a video, or create a video from many images:
.Sp
For extracting images from a video:
.Sp
.Vb 1
\&        ffmpeg \-i foo.avi \-r 1 \-s WxH \-f image2 foo\-%03d.jpeg
.Ve
.Sp
This will extract one video frame per second from the video and will
output them in files named \fIfoo\-001.jpeg\fR, \fIfoo\-002.jpeg\fR,
etc. Images will be rescaled to fit the new WxH values.
.Sp
If you want to extract just a limited number of frames, you can use the
above command in combination with the \-vframes or \-t option, or in
combination with \-ss to start extracting from a certain point in time.
.Sp
For creating a video from many images:
.Sp
.Vb 1
\&        ffmpeg \-f image2 \-i foo\-%03d.jpeg \-r 12 \-s WxH foo.avi
.Ve
.Sp
The syntax \f(CW\*(C`foo\-%03d.jpeg\*(C'\fR specifies to use a decimal number
composed of three digits padded with zeroes to express the sequence
number. It is the same syntax supported by the C printf function, but
only formats accepting a normal integer are suitable.
.Sp
When importing an image sequence, \-i also supports expanding
shell-like wildcard patterns (globbing) internally, by selecting the
image2\-specific \f(CW\*(C`\-pattern_type glob\*(C'\fR option.
.Sp
For example, for creating a video from filenames matching the glob pattern
\&\f(CW\*(C`foo\-*.jpeg\*(C'\fR:
.Sp
.Vb 1
\&        ffmpeg \-f image2 \-pattern_type glob \-i \*(Aqfoo\-*.jpeg\*(Aq \-r 12 \-s WxH foo.avi
.Ve
.IP "\(bu" 4
You can put many streams of the same type in the output:
.Sp
.Vb 1
\&        ffmpeg \-i test1.avi \-i test2.avi \-map 0:3 \-map 0:2 \-map 0:1 \-map 0:0 \-c copy test12.nut
.Ve
.Sp
The resulting output file \fItest12.avi\fR will contain first four streams from
the input file in reverse order.
.IP "\(bu" 4
To force \s-1CBR\s0 video output:
.Sp
.Vb 1
\&        ffmpeg \-i myfile.avi \-b 4000k \-minrate 4000k \-maxrate 4000k \-bufsize 1835k out.m2v
.Ve
.IP "\(bu" 4
The four options lmin, lmax, mblmin and mblmax use 'lambda' units,
but you may use the \s-1QP2LAMBDA\s0 constant to easily convert from 'q' units:
.Sp
.Vb 1
\&        ffmpeg \-i src.ext \-lmax 21*QP2LAMBDA dst.ext
.Ve
.SH "SYNTAX"
.IX Header "SYNTAX"
This section documents the syntax and formats employed by the FFmpeg
libraries and tools.
.SS "Quoting and escaping"
.IX Subsection "Quoting and escaping"
FFmpeg adopts the following quoting and escaping mechanism, unless
explicitly specified. The following rules are applied:
.IP "\(bu" 4
\&\f(CW\*(C`\*(Aq\*(C'\fR and \f(CW\*(C`\e\*(C'\fR are special characters (respectively used for
quoting and escaping). In addition to them, there might be other
special characters depending on the specific syntax where the escaping
and quoting are employed.
.IP "\(bu" 4
A special character is escaped by prefixing it with a '\e'.
.IP "\(bu" 4
All characters enclosed between '' are included literally in the
parsed string. The quote character \f(CW\*(C`\*(Aq\*(C'\fR itself cannot be quoted,
so you may need to close the quote and escape it.
.IP "\(bu" 4
Leading and trailing whitespaces, unless escaped or quoted, are
removed from the parsed string.
.PP
Note that you may need to add a second level of escaping when using
the command line or a script, which depends on the syntax of the
adopted shell language.
.PP
The function \f(CW\*(C`av_get_token\*(C'\fR defined in
\&\fIlibavutil/avstring.h\fR can be used to parse a token quoted or
escaped according to the rules defined above.
.PP
The tool \fItools/ffescape\fR in the FFmpeg source tree can be used
to automatically quote or escape a string in a script.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Escape the string \f(CW\*(C`Crime d\*(AqAmour\*(C'\fR containing the \f(CW\*(C`\*(Aq\*(C'\fR special
character:
.Sp
.Vb 1
\&        Crime d\e\*(AqAmour
.Ve
.IP "\(bu" 4
The string above contains a quote, so the \f(CW\*(C`\*(Aq\*(C'\fR needs to be escaped
when quoting it:
.Sp
.Vb 1
\&        \*(AqCrime d\*(Aq\e\*(Aq\*(AqAmour\*(Aq
.Ve
.IP "\(bu" 4
Include leading or trailing whitespaces using quoting:
.Sp
.Vb 1
\&        \*(Aq  this string starts and ends with whitespaces  \*(Aq
.Ve
.IP "\(bu" 4
Escaping and quoting can be mixed together:
.Sp
.Vb 1
\&        \*(Aq The string \*(Aq\e\*(Aqstring\e\*(Aq\*(Aq is a string \*(Aq
.Ve
.IP "\(bu" 4
To include a literal \f(CW\*(C`\e\*(C'\fR you can use either escaping or quoting:
.Sp
.Vb 1
\&        \*(Aqc:\efoo\*(Aq can be written as c:\e\efoo
.Ve
.SS "Date"
.IX Subsection "Date"
The accepted syntax is:
.PP
.Vb 2
\&        [(YYYY\-MM\-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
\&        now
.Ve
.PP
If the value is \*(L"now\*(R" it takes the current time.
.PP
Time is local time unless Z is appended, in which case it is
interpreted as \s-1UTC\s0.
If the year-month-day part is not specified it takes the current
year-month-day.
.SS "Time duration"
.IX Subsection "Time duration"
The accepted syntax is:
.PP
.Vb 2
\&        [\-][HH:]MM:SS[.m...]
\&        [\-]S+[.m...]
.Ve
.PP
\&\fI\s-1HH\s0\fR expresses the number of hours, \fI\s-1MM\s0\fR the number a of minutes
and \fI\s-1SS\s0\fR the number of seconds.
.SS "Video size"
.IX Subsection "Video size"
Specify the size of the sourced video, it may be a string of the form
\&\fIwidth\fRx\fIheight\fR, or the name of a size abbreviation.
.PP
The following abbreviations are recognized:
.IP "\fBntsc\fR" 4
.IX Item "ntsc"
720x480
.IP "\fBpal\fR" 4
.IX Item "pal"
720x576
.IP "\fBqntsc\fR" 4
.IX Item "qntsc"
352x240
.IP "\fBqpal\fR" 4
.IX Item "qpal"
352x288
.IP "\fBsntsc\fR" 4
.IX Item "sntsc"
640x480
.IP "\fBspal\fR" 4
.IX Item "spal"
768x576
.IP "\fBfilm\fR" 4
.IX Item "film"
352x240
.IP "\fBntsc-film\fR" 4
.IX Item "ntsc-film"
352x240
.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
.IP "\fB16cif\fR" 4
.IX Item "16cif"
1408x1152
.IP "\fBqqvga\fR" 4
.IX Item "qqvga"
160x120
.IP "\fBqvga\fR" 4
.IX Item "qvga"
320x240
.IP "\fBvga\fR" 4
.IX Item "vga"
640x480
.IP "\fBsvga\fR" 4
.IX Item "svga"
800x600
.IP "\fBxga\fR" 4
.IX Item "xga"
1024x768
.IP "\fBuxga\fR" 4
.IX Item "uxga"
1600x1200
.IP "\fBqxga\fR" 4
.IX Item "qxga"
2048x1536
.IP "\fBsxga\fR" 4
.IX Item "sxga"
1280x1024
.IP "\fBqsxga\fR" 4
.IX Item "qsxga"
2560x2048
.IP "\fBhsxga\fR" 4
.IX Item "hsxga"
5120x4096
.IP "\fBwvga\fR" 4
.IX Item "wvga"
852x480
.IP "\fBwxga\fR" 4
.IX Item "wxga"
1366x768
.IP "\fBwsxga\fR" 4
.IX Item "wsxga"
1600x1024
.IP "\fBwuxga\fR" 4
.IX Item "wuxga"
1920x1200
.IP "\fBwoxga\fR" 4
.IX Item "woxga"
2560x1600
.IP "\fBwqsxga\fR" 4
.IX Item "wqsxga"
3200x2048
.IP "\fBwquxga\fR" 4
.IX Item "wquxga"
3840x2400
.IP "\fBwhsxga\fR" 4
.IX Item "whsxga"
6400x4096
.IP "\fBwhuxga\fR" 4
.IX Item "whuxga"
7680x4800
.IP "\fBcga\fR" 4
.IX Item "cga"
320x200
.IP "\fBega\fR" 4
.IX Item "ega"
640x350
.IP "\fBhd480\fR" 4
.IX Item "hd480"
852x480
.IP "\fBhd720\fR" 4
.IX Item "hd720"
1280x720
.IP "\fBhd1080\fR" 4
.IX Item "hd1080"
1920x1080
.IP "\fB2k\fR" 4
.IX Item "2k"
2048x1080
.IP "\fB2kflat\fR" 4
.IX Item "2kflat"
1998x1080
.IP "\fB2kscope\fR" 4
.IX Item "2kscope"
2048x858
.IP "\fB4k\fR" 4
.IX Item "4k"
4096x2160
.IP "\fB4kflat\fR" 4
.IX Item "4kflat"
3996x2160
.IP "\fB4kscope\fR" 4
.IX Item "4kscope"
4096x1716
.SS "Video rate"
.IX Subsection "Video rate"
Specify the frame rate of a video, expressed as the number of frames
generated per second. It has to be a string in the format
\&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float
number or a valid video frame rate abbreviation.
.PP
The following abbreviations are recognized:
.IP "\fBntsc\fR" 4
.IX Item "ntsc"
30000/1001
.IP "\fBpal\fR" 4
.IX Item "pal"
25/1
.IP "\fBqntsc\fR" 4
.IX Item "qntsc"
30000/1001
.IP "\fBqpal\fR" 4
.IX Item "qpal"
25/1
.IP "\fBsntsc\fR" 4
.IX Item "sntsc"
30000/1001
.IP "\fBspal\fR" 4
.IX Item "spal"
25/1
.IP "\fBfilm\fR" 4
.IX Item "film"
24/1
.IP "\fBntsc-film\fR" 4
.IX Item "ntsc-film"
24000/1001
.SS "Ratio"
.IX Subsection "Ratio"
A ratio can be expressed as an expression, or in the form
\&\fInumerator\fR:\fIdenominator\fR.
.PP
Note that a ratio with infinite (1/0) or negative value is
considered valid, so you should check on the returned value if you
want to exclude those values.
.PP
The undefined value can be expressed using the \*(L"0:0\*(R" string.
.SS "Color"
.IX Subsection "Color"
It can be the name of a color (case insensitive match) or a
[0x|#]RRGGBB[\s-1AA\s0] sequence, possibly followed by \*(L"@\*(R" and a string
representing the alpha component.
.PP
The alpha component may be a string composed by \*(L"0x\*(R" followed by an
hexadecimal number or a decimal number between 0.0 and 1.0, which
represents the opacity value (0x00/0.0 means completely transparent,
0xff/1.0 completely opaque).
If the alpha component is not specified then 0xff is assumed.
.PP
The string \*(L"random\*(R" will result in a random color.
.SH "EXPRESSION EVALUATION"
.IX Header "EXPRESSION EVALUATION"
When evaluating an arithmetic expression, FFmpeg uses an internal
formula evaluator, implemented through the \fIlibavutil/eval.h\fR
interface.
.PP
An expression may contain unary, binary operators, constants, and
functions.
.PP
Two expressions \fIexpr1\fR and \fIexpr2\fR can be combined to form
another expression "\fIexpr1\fR;\fIexpr2\fR".
\&\fIexpr1\fR and \fIexpr2\fR are evaluated in turn, and the new
expression evaluates to the value of \fIexpr2\fR.
.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.
.PP
The following functions are available:
.IP "\fBabs(x)\fR" 4
.IX Item "abs(x)"
Compute absolute value of \fIx\fR.
.IP "\fBacos(x)\fR" 4
.IX Item "acos(x)"
Compute arccosine of \fIx\fR.
.IP "\fBasin(x)\fR" 4
.IX Item "asin(x)"
Compute arcsine of \fIx\fR.
.IP "\fBatan(x)\fR" 4
.IX Item "atan(x)"
Compute arctangent of \fIx\fR.
.IP "\fBbetween(x, min, max)\fR" 4
.IX Item "between(x, min, max)"
Return 1 if \fIx\fR is greater than or equal to \fImin\fR and lesser than or
equal to \fImax\fR, 0 otherwise.
.IP "\fBbitand(x, y)\fR" 4
.IX Item "bitand(x, y)"
.PD 0
.IP "\fBbitor(x, y)\fR" 4
.IX Item "bitor(x, y)"
.PD
Compute bitwise and/or operation on \fIx\fR and \fIy\fR.
.Sp
The results of the evaluation of \fIx\fR and \fIy\fR are converted to
integers before executing the bitwise operation.
.Sp
Note that both the conversion to integer and the conversion back to
floating point can lose precision. Beware of unexpected results for
large numbers (usually 2^53 and larger).
.IP "\fBceil(expr)\fR" 4
.IX Item "ceil(expr)"
Round the value of expression \fIexpr\fR upwards to the nearest
integer. For example, \*(L"ceil(1.5)\*(R" is \*(L"2.0\*(R".
.IP "\fBcos(x)\fR" 4
.IX Item "cos(x)"
Compute cosine of \fIx\fR.
.IP "\fBcosh(x)\fR" 4
.IX Item "cosh(x)"
Compute hyperbolic cosine of \fIx\fR.
.IP "\fBeq(x, y)\fR" 4
.IX Item "eq(x, y)"
Return 1 if \fIx\fR and \fIy\fR are equivalent, 0 otherwise.
.IP "\fBexp(x)\fR" 4
.IX Item "exp(x)"
Compute exponential of \fIx\fR (with base \f(CW\*(C`e\*(C'\fR, the Euler's number).
.IP "\fBfloor(expr)\fR" 4
.IX Item "floor(expr)"
Round the value of expression \fIexpr\fR downwards to the nearest
integer. For example, \*(L"floor(\-1.5)\*(R" is \*(L"\-2.0\*(R".
.IP "\fBgauss(x)\fR" 4
.IX Item "gauss(x)"
Compute Gauss function of \fIx\fR, corresponding to
\&\f(CW\*(C`exp(\-x*x/2) / sqrt(2*PI)\*(C'\fR.
.IP "\fBgcd(x, y)\fR" 4
.IX Item "gcd(x, y)"
Return the greatest common divisor of \fIx\fR and \fIy\fR. If both \fIx\fR and
\&\fIy\fR are 0 or either or both are less than zero then behavior is undefined.
.IP "\fBgt(x, y)\fR" 4
.IX Item "gt(x, y)"
Return 1 if \fIx\fR is greater than \fIy\fR, 0 otherwise.
.IP "\fBgte(x, y)\fR" 4
.IX Item "gte(x, y)"
Return 1 if \fIx\fR is greater than or equal to \fIy\fR, 0 otherwise.
.IP "\fBhypot(x, y)\fR" 4
.IX Item "hypot(x, y)"
This function is similar to the C function with the same name; it returns
"sqrt(\fIx\fR*\fIx\fR + \fIy\fR*\fIy\fR)", the length of the hypotenuse of a
right triangle with sides of length \fIx\fR and \fIy\fR, or the distance of the
point (\fIx\fR, \fIy\fR) from the origin.
.IP "\fBif(x, y)\fR" 4
.IX Item "if(x, y)"
Evaluate \fIx\fR, and if the result is non-zero return the result of
the evaluation of \fIy\fR, return 0 otherwise.
.IP "\fBif(x, y, z)\fR" 4
.IX Item "if(x, y, z)"
Evaluate \fIx\fR, and if the result is non-zero return the evaluation
result of \fIy\fR, otherwise the evaluation result of \fIz\fR.
.IP "\fBifnot(x, y)\fR" 4
.IX Item "ifnot(x, y)"
Evaluate \fIx\fR, and if the result is zero return the result of the
evaluation of \fIy\fR, return 0 otherwise.
.IP "\fBifnot(x, y, z)\fR" 4
.IX Item "ifnot(x, y, z)"
Evaluate \fIx\fR, and if the result is zero return the evaluation
result of \fIy\fR, otherwise the evaluation result of \fIz\fR.
.IP "\fBisinf(x)\fR" 4
.IX Item "isinf(x)"
Return 1.0 if \fIx\fR is +/\-INFINITY, 0.0 otherwise.
.IP "\fBisnan(x)\fR" 4
.IX Item "isnan(x)"
Return 1.0 if \fIx\fR is \s-1NAN\s0, 0.0 otherwise.
.IP "\fBld(var)\fR" 4
.IX Item "ld(var)"
Allow to load the value of the internal variable with number
\&\fIvar\fR, which was previously stored with st(\fIvar\fR, \fIexpr\fR).
The function returns the loaded value.
.IP "\fBlog(x)\fR" 4
.IX Item "log(x)"
Compute natural logarithm of \fIx\fR.
.IP "\fBlt(x, y)\fR" 4
.IX Item "lt(x, y)"
Return 1 if \fIx\fR is lesser than \fIy\fR, 0 otherwise.
.IP "\fBlte(x, y)\fR" 4
.IX Item "lte(x, y)"
Return 1 if \fIx\fR is lesser than or equal to \fIy\fR, 0 otherwise.
.IP "\fBmax(x, y)\fR" 4
.IX Item "max(x, y)"
Return the maximum between \fIx\fR and \fIy\fR.
.IP "\fBmin(x, y)\fR" 4
.IX Item "min(x, y)"
Return the maximum between \fIx\fR and \fIy\fR.
.IP "\fBmod(x, y)\fR" 4
.IX Item "mod(x, y)"
Compute the remainder of division of \fIx\fR by \fIy\fR.
.IP "\fBnot(expr)\fR" 4
.IX Item "not(expr)"
Return 1.0 if \fIexpr\fR is zero, 0.0 otherwise.
.IP "\fBpow(x, y)\fR" 4
.IX Item "pow(x, y)"
Compute the power of \fIx\fR elevated \fIy\fR, it is equivalent to
"(\fIx\fR)^(\fIy\fR)".
.IP "\fBprint(t)\fR" 4
.IX Item "print(t)"
.PD 0
.IP "\fBprint(t, l)\fR" 4
.IX Item "print(t, l)"
.PD
Print the value of expression \fIt\fR with loglevel \fIl\fR. If
\&\fIl\fR is not specified then a default log level is used.
Returns the value of the expression printed.
.Sp
Prints t with loglevel l
.IP "\fBrandom(x)\fR" 4
.IX Item "random(x)"
Return a pseudo random value between 0.0 and 1.0. \fIx\fR is the index of the
internal variable which will be used to save the seed/state.
.IP "\fBroot(expr, max)\fR" 4
.IX Item "root(expr, max)"
Find an input value for which the function represented by \fIexpr\fR
with argument \fI\fIld\fI\|(0)\fR is 0 in the interval 0..\fImax\fR.
.Sp
The expression in \fIexpr\fR must denote a continuous function or the
result is undefined.
.Sp
\&\fI\fIld\fI\|(0)\fR is used to represent the function input value, which means
that the given expression will be evaluated multiple times with
various input values that the expression can access through
\&\f(CWld(0)\fR. When the expression evaluates to 0 then the
corresponding input value will be returned.
.IP "\fBsin(x)\fR" 4
.IX Item "sin(x)"
Compute sine of \fIx\fR.
.IP "\fBsinh(x)\fR" 4
.IX Item "sinh(x)"
Compute hyperbolic sine of \fIx\fR.
.IP "\fBsqrt(expr)\fR" 4
.IX Item "sqrt(expr)"
Compute the square root of \fIexpr\fR. This is equivalent to
"(\fIexpr\fR)^.5".
.IP "\fBsquish(x)\fR" 4
.IX Item "squish(x)"
Compute expression \f(CW\*(C`1/(1 + exp(4*x))\*(C'\fR.
.IP "\fBst(var, expr)\fR" 4
.IX Item "st(var, expr)"
Allow to store the value of the expression \fIexpr\fR in an internal
variable. \fIvar\fR specifies the number of the variable where to
store the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
Note, Variables are currently not shared between expressions.
.IP "\fBtan(x)\fR" 4
.IX Item "tan(x)"
Compute tangent of \fIx\fR.
.IP "\fBtanh(x)\fR" 4
.IX Item "tanh(x)"
Compute hyperbolic tangent of \fIx\fR.
.IP "\fBtaylor(expr, x)\fR" 4
.IX Item "taylor(expr, x)"
.PD 0
.IP "\fBtaylor(expr, x, id)\fR" 4
.IX Item "taylor(expr, x, id)"
.PD
Evaluate a Taylor series at \fIx\fR, given an expression representing
the \f(CW\*(C`ld(id)\*(C'\fR\-th derivative of a function at 0.
.Sp
When the series does not converge the result is undefined.
.Sp
\&\fIld(id)\fR is used to represent the derivative order in \fIexpr\fR,
which means that the given expression will be evaluated multiple times
with various input values that the expression can access through
\&\f(CW\*(C`ld(id)\*(C'\fR. If \fIid\fR is not specified then 0 is assumed.
.Sp
Note, when you have the derivatives at y instead of 0,
\&\f(CW\*(C`taylor(expr, x\-y)\*(C'\fR can be used.
.IP "\fB\f(BItime\fB\|(0)\fR" 4
.IX Item "time"
Return the current (wallclock) time in seconds.
.IP "\fBtrunc(expr)\fR" 4
.IX Item "trunc(expr)"
Round the value of expression \fIexpr\fR towards zero to the nearest
integer. For example, \*(L"trunc(\-1.5)\*(R" is \*(L"\-1.0\*(R".
.IP "\fBwhile(cond, expr)\fR" 4
.IX Item "while(cond, expr)"
Evaluate expression \fIexpr\fR while the expression \fIcond\fR is
non-zero, and returns the value of the last \fIexpr\fR evaluation, or
\&\s-1NAN\s0 if \fIcond\fR was always false.
.PP
The following constants are available:
.IP "\fB\s-1PI\s0\fR" 4
.IX Item "PI"
area of the unit disc, approximately 3.14
.IP "\fBE\fR" 4
.IX Item "E"
\&\fIexp\fR\|(1) (Euler's number), approximately 2.718
.IP "\fB\s-1PHI\s0\fR" 4
.IX Item "PHI"
golden ratio (1+\fIsqrt\fR\|(5))/2, approximately 1.618
.PP
Assuming that an expression is considered \*(L"true\*(R" if it has a non-zero
value, note that:
.PP
\&\f(CW\*(C`*\*(C'\fR works like \s-1AND\s0
.PP
\&\f(CW\*(C`+\*(C'\fR works like \s-1OR\s0
.PP
For example the construct:
.PP
.Vb 1
\&        if (A AND B) then C
.Ve
.PP
is equivalent to:
.PP
.Vb 1
\&        if(A*B, C)
.Ve
.PP
In your C code, you can extend the list of unary and binary functions,
and define recognized constants, so that they are available for your
expressions.
.PP
The evaluator also recognizes the International System unit prefixes.
If 'i' is appended after the prefix, binary prefixes are used, which
are based on powers of 1024 instead of powers of 1000.
The 'B' postfix multiplies the value by 8, and can be appended after a
unit prefix or used alone. This allows using for example '\s-1KB\s0', 'MiB',
\&'G' and 'B' as number postfix.
.PP
The list of available International System prefixes follows, with
indication of the corresponding powers of 10 and of 2.
.IP "\fBy\fR" 4
.IX Item "y"
10^\-24 / 2^\-80
.IP "\fBz\fR" 4
.IX Item "z"
10^\-21 / 2^\-70
.IP "\fBa\fR" 4
.IX Item "a"
10^\-18 / 2^\-60
.IP "\fBf\fR" 4
.IX Item "f"
10^\-15 / 2^\-50
.IP "\fBp\fR" 4
.IX Item "p"
10^\-12 / 2^\-40
.IP "\fBn\fR" 4
.IX Item "n"
10^\-9 / 2^\-30
.IP "\fBu\fR" 4
.IX Item "u"
10^\-6 / 2^\-20
.IP "\fBm\fR" 4
.IX Item "m"
10^\-3 / 2^\-10
.IP "\fBc\fR" 4
.IX Item "c"
10^\-2
.IP "\fBd\fR" 4
.IX Item "d"
10^\-1
.IP "\fBh\fR" 4
.IX Item "h"
10^2
.IP "\fBk\fR" 4
.IX Item "k"
10^3 / 2^10
.IP "\fBK\fR" 4
.IX Item "K"
10^3 / 2^10
.IP "\fBM\fR" 4
.IX Item "M"
10^6 / 2^20
.IP "\fBG\fR" 4
.IX Item "G"
10^9 / 2^30
.IP "\fBT\fR" 4
.IX Item "T"
10^12 / 2^40
.IP "\fBP\fR" 4
.IX Item "P"
10^15 / 2^40
.IP "\fBE\fR" 4
.IX Item "E"
10^18 / 2^50
.IP "\fBZ\fR" 4
.IX Item "Z"
10^21 / 2^60
.IP "\fBY\fR" 4
.IX Item "Y"
10^24 / 2^70
.SH "OPENCL OPTIONS"
.IX Header "OPENCL OPTIONS"
When FFmpeg is configured with \f(CW\*(C`\-\-enable\-opencl\*(C'\fR, it is possible
to set the options for the global OpenCL context.
.PP
The list of supported options follows:
.IP "\fBbuild_options\fR" 4
.IX Item "build_options"
Set build options used to compile the registered kernels.
.Sp
See reference \*(L"OpenCL Specification Version: 1.2 chapter 5.6.4\*(R".
.IP "\fBplatform_idx\fR" 4
.IX Item "platform_idx"
Select the index of the platform to run OpenCL code.
.Sp
The specified index must be one of the indexes in the device list
which can be obtained with \f(CW\*(C`av_opencl_get_device_list()\*(C'\fR.
.IP "\fBdevice_idx\fR" 4
.IX Item "device_idx"
Select the index of the device used to run OpenCL code.
.Sp
The specifed index must be one of the indexes in the device list which
can be obtained with \f(CW\*(C`av_opencl_get_device_list()\*(C'\fR.
.SH "CODEC OPTIONS"
.IX Header "CODEC OPTIONS"
libavcodec provides some generic global options, which can be set on
all the encoders and decoders. In addition each codec may support
so-called private options, which are specific for a given codec.
.PP
Sometimes, a global option may only affect a specific kind of codec,
and may be unsensical or ignored by another, so you need to be aware
of the meaning of the specified options. Also some options are
meant only for decoding or encoding.
.PP
Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
FFmpeg tools, or by setting the value explicitly in the
\&\f(CW\*(C`AVCodecContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0
for programmatic use.
.PP
The list of supported options follow:
.IP "\fBb\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "b integer (encoding,audio,video)"
Set bitrate in bits/s. Default value is 200K.
.IP "\fBab\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "ab integer (encoding,audio)"
Set audio bitrate (in bits/s). Default value is 128K.
.IP "\fBbt\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "bt integer (encoding,video)"
Set video bitrate tolerance (in bits/s). In 1\-pass mode, bitrate
tolerance specifies how far ratecontrol is willing to deviate from the
target average bitrate value. This is not related to min/max
bitrate. Lowering tolerance too much has an adverse effect on quality.
.IP "\fBflags\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video,subtitles\fR\fB)\fR" 4
.IX Item "flags flags (decoding/encoding,audio,video,subtitles)"
Set generic flags.
.Sp
Possible values:
.RS 4
.IP "\fBmv4\fR" 4
.IX Item "mv4"
Use four motion vector by macroblock (mpeg4).
.IP "\fBqpel\fR" 4
.IX Item "qpel"
Use 1/4 pel motion compensation.
.IP "\fBloop\fR" 4
.IX Item "loop"
Use loop filter.
.IP "\fBqscale\fR" 4
.IX Item "qscale"
Use fixed qscale.
.IP "\fBgmc\fR" 4
.IX Item "gmc"
Use gmc.
.IP "\fBmv0\fR" 4
.IX Item "mv0"
Always try a mb with mv=<0,0>.
.IP "\fBinput_preserved\fR" 4
.IX Item "input_preserved"
.PD 0
.IP "\fBpass1\fR" 4
.IX Item "pass1"
.PD
Use internal 2pass ratecontrol in first pass mode.
.IP "\fBpass2\fR" 4
.IX Item "pass2"
Use internal 2pass ratecontrol in second pass mode.
.IP "\fBgray\fR" 4
.IX Item "gray"
Only decode/encode grayscale.
.IP "\fBemu_edge\fR" 4
.IX Item "emu_edge"
Do not draw edges.
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
Set error[?] variables during encoding.
.IP "\fBtruncated\fR" 4
.IX Item "truncated"
.PD 0
.IP "\fBnaq\fR" 4
.IX Item "naq"
.PD
Normalize adaptive quantization.
.IP "\fBildct\fR" 4
.IX Item "ildct"
Use interlaced \s-1DCT\s0.
.IP "\fBlow_delay\fR" 4
.IX Item "low_delay"
Force low delay.
.IP "\fBglobal_header\fR" 4
.IX Item "global_header"
Place global headers in extradata instead of every keyframe.
.IP "\fBbitexact\fR" 4
.IX Item "bitexact"
Use only bitexact stuff (except (I)DCT).
.IP "\fBaic\fR" 4
.IX Item "aic"
Apply H263 advanced intra coding / mpeg4 ac prediction.
.IP "\fBcbp\fR" 4
.IX Item "cbp"
Deprecated, use mpegvideo private options instead.
.IP "\fBqprd\fR" 4
.IX Item "qprd"
Deprecated, use mpegvideo private options instead.
.IP "\fBilme\fR" 4
.IX Item "ilme"
Apply interlaced motion estimation.
.IP "\fBcgop\fR" 4
.IX Item "cgop"
Use closed gop.
.RE
.RS 4
.RE
.IP "\fBsub_id\fR \fIinteger\fR" 4
.IX Item "sub_id integer"
Deprecated, currently unused.
.IP "\fBme_method\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "me_method integer (encoding,video)"
Set motion estimation method.
.Sp
Possible values:
.RS 4
.IP "\fBzero\fR" 4
.IX Item "zero"
zero motion estimation (fastest)
.IP "\fBfull\fR" 4
.IX Item "full"
full motion estimation (slowest)
.IP "\fBepzs\fR" 4
.IX Item "epzs"
\&\s-1EPZS\s0 motion estimation (default)
.IP "\fBesa\fR" 4
.IX Item "esa"
esa motion estimation (alias for full)
.IP "\fBtesa\fR" 4
.IX Item "tesa"
tesa motion estimation
.IP "\fBdia\fR" 4
.IX Item "dia"
dia motion estimation (alias for epzs)
.IP "\fBlog\fR" 4
.IX Item "log"
log motion estimation
.IP "\fBphods\fR" 4
.IX Item "phods"
phods motion estimation
.IP "\fBx1\fR" 4
.IX Item "x1"
X1 motion estimation
.IP "\fBhex\fR" 4
.IX Item "hex"
hex motion estimation
.IP "\fBumh\fR" 4
.IX Item "umh"
umh motion estimation
.IP "\fBiter\fR" 4
.IX Item "iter"
iter motion estimation
.RE
.RS 4
.RE
.IP "\fBextradata_size\fR \fIinteger\fR" 4
.IX Item "extradata_size integer"
Set extradata size.
.IP "\fBtime_base\fR \fIrational number\fR" 4
.IX Item "time_base rational number"
Set codec time base.
.Sp
It is the fundamental unit of time (in seconds) in terms of which
frame timestamps are represented. For fixed-fps content, timebase
should be \f(CW\*(C`1 / frame_rate\*(C'\fR and timestamp increments should be
identically 1.
.IP "\fBg\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "g integer (encoding,video)"
Set the group of picture size. Default value is 12.
.IP "\fBar\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4
.IX Item "ar integer (decoding/encoding,audio)"
Set audio sampling rate (in Hz).
.IP "\fBac\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4
.IX Item "ac integer (decoding/encoding,audio)"
Set number of audio channels.
.IP "\fBcutoff\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "cutoff integer (encoding,audio)"
Set cutoff bandwidth.
.IP "\fBframe_size\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "frame_size integer (encoding,audio)"
Set audio frame size.
.Sp
Each submitted frame except the last must contain exactly frame_size
samples per channel. May be 0 when the codec has
\&\s-1CODEC_CAP_VARIABLE_FRAME_SIZE\s0 set, in that case the frame size is not
restricted. It is set by some decoders to indicate constant frame
size.
.IP "\fBframe_number\fR \fIinteger\fR" 4
.IX Item "frame_number integer"
Set the frame number.
.IP "\fBdelay\fR \fIinteger\fR" 4
.IX Item "delay integer"
.PD 0
.IP "\fBqcomp\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qcomp float (encoding,video)"
.PD
Set video quantizer scale compression (\s-1VBR\s0). It is used as a constant
in the ratecontrol equation. Recommended range for default rc_eq:
0.0\-1.0.
.IP "\fBqblur\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qblur float (encoding,video)"
Set video quantizer scale blur (\s-1VBR\s0).
.IP "\fBqmin\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qmin integer (encoding,video)"
Set min video quantizer scale (\s-1VBR\s0). Must be included between \-1 and
69, default value is 2.
.IP "\fBqmax\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qmax integer (encoding,video)"
Set max video quantizer scale (\s-1VBR\s0). Must be included between \-1 and
1024, default value is 31.
.IP "\fBqdiff\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qdiff integer (encoding,video)"
Set max difference between the quantizer scale (\s-1VBR\s0).
.IP "\fBbf\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "bf integer (encoding,video)"
Set max number of B frames.
.IP "\fBb_qfactor\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "b_qfactor float (encoding,video)"
Set qp factor between P and B frames.
.IP "\fBrc_strategy\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_strategy integer (encoding,video)"
Set ratecontrol method.
.IP "\fBb_strategy\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "b_strategy integer (encoding,video)"
Set strategy to choose between I/P/B\-frames.
.IP "\fBps\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "ps integer (encoding,video)"
Set \s-1RTP\s0 payload size in bytes.
.IP "\fBmv_bits\fR \fIinteger\fR" 4
.IX Item "mv_bits integer"
.PD 0
.IP "\fBheader_bits\fR \fIinteger\fR" 4
.IX Item "header_bits integer"
.IP "\fBi_tex_bits\fR \fIinteger\fR" 4
.IX Item "i_tex_bits integer"
.IP "\fBp_tex_bits\fR \fIinteger\fR" 4
.IX Item "p_tex_bits integer"
.IP "\fBi_count\fR \fIinteger\fR" 4
.IX Item "i_count integer"
.IP "\fBp_count\fR \fIinteger\fR" 4
.IX Item "p_count integer"
.IP "\fBskip_count\fR \fIinteger\fR" 4
.IX Item "skip_count integer"
.IP "\fBmisc_bits\fR \fIinteger\fR" 4
.IX Item "misc_bits integer"
.IP "\fBframe_bits\fR \fIinteger\fR" 4
.IX Item "frame_bits integer"
.IP "\fBcodec_tag\fR \fIinteger\fR" 4
.IX Item "codec_tag integer"
.IP "\fBbug\fR \fIflags\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "bug flags (decoding,video)"
.PD
Workaround not auto detected encoder bugs.
.Sp
Possible values:
.RS 4
.IP "\fBautodetect\fR" 4
.IX Item "autodetect"
.PD 0
.IP "\fBold_msmpeg4\fR" 4
.IX Item "old_msmpeg4"
.PD
some old lavc generated msmpeg4v3 files (no autodetection)
.IP "\fBxvid_ilace\fR" 4
.IX Item "xvid_ilace"
Xvid interlacing bug (autodetected if fourcc==XVIX)
.IP "\fBump4\fR" 4
.IX Item "ump4"
(autodetected if fourcc==UMP4)
.IP "\fBno_padding\fR" 4
.IX Item "no_padding"
padding bug (autodetected)
.IP "\fBamv\fR" 4
.IX Item "amv"
.PD 0
.IP "\fBac_vlc\fR" 4
.IX Item "ac_vlc"
.PD
illegal vlc bug (autodetected per fourcc)
.IP "\fBqpel_chroma\fR" 4
.IX Item "qpel_chroma"
.PD 0
.IP "\fBstd_qpel\fR" 4
.IX Item "std_qpel"
.PD
old standard qpel (autodetected per fourcc/version)
.IP "\fBqpel_chroma2\fR" 4
.IX Item "qpel_chroma2"
.PD 0
.IP "\fBdirect_blocksize\fR" 4
.IX Item "direct_blocksize"
.PD
direct-qpel-blocksize bug (autodetected per fourcc/version)
.IP "\fBedge\fR" 4
.IX Item "edge"
edge padding bug (autodetected per fourcc/version)
.IP "\fBhpel_chroma\fR" 4
.IX Item "hpel_chroma"
.PD 0
.IP "\fBdc_clip\fR" 4
.IX Item "dc_clip"
.IP "\fBms\fR" 4
.IX Item "ms"
.PD
Workaround various bugs in microsoft broken decoders.
.IP "\fBtrunc\fR" 4
.IX Item "trunc"
trancated frames
.RE
.RS 4
.RE
.IP "\fBlelim\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "lelim integer (encoding,video)"
Set single coefficient elimination threshold for luminance (negative
values also consider \s-1DC\s0 coefficient).
.IP "\fBcelim\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "celim integer (encoding,video)"
Set single coefficient elimination threshold for chrominance (negative
values also consider dc coefficient)
.IP "\fBstrict\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio,video\fR\fB)\fR" 4
.IX Item "strict integer (decoding/encoding,audio,video)"
Specify how strictly to follow the standards.
.Sp
Possible values:
.RS 4
.IP "\fBvery\fR" 4
.IX Item "very"
strictly conform to a older more strict version of the spec or reference software
.IP "\fBstrict\fR" 4
.IX Item "strict"
strictly conform to all the things in the spec no matter what consequences
.IP "\fBnormal\fR" 4
.IX Item "normal"
.PD 0
.IP "\fBunofficial\fR" 4
.IX Item "unofficial"
.PD
allow unofficial extensions
.IP "\fBexperimental\fR" 4
.IX Item "experimental"
allow non standardized experimental things
.RE
.RS 4
.RE
.IP "\fBb_qoffset\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "b_qoffset float (encoding,video)"
Set \s-1QP\s0 offset between P and B frames.
.IP "\fBerr_detect\fR \fIflags\fR \fB(\fR\fIdecoding,audio,video\fR\fB)\fR" 4
.IX Item "err_detect flags (decoding,audio,video)"
Set error detection flags.
.Sp
Possible values:
.RS 4
.IP "\fBcrccheck\fR" 4
.IX Item "crccheck"
verify embedded CRCs
.IP "\fBbitstream\fR" 4
.IX Item "bitstream"
detect bitstream specification deviations
.IP "\fBbuffer\fR" 4
.IX Item "buffer"
detect improper bitstream length
.IP "\fBexplode\fR" 4
.IX Item "explode"
abort decoding on minor error detection
.IP "\fBcareful\fR" 4
.IX Item "careful"
consider things that violate the spec and have not been seen in the wild as errors
.IP "\fBcompliant\fR" 4
.IX Item "compliant"
consider all spec non compliancies as errors
.IP "\fBaggressive\fR" 4
.IX Item "aggressive"
consider things that a sane encoder should not do as an error
.RE
.RS 4
.RE
.IP "\fBhas_b_frames\fR \fIinteger\fR" 4
.IX Item "has_b_frames integer"
.PD 0
.IP "\fBblock_align\fR \fIinteger\fR" 4
.IX Item "block_align integer"
.IP "\fBmpeg_quant\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mpeg_quant integer (encoding,video)"
.PD
Use \s-1MPEG\s0 quantizers instead of H.263.
.IP "\fBqsquish\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qsquish float (encoding,video)"
How to keep quantizer between qmin and qmax (0 = clip, 1 = use
differentiable function).
.IP "\fBrc_qmod_amp\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_qmod_amp float (encoding,video)"
Set experimental quantizer modulation.
.IP "\fBrc_qmod_freq\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_qmod_freq integer (encoding,video)"
Set experimental quantizer modulation.
.IP "\fBrc_override_count\fR \fIinteger\fR" 4
.IX Item "rc_override_count integer"
.PD 0
.IP "\fBrc_eq\fR \fIstring\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_eq string (encoding,video)"
.PD
Set rate control equation. When computing the expression, besides the
standard functions defined in the section 'Expression Evaluation', the
following functions are available: bits2qp(bits), qp2bits(qp). Also
the following constants are available: iTex pTex tex mv fCode iCount
mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
avgTex.
.IP "\fBmaxrate\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "maxrate integer (encoding,audio,video)"
Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
.IP "\fBminrate\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "minrate integer (encoding,audio,video)"
Set min bitrate tolerance (in bits/s). Most useful in setting up a \s-1CBR\s0
encode. It is of little use elsewise.
.IP "\fBbufsize\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "bufsize integer (encoding,audio,video)"
Set ratecontrol buffer size (in bits).
.IP "\fBrc_buf_aggressivity\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_buf_aggressivity float (encoding,video)"
Currently useless.
.IP "\fBi_qfactor\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "i_qfactor float (encoding,video)"
Set \s-1QP\s0 factor between P and I frames.
.IP "\fBi_qoffset\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "i_qoffset float (encoding,video)"
Set \s-1QP\s0 offset between P and I frames.
.IP "\fBrc_init_cplx\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_init_cplx float (encoding,video)"
Set initial complexity for 1\-pass encoding.
.IP "\fBdct\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "dct integer (encoding,video)"
Set \s-1DCT\s0 algorithm.
.Sp
Possible values:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
autoselect a good one (default)
.IP "\fBfastint\fR" 4
.IX Item "fastint"
fast integer
.IP "\fBint\fR" 4
.IX Item "int"
accurate integer
.IP "\fBmmx\fR" 4
.IX Item "mmx"
.PD 0
.IP "\fBaltivec\fR" 4
.IX Item "altivec"
.IP "\fBfaan\fR" 4
.IX Item "faan"
.PD
floating point \s-1AAN\s0 \s-1DCT\s0
.RE
.RS 4
.RE
.IP "\fBlumi_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "lumi_mask float (encoding,video)"
Compress bright areas stronger than medium ones.
.IP "\fBtcplx_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "tcplx_mask float (encoding,video)"
Set temporal complexity masking.
.IP "\fBscplx_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "scplx_mask float (encoding,video)"
Set spatial complexity masking.
.IP "\fBp_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "p_mask float (encoding,video)"
Set inter masking.
.IP "\fBdark_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "dark_mask float (encoding,video)"
Compress dark areas stronger than medium ones.
.IP "\fBidct\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "idct integer (decoding/encoding,video)"
Select \s-1IDCT\s0 implementation.
.Sp
Possible values:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
.PD 0
.IP "\fBint\fR" 4
.IX Item "int"
.IP "\fBsimple\fR" 4
.IX Item "simple"
.IP "\fBsimplemmx\fR" 4
.IX Item "simplemmx"
.IP "\fBlibmpeg2mmx\fR" 4
.IX Item "libmpeg2mmx"
.IP "\fBmmi\fR" 4
.IX Item "mmi"
.IP "\fBarm\fR" 4
.IX Item "arm"
.IP "\fBaltivec\fR" 4
.IX Item "altivec"
.IP "\fBsh4\fR" 4
.IX Item "sh4"
.IP "\fBsimplearm\fR" 4
.IX Item "simplearm"
.IP "\fBsimplearmv5te\fR" 4
.IX Item "simplearmv5te"
.IP "\fBsimplearmv6\fR" 4
.IX Item "simplearmv6"
.IP "\fBsimpleneon\fR" 4
.IX Item "simpleneon"
.IP "\fBsimplealpha\fR" 4
.IX Item "simplealpha"
.IP "\fBh264\fR" 4
.IX Item "h264"
.IP "\fBvp3\fR" 4
.IX Item "vp3"
.IP "\fBipp\fR" 4
.IX Item "ipp"
.IP "\fBxvidmmx\fR" 4
.IX Item "xvidmmx"
.IP "\fBfaani\fR" 4
.IX Item "faani"
.PD
floating point \s-1AAN\s0 \s-1IDCT\s0
.RE
.RS 4
.RE
.IP "\fBslice_count\fR \fIinteger\fR" 4
.IX Item "slice_count integer"
.PD 0
.IP "\fBec\fR \fIflags\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "ec flags (decoding,video)"
.PD
Set error concealment strategy.
.Sp
Possible values:
.RS 4
.IP "\fBguess_mvs\fR" 4
.IX Item "guess_mvs"
iterative motion vector (\s-1MV\s0) search (slow)
.IP "\fBdeblock\fR" 4
.IX Item "deblock"
use strong deblock filter for damaged MBs
.RE
.RS 4
.RE
.IP "\fBbits_per_coded_sample\fR \fIinteger\fR" 4
.IX Item "bits_per_coded_sample integer"
.PD 0
.IP "\fBpred\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "pred integer (encoding,video)"
.PD
Set prediction method.
.Sp
Possible values:
.RS 4
.IP "\fBleft\fR" 4
.IX Item "left"
.PD 0
.IP "\fBplane\fR" 4
.IX Item "plane"
.IP "\fBmedian\fR" 4
.IX Item "median"
.RE
.RS 4
.RE
.IP "\fBaspect\fR \fIrational number\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "aspect rational number (encoding,video)"
.PD
Set sample aspect ratio.
.IP "\fBdebug\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video,subtitles\fR\fB)\fR" 4
.IX Item "debug flags (decoding/encoding,audio,video,subtitles)"
Print specific debug info.
.Sp
Possible values:
.RS 4
.IP "\fBpict\fR" 4
.IX Item "pict"
picture info
.IP "\fBrc\fR" 4
.IX Item "rc"
rate control
.IP "\fBbitstream\fR" 4
.IX Item "bitstream"
.PD 0
.IP "\fBmb_type\fR" 4
.IX Item "mb_type"
.PD
macroblock (\s-1MB\s0) type
.IP "\fBqp\fR" 4
.IX Item "qp"
per-block quantization parameter (\s-1QP\s0)
.IP "\fBmv\fR" 4
.IX Item "mv"
motion vector
.IP "\fBdct_coeff\fR" 4
.IX Item "dct_coeff"
.PD 0
.IP "\fBskip\fR" 4
.IX Item "skip"
.IP "\fBstartcode\fR" 4
.IX Item "startcode"
.IP "\fBpts\fR" 4
.IX Item "pts"
.IP "\fBer\fR" 4
.IX Item "er"
.PD
error recognition
.IP "\fBmmco\fR" 4
.IX Item "mmco"
memory management control operations (H.264)
.IP "\fBbugs\fR" 4
.IX Item "bugs"
.PD 0
.IP "\fBvis_qp\fR" 4
.IX Item "vis_qp"
.PD
visualize quantization parameter (\s-1QP\s0), lower \s-1QP\s0 are tinted greener
.IP "\fBvis_mb_type\fR" 4
.IX Item "vis_mb_type"
visualize block types
.IP "\fBbuffers\fR" 4
.IX Item "buffers"
picture buffer allocations
.IP "\fBthread_ops\fR" 4
.IX Item "thread_ops"
threading operations
.RE
.RS 4
.RE
.IP "\fBvismv\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "vismv integer (decoding,video)"
Visualize motion vectors (MVs).
.Sp
Possible values:
.RS 4
.IP "\fBpf\fR" 4
.IX Item "pf"
forward predicted MVs of P\-frames
.IP "\fBbf\fR" 4
.IX Item "bf"
forward predicted MVs of B\-frames
.IP "\fBbb\fR" 4
.IX Item "bb"
backward predicted MVs of B\-frames
.RE
.RS 4
.RE
.IP "\fBcmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "cmp integer (encoding,video)"
Set full pel me compare function.
.Sp
Possible values:
.RS 4
.IP "\fBsad\fR" 4
.IX Item "sad"
sum of absolute differences, fast (default)
.IP "\fBsse\fR" 4
.IX Item "sse"
sum of squared errors
.IP "\fBsatd\fR" 4
.IX Item "satd"
sum of absolute Hadamard transformed differences
.IP "\fBdct\fR" 4
.IX Item "dct"
sum of absolute \s-1DCT\s0 transformed differences
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
sum of squared quantization errors (avoid, low quality)
.IP "\fBbit\fR" 4
.IX Item "bit"
number of bits needed for the block
.IP "\fBrd\fR" 4
.IX Item "rd"
rate distortion optimal, slow
.IP "\fBzero\fR" 4
.IX Item "zero"
0
.IP "\fBvsad\fR" 4
.IX Item "vsad"
sum of absolute vertical differences
.IP "\fBvsse\fR" 4
.IX Item "vsse"
sum of squared vertical differences
.IP "\fBnsse\fR" 4
.IX Item "nsse"
noise preserving sum of squared differences
.IP "\fBw53\fR" 4
.IX Item "w53"
5/3 wavelet, only used in snow
.IP "\fBw97\fR" 4
.IX Item "w97"
9/7 wavelet, only used in snow
.IP "\fBdctmax\fR" 4
.IX Item "dctmax"
.PD 0
.IP "\fBchroma\fR" 4
.IX Item "chroma"
.RE
.RS 4
.RE
.IP "\fBsubcmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "subcmp integer (encoding,video)"
.PD
Set sub pel me compare function.
.Sp
Possible values:
.RS 4
.IP "\fBsad\fR" 4
.IX Item "sad"
sum of absolute differences, fast (default)
.IP "\fBsse\fR" 4
.IX Item "sse"
sum of squared errors
.IP "\fBsatd\fR" 4
.IX Item "satd"
sum of absolute Hadamard transformed differences
.IP "\fBdct\fR" 4
.IX Item "dct"
sum of absolute \s-1DCT\s0 transformed differences
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
sum of squared quantization errors (avoid, low quality)
.IP "\fBbit\fR" 4
.IX Item "bit"
number of bits needed for the block
.IP "\fBrd\fR" 4
.IX Item "rd"
rate distortion optimal, slow
.IP "\fBzero\fR" 4
.IX Item "zero"
0
.IP "\fBvsad\fR" 4
.IX Item "vsad"
sum of absolute vertical differences
.IP "\fBvsse\fR" 4
.IX Item "vsse"
sum of squared vertical differences
.IP "\fBnsse\fR" 4
.IX Item "nsse"
noise preserving sum of squared differences
.IP "\fBw53\fR" 4
.IX Item "w53"
5/3 wavelet, only used in snow
.IP "\fBw97\fR" 4
.IX Item "w97"
9/7 wavelet, only used in snow
.IP "\fBdctmax\fR" 4
.IX Item "dctmax"
.PD 0
.IP "\fBchroma\fR" 4
.IX Item "chroma"
.RE
.RS 4
.RE
.IP "\fBmbcmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mbcmp integer (encoding,video)"
.PD
Set macroblock compare function.
.Sp
Possible values:
.RS 4
.IP "\fBsad\fR" 4
.IX Item "sad"
sum of absolute differences, fast (default)
.IP "\fBsse\fR" 4
.IX Item "sse"
sum of squared errors
.IP "\fBsatd\fR" 4
.IX Item "satd"
sum of absolute Hadamard transformed differences
.IP "\fBdct\fR" 4
.IX Item "dct"
sum of absolute \s-1DCT\s0 transformed differences
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
sum of squared quantization errors (avoid, low quality)
.IP "\fBbit\fR" 4
.IX Item "bit"
number of bits needed for the block
.IP "\fBrd\fR" 4
.IX Item "rd"
rate distortion optimal, slow
.IP "\fBzero\fR" 4
.IX Item "zero"
0
.IP "\fBvsad\fR" 4
.IX Item "vsad"
sum of absolute vertical differences
.IP "\fBvsse\fR" 4
.IX Item "vsse"
sum of squared vertical differences
.IP "\fBnsse\fR" 4
.IX Item "nsse"
noise preserving sum of squared differences
.IP "\fBw53\fR" 4
.IX Item "w53"
5/3 wavelet, only used in snow
.IP "\fBw97\fR" 4
.IX Item "w97"
9/7 wavelet, only used in snow
.IP "\fBdctmax\fR" 4
.IX Item "dctmax"
.PD 0
.IP "\fBchroma\fR" 4
.IX Item "chroma"
.RE
.RS 4
.RE
.IP "\fBildctcmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "ildctcmp integer (encoding,video)"
.PD
Set interlaced dct compare function.
.Sp
Possible values:
.RS 4
.IP "\fBsad\fR" 4
.IX Item "sad"
sum of absolute differences, fast (default)
.IP "\fBsse\fR" 4
.IX Item "sse"
sum of squared errors
.IP "\fBsatd\fR" 4
.IX Item "satd"
sum of absolute Hadamard transformed differences
.IP "\fBdct\fR" 4
.IX Item "dct"
sum of absolute \s-1DCT\s0 transformed differences
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
sum of squared quantization errors (avoid, low quality)
.IP "\fBbit\fR" 4
.IX Item "bit"
number of bits needed for the block
.IP "\fBrd\fR" 4
.IX Item "rd"
rate distortion optimal, slow
.IP "\fBzero\fR" 4
.IX Item "zero"
0
.IP "\fBvsad\fR" 4
.IX Item "vsad"
sum of absolute vertical differences
.IP "\fBvsse\fR" 4
.IX Item "vsse"
sum of squared vertical differences
.IP "\fBnsse\fR" 4
.IX Item "nsse"
noise preserving sum of squared differences
.IP "\fBw53\fR" 4
.IX Item "w53"
5/3 wavelet, only used in snow
.IP "\fBw97\fR" 4
.IX Item "w97"
9/7 wavelet, only used in snow
.IP "\fBdctmax\fR" 4
.IX Item "dctmax"
.PD 0
.IP "\fBchroma\fR" 4
.IX Item "chroma"
.RE
.RS 4
.RE
.IP "\fBdia_size\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "dia_size integer (encoding,video)"
.PD
Set diamond type & size for motion estimation.
.IP "\fBlast_pred\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "last_pred integer (encoding,video)"
Set amount of motion predictors from the previous frame.
.IP "\fBpreme\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "preme integer (encoding,video)"
Set pre motion estimation.
.IP "\fBprecmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "precmp integer (encoding,video)"
Set pre motion estimation compare function.
.Sp
Possible values:
.RS 4
.IP "\fBsad\fR" 4
.IX Item "sad"
sum of absolute differences, fast (default)
.IP "\fBsse\fR" 4
.IX Item "sse"
sum of squared errors
.IP "\fBsatd\fR" 4
.IX Item "satd"
sum of absolute Hadamard transformed differences
.IP "\fBdct\fR" 4
.IX Item "dct"
sum of absolute \s-1DCT\s0 transformed differences
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
sum of squared quantization errors (avoid, low quality)
.IP "\fBbit\fR" 4
.IX Item "bit"
number of bits needed for the block
.IP "\fBrd\fR" 4
.IX Item "rd"
rate distortion optimal, slow
.IP "\fBzero\fR" 4
.IX Item "zero"
0
.IP "\fBvsad\fR" 4
.IX Item "vsad"
sum of absolute vertical differences
.IP "\fBvsse\fR" 4
.IX Item "vsse"
sum of squared vertical differences
.IP "\fBnsse\fR" 4
.IX Item "nsse"
noise preserving sum of squared differences
.IP "\fBw53\fR" 4
.IX Item "w53"
5/3 wavelet, only used in snow
.IP "\fBw97\fR" 4
.IX Item "w97"
9/7 wavelet, only used in snow
.IP "\fBdctmax\fR" 4
.IX Item "dctmax"
.PD 0
.IP "\fBchroma\fR" 4
.IX Item "chroma"
.RE
.RS 4
.RE
.IP "\fBpre_dia_size\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "pre_dia_size integer (encoding,video)"
.PD
Set diamond type & size for motion estimation pre-pass.
.IP "\fBsubq\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "subq integer (encoding,video)"
Set sub pel motion estimation quality.
.IP "\fBdtg_active_format\fR \fIinteger\fR" 4
.IX Item "dtg_active_format integer"
.PD 0
.IP "\fBme_range\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "me_range integer (encoding,video)"
.PD
Set limit motion vectors range (1023 for DivX player).
.IP "\fBibias\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "ibias integer (encoding,video)"
Set intra quant bias.
.IP "\fBpbias\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "pbias integer (encoding,video)"
Set inter quant bias.
.IP "\fBcolor_table_id\fR \fIinteger\fR" 4
.IX Item "color_table_id integer"
.PD 0
.IP "\fBglobal_quality\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "global_quality integer (encoding,audio,video)"
.IP "\fBcoder\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "coder integer (encoding,video)"
.PD
Possible values:
.RS 4
.IP "\fBvlc\fR" 4
.IX Item "vlc"
variable length coder / huffman coder
.IP "\fBac\fR" 4
.IX Item "ac"
arithmetic coder
.IP "\fBraw\fR" 4
.IX Item "raw"
raw (no encoding)
.IP "\fBrle\fR" 4
.IX Item "rle"
run-length coder
.IP "\fBdeflate\fR" 4
.IX Item "deflate"
deflate-based coder
.RE
.RS 4
.RE
.IP "\fBcontext\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "context integer (encoding,video)"
Set context model.
.IP "\fBslice_flags\fR \fIinteger\fR" 4
.IX Item "slice_flags integer"
.PD 0
.IP "\fBxvmc_acceleration\fR \fIinteger\fR" 4
.IX Item "xvmc_acceleration integer"
.IP "\fBmbd\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mbd integer (encoding,video)"
.PD
Set macroblock decision algorithm (high quality mode).
.Sp
Possible values:
.RS 4
.IP "\fBsimple\fR" 4
.IX Item "simple"
use mbcmp (default)
.IP "\fBbits\fR" 4
.IX Item "bits"
use fewest bits
.IP "\fBrd\fR" 4
.IX Item "rd"
use best rate distortion
.RE
.RS 4
.RE
.IP "\fBstream_codec_tag\fR \fIinteger\fR" 4
.IX Item "stream_codec_tag integer"
.PD 0
.IP "\fBsc_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "sc_threshold integer (encoding,video)"
.PD
Set scene change threshold.
.IP "\fBlmin\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "lmin integer (encoding,video)"
Set min lagrange factor (\s-1VBR\s0).
.IP "\fBlmax\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "lmax integer (encoding,video)"
Set max lagrange factor (\s-1VBR\s0).
.IP "\fBnr\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "nr integer (encoding,video)"
Set noise reduction.
.IP "\fBrc_init_occupancy\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_init_occupancy integer (encoding,video)"
Set number of bits which should be loaded into the rc buffer before
decoding starts.
.IP "\fBinter_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "inter_threshold integer (encoding,video)"
.PD 0
.IP "\fBflags2\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video\fR\fB)\fR" 4
.IX Item "flags2 flags (decoding/encoding,audio,video)"
.PD
Possible values:
.RS 4
.IP "\fBfast\fR" 4
.IX Item "fast"
allow non spec compliant speedup tricks
.IP "\fBsgop\fR" 4
.IX Item "sgop"
Deprecated, use mpegvideo private options instead
.IP "\fBnoout\fR" 4
.IX Item "noout"
skip bitstream encoding
.IP "\fBlocal_header\fR" 4
.IX Item "local_header"
place global headers at every keyframe instead of in extradata
.IP "\fBchunks\fR" 4
.IX Item "chunks"
Frame data might be split into multiple chunks
.IP "\fBshowall\fR" 4
.IX Item "showall"
Show all frames before the first keyframe
.IP "\fBskiprd\fR" 4
.IX Item "skiprd"
Deprecated, use mpegvideo private options instead
.RE
.RS 4
.RE
.IP "\fBerror\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "error integer (encoding,video)"
.PD 0
.IP "\fBqns\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "qns integer (encoding,video)"
.PD
Deprecated, use mpegvideo private options instead.
.IP "\fBthreads\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "threads integer (decoding/encoding,video)"
Possible values:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
detect a good number of threads
.RE
.RS 4
.RE
.IP "\fBme_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "me_threshold integer (encoding,video)"
Set motion estimation threshold.
.IP "\fBmb_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mb_threshold integer (encoding,video)"
Set macroblock threshold.
.IP "\fBdc\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "dc integer (encoding,video)"
Set intra_dc_precision.
.IP "\fBnssew\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "nssew integer (encoding,video)"
Set nsse weight.
.IP "\fBskip_top\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "skip_top integer (decoding,video)"
Set number of macroblock rows at the top which are skipped.
.IP "\fBskip_bottom\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "skip_bottom integer (decoding,video)"
Set number of macroblock rows at the bottom which are skipped.
.IP "\fBprofile\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "profile integer (encoding,audio,video)"
Possible values:
.RS 4
.IP "\fBunknown\fR" 4
.IX Item "unknown"
.PD 0
.IP "\fBaac_main\fR" 4
.IX Item "aac_main"
.IP "\fBaac_low\fR" 4
.IX Item "aac_low"
.IP "\fBaac_ssr\fR" 4
.IX Item "aac_ssr"
.IP "\fBaac_ltp\fR" 4
.IX Item "aac_ltp"
.IP "\fBaac_he\fR" 4
.IX Item "aac_he"
.IP "\fBaac_he_v2\fR" 4
.IX Item "aac_he_v2"
.IP "\fBaac_ld\fR" 4
.IX Item "aac_ld"
.IP "\fBaac_eld\fR" 4
.IX Item "aac_eld"
.IP "\fBdts\fR" 4
.IX Item "dts"
.IP "\fBdts_es\fR" 4
.IX Item "dts_es"
.IP "\fBdts_96_24\fR" 4
.IX Item "dts_96_24"
.IP "\fBdts_hd_hra\fR" 4
.IX Item "dts_hd_hra"
.IP "\fBdts_hd_ma\fR" 4
.IX Item "dts_hd_ma"
.RE
.RS 4
.RE
.IP "\fBlevel\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "level integer (encoding,audio,video)"
.PD
Possible values:
.RS 4
.IP "\fBunknown\fR" 4
.IX Item "unknown"
.RE
.RS 4
.RE
.PD 0
.IP "\fBlowres\fR \fIinteger\fR \fB(\fR\fIdecoding,audio,video\fR\fB)\fR" 4
.IX Item "lowres integer (decoding,audio,video)"
.PD
Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
.IP "\fBskip_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "skip_threshold integer (encoding,video)"
Set frame skip threshold.
.IP "\fBskip_factor\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "skip_factor integer (encoding,video)"
Set frame skip factor.
.IP "\fBskip_exp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "skip_exp integer (encoding,video)"
Set frame skip exponent.
.IP "\fBskipcmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "skipcmp integer (encoding,video)"
Set frame skip compare function.
.Sp
Possible values:
.RS 4
.IP "\fBsad\fR" 4
.IX Item "sad"
sum of absolute differences, fast (default)
.IP "\fBsse\fR" 4
.IX Item "sse"
sum of squared errors
.IP "\fBsatd\fR" 4
.IX Item "satd"
sum of absolute Hadamard transformed differences
.IP "\fBdct\fR" 4
.IX Item "dct"
sum of absolute \s-1DCT\s0 transformed differences
.IP "\fBpsnr\fR" 4
.IX Item "psnr"
sum of squared quantization errors (avoid, low quality)
.IP "\fBbit\fR" 4
.IX Item "bit"
number of bits needed for the block
.IP "\fBrd\fR" 4
.IX Item "rd"
rate distortion optimal, slow
.IP "\fBzero\fR" 4
.IX Item "zero"
0
.IP "\fBvsad\fR" 4
.IX Item "vsad"
sum of absolute vertical differences
.IP "\fBvsse\fR" 4
.IX Item "vsse"
sum of squared vertical differences
.IP "\fBnsse\fR" 4
.IX Item "nsse"
noise preserving sum of squared differences
.IP "\fBw53\fR" 4
.IX Item "w53"
5/3 wavelet, only used in snow
.IP "\fBw97\fR" 4
.IX Item "w97"
9/7 wavelet, only used in snow
.IP "\fBdctmax\fR" 4
.IX Item "dctmax"
.PD 0
.IP "\fBchroma\fR" 4
.IX Item "chroma"
.RE
.RS 4
.RE
.IP "\fBborder_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "border_mask float (encoding,video)"
.PD
Increase the quantizer for macroblocks close to borders.
.IP "\fBmblmin\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mblmin integer (encoding,video)"
Set min macroblock lagrange factor (\s-1VBR\s0).
.IP "\fBmblmax\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mblmax integer (encoding,video)"
Set max macroblock lagrange factor (\s-1VBR\s0).
.IP "\fBmepc\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mepc integer (encoding,video)"
Set motion estimation bitrate penalty compensation (1.0 = 256).
.IP "\fBskip_loop_filter\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "skip_loop_filter integer (decoding,video)"
.PD 0
.IP "\fBskip_idct\fR        \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "skip_idct        integer (decoding,video)"
.IP "\fBskip_frame\fR       \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "skip_frame       integer (decoding,video)"
.PD
Make decoder discard processing depending on the frame type selected
by the option value.
.Sp
\&\fBskip_loop_filter\fR skips frame loop filtering, \fBskip_idct\fR
skips frame IDCT/dequantization, \fBskip_frame\fR skips decoding.
.Sp
Possible values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Discard no frame.
.IP "\fBdefault\fR" 4
.IX Item "default"
Discard useless frames like 0\-sized frames.
.IP "\fBnoref\fR" 4
.IX Item "noref"
Discard all non-reference frames.
.IP "\fBbidir\fR" 4
.IX Item "bidir"
Discard all bidirectional frames.
.IP "\fBnokey\fR" 4
.IX Item "nokey"
Discard all frames excepts keyframes.
.IP "\fBall\fR" 4
.IX Item "all"
Discard all frames.
.RE
.RS 4
.Sp
Default value is \fBdefault\fR.
.RE
.IP "\fBbidir_refine\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "bidir_refine integer (encoding,video)"
Refine the two motion vectors used in bidirectional macroblocks.
.IP "\fBbrd_scale\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "brd_scale integer (encoding,video)"
Downscale frames for dynamic B\-frame decision.
.IP "\fBkeyint_min\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "keyint_min integer (encoding,video)"
Set minimum interval between IDR-frames.
.IP "\fBrefs\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "refs integer (encoding,video)"
Set reference frames to consider for motion compensation.
.IP "\fBchromaoffset\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "chromaoffset integer (encoding,video)"
Set chroma qp offset from luma.
.IP "\fBtrellis\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "trellis integer (encoding,audio,video)"
Set rate-distortion optimal quantization.
.IP "\fBsc_factor\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "sc_factor integer (encoding,video)"
Set value multiplied by qscale for each frame and added to
scene_change_score.
.IP "\fBmv0_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "mv0_threshold integer (encoding,video)"
.PD 0
.IP "\fBb_sensitivity\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "b_sensitivity integer (encoding,video)"
.PD
Adjust sensitivity of b_frame_strategy 1.
.IP "\fBcompression_level\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4
.IX Item "compression_level integer (encoding,audio,video)"
.PD 0
.IP "\fBmin_prediction_order\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "min_prediction_order integer (encoding,audio)"
.IP "\fBmax_prediction_order\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "max_prediction_order integer (encoding,audio)"
.IP "\fBtimecode_frame_start\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "timecode_frame_start integer (encoding,video)"
.PD
Set \s-1GOP\s0 timecode frame start number, in non drop frame format.
.IP "\fBrequest_channels\fR \fIinteger\fR \fB(\fR\fIdecoding,audio\fR\fB)\fR" 4
.IX Item "request_channels integer (decoding,audio)"
Set desired number of audio channels.
.IP "\fBbits_per_raw_sample\fR \fIinteger\fR" 4
.IX Item "bits_per_raw_sample integer"
.PD 0
.IP "\fBchannel_layout\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4
.IX Item "channel_layout integer (decoding/encoding,audio)"
.PD
Possible values:
.IP "\fBrequest_channel_layout\fR \fIinteger\fR \fB(\fR\fIdecoding,audio\fR\fB)\fR" 4
.IX Item "request_channel_layout integer (decoding,audio)"
Possible values:
.IP "\fBrc_max_vbv_use\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_max_vbv_use float (encoding,video)"
.PD 0
.IP "\fBrc_min_vbv_use\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "rc_min_vbv_use float (encoding,video)"
.IP "\fBticks_per_frame\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio,video\fR\fB)\fR" 4
.IX Item "ticks_per_frame integer (decoding/encoding,audio,video)"
.IP "\fBcolor_primaries\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "color_primaries integer (decoding/encoding,video)"
.IP "\fBcolor_trc\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "color_trc integer (decoding/encoding,video)"
.IP "\fBcolorspace\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "colorspace integer (decoding/encoding,video)"
.IP "\fBcolor_range\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "color_range integer (decoding/encoding,video)"
.IP "\fBchroma_sample_location\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "chroma_sample_location integer (decoding/encoding,video)"
.IP "\fBlog_level_offset\fR \fIinteger\fR" 4
.IX Item "log_level_offset integer"
.PD
Set the log level offset.
.IP "\fBslices\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "slices integer (encoding,video)"
Number of slices, used in parallelized encoding.
.IP "\fBthread_type\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "thread_type flags (decoding/encoding,video)"
Select multithreading type.
.Sp
Possible values:
.RS 4
.IP "\fBslice\fR" 4
.IX Item "slice"
.PD 0
.IP "\fBframe\fR" 4
.IX Item "frame"
.RE
.RS 4
.RE
.IP "\fBaudio_service_type\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "audio_service_type integer (encoding,audio)"
.PD
Set audio service type.
.Sp
Possible values:
.RS 4
.IP "\fBma\fR" 4
.IX Item "ma"
Main Audio Service
.IP "\fBef\fR" 4
.IX Item "ef"
Effects
.IP "\fBvi\fR" 4
.IX Item "vi"
Visually Impaired
.IP "\fBhi\fR" 4
.IX Item "hi"
Hearing Impaired
.IP "\fBdi\fR" 4
.IX Item "di"
Dialogue
.IP "\fBco\fR" 4
.IX Item "co"
Commentary
.IP "\fBem\fR" 4
.IX Item "em"
Emergency
.IP "\fBvo\fR" 4
.IX Item "vo"
Voice Over
.IP "\fBka\fR" 4
.IX Item "ka"
Karaoke
.RE
.RS 4
.RE
.IP "\fBrequest_sample_fmt\fR \fIsample_fmt\fR \fB(\fR\fIdecoding,audio\fR\fB)\fR" 4
.IX Item "request_sample_fmt sample_fmt (decoding,audio)"
Set sample format audio decoders should prefer. Default value is
\&\f(CW\*(C`none\*(C'\fR.
.IP "\fBpkt_timebase\fR \fIrational number\fR" 4
.IX Item "pkt_timebase rational number"
.PD 0
.IP "\fBsub_charenc\fR \fIencoding\fR \fB(\fR\fIdecoding,subtitles\fR\fB)\fR" 4
.IX Item "sub_charenc encoding (decoding,subtitles)"
.PD
Set the input subtitles character encoding.
.SH "DECODERS"
.IX Header "DECODERS"
Decoders are configured elements in FFmpeg which allow the decoding of
multimedia streams.
.PP
When you configure your FFmpeg build, all the supported native decoders
are enabled by default. Decoders requiring an external library must be enabled
manually via the corresponding \f(CW\*(C`\-\-enable\-lib\*(C'\fR option. You can list all
available decoders using the configure option \f(CW\*(C`\-\-list\-decoders\*(C'\fR.
.PP
You can disable all the decoders with the configure option
\&\f(CW\*(C`\-\-disable\-decoders\*(C'\fR and selectively enable / disable single decoders
with the options \f(CW\*(C`\-\-enable\-decoder=\f(CIDECODER\f(CW\*(C'\fR /
\&\f(CW\*(C`\-\-disable\-decoder=\f(CIDECODER\f(CW\*(C'\fR.
.PP
The option \f(CW\*(C`\-codecs\*(C'\fR of the ff* tools will display the list of
enabled decoders.
.SH "VIDEO DECODERS"
.IX Header "VIDEO DECODERS"
A description of some of the currently available video decoders
follows.
.SS "rawvideo"
.IX Subsection "rawvideo"
Raw video decoder.
.PP
This decoder decodes rawvideo streams.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBtop\fR \fItop_field_first\fR" 4
.IX Item "top top_field_first"
Specify the assumed field type of the input video.
.RS 4
.IP "\fB\-1\fR" 4
.IX Item "-1"
the video is assumed to be progressive (default)
.IP "\fB0\fR" 4
.IX Item "0"
bottom-field-first is assumed
.IP "\fB1\fR" 4
.IX Item "1"
top-field-first is assumed
.RE
.RS 4
.RE
.SH "AUDIO DECODERS"
.IX Header "AUDIO DECODERS"
.SS "ffwavesynth"
.IX Subsection "ffwavesynth"
Internal wave synthetizer.
.PP
This decoder generates wave patterns according to predefined sequences. Its
use is purely internal and the format of the data it accepts is not publicly
documented.
.SH "SUBTITLES DECODERS"
.IX Header "SUBTITLES DECODERS"
.SS "dvdsub"
.IX Subsection "dvdsub"
This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
also be found in VobSub file pairs and in some Matroska files.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBpalette\fR" 4
.IX Item "palette"
Specify the global palette used by the bitmaps. When stored in VobSub, the
palette is normally specified in the index file; in Matroska, the palette is
stored in the codec extra-data in the same format as in VobSub. In DVDs, the
palette is stored in the \s-1IFO\s0 file, and therefore not available when reading
from dumped \s-1VOB\s0 files.
.Sp
The format for this option is a string containing 16 24\-bits hexadecimal
numbers (without 0x prefix) separated by comas, for example \f(CW\*(C`0d00ee,
ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b\*(C'\fR.
.SH "ENCODERS"
.IX Header "ENCODERS"
Encoders are configured elements in FFmpeg which allow the encoding of
multimedia streams.
.PP
When you configure your FFmpeg build, all the supported native encoders
are enabled by default. Encoders requiring an external library must be enabled
manually via the corresponding \f(CW\*(C`\-\-enable\-lib\*(C'\fR option. You can list all
available encoders using the configure option \f(CW\*(C`\-\-list\-encoders\*(C'\fR.
.PP
You can disable all the encoders with the configure option
\&\f(CW\*(C`\-\-disable\-encoders\*(C'\fR and selectively enable / disable single encoders
with the options \f(CW\*(C`\-\-enable\-encoder=\f(CIENCODER\f(CW\*(C'\fR /
\&\f(CW\*(C`\-\-disable\-encoder=\f(CIENCODER\f(CW\*(C'\fR.
.PP
The option \f(CW\*(C`\-codecs\*(C'\fR of the ff* tools will display the list of
enabled encoders.
.SH "AUDIO ENCODERS"
.IX Header "AUDIO ENCODERS"
A description of some of the currently available audio encoders
follows.
.SS "ac3 and ac3_fixed"
.IX Subsection "ac3 and ac3_fixed"
\&\s-1AC\-3\s0 audio encoders.
.PP
These encoders implement part of \s-1ATSC\s0 A/52:2010 and \s-1ETSI\s0 \s-1TS\s0 102 366, as well as
the undocumented RealAudio 3 (a.k.a. dnet).
.PP
The \fIac3\fR encoder uses floating-point math, while the \fIac3_fixed\fR
encoder only uses fixed-point integer math. This does not mean that one is
always faster, just that one or the other may be better suited to a
particular system. The floating-point encoder will generally produce better
quality audio for a given bitrate. The \fIac3_fixed\fR encoder is not the
default codec for any of the output formats, so it must be specified explicitly
using the option \f(CW\*(C`\-acodec ac3_fixed\*(C'\fR in order to use it.
.PP
\fI\s-1AC\-3\s0 Metadata\fR
.IX Subsection "AC-3 Metadata"
.PP
The \s-1AC\-3\s0 metadata options are used to set parameters that describe the audio,
but in most cases do not affect the audio encoding itself. Some of the options
do directly affect or influence the decoding and playback of the resulting
bitstream, while others are just for informational purposes. A few of the
options will add bits to the output stream that could otherwise be used for
audio data, and will thus affect the quality of the output. Those will be
indicated accordingly with a note in the option list below.
.PP
These parameters are described in detail in several publicly-available
documents.
.IP "*<<\fBhttp://www.atsc.org/cms/standards/a_52\-2010.pdf\fR>>" 4
.IX Item "*<<http://www.atsc.org/cms/standards/a_52-2010.pdf>>"
.PD 0
.IP "*<<\fBhttp://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf\fR>>" 4
.IX Item "*<<http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf>>"
.IP "*<<\fBhttp://www.dolby.com/uploadedFiles/zz\-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf\fR>>" 4
.IX Item "*<<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf>>"
.IP "*<<\fBhttp://www.dolby.com/uploadedFiles/zz\-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf\fR>>" 4
.IX Item "*<<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf>>"
.PD
.PP
Metadata Control Options
.IX Subsection "Metadata Control Options"
.IP "\fB\-per_frame_metadata\fR \fIboolean\fR" 4
.IX Item "-per_frame_metadata boolean"
Allow Per-Frame Metadata. Specifies if the encoder should check for changing
metadata for each frame.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
The metadata values set at initialization will be used for every frame in the
stream. (default)
.IP "\fB1\fR" 4
.IX Item "1"
Metadata values can be changed before encoding each frame.
.RE
.RS 4
.RE
.PP
Downmix Levels
.IX Subsection "Downmix Levels"
.IP "\fB\-center_mixlev\fR \fIlevel\fR" 4
.IX Item "-center_mixlev level"
Center Mix Level. The amount of gain the decoder should apply to the center
channel when downmixing to stereo. This field will only be written to the
bitstream if a center channel is present. The value is specified as a scale
factor. There are 3 valid values:
.RS 4
.IP "\fB0.707\fR" 4
.IX Item "0.707"
Apply \-3dB gain
.IP "\fB0.595\fR" 4
.IX Item "0.595"
Apply \-4.5dB gain (default)
.IP "\fB0.500\fR" 4
.IX Item "0.500"
Apply \-6dB gain
.RE
.RS 4
.RE
.IP "\fB\-surround_mixlev\fR \fIlevel\fR" 4
.IX Item "-surround_mixlev level"
Surround Mix Level. The amount of gain the decoder should apply to the surround
channel(s) when downmixing to stereo. This field will only be written to the
bitstream if one or more surround channels are present. The value is specified
as a scale factor.  There are 3 valid values:
.RS 4
.IP "\fB0.707\fR" 4
.IX Item "0.707"
Apply \-3dB gain
.IP "\fB0.500\fR" 4
.IX Item "0.500"
Apply \-6dB gain (default)
.IP "\fB0.000\fR" 4
.IX Item "0.000"
Silence Surround Channel(s)
.RE
.RS 4
.RE
.PP
Audio Production Information
.IX Subsection "Audio Production Information"
.PP
Audio Production Information is optional information describing the mixing
environment.  Either none or both of the fields are written to the bitstream.
.IP "\fB\-mixing_level\fR \fInumber\fR" 4
.IX Item "-mixing_level number"
Mixing Level. Specifies peak sound pressure level (\s-1SPL\s0) in the production
environment when the mix was mastered. Valid values are 80 to 111, or \-1 for
unknown or not indicated. The default value is \-1, but that value cannot be
used if the Audio Production Information is written to the bitstream. Therefore,
if the \f(CW\*(C`room_type\*(C'\fR option is not the default value, the \f(CW\*(C`mixing_level\*(C'\fR
option must not be \-1.
.IP "\fB\-room_type\fR \fItype\fR" 4
.IX Item "-room_type type"
Room Type. Describes the equalization used during the final mixing session at
the studio or on the dubbing stage. A large room is a dubbing stage with the
industry standard X\-curve equalization; a small room has flat equalization.
This field will not be written to the bitstream if both the \f(CW\*(C`mixing_level\*(C'\fR
option and the \f(CW\*(C`room_type\*(C'\fR option have the default values.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBnotindicated\fR" 4
.IX Item "notindicated"
.PD
Not Indicated (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBlarge\fR" 4
.IX Item "large"
.PD
Large Room
.IP "\fB2\fR" 4
.IX Item "2"
.PD 0
.IP "\fBsmall\fR" 4
.IX Item "small"
.PD
Small Room
.RE
.RS 4
.RE
.PP
Other Metadata Options
.IX Subsection "Other Metadata Options"
.IP "\fB\-copyright\fR \fIboolean\fR" 4
.IX Item "-copyright boolean"
Copyright Indicator. Specifies whether a copyright exists for this audio.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBoff\fR" 4
.IX Item "off"
.PD
No Copyright Exists (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBon\fR" 4
.IX Item "on"
.PD
Copyright Exists
.RE
.RS 4
.RE
.IP "\fB\-dialnorm\fR \fIvalue\fR" 4
.IX Item "-dialnorm value"
Dialogue Normalization. Indicates how far the average dialogue level of the
program is below digital 100% full scale (0 dBFS). This parameter determines a
level shift during audio reproduction that sets the average volume of the
dialogue to a preset level. The goal is to match volume level between program
sources. A value of \-31dB will result in no volume level change, relative to
the source volume, during audio reproduction. Valid values are whole numbers in
the range \-31 to \-1, with \-31 being the default.
.IP "\fB\-dsur_mode\fR \fImode\fR" 4
.IX Item "-dsur_mode mode"
Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
(Pro Logic). This field will only be written to the bitstream if the audio
stream is stereo. Using this option does \fB\s-1NOT\s0\fR mean the encoder will actually
apply Dolby Surround processing.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBnotindicated\fR" 4
.IX Item "notindicated"
.PD
Not Indicated (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBoff\fR" 4
.IX Item "off"
.PD
Not Dolby Surround Encoded
.IP "\fB2\fR" 4
.IX Item "2"
.PD 0
.IP "\fBon\fR" 4
.IX Item "on"
.PD
Dolby Surround Encoded
.RE
.RS 4
.RE
.IP "\fB\-original\fR \fIboolean\fR" 4
.IX Item "-original boolean"
Original Bit Stream Indicator. Specifies whether this audio is from the
original source and not a copy.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBoff\fR" 4
.IX Item "off"
.PD
Not Original Source
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBon\fR" 4
.IX Item "on"
.PD
Original Source (default)
.RE
.RS 4
.RE
.PP
\fIExtended Bitstream Information\fR
.IX Subsection "Extended Bitstream Information"
.PP
The extended bitstream options are part of the Alternate Bit Stream Syntax as
specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
If any one parameter in a group is specified, all values in that group will be
written to the bitstream.  Default values are used for those that are written
but have not been specified.  If the mixing levels are written, the decoder
will use these values instead of the ones specified in the \f(CW\*(C`center_mixlev\*(C'\fR
and \f(CW\*(C`surround_mixlev\*(C'\fR options if it supports the Alternate Bit Stream
Syntax.
.PP
Extended Bitstream Information \- Part 1
.IX Subsection "Extended Bitstream Information - Part 1"
.IP "\fB\-dmix_mode\fR \fImode\fR" 4
.IX Item "-dmix_mode mode"
Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBnotindicated\fR" 4
.IX Item "notindicated"
.PD
Not Indicated (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBltrt\fR" 4
.IX Item "ltrt"
.PD
Lt/Rt Downmix Preferred
.IP "\fB2\fR" 4
.IX Item "2"
.PD 0
.IP "\fBloro\fR" 4
.IX Item "loro"
.PD
Lo/Ro Downmix Preferred
.RE
.RS 4
.RE
.IP "\fB\-ltrt_cmixlev\fR \fIlevel\fR" 4
.IX Item "-ltrt_cmixlev level"
Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
center channel when downmixing to stereo in Lt/Rt mode.
.RS 4
.IP "\fB1.414\fR" 4
.IX Item "1.414"
Apply +3dB gain
.IP "\fB1.189\fR" 4
.IX Item "1.189"
Apply +1.5dB gain
.IP "\fB1.000\fR" 4
.IX Item "1.000"
Apply 0dB gain
.IP "\fB0.841\fR" 4
.IX Item "0.841"
Apply \-1.5dB gain
.IP "\fB0.707\fR" 4
.IX Item "0.707"
Apply \-3.0dB gain
.IP "\fB0.595\fR" 4
.IX Item "0.595"
Apply \-4.5dB gain (default)
.IP "\fB0.500\fR" 4
.IX Item "0.500"
Apply \-6.0dB gain
.IP "\fB0.000\fR" 4
.IX Item "0.000"
Silence Center Channel
.RE
.RS 4
.RE
.IP "\fB\-ltrt_surmixlev\fR \fIlevel\fR" 4
.IX Item "-ltrt_surmixlev level"
Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
surround channel(s) when downmixing to stereo in Lt/Rt mode.
.RS 4
.IP "\fB0.841\fR" 4
.IX Item "0.841"
Apply \-1.5dB gain
.IP "\fB0.707\fR" 4
.IX Item "0.707"
Apply \-3.0dB gain
.IP "\fB0.595\fR" 4
.IX Item "0.595"
Apply \-4.5dB gain
.IP "\fB0.500\fR" 4
.IX Item "0.500"
Apply \-6.0dB gain (default)
.IP "\fB0.000\fR" 4
.IX Item "0.000"
Silence Surround Channel(s)
.RE
.RS 4
.RE
.IP "\fB\-loro_cmixlev\fR \fIlevel\fR" 4
.IX Item "-loro_cmixlev level"
Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
center channel when downmixing to stereo in Lo/Ro mode.
.RS 4
.IP "\fB1.414\fR" 4
.IX Item "1.414"
Apply +3dB gain
.IP "\fB1.189\fR" 4
.IX Item "1.189"
Apply +1.5dB gain
.IP "\fB1.000\fR" 4
.IX Item "1.000"
Apply 0dB gain
.IP "\fB0.841\fR" 4
.IX Item "0.841"
Apply \-1.5dB gain
.IP "\fB0.707\fR" 4
.IX Item "0.707"
Apply \-3.0dB gain
.IP "\fB0.595\fR" 4
.IX Item "0.595"
Apply \-4.5dB gain (default)
.IP "\fB0.500\fR" 4
.IX Item "0.500"
Apply \-6.0dB gain
.IP "\fB0.000\fR" 4
.IX Item "0.000"
Silence Center Channel
.RE
.RS 4
.RE
.IP "\fB\-loro_surmixlev\fR \fIlevel\fR" 4
.IX Item "-loro_surmixlev level"
Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
surround channel(s) when downmixing to stereo in Lo/Ro mode.
.RS 4
.IP "\fB0.841\fR" 4
.IX Item "0.841"
Apply \-1.5dB gain
.IP "\fB0.707\fR" 4
.IX Item "0.707"
Apply \-3.0dB gain
.IP "\fB0.595\fR" 4
.IX Item "0.595"
Apply \-4.5dB gain
.IP "\fB0.500\fR" 4
.IX Item "0.500"
Apply \-6.0dB gain (default)
.IP "\fB0.000\fR" 4
.IX Item "0.000"
Silence Surround Channel(s)
.RE
.RS 4
.RE
.PP
Extended Bitstream Information \- Part 2
.IX Subsection "Extended Bitstream Information - Part 2"
.IP "\fB\-dsurex_mode\fR \fImode\fR" 4
.IX Item "-dsurex_mode mode"
Dolby Surround \s-1EX\s0 Mode. Indicates whether the stream uses Dolby Surround \s-1EX\s0
(7.1 matrixed to 5.1). Using this option does \fB\s-1NOT\s0\fR mean the encoder will actually
apply Dolby Surround \s-1EX\s0 processing.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBnotindicated\fR" 4
.IX Item "notindicated"
.PD
Not Indicated (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBon\fR" 4
.IX Item "on"
.PD
Dolby Surround \s-1EX\s0 Off
.IP "\fB2\fR" 4
.IX Item "2"
.PD 0
.IP "\fBoff\fR" 4
.IX Item "off"
.PD
Dolby Surround \s-1EX\s0 On
.RE
.RS 4
.RE
.IP "\fB\-dheadphone_mode\fR \fImode\fR" 4
.IX Item "-dheadphone_mode mode"
Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
option does \fB\s-1NOT\s0\fR mean the encoder will actually apply Dolby Headphone
processing.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBnotindicated\fR" 4
.IX Item "notindicated"
.PD
Not Indicated (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBon\fR" 4
.IX Item "on"
.PD
Dolby Headphone Off
.IP "\fB2\fR" 4
.IX Item "2"
.PD 0
.IP "\fBoff\fR" 4
.IX Item "off"
.PD
Dolby Headphone On
.RE
.RS 4
.RE
.IP "\fB\-ad_conv_type\fR \fItype\fR" 4
.IX Item "-ad_conv_type type"
A/D Converter Type. Indicates whether the audio has passed through \s-1HDCD\s0 A/D
conversion.
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBstandard\fR" 4
.IX Item "standard"
.PD
Standard A/D Converter (default)
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBhdcd\fR" 4
.IX Item "hdcd"
.PD
\&\s-1HDCD\s0 A/D Converter
.RE
.RS 4
.RE
.PP
\fIOther \s-1AC\-3\s0 Encoding Options\fR
.IX Subsection "Other AC-3 Encoding Options"
.IP "\fB\-stereo_rematrixing\fR \fIboolean\fR" 4
.IX Item "-stereo_rematrixing boolean"
Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
is an optional \s-1AC\-3\s0 feature that increases quality by selectively encoding
the left/right channels as mid/side. This option is enabled by default, and it
is highly recommended that it be left as enabled except for testing purposes.
.PP
\fIFloating-Point-Only \s-1AC\-3\s0 Encoding Options\fR
.IX Subsection "Floating-Point-Only AC-3 Encoding Options"
.PP
These options are only valid for the floating-point encoder and do not exist
for the fixed-point encoder due to the corresponding features not being
implemented in fixed-point.
.IP "\fB\-channel_coupling\fR \fIboolean\fR" 4
.IX Item "-channel_coupling boolean"
Enables/Disables use of channel coupling, which is an optional \s-1AC\-3\s0 feature
that increases quality by combining high frequency information from multiple
channels into a single channel. The per-channel high frequency information is
sent with less accuracy in both the frequency and time domains. This allows
more bits to be used for lower frequencies while preserving enough information
to reconstruct the high frequencies. This option is enabled by default for the
floating-point encoder and should generally be left as enabled except for
testing purposes or to increase encoding speed.
.RS 4
.IP "\fB\-1\fR" 4
.IX Item "-1"
.PD 0
.IP "\fBauto\fR" 4
.IX Item "auto"
.PD
Selected by Encoder (default)
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBoff\fR" 4
.IX Item "off"
.PD
Disable Channel Coupling
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBon\fR" 4
.IX Item "on"
.PD
Enable Channel Coupling
.RE
.RS 4
.RE
.IP "\fB\-cpl_start_band\fR \fInumber\fR" 4
.IX Item "-cpl_start_band number"
Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
value higher than the bandwidth is used, it will be reduced to 1 less than the
coupling end band. If \fIauto\fR is used, the start band will be determined by
the encoder based on the bit rate, sample rate, and channel layout. This option
has no effect if channel coupling is disabled.
.RS 4
.IP "\fB\-1\fR" 4
.IX Item "-1"
.PD 0
.IP "\fBauto\fR" 4
.IX Item "auto"
.PD
Selected by Encoder (default)
.RE
.RS 4
.RE
.SH "VIDEO ENCODERS"
.IX Header "VIDEO ENCODERS"
A description of some of the currently available video encoders
follows.
.SS "libtheora"
.IX Subsection "libtheora"
Theora format supported through libtheora.
.PP
Requires the presence of the libtheora headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libtheora\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following global options are mapped to internal libtheora options
which affect the quality and the bitrate of the encoded stream.
.IP "\fBb\fR" 4
.IX Item "b"
Set the video bitrate, only works if the \f(CW\*(C`qscale\*(C'\fR flag in
\&\fBflags\fR is not enabled.
.IP "\fBflags\fR" 4
.IX Item "flags"
Used to enable constant quality mode encoding through the
\&\fBqscale\fR flag, and to enable the \f(CW\*(C`pass1\*(C'\fR and \f(CW\*(C`pass2\*(C'\fR
modes.
.IP "\fBg\fR" 4
.IX Item "g"
Set the \s-1GOP\s0 size.
.IP "\fBglobal_quality\fR" 4
.IX Item "global_quality"
Set the global quality in lambda units, only works if the
\&\f(CW\*(C`qscale\*(C'\fR flag in \fBflags\fR is enabled. The value is clipped
in the [0 \- 10*\f(CW\*(C`FF_QP2LAMBDA\*(C'\fR] range, and then multiplied for 6.3
to get a value in the native libtheora range [0\-63]. A higher value
corresponds to a higher quality.
.Sp
For example, to set maximum constant quality encoding with
\&\fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-flags:v qscale \-global_quality:v "10*QP2LAMBDA" \-codec:v libtheora OUTPUT.ogg
.Ve
.SS "libvpx"
.IX Subsection "libvpx"
\&\s-1VP8\s0 format supported through libvpx.
.PP
Requires the presence of the libvpx headers and library during configuration.
You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libvpx\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
.IP "\fBthreads\fR" 4
.IX Item "threads"
g_threads
.IP "\fBprofile\fR" 4
.IX Item "profile"
g_profile
.IP "\fBvb\fR" 4
.IX Item "vb"
rc_target_bitrate
.IP "\fBg\fR" 4
.IX Item "g"
kf_max_dist
.IP "\fBkeyint_min\fR" 4
.IX Item "keyint_min"
kf_min_dist
.IP "\fBqmin\fR" 4
.IX Item "qmin"
rc_min_quantizer
.IP "\fBqmax\fR" 4
.IX Item "qmax"
rc_max_quantizer
.IP "\fBbufsize, vb\fR" 4
.IX Item "bufsize, vb"
rc_buf_sz
\&\f(CW\*(C`(bufsize * 1000 / vb)\*(C'\fR
.Sp
rc_buf_optimal_sz
\&\f(CW\*(C`(bufsize * 1000 / vb * 5 / 6)\*(C'\fR
.IP "\fBrc_init_occupancy, vb\fR" 4
.IX Item "rc_init_occupancy, vb"
rc_buf_initial_sz
\&\f(CW\*(C`(rc_init_occupancy * 1000 / vb)\*(C'\fR
.IP "\fBrc_buffer_aggressivity\fR" 4
.IX Item "rc_buffer_aggressivity"
rc_undershoot_pct
.IP "\fBskip_threshold\fR" 4
.IX Item "skip_threshold"
rc_dropframe_thresh
.IP "\fBqcomp\fR" 4
.IX Item "qcomp"
rc_2pass_vbr_bias_pct
.IP "\fBmaxrate, vb\fR" 4
.IX Item "maxrate, vb"
rc_2pass_vbr_maxsection_pct
\&\f(CW\*(C`(maxrate * 100 / vb)\*(C'\fR
.IP "\fBminrate, vb\fR" 4
.IX Item "minrate, vb"
rc_2pass_vbr_minsection_pct
\&\f(CW\*(C`(minrate * 100 / vb)\*(C'\fR
.IP "\fBminrate, maxrate, vb\fR" 4
.IX Item "minrate, maxrate, vb"
\&\f(CW\*(C`VPX_CBR\*(C'\fR
\&\f(CW\*(C`(minrate == maxrate == vb)\*(C'\fR
.IP "\fBcrf\fR" 4
.IX Item "crf"
\&\f(CW\*(C`VPX_CQ\*(C'\fR, \f(CW\*(C`VP8E_SET_CQ_LEVEL\*(C'\fR
.IP "\fBquality\fR" 4
.IX Item "quality"
.RS 4
.PD 0
.IP "\fIbest\fR" 4
.IX Item "best"
.PD
\&\f(CW\*(C`VPX_DL_BEST_QUALITY\*(C'\fR
.IP "\fIgood\fR" 4
.IX Item "good"
\&\f(CW\*(C`VPX_DL_GOOD_QUALITY\*(C'\fR
.IP "\fIrealtime\fR" 4
.IX Item "realtime"
\&\f(CW\*(C`VPX_DL_REALTIME\*(C'\fR
.RE
.RS 4
.RE
.IP "\fBspeed\fR" 4
.IX Item "speed"
\&\f(CW\*(C`VP8E_SET_CPUUSED\*(C'\fR
.IP "\fBnr\fR" 4
.IX Item "nr"
\&\f(CW\*(C`VP8E_SET_NOISE_SENSITIVITY\*(C'\fR
.IP "\fBmb_threshold\fR" 4
.IX Item "mb_threshold"
\&\f(CW\*(C`VP8E_SET_STATIC_THRESHOLD\*(C'\fR
.IP "\fBslices\fR" 4
.IX Item "slices"
\&\f(CW\*(C`VP8E_SET_TOKEN_PARTITIONS\*(C'\fR
.IP "\fBmax-intra-rate\fR" 4
.IX Item "max-intra-rate"
\&\f(CW\*(C`VP8E_SET_MAX_INTRA_BITRATE_PCT\*(C'\fR
.IP "\fBforce_key_frames\fR" 4
.IX Item "force_key_frames"
\&\f(CW\*(C`VPX_EFLAG_FORCE_KF\*(C'\fR
.IP "\fBAlternate reference frame related\fR" 4
.IX Item "Alternate reference frame related"
.RS 4
.PD 0
.IP "\fBvp8flags altref\fR" 4
.IX Item "vp8flags altref"
.PD
\&\f(CW\*(C`VP8E_SET_ENABLEAUTOALTREF\*(C'\fR
.IP "\fIarnr_max_frames\fR" 4
.IX Item "arnr_max_frames"
\&\f(CW\*(C`VP8E_SET_ARNR_MAXFRAMES\*(C'\fR
.IP "\fIarnr_type\fR" 4
.IX Item "arnr_type"
\&\f(CW\*(C`VP8E_SET_ARNR_TYPE\*(C'\fR
.IP "\fIarnr_strength\fR" 4
.IX Item "arnr_strength"
\&\f(CW\*(C`VP8E_SET_ARNR_STRENGTH\*(C'\fR
.IP "\fIrc_lookahead\fR" 4
.IX Item "rc_lookahead"
g_lag_in_frames
.RE
.RS 4
.RE
.IP "\fBvp8flags error_resilient\fR" 4
.IX Item "vp8flags error_resilient"
g_error_resilient
.PP
For more information about libvpx see:
<\fBhttp://www.webmproject.org/\fR>
.SS "libx264"
.IX Subsection "libx264"
x264 H.264/MPEG\-4 \s-1AVC\s0 encoder wrapper
.PP
Requires the presence of the libx264 headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libx264\*(C'\fR.
.PP
x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
spatial transform, adaptive B\-frame placement, \s-1CAVLC/CABAC\s0 entropy coding,
interlacing (\s-1MBAFF\s0), lossless mode, psy optimizations for detail retention
(adaptive quantization, psy-RD, psy-trellis).
.PP
The FFmpeg wrapper provides a mapping for most of them using global options
that match those of the encoders and provides private options for the unique
encoder options. Additionally an expert override is provided to directly pass
a list of key=value tuples as accepted by x264_param_parse.
.PP
\fIOption Mapping\fR
.IX Subsection "Option Mapping"
.PP
The following options are supported by the x264 wrapper, the x264\-equivalent
options follow the FFmpeg ones.
.IP "\fBb                  :  bitrate\fR" 4
.IX Item "b                  :  bitrate"
FFmpeg \f(CW\*(C`b\*(C'\fR option is expressed in bits/s, x264 \f(CW\*(C`bitrate\*(C'\fR in kilobits/s.
.IP "\fBbf                 :  bframes\fR" 4
.IX Item "bf                 :  bframes"
Maximum number of B\-frames.
.IP "\fBg                  :  keyint\fR" 4
.IX Item "g                  :  keyint"
Maximum \s-1GOP\s0 size.
.IP "\fBqmin               :  qpmin\fR" 4
.IX Item "qmin               :  qpmin"
.PD 0
.IP "\fBqmax               :  qpmax\fR" 4
.IX Item "qmax               :  qpmax"
.IP "\fBqdiff              :  qpstep\fR" 4
.IX Item "qdiff              :  qpstep"
.IP "\fBqblur              :  qblur\fR" 4
.IX Item "qblur              :  qblur"
.IP "\fBqcomp              :  qcomp\fR" 4
.IX Item "qcomp              :  qcomp"
.IP "\fBrefs               :  ref\fR" 4
.IX Item "refs               :  ref"
.IP "\fBsc_threshold       :  scenecut\fR" 4
.IX Item "sc_threshold       :  scenecut"
.IP "\fBtrellis            :  trellis\fR" 4
.IX Item "trellis            :  trellis"
.IP "\fBnr                 :  nr\fR" 4
.IX Item "nr                 :  nr"
.PD
Noise reduction.
.IP "\fBme_range           :  merange\fR" 4
.IX Item "me_range           :  merange"
.PD 0
.IP "\fBme_method          :  me\fR" 4
.IX Item "me_method          :  me"
.IP "\fBsubq               :  subme\fR" 4
.IX Item "subq               :  subme"
.IP "\fBb_strategy         :  b\-adapt\fR" 4
.IX Item "b_strategy         :  b-adapt"
.IP "\fBkeyint_min         :  keyint-min\fR" 4
.IX Item "keyint_min         :  keyint-min"
.IP "\fBcoder              :  cabac\fR" 4
.IX Item "coder              :  cabac"
.PD
Set coder to \f(CW\*(C`ac\*(C'\fR to use \s-1CABAC\s0.
.IP "\fBcmp                :  chroma-me\fR" 4
.IX Item "cmp                :  chroma-me"
Set to \f(CW\*(C`chroma\*(C'\fR to use chroma motion estimation.
.IP "\fBthreads            :  threads\fR" 4
.IX Item "threads            :  threads"
.PD 0
.IP "\fBthread_type        :  sliced_threads\fR" 4
.IX Item "thread_type        :  sliced_threads"
.PD
Set to \f(CW\*(C`slice\*(C'\fR to use sliced threading instead of frame threading.
.IP "\fBflags \-cgop        :  open-gop\fR" 4
.IX Item "flags -cgop        :  open-gop"
Set \f(CW\*(C`\-cgop\*(C'\fR to use recovery points to close GOPs.
.IP "\fBrc_init_occupancy  :  vbv-init\fR" 4
.IX Item "rc_init_occupancy  :  vbv-init"
Initial buffer occupancy.
.PP
\fIPrivate Options\fR
.IX Subsection "Private Options"
.IP "\fB\-preset\fR \fIstring\fR" 4
.IX Item "-preset string"
Set the encoding preset (cf. x264 \-\-fullhelp).
.IP "\fB\-tune\fR \fIstring\fR" 4
.IX Item "-tune string"
Tune the encoding params (cf. x264 \-\-fullhelp).
.IP "\fB\-profile\fR \fIstring\fR" 4
.IX Item "-profile string"
Set profile restrictions (cf. x264 \-\-fullhelp).
.IP "\fB\-fastfirstpass\fR \fIinteger\fR" 4
.IX Item "-fastfirstpass integer"
Use fast settings when encoding first pass.
.IP "\fB\-crf\fR \fIfloat\fR" 4
.IX Item "-crf float"
Select the quality for constant quality mode.
.IP "\fB\-crf_max\fR \fIfloat\fR" 4
.IX Item "-crf_max float"
In \s-1CRF\s0 mode, prevents \s-1VBV\s0 from lowering quality beyond this point.
.IP "\fB\-qp\fR \fIinteger\fR" 4
.IX Item "-qp integer"
Constant quantization parameter rate control method.
.IP "\fB\-aq\-mode\fR \fIinteger\fR" 4
.IX Item "-aq-mode integer"
\&\s-1AQ\s0 method
.Sp
Possible values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBvariance\fR" 4
.IX Item "variance"
.PD
Variance \s-1AQ\s0 (complexity mask).
.IP "\fBautovariance\fR" 4
.IX Item "autovariance"
Auto-variance \s-1AQ\s0 (experimental).
.RE
.RS 4
.RE
.IP "\fB\-aq\-strength\fR \fIfloat\fR" 4
.IX Item "-aq-strength float"
\&\s-1AQ\s0 strength, reduces blocking and blurring in flat and textured areas.
.IP "\fB\-psy\fR \fIinteger\fR" 4
.IX Item "-psy integer"
Use psychovisual optimizations.
.IP "\fB\-psy\-rd\fR \fIstring\fR" 4
.IX Item "-psy-rd string"
Strength of psychovisual optimization, in <psy\-rd>:<psy\-trellis> format.
.IP "\fB\-rc\-lookahead\fR \fIinteger\fR" 4
.IX Item "-rc-lookahead integer"
Number of frames to look ahead for frametype and ratecontrol.
.IP "\fB\-weightb\fR \fIinteger\fR" 4
.IX Item "-weightb integer"
Weighted prediction for B\-frames.
.IP "\fB\-weightp\fR \fIinteger\fR" 4
.IX Item "-weightp integer"
Weighted prediction analysis method.
.Sp
Possible values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBsimple\fR" 4
.IX Item "simple"
.IP "\fBsmart\fR" 4
.IX Item "smart"
.RE
.RS 4
.RE
.IP "\fB\-ssim\fR \fIinteger\fR" 4
.IX Item "-ssim integer"
.PD
Calculate and print \s-1SSIM\s0 stats.
.IP "\fB\-intra\-refresh\fR \fIinteger\fR" 4
.IX Item "-intra-refresh integer"
Use Periodic Intra Refresh instead of \s-1IDR\s0 frames.
.IP "\fB\-b\-bias\fR \fIinteger\fR" 4
.IX Item "-b-bias integer"
Influences how often B\-frames are used.
.IP "\fB\-b\-pyramid\fR \fIinteger\fR" 4
.IX Item "-b-pyramid integer"
Keep some B\-frames as references.
.Sp
Possible values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBstrict\fR" 4
.IX Item "strict"
.PD
Strictly hierarchical pyramid.
.IP "\fBnormal\fR" 4
.IX Item "normal"
Non-strict (not Blu-ray compatible).
.RE
.RS 4
.RE
.IP "\fB\-mixed\-refs\fR \fIinteger\fR" 4
.IX Item "-mixed-refs integer"
One reference per partition, as opposed to one reference per macroblock.
.IP "\fB\-8x8dct\fR \fIinteger\fR" 4
.IX Item "-8x8dct integer"
High profile 8x8 transform.
.IP "\fB\-fast\-pskip\fR \fIinteger\fR" 4
.IX Item "-fast-pskip integer"
.PD 0
.IP "\fB\-aud\fR \fIinteger\fR" 4
.IX Item "-aud integer"
.PD
Use access unit delimiters.
.IP "\fB\-mbtree\fR \fIinteger\fR" 4
.IX Item "-mbtree integer"
Use macroblock tree ratecontrol.
.IP "\fB\-deblock\fR \fIstring\fR" 4
.IX Item "-deblock string"
Loop filter parameters, in <alpha:beta> form.
.IP "\fB\-cplxblur\fR \fIfloat\fR" 4
.IX Item "-cplxblur float"
Reduce fluctuations in \s-1QP\s0 (before curve compression).
.IP "\fB\-partitions\fR \fIstring\fR" 4
.IX Item "-partitions string"
A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
.IP "\fB\-direct\-pred\fR \fIinteger\fR" 4
.IX Item "-direct-pred integer"
Direct \s-1MV\s0 prediction mode
.Sp
Possible values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBspatial\fR" 4
.IX Item "spatial"
.IP "\fBtemporal\fR" 4
.IX Item "temporal"
.IP "\fBauto\fR" 4
.IX Item "auto"
.RE
.RS 4
.RE
.IP "\fB\-slice\-max\-size\fR \fIinteger\fR" 4
.IX Item "-slice-max-size integer"
.PD
Limit the size of each slice in bytes.
.IP "\fB\-stats\fR \fIstring\fR" 4
.IX Item "-stats string"
Filename for 2 pass stats.
.IP "\fB\-nal\-hrd\fR \fIinteger\fR" 4
.IX Item "-nal-hrd integer"
Signal \s-1HRD\s0 information (requires vbv-bufsize; cbr not allowed in .mp4).
.Sp
Possible values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBvbr\fR" 4
.IX Item "vbr"
.IP "\fBcbr\fR" 4
.IX Item "cbr"
.RE
.RS 4
.RE
.IP "\fBx264opts\fR \fIoptions\fR" 4
.IX Item "x264opts options"
.PD
Allow to set any x264 option, see \f(CW\*(C`x264 \-\-fullhelp\*(C'\fR for a list.
.Sp
\&\fIoptions\fR is a list of \fIkey\fR=\fIvalue\fR couples separated by
\&\*(L":\*(R". In \fIfilter\fR and \fIpsy-rd\fR options that use \*(L":\*(R" as a separator
themselves, use \*(L",\*(R" instead. They accept it as well since long ago but this
is kept undocumented for some reason.
.Sp
For example to specify libx264 encoding options with \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i foo.mpg \-vcodec libx264 \-x264opts keyint=123:min\-keyint=20 \-an out.mkv
.Ve
.Sp
For more information about libx264 and the supported options see:
<\fBhttp://www.videolan.org/developers/x264.html\fR>
.IP "\fB\-x264\-params\fR \fIstring\fR" 4
.IX Item "-x264-params string"
Override the x264 configuration using a :\-separated list of key=value parameters.
.Sp
.Vb 1
\&        \-x264\-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv\-maxrate=768:vbv\-bufsize=2000:analyse=all:me=umh:no\-fast\-pskip=1:subq=6:8x8dct=0:trellis=0
.Ve
.PP
Encoding avpresets for common usages are provided so they can be used with the
general presets system (e.g. passing the \f(CW\*(C`\-pre\*(C'\fR option).
.SS "ProRes"
.IX Subsection "ProRes"
Apple ProRes encoder.
.PP
FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
The used encoder can be choosen with the \f(CW\*(C`\-vcodec\*(C'\fR option.
.PP
\fIPrivate Options for prores-ks\fR
.IX Subsection "Private Options for prores-ks"
.IP "\fBprofile\fR \fIinteger\fR" 4
.IX Item "profile integer"
Select the ProRes profile to encode
.RS 4
.IP "\fBproxy\fR" 4
.IX Item "proxy"
.PD 0
.IP "\fBlt\fR" 4
.IX Item "lt"
.IP "\fBstandard\fR" 4
.IX Item "standard"
.IP "\fBhq\fR" 4
.IX Item "hq"
.RE
.RS 4
.RE
.IP "\fBquant_mat\fR \fIinteger\fR" 4
.IX Item "quant_mat integer"
.PD
Select quantization matrix.
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
.PD 0
.IP "\fBdefault\fR" 4
.IX Item "default"
.IP "\fBproxy\fR" 4
.IX Item "proxy"
.IP "\fBlt\fR" 4
.IX Item "lt"
.IP "\fBstandard\fR" 4
.IX Item "standard"
.IP "\fBhq\fR" 4
.IX Item "hq"
.RE
.RS 4
.PD
.Sp
If set to \fIauto\fR, the matrix matching the profile will be picked.
If not set, the matrix providing the highest quality, \fIdefault\fR, will be
picked.
.RE
.IP "\fBbits_per_mb\fR \fIinteger\fR" 4
.IX Item "bits_per_mb integer"
How many bits to allot for coding one macroblock. Different profiles use
between 200 and 2400 bits per macroblock, the maximum is 8000.
.IP "\fBmbs_per_slice\fR \fIinteger\fR" 4
.IX Item "mbs_per_slice integer"
Number of macroblocks in each slice (1\-8); the default value (8)
should be good in almost all situations.
.IP "\fBvendor\fR \fIstring\fR" 4
.IX Item "vendor string"
Override the 4\-byte vendor \s-1ID\s0.
A custom vendor \s-1ID\s0 like \fIapl0\fR would claim the stream was produced by
the Apple encoder.
.PP
\fISpeed considerations\fR
.IX Subsection "Speed considerations"
.PP
In the default mode of operation the encoder has to honor frame constraints
(i.e. not produc frames with size bigger than requested) while still making
output picture as good as possible.
A frame containing a lot of small details is harder to compress and the encoder
would spend more time searching for appropriate quantizers for each slice.
.PP
Setting a higher \fBbits_per_mb\fR limit will improve the speed.
.PP
For the fastest encoding speed set the \fBqscale\fR parameter (4 is the
recommended value) and do not set a size constraint.
.SH "BITSTREAM FILTERS"
.IX Header "BITSTREAM FILTERS"
When you configure your FFmpeg build, all the supported bitstream
filters are enabled by default. You can list all available ones using
the configure option \f(CW\*(C`\-\-list\-bsfs\*(C'\fR.
.PP
You can disable all the bitstream filters using the configure option
\&\f(CW\*(C`\-\-disable\-bsfs\*(C'\fR, and selectively enable any bitstream filter using
the option \f(CW\*(C`\-\-enable\-bsf=BSF\*(C'\fR, or you can disable a particular
bitstream filter using the option \f(CW\*(C`\-\-disable\-bsf=BSF\*(C'\fR.
.PP
The option \f(CW\*(C`\-bsfs\*(C'\fR of the ff* tools will display the list of
all the supported bitstream filters included in your build.
.PP
Below is a description of the currently available bitstream filters.
.SS "aac_adtstoasc"
.IX Subsection "aac_adtstoasc"
.SS "chomp"
.IX Subsection "chomp"
.SS "dump_extradata"
.IX Subsection "dump_extradata"
.SS "h264_mp4toannexb"
.IX Subsection "h264_mp4toannexb"
Convert an H.264 bitstream from length prefixed mode to start code
prefixed mode (as defined in the Annex B of the ITU-T H.264
specification).
.PP
This is required by some streaming formats, typically the \s-1MPEG\-2\s0
transport stream format (\*(L"mpegts\*(R").
.PP
For example to remux an \s-1MP4\s0 file containing an H.264 stream to mpegts
format with \fBffmpeg\fR, you can use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT.mp4 \-codec copy \-bsf:v h264_mp4toannexb OUTPUT.ts
.Ve
.SS "imx_dump_header"
.IX Subsection "imx_dump_header"
.SS "mjpeg2jpeg"
.IX Subsection "mjpeg2jpeg"
Convert \s-1MJPEG/AVI1\s0 packets to full \s-1JPEG/JFIF\s0 packets.
.PP
\&\s-1MJPEG\s0 is a video codec wherein each video frame is essentially a
\&\s-1JPEG\s0 image. The individual frames can be extracted without loss,
e.g. by
.PP
.Vb 1
\&        ffmpeg \-i ../some_mjpeg.avi \-c:v copy frames_%d.jpg
.Ve
.PP
Unfortunately, these chunks are incomplete \s-1JPEG\s0 images, because
they lack the \s-1DHT\s0 segment required for decoding. Quoting from
<\fBhttp://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml\fR>:
.PP
Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
commented that \*(L"\s-1MJPEG\s0, or at least the \s-1MJPEG\s0 in AVIs having the
\&\s-1MJPG\s0 fourcc, is restricted \s-1JPEG\s0 with a fixed \*(-- and *omitted* \*(--
Huffman table. The \s-1JPEG\s0 must be YCbCr colorspace, it must be 4:2:2,
and it must use basic Huffman encoding, not arithmetic or
progressive. . . . You can indeed extract the \s-1MJPEG\s0 frames and
decode them with a regular \s-1JPEG\s0 decoder, but you have to prepend
the \s-1DHT\s0 segment to them, or else the decoder won't have any idea
how to decompress the data. The exact table necessary is given in
the OpenDML spec.\*(R"
.PP
This bitstream filter patches the header of frames extracted from an \s-1MJPEG\s0
stream (carrying the \s-1AVI1\s0 header \s-1ID\s0 and lacking a \s-1DHT\s0 segment) to
produce fully qualified \s-1JPEG\s0 images.
.PP
.Vb 3
\&        ffmpeg \-i mjpeg\-movie.avi \-c:v copy \-bsf:v mjpeg2jpeg frame_%d.jpg
\&        exiftran \-i \-9 frame*.jpg
\&        ffmpeg \-i frame_%d.jpg \-c:v copy rotated.avi
.Ve
.SS "mjpega_dump_header"
.IX Subsection "mjpega_dump_header"
.SS "movsub"
.IX Subsection "movsub"
.SS "mp3_header_compress"
.IX Subsection "mp3_header_compress"
.SS "mp3_header_decompress"
.IX Subsection "mp3_header_decompress"
.SS "noise"
.IX Subsection "noise"
.SS "remove_extradata"
.IX Subsection "remove_extradata"
.SH "FORMAT OPTIONS"
.IX Header "FORMAT OPTIONS"
The libavformat library provides some generic global options, which
can be set on all the muxers and demuxers. In addition each muxer or
demuxer may support so-called private options, which are specific for
that component.
.PP
Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
FFmpeg tools, or by setting the value explicitly in the
\&\f(CW\*(C`AVFormatContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0
for programmatic use.
.PP
The list of supported options follows:
.IP "\fBavioflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "avioflags flags (input/output)"
Possible values:
.RS 4
.IP "\fBdirect\fR" 4
.IX Item "direct"
Reduce buffering.
.RE
.RS 4
.RE
.IP "\fBprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "probesize integer (input)"
Set probing size in bytes, i.e. the size of the data to analyze to get
stream information. A higher value will allow to detect more
information in case it is dispersed into the stream, but will increase
latency. Must be an integer not lesser than 32. It is 5000000 by default.
.IP "\fBpacketsize\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "packetsize integer (output)"
Set packet size.
.IP "\fBfflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "fflags flags (input/output)"
Set format flags.
.Sp
Possible values:
.RS 4
.IP "\fBignidx\fR" 4
.IX Item "ignidx"
Ignore index.
.IP "\fBgenpts\fR" 4
.IX Item "genpts"
Generate \s-1PTS\s0.
.IP "\fBnofillin\fR" 4
.IX Item "nofillin"
Do not fill in missing values that can be exactly calculated.
.IP "\fBnoparse\fR" 4
.IX Item "noparse"
Disable AVParsers, this needs \f(CW\*(C`+nofillin\*(C'\fR too.
.IP "\fBigndts\fR" 4
.IX Item "igndts"
Ignore \s-1DTS\s0.
.IP "\fBdiscardcorrupt\fR" 4
.IX Item "discardcorrupt"
Discard corrupted frames.
.IP "\fBsortdts\fR" 4
.IX Item "sortdts"
Try to interleave output packets by \s-1DTS\s0.
.IP "\fBkeepside\fR" 4
.IX Item "keepside"
Do not merge side data.
.IP "\fBlatm\fR" 4
.IX Item "latm"
Enable \s-1RTP\s0 \s-1MP4A\-LATM\s0 payload.
.IP "\fBnobuffer\fR" 4
.IX Item "nobuffer"
Reduce the latency introduced by optional buffering
.RE
.RS 4
.RE
.IP "\fBanalyzeduration\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "analyzeduration integer (input)"
Specify how many microseconds are analyzed to probe the input. A
higher value will allow to detect more accurate information, but will
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
.IP "\fBcryptokey\fR \fIhexadecimal string\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "cryptokey hexadecimal string (input)"
Set decryption key.
.IP "\fBindexmem\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "indexmem integer (input)"
Set max memory used for timestamp index (per stream).
.IP "\fBrtbufsize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "rtbufsize integer (input)"
Set max memory used for buffering real-time frames.
.IP "\fBfdebug\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "fdebug flags (input/output)"
Print specific debug info.
.Sp
Possible values:
.RS 4
.IP "\fBts\fR" 4
.IX Item "ts"
.RE
.RS 4
.RE
.PD 0
.IP "\fBmax_delay\fR \fIinteger\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
.IX Item "max_delay integer (input/output)"
.PD
Set maximum muxing or demuxing delay in microseconds.
.IP "\fBfpsprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "fpsprobesize integer (input)"
Set number of frames used to probe fps.
.IP "\fBaudio_preload\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "audio_preload integer (output)"
Set microseconds by which audio packets should be interleaved earlier.
.IP "\fBchunk_duration\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "chunk_duration integer (output)"
Set microseconds for each chunk.
.IP "\fBchunk_size\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "chunk_size integer (output)"
Set size in bytes for each chunk.
.IP "\fBerr_detect, f_err_detect\fR \fIflags\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "err_detect, f_err_detect flags (input)"
Set error detection flags. \f(CW\*(C`f_err_detect\*(C'\fR is deprecated and
should be used only via the \fBffmpeg\fR tool.
.Sp
Possible values:
.RS 4
.IP "\fBcrccheck\fR" 4
.IX Item "crccheck"
Verify embedded CRCs.
.IP "\fBbitstream\fR" 4
.IX Item "bitstream"
Detect bitstream specification deviations.
.IP "\fBbuffer\fR" 4
.IX Item "buffer"
Detect improper bitstream length.
.IP "\fBexplode\fR" 4
.IX Item "explode"
Abort decoding on minor error detection.
.IP "\fBcareful\fR" 4
.IX Item "careful"
Consider things that violate the spec and have not been seen in the
wild as errors.
.IP "\fBcompliant\fR" 4
.IX Item "compliant"
Consider all spec non compliancies as errors.
.IP "\fBaggressive\fR" 4
.IX Item "aggressive"
Consider things that a sane encoder should not do as an error.
.RE
.RS 4
.RE
.IP "\fBuse_wallclock_as_timestamps\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "use_wallclock_as_timestamps integer (input)"
Use wallclock as timestamps.
.IP "\fBavoid_negative_ts\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "avoid_negative_ts integer (output)"
Shift timestamps to make them positive. A value of 1 enables shifting,
a value of 0 disables it, the default value of \-1 enables shifting
when required by the target format.
.Sp
When shifting is enabled, all output timestamps are shifted by the
same amount. Audio, video, and subtitles desynching and relative
timestamp differences are preserved compared to how they would have
been without shifting.
.Sp
Also note that this affects only leading negative timestamps, and not
non-monotonic negative timestamps.
.IP "\fBflush_packets\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "flush_packets integer (output)"
Flush the underlying I/O stream after each packet. Default 1 enables it, and
has the effect of reducing the latency; 0 disables it and may slightly
increase performance in some cases.
.SH "DEMUXERS"
.IX Header "DEMUXERS"
Demuxers are configured elements in FFmpeg which allow to read the
multimedia streams from a particular type of file.
.PP
When you configure your FFmpeg build, all the supported demuxers
are enabled by default. You can list all available ones using the
configure option \f(CW\*(C`\-\-list\-demuxers\*(C'\fR.
.PP
You can disable all the demuxers using the configure option
\&\f(CW\*(C`\-\-disable\-demuxers\*(C'\fR, and selectively enable a single demuxer with
the option \f(CW\*(C`\-\-enable\-demuxer=\f(CIDEMUXER\f(CW\*(C'\fR, or disable it
with the option \f(CW\*(C`\-\-disable\-demuxer=\f(CIDEMUXER\f(CW\*(C'\fR.
.PP
The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
enabled demuxers.
.PP
The description of some of the currently available demuxers follows.
.SS "applehttp"
.IX Subsection "applehttp"
Apple \s-1HTTP\s0 Live Streaming demuxer.
.PP
This demuxer presents all AVStreams from all variant streams.
The id field is set to the bitrate variant index number. By setting
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
the caller can decide which variant streams to actually receive.
The total bitrate of the variant that the stream belongs to is
available in a metadata key named \*(L"variant_bitrate\*(R".
.SS "concat"
.IX Subsection "concat"
Virtual concatenation script demuxer.
.PP
This demuxer reads a list of files and other directives from a text file and
demuxes them one after the other, as if all their packet had been muxed
together.
.PP
The timestamps in the files are adjusted so that the first file starts at 0
and each next file starts where the previous one finishes. Note that it is
done globally and may cause gaps if all streams do not have exactly the same
length.
.PP
All files must have the same streams (same codecs, same time base, etc.).
.PP
The duration of each file is used to adjust the timestamps of the next file:
if the duration is incorrect (because it was computed using the bit-rate or
because the file is truncated, for example), it can cause artifacts. The
\&\f(CW\*(C`duration\*(C'\fR directive can be used to override the duration stored in
each file.
.PP
\fISyntax\fR
.IX Subsection "Syntax"
.PP
The script is a text file in extended-ASCII, with one directive per line.
Empty lines, leading spaces and lines starting with '#' are ignored. The
following directive is recognized:
.ie n .IP "\fB\fB""file \f(BIpath\f(CB""\fB\fR" 4
.el .IP "\fB\f(CBfile \f(CBpath\f(CB\fB\fR" 4
.IX Item "file path"
Path to a file to read; special characters and spaces must be escaped with
backslash or single quotes.
.Sp
All subsequent directives apply to that file.
.ie n .IP "\fB\fB""ffconcat version 1.0""\fB\fR" 4
.el .IP "\fB\f(CBffconcat version 1.0\fB\fR" 4
.IX Item "ffconcat version 1.0"
Identify the script type and version. It also sets the \fBsafe\fR option
to 1 if it was to its default \-1.
.Sp
To make FFmpeg recognize the format automatically, this directive must
appears exactly as is (no extra space or byte-order-mark) on the very first
line of the script.
.ie n .IP "\fB\fB""duration \f(BIdur\f(CB""\fB\fR" 4
.el .IP "\fB\f(CBduration \f(CBdur\f(CB\fB\fR" 4
.IX Item "duration dur"
Duration of the file. This information can be specified from the file;
specifying it here may be more efficient or help if the information from the
file is not available or accurate.
.Sp
If the duration is set for all files, then it is possible to seek in the
whole concatenated video.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
This demuxer accepts the following option:
.IP "\fBsafe\fR" 4
.IX Item "safe"
If set to 1, reject unsafe file paths. A file path is considered safe if it
does not contain a protocol specification and is relative and all components
only contain characters from the portable character set (letters, digits,
period, underscore and hyphen) and have no period at the beginning of a
component.
.Sp
If set to 0, any file name is accepted.
.Sp
The default is \-1, it is equivalent to 1 if the format was automatically
probed and 0 otherwise.
.SS "libquvi"
.IX Subsection "libquvi"
Play media from Internet services using the quvi project.
.PP
The demuxer accepts a \fBformat\fR option to request a specific quality. It
is by default set to \fIbest\fR.
.PP
See <\fBhttp://quvi.sourceforge.net/\fR> for more information.
.PP
FFmpeg needs to be built with \f(CW\*(C`\-\-enable\-libquvi\*(C'\fR for this demuxer to be
enabled.
.SS "image2"
.IX Subsection "image2"
Image file demuxer.
.PP
This demuxer reads from a list of image files specified by a pattern.
The syntax and meaning of the pattern is specified by the
option \fIpattern_type\fR.
.PP
The pattern may contain a suffix which is used to automatically
determine the format of the images contained in the files.
.PP
The size, the pixel format, and the format of each image must be the
same for all the files in the sequence.
.PP
This demuxer accepts the following options:
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the frame rate for the video stream. It defaults to 25.
.IP "\fBloop\fR" 4
.IX Item "loop"
If set to 1, loop over the input. Default value is 0.
.IP "\fBpattern_type\fR" 4
.IX Item "pattern_type"
Select the pattern type used to interpret the provided filename.
.Sp
\&\fIpattern_type\fR accepts one of the following values.
.RS 4
.IP "\fBsequence\fR" 4
.IX Item "sequence"
Select a sequence pattern type, used to specify a sequence of files
indexed by sequential numbers.
.Sp
A sequence pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", which
specifies the position of the characters representing a sequential
number in each filename matched by the pattern. If the form
\&\*(R"%d0\fIN\fRd" is used, the string representing the number in each
filename is 0\-padded and \fIN\fR is the total number of 0\-padded
digits representing the number. The literal character '%' can be
specified in the pattern with the string \*(L"%%\*(R".
.Sp
If the sequence pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
the file list specified by the pattern must contain a number
inclusively contained between \fIstart_number\fR and
\&\fIstart_number\fR+\fIstart_number_range\fR\-1, and all the following
numbers must be sequential.
.Sp
For example the pattern \*(L"img\-%03d.bmp\*(R" will match a sequence of
filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
\&\fIimg\-010.bmp\fR, etc.; the pattern \*(L"i%%m%%g\-%d.jpg\*(R" will match a
sequence of filenames of the form \fIi%m%g\-1.jpg\fR,
\&\fIi%m%g\-2.jpg\fR, ..., \fIi%m%g\-10.jpg\fR, etc.
.Sp
Note that the pattern must not necessarily contain \*(L"%d\*(R" or
"%0\fIN\fRd", for example to convert a single image file
\&\fIimg.jpeg\fR you can employ the command:
.Sp
.Vb 1
\&        ffmpeg \-i img.jpeg img.png
.Ve
.IP "\fBglob\fR" 4
.IX Item "glob"
Select a glob wildcard pattern type.
.Sp
The pattern is interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern. This is only
selectable if libavformat was compiled with globbing support.
.IP "\fBglob_sequence\fR \fI(deprecated, will be removed)\fR" 4
.IX Item "glob_sequence (deprecated, will be removed)"
Select a mixed glob wildcard/sequence pattern.
.Sp
If your version of libavformat was compiled with globbing support, and
the provided pattern contains at least one glob meta character among
\&\f(CW\*(C`%*?[]{}\*(C'\fR that is preceded by an unescaped \*(L"%\*(R", the pattern is
interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern, otherwise it is interpreted
like a sequence pattern.
.Sp
All glob special characters \f(CW\*(C`%*?[]{}\*(C'\fR must be prefixed
with \*(L"%\*(R". To escape a literal \*(L"%\*(R" you shall use \*(L"%%\*(R".
.Sp
For example the pattern \f(CW\*(C`foo\-%*.jpeg\*(C'\fR will match all the
filenames prefixed by \*(L"foo\-\*(R" and terminating with \*(L".jpeg\*(R", and
\&\f(CW\*(C`foo\-%?%?%?.jpeg\*(C'\fR will match all the filenames prefixed with
\&\*(L"foo\-\*(R", followed by a sequence of three characters, and terminating
with \*(L".jpeg\*(R".
.Sp
This pattern type is deprecated in favor of \fIglob\fR and
\&\fIsequence\fR.
.RE
.RS 4
.Sp
Default value is \fIglob_sequence\fR.
.RE
.IP "\fBpixel_format\fR" 4
.IX Item "pixel_format"
Set the pixel format of the images to read. If not specified the pixel
format is guessed from the first image file in the sequence.
.IP "\fBstart_number\fR" 4
.IX Item "start_number"
Set the index of the file matched by the image file pattern to start
to read from. Default value is 0.
.IP "\fBstart_number_range\fR" 4
.IX Item "start_number_range"
Set the index interval range to check when looking for the first image
file in the sequence, starting from \fIstart_number\fR. Default value
is 5.
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video size of the images to read. If not specified the video
size is guessed from the first image file in the sequence.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use \fBffmpeg\fR for creating a video from the images in the file
sequence \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., assuming an
input frame rate of 10 frames per second:
.Sp
.Vb 1
\&        ffmpeg \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv
.Ve
.IP "\(bu" 4
As above, but start by reading from a file with index 100 in the sequence:
.Sp
.Vb 1
\&        ffmpeg \-start_number 100 \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv
.Ve
.IP "\(bu" 4
Read images matching the \*(L"*.png\*(R" glob pattern , that is all the files
terminating with the \*(L".png\*(R" suffix:
.Sp
.Vb 1
\&        ffmpeg \-pattern_type glob \-i "*.png" \-r 10 out.mkv
.Ve
.SS "rawvideo"
.IX Subsection "rawvideo"
Raw video demuxer.
.PP
This demuxer allows to read raw video data. Since there is no header
specifying the assumed video parameters, the user must specify them
in order to be able to decode the data correctly.
.PP
This demuxer accepts the following options:
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set input video frame rate. Default value is 25.
.IP "\fBpixel_format\fR" 4
.IX Item "pixel_format"
Set the input video pixel format. Default value is \f(CW\*(C`yuv420p\*(C'\fR.
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the input video size. This value must be specified explicitly.
.PP
For example to read a rawvideo file \fIinput.raw\fR with
\&\fBffplay\fR, assuming a pixel format of \f(CW\*(C`rgb24\*(C'\fR, a video
size of \f(CW\*(C`320x240\*(C'\fR, and a frame rate of 10 images per second, use
the command:
.PP
.Vb 1
\&        ffplay \-f rawvideo \-pixel_format rgb24 \-video_size 320x240 \-framerate 10 input.raw
.Ve
.SS "sbg"
.IX Subsection "sbg"
SBaGen script demuxer.
.PP
This demuxer reads the script language used by SBaGen
<\fBhttp://uazu.net/sbagen/\fR> to generate binaural beats sessions. A \s-1SBG\s0
script looks like that:
.PP
.Vb 9
\&        \-SE
\&        a: 300\-2.5/3 440+4.5/0
\&        b: 300\-2.5/0 440+4.5/3
\&        off: \-
\&        NOW      == a
\&        +0:07:00 == b
\&        +0:14:00 == a
\&        +0:21:00 == b
\&        +0:30:00    off
.Ve
.PP
A \s-1SBG\s0 script can mix absolute and relative timestamps. If the script uses
either only absolute timestamps (including the script start time) or only
relative ones, then its layout is fixed, and the conversion is
straightforward. On the other hand, if the script mixes both kind of
timestamps, then the \fI\s-1NOW\s0\fR reference for relative timestamps will be
taken from the current time of day at the time the script is read, and the
script layout will be frozen according to that reference. That means that if
the script is directly played, the actual times will match the absolute
timestamps up to the sound controller's clock accuracy, but if the user
somehow pauses the playback or seeks, all times will be shifted accordingly.
.SS "tedcaptions"
.IX Subsection "tedcaptions"
\&\s-1JSON\s0 captions used for <\fBhttp://www.ted.com/\fR>.
.PP
\&\s-1TED\s0 does not provide links to the captions, but they can be guessed from the
page. The file \fItools/bookmarklets.html\fR from the FFmpeg source tree
contains a bookmarklet to expose them.
.PP
This demuxer accepts the following option:
.IP "\fBstart_time\fR" 4
.IX Item "start_time"
Set the start time of the \s-1TED\s0 talk, in milliseconds. The default is 15000
(15s). It is used to sync the captions with the downloadable videos, because
they include a 15s intro.
.PP
Example: convert the captions to a format most players understand:
.PP
.Vb 1
\&        ffmpeg \-i http://www.ted.com/talks/subtitles/id/1/lang/en talk1\-en.srt
.Ve
.SH "MUXERS"
.IX Header "MUXERS"
Muxers are configured elements in FFmpeg which allow writing
multimedia streams to a particular type of file.
.PP
When you configure your FFmpeg build, all the supported muxers
are enabled by default. You can list all available muxers using the
configure option \f(CW\*(C`\-\-list\-muxers\*(C'\fR.
.PP
You can disable all the muxers with the configure option
\&\f(CW\*(C`\-\-disable\-muxers\*(C'\fR and selectively enable / disable single muxers
with the options \f(CW\*(C`\-\-enable\-muxer=\f(CIMUXER\f(CW\*(C'\fR /
\&\f(CW\*(C`\-\-disable\-muxer=\f(CIMUXER\f(CW\*(C'\fR.
.PP
The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
enabled muxers.
.PP
A description of some of the currently available muxers follows.
.SS "crc"
.IX Subsection "crc"
\&\s-1CRC\s0 (Cyclic Redundancy Check) testing format.
.PP
This muxer computes and prints the Adler\-32 \s-1CRC\s0 of all the input audio
and video frames. By default audio frames are converted to signed
16\-bit raw audio and video frames to raw video before computing the
\&\s-1CRC\s0.
.PP
The output of the muxer consists of a single line of the form:
CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to
8 digits containing the \s-1CRC\s0 for all the decoded input frames.
.PP
For example to compute the \s-1CRC\s0 of the input, and store it in the file
\&\fIout.crc\fR:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f crc out.crc
.Ve
.PP
You can print the \s-1CRC\s0 to stdout with the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f crc \-
.Ve
.PP
You can select the output format of each frame with \fBffmpeg\fR by
specifying the audio and video codec and format. For example to
compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit
and the input video converted to \s-1MPEG\-2\s0 video, use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f crc \-
.Ve
.PP
See also the framecrc muxer.
.SS "framecrc"
.IX Subsection "framecrc"
Per-packet \s-1CRC\s0 (Cyclic Redundancy Check) testing format.
.PP
This muxer computes and prints the Adler\-32 \s-1CRC\s0 for each audio
and video packet. By default audio frames are converted to signed
16\-bit raw audio and video frames to raw video before computing the
\&\s-1CRC\s0.
.PP
The output of the muxer consists of a line for each audio and video
packet of the form:
.PP
.Vb 1
\&        <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
.Ve
.PP
\&\fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the
\&\s-1CRC\s0 of the packet.
.PP
For example to compute the \s-1CRC\s0 of the audio and video frames in
\&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
in the file \fIout.crc\fR:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f framecrc out.crc
.Ve
.PP
To print the information to stdout, use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f framecrc \-
.Ve
.PP
With \fBffmpeg\fR, you can select the output format to which the
audio and video frames are encoded before computing the \s-1CRC\s0 for each
packet by specifying the audio and video codec. For example, to
compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0
unsigned 8\-bit and of each decoded input video frame converted to
\&\s-1MPEG\-2\s0 video, use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f framecrc \-
.Ve
.PP
See also the crc muxer.
.SS "framemd5"
.IX Subsection "framemd5"
Per-packet \s-1MD5\s0 testing format.
.PP
This muxer computes and prints the \s-1MD5\s0 hash for each audio
and video packet. By default audio frames are converted to signed
16\-bit raw audio and video frames to raw video before computing the
hash.
.PP
The output of the muxer consists of a line for each audio and video
packet of the form:
.PP
.Vb 1
\&        <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
.Ve
.PP
\&\fI\s-1MD5\s0\fR is a hexadecimal number representing the computed \s-1MD5\s0 hash
for the packet.
.PP
For example to compute the \s-1MD5\s0 of the audio and video frames in
\&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
in the file \fIout.md5\fR:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f framemd5 out.md5
.Ve
.PP
To print the information to stdout, use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f framemd5 \-
.Ve
.PP
See also the md5 muxer.
.SS "hls"
.IX Subsection "hls"
Apple \s-1HTTP\s0 Live Streaming muxer that segments MPEG-TS according to
the \s-1HTTP\s0 Live Streaming specification.
.PP
It creates a playlist file and numbered segment files. The output
filename specifies the playlist filename; the segment filenames
receive the same basename as the playlist, a sequential number and
a .ts extension.
.PP
.Vb 1
\&        ffmpeg \-i in.nut out.m3u8
.Ve
.IP "\fB\-hls_time\fR \fIseconds\fR" 4
.IX Item "-hls_time seconds"
Set the segment length in seconds.
.IP "\fB\-hls_list_size\fR \fIsize\fR" 4
.IX Item "-hls_list_size size"
Set the maximum number of playlist entries.
.IP "\fB\-hls_wrap\fR \fIwrap\fR" 4
.IX Item "-hls_wrap wrap"
Set the number after which index wraps.
.IP "\fB\-start_number\fR \fInumber\fR" 4
.IX Item "-start_number number"
Start the sequence from \fInumber\fR.
.SS "ico"
.IX Subsection "ico"
\&\s-1ICO\s0 file muxer.
.PP
Microsoft's icon file format (\s-1ICO\s0) has some strict limitations that should be noted:
.IP "\(bu" 4
Size cannot exceed 256 pixels in any dimension
.IP "\(bu" 4
Only \s-1BMP\s0 and \s-1PNG\s0 images can be stored
.IP "\(bu" 4
If a \s-1BMP\s0 image is used, it must be one of the following pixel formats:
.Sp
.Vb 7
\&        BMP Bit Depth      FFmpeg Pixel Format
\&        1bit               pal8
\&        4bit               pal8
\&        8bit               pal8
\&        16bit              rgb555le
\&        24bit              bgr24
\&        32bit              bgra
.Ve
.IP "\(bu" 4
If a \s-1BMP\s0 image is used, it must use the \s-1BITMAPINFOHEADER\s0 \s-1DIB\s0 header
.IP "\(bu" 4
If a \s-1PNG\s0 image is used, it must use the rgba pixel format
.SS "image2"
.IX Subsection "image2"
Image file muxer.
.PP
The image file muxer writes video frames to image files.
.PP
The output filenames are specified by a pattern, which can be used to
produce sequentially numbered series of files.
The pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", this string
specifies the position of the characters representing a numbering in
the filenames. If the form \*(R"%0\fIN\fRd" is used, the string
representing the number in each filename is 0\-padded to \fIN\fR
digits. The literal character '%' can be specified in the pattern with
the string \*(L"%%\*(R".
.PP
If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
the file list specified will contain the number 1, all the following
numbers will be sequential.
.PP
The pattern may contain a suffix which is used to automatically
determine the format of the image files to write.
.PP
For example the pattern \*(L"img\-%03d.bmp\*(R" will specify a sequence of
filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
\&\fIimg\-010.bmp\fR, etc.
The pattern \*(L"img%%\-%d.jpg\*(R" will specify a sequence of filenames of the
form \fIimg%\-1.jpg\fR, \fIimg%\-2.jpg\fR, ..., \fIimg%\-10.jpg\fR,
etc.
.PP
The following example shows how to use \fBffmpeg\fR for creating a
sequence of files \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ...,
taking one image every second from the input video:
.PP
.Vb 1
\&        ffmpeg \-i in.avi \-vsync 1 \-r 1 \-f image2 \*(Aqimg\-%03d.jpeg\*(Aq
.Ve
.PP
Note that with \fBffmpeg\fR, if the format is not specified with the
\&\f(CW\*(C`\-f\*(C'\fR option and the output filename specifies an image file
format, the image2 muxer is automatically selected, so the previous
command can be written as:
.PP
.Vb 1
\&        ffmpeg \-i in.avi \-vsync 1 \-r 1 \*(Aqimg\-%03d.jpeg\*(Aq
.Ve
.PP
Note also that the pattern must not necessarily contain \*(L"%d\*(R" or
"%0\fIN\fRd", for example to create a single image file
\&\fIimg.jpeg\fR from the input video you can employ the command:
.PP
.Vb 1
\&        ffmpeg \-i in.avi \-f image2 \-frames:v 1 img.jpeg
.Ve
.IP "\fBstart_number\fR \fInumber\fR" 4
.IX Item "start_number number"
Start the sequence from \fInumber\fR. Default value is 1. Must be a
positive number.
.IP "\fB\-update\fR \fInumber\fR" 4
.IX Item "-update number"
If \fInumber\fR is nonzero, the filename will always be interpreted as just a
filename, not a pattern, and this file will be continuously overwritten with new
images.
.PP
The image muxer supports the .Y.U.V image file format. This format is
special in that that each image frame consists of three files, for
each of the \s-1YUV420P\s0 components. To read or write this image file format,
specify the name of the '.Y' file. The muxer will automatically open the
\&'.U' and '.V' files as required.
.SS "md5"
.IX Subsection "md5"
\&\s-1MD5\s0 testing format.
.PP
This muxer computes and prints the \s-1MD5\s0 hash of all the input audio
and video frames. By default audio frames are converted to signed
16\-bit raw audio and video frames to raw video before computing the
hash.
.PP
The output of the muxer consists of a single line of the form:
MD5=\fI\s-1MD5\s0\fR, where \fI\s-1MD5\s0\fR is a hexadecimal number representing
the computed \s-1MD5\s0 hash.
.PP
For example to compute the \s-1MD5\s0 hash of the input converted to raw
audio and video, and store it in the file \fIout.md5\fR:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f md5 out.md5
.Ve
.PP
You can print the \s-1MD5\s0 to stdout with the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f md5 \-
.Ve
.PP
See also the framemd5 muxer.
.SS "\s-1MOV/MP4/ISMV\s0"
.IX Subsection "MOV/MP4/ISMV"
The mov/mp4/ismv muxer supports fragmentation. Normally, a \s-1MOV/MP4\s0
file has all the metadata about all packets stored in one location
(written at the end of the file, it can be moved to the start for
better playback by adding \fIfaststart\fR to the \fImovflags\fR, or
using the \fBqt-faststart\fR tool). A fragmented
file consists of a number of fragments, where packets and metadata
about these packets are stored together. Writing a fragmented
file has the advantage that the file is decodable even if the
writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if
it is not properly finished), and it requires less memory when writing
very long files (since writing normal \s-1MOV/MP4\s0 files stores info about
every single packet in memory until the file is closed). The downside
is that it is less compatible with other applications.
.PP
Fragmentation is enabled by setting one of the AVOptions that define
how to cut the file into fragments:
.IP "\fB\-moov_size\fR \fIbytes\fR" 4
.IX Item "-moov_size bytes"
Reserves space for the moov atom at the beginning of the file instead of placing the
moov atom at the end. If the space reserved is insufficient, muxing will fail.
.IP "\fB\-movflags frag_keyframe\fR" 4
.IX Item "-movflags frag_keyframe"
Start a new fragment at each video keyframe.
.IP "\fB\-frag_duration\fR \fIduration\fR" 4
.IX Item "-frag_duration duration"
Create fragments that are \fIduration\fR microseconds long.
.IP "\fB\-frag_size\fR \fIsize\fR" 4
.IX Item "-frag_size size"
Create fragments that contain up to \fIsize\fR bytes of payload data.
.IP "\fB\-movflags frag_custom\fR" 4
.IX Item "-movflags frag_custom"
Allow the caller to manually choose when to cut fragments, by
calling \f(CW\*(C`av_write_frame(ctx, NULL)\*(C'\fR to write a fragment with
the packets written so far. (This is only useful with other
applications integrating libavformat, not from \fBffmpeg\fR.)
.IP "\fB\-min_frag_duration\fR \fIduration\fR" 4
.IX Item "-min_frag_duration duration"
Don't create fragments that are shorter than \fIduration\fR microseconds long.
.PP
If more than one condition is specified, fragments are cut when
one of the specified conditions is fulfilled. The exception to this is
\&\f(CW\*(C`\-min_frag_duration\*(C'\fR, which has to be fulfilled for any of the other
conditions to apply.
.PP
Additionally, the way the output file is written can be adjusted
through a few other options:
.IP "\fB\-movflags empty_moov\fR" 4
.IX Item "-movflags empty_moov"
Write an initial moov atom directly at the start of the file, without
describing any samples in it. Generally, an mdat/moov pair is written
at the start of the file, as a normal \s-1MOV/MP4\s0 file, containing only
a short portion of the file. With this option set, there is no initial
mdat atom, and the moov atom only describes the tracks but has
a zero duration.
.Sp
Files written with this option set do not work in QuickTime.
This option is implicitly set when writing ismv (Smooth Streaming) files.
.IP "\fB\-movflags separate_moof\fR" 4
.IX Item "-movflags separate_moof"
Write a separate moof (movie fragment) atom for each track. Normally,
packets for all tracks are written in a moof atom (which is slightly
more efficient), but with this option set, the muxer writes one moof/mdat
pair for each track, making it easier to separate tracks.
.Sp
This option is implicitly set when writing ismv (Smooth Streaming) files.
.IP "\fB\-movflags faststart\fR" 4
.IX Item "-movflags faststart"
Run a second pass moving the moov atom on top of the file. This
operation can take a while, and will not work in various situations such
as fragmented output, thus it is not enabled by default.
.IP "\fB\-movflags rtphint\fR" 4
.IX Item "-movflags rtphint"
Add \s-1RTP\s0 hinting tracks to the output file.
.PP
Smooth Streaming content can be pushed in real time to a publishing
point on \s-1IIS\s0 with this muxer. Example:
.PP
.Vb 1
\&        ffmpeg \-re <<normal input/transcoding options>> \-movflags isml+frag_keyframe \-f ismv http://server/publishingpoint.isml/Streams(Encoder1)
.Ve
.SS "mpegts"
.IX Subsection "mpegts"
\&\s-1MPEG\s0 transport stream muxer.
.PP
This muxer implements \s-1ISO\s0 13818\-1 and part of \s-1ETSI\s0 \s-1EN\s0 300 468.
.PP
The muxer options are:
.IP "\fB\-mpegts_original_network_id\fR \fInumber\fR" 4
.IX Item "-mpegts_original_network_id number"
Set the original_network_id (default 0x0001). This is unique identifier
of a network in \s-1DVB\s0. Its main use is in the unique identification of a
service through the path Original_Network_ID, Transport_Stream_ID.
.IP "\fB\-mpegts_transport_stream_id\fR \fInumber\fR" 4
.IX Item "-mpegts_transport_stream_id number"
Set the transport_stream_id (default 0x0001). This identifies a
transponder in \s-1DVB\s0.
.IP "\fB\-mpegts_service_id\fR \fInumber\fR" 4
.IX Item "-mpegts_service_id number"
Set the service_id (default 0x0001) also known as program in \s-1DVB\s0.
.IP "\fB\-mpegts_pmt_start_pid\fR \fInumber\fR" 4
.IX Item "-mpegts_pmt_start_pid number"
Set the first \s-1PID\s0 for \s-1PMT\s0 (default 0x1000, max 0x1f00).
.IP "\fB\-mpegts_start_pid\fR \fInumber\fR" 4
.IX Item "-mpegts_start_pid number"
Set the first \s-1PID\s0 for data packets (default 0x0100, max 0x0f00).
.PP
The recognized metadata settings in mpegts muxer are \f(CW\*(C`service_provider\*(C'\fR
and \f(CW\*(C`service_name\*(C'\fR. If they are not set the default for
\&\f(CW\*(C`service_provider\*(C'\fR is \*(L"FFmpeg\*(R" and the default for
\&\f(CW\*(C`service_name\*(C'\fR is \*(L"Service01\*(R".
.PP
.Vb 9
\&        ffmpeg \-i file.mpg \-c copy \e
\&             \-mpegts_original_network_id 0x1122 \e
\&             \-mpegts_transport_stream_id 0x3344 \e
\&             \-mpegts_service_id 0x5566 \e
\&             \-mpegts_pmt_start_pid 0x1500 \e
\&             \-mpegts_start_pid 0x150 \e
\&             \-metadata service_provider="Some provider" \e
\&             \-metadata service_name="Some Channel" \e
\&             \-y out.ts
.Ve
.SS "null"
.IX Subsection "null"
Null muxer.
.PP
This muxer does not generate any output file, it is mainly useful for
testing or benchmarking purposes.
.PP
For example to benchmark decoding with \fBffmpeg\fR you can use the
command:
.PP
.Vb 1
\&        ffmpeg \-benchmark \-i INPUT \-f null out.null
.Ve
.PP
Note that the above command does not read or write the \fIout.null\fR
file, but specifying the output file is required by the \fBffmpeg\fR
syntax.
.PP
Alternatively you can write the command as:
.PP
.Vb 1
\&        ffmpeg \-benchmark \-i INPUT \-f null \-
.Ve
.SS "matroska"
.IX Subsection "matroska"
Matroska container muxer.
.PP
This muxer implements the matroska and webm container specs.
.PP
The recognized metadata settings in this muxer are:
.IP "\fBtitle=\fR\fItitle name\fR" 4
.IX Item "title=title name"
Name provided to a single track
.IP "\fBlanguage=\fR\fIlanguage name\fR" 4
.IX Item "language=language name"
Specifies the language of the track in the Matroska languages form
.IP "\fBstereo_mode=\fR\fImode\fR" 4
.IX Item "stereo_mode=mode"
Stereo 3D video layout of two views in a single video track
.RS 4
.IP "\fBmono\fR" 4
.IX Item "mono"
video is not stereo
.IP "\fBleft_right\fR" 4
.IX Item "left_right"
Both views are arranged side by side, Left-eye view is on the left
.IP "\fBbottom_top\fR" 4
.IX Item "bottom_top"
Both views are arranged in top-bottom orientation, Left-eye view is at bottom
.IP "\fBtop_bottom\fR" 4
.IX Item "top_bottom"
Both views are arranged in top-bottom orientation, Left-eye view is on top
.IP "\fBcheckerboard_rl\fR" 4
.IX Item "checkerboard_rl"
Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
.IP "\fBcheckerboard_lr\fR" 4
.IX Item "checkerboard_lr"
Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
.IP "\fBrow_interleaved_rl\fR" 4
.IX Item "row_interleaved_rl"
Each view is constituted by a row based interleaving, Right-eye view is first row
.IP "\fBrow_interleaved_lr\fR" 4
.IX Item "row_interleaved_lr"
Each view is constituted by a row based interleaving, Left-eye view is first row
.IP "\fBcol_interleaved_rl\fR" 4
.IX Item "col_interleaved_rl"
Both views are arranged in a column based interleaving manner, Right-eye view is first column
.IP "\fBcol_interleaved_lr\fR" 4
.IX Item "col_interleaved_lr"
Both views are arranged in a column based interleaving manner, Left-eye view is first column
.IP "\fBanaglyph_cyan_red\fR" 4
.IX Item "anaglyph_cyan_red"
All frames are in anaglyph format viewable through red-cyan filters
.IP "\fBright_left\fR" 4
.IX Item "right_left"
Both views are arranged side by side, Right-eye view is on the left
.IP "\fBanaglyph_green_magenta\fR" 4
.IX Item "anaglyph_green_magenta"
All frames are in anaglyph format viewable through green-magenta filters
.IP "\fBblock_lr\fR" 4
.IX Item "block_lr"
Both eyes laced in one Block, Left-eye view is first
.IP "\fBblock_rl\fR" 4
.IX Item "block_rl"
Both eyes laced in one Block, Right-eye view is first
.RE
.RS 4
.RE
.PP
For example a 3D WebM clip can be created using the following command line:
.PP
.Vb 1
\&        ffmpeg \-i sample_left_right_clip.mpg \-an \-c:v libvpx \-metadata stereo_mode=left_right \-y stereo_clip.webm
.Ve
.SS "segment, stream_segment, ssegment"
.IX Subsection "segment, stream_segment, ssegment"
Basic stream segmenter.
.PP
The segmenter muxer outputs streams to a number of separate files of nearly
fixed duration. Output filename pattern can be set in a fashion similar to
image2.
.PP
\&\f(CW\*(C`stream_segment\*(C'\fR is a variant of the muxer used to write to
streaming output formats, i.e. which do not require global headers,
and is recommended for outputting e.g. to \s-1MPEG\s0 transport stream segments.
\&\f(CW\*(C`ssegment\*(C'\fR is a shorter alias for \f(CW\*(C`stream_segment\*(C'\fR.
.PP
Every segment starts with a keyframe of the selected reference stream,
which is set through the \fBreference_stream\fR option.
.PP
Note that if you want accurate splitting for a video file, you need to
make the input key frames correspond to the exact splitting times
expected by the segmenter, or the segment muxer will start the new
segment with the key frame found next after the specified start
time.
.PP
The segment muxer works best with a single constant frame rate video.
.PP
Optionally it can generate a list of the created segments, by setting
the option \fIsegment_list\fR. The list type is specified by the
\&\fIsegment_list_type\fR option.
.PP
The segment muxer supports the following options:
.IP "\fBreference_stream\fR \fIspecifier\fR" 4
.IX Item "reference_stream specifier"
Set the reference stream, as specified by the string \fIspecifier\fR.
If \fIspecifier\fR is set to \f(CW\*(C`auto\*(C'\fR, the reference is choosen
automatically. Otherwise it must be a stream specifier (see the ``Stream
specifiers'' chapter in the ffmpeg manual) which specifies the
reference stream. The default value is ``auto''.
.IP "\fBsegment_format\fR \fIformat\fR" 4
.IX Item "segment_format format"
Override the inner container format, by default it is guessed by the filename
extension.
.IP "\fBsegment_list\fR \fIname\fR" 4
.IX Item "segment_list name"
Generate also a listfile named \fIname\fR. If not specified no
listfile is generated.
.IP "\fBsegment_list_flags\fR \fIflags\fR" 4
.IX Item "segment_list_flags flags"
Set flags affecting the segment list generation.
.Sp
It currently supports the following flags:
.RS 4
.IP "\fIcache\fR" 4
.IX Item "cache"
Allow caching (only affects M3U8 list files).
.IP "\fIlive\fR" 4
.IX Item "live"
Allow live-friendly file generation.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`cache\*(C'\fR.
.RE
.IP "\fBsegment_list_size\fR \fIsize\fR" 4
.IX Item "segment_list_size size"
Update the list file so that it contains at most the last \fIsize\fR
segments. If 0 the list file will contain all the segments. Default
value is 0.
.IP "\fBsegment_list type\fR \fItype\fR" 4
.IX Item "segment_list type type"
Specify the format for the segment list file.
.Sp
The following values are recognized:
.RS 4
.IP "\fBflat\fR" 4
.IX Item "flat"
Generate a flat list for the created segments, one segment per line.
.IP "\fBcsv, ext\fR" 4
.IX Item "csv, ext"
Generate a list for the created segments, one segment per line,
each line matching the format (comma-separated values):
.Sp
.Vb 1
\&        <segment_filename>,<segment_start_time>,<segment_end_time>
.Ve
.Sp
\&\fIsegment_filename\fR is the name of the output file generated by the
muxer according to the provided pattern. \s-1CSV\s0 escaping (according to
\&\s-1RFC4180\s0) is applied if required.
.Sp
\&\fIsegment_start_time\fR and \fIsegment_end_time\fR specify
the segment start and end time expressed in seconds.
.Sp
A list file with the suffix \f(CW".csv"\fR or \f(CW".ext"\fR will
auto-select this format.
.Sp
\&\f(CW\*(C`ext\*(C'\fR is deprecated in favor or \f(CW\*(C`csv\*(C'\fR.
.IP "\fBffconcat\fR" 4
.IX Item "ffconcat"
Generate an ffconcat file for the created segments. The resulting file
can be read using the FFmpeg concat demuxer.
.Sp
A list file with the suffix \f(CW".ffcat"\fR or \f(CW".ffconcat"\fR will
auto-select this format.
.IP "\fBm3u8\fR" 4
.IX Item "m3u8"
Generate an extended M3U8 file, version 3, compliant with
<\fBhttp://tools.ietf.org/id/draft\-pantos\-http\-live\-streaming\fR>.
.Sp
A list file with the suffix \f(CW".m3u8"\fR will auto-select this format.
.RE
.RS 4
.Sp
If not specified the type is guessed from the list file name suffix.
.RE
.IP "\fBsegment_time\fR \fItime\fR" 4
.IX Item "segment_time time"
Set segment duration to \fItime\fR, the value must be a duration
specification. Default value is \*(L"2\*(R". See also the
\&\fBsegment_times\fR option.
.Sp
Note that splitting may not be accurate, unless you force the
reference stream key-frames at the given time. See the introductory
notice and the examples below.
.IP "\fBsegment_time_delta\fR \fIdelta\fR" 4
.IX Item "segment_time_delta delta"
Specify the accuracy time when selecting the start time for a
segment, expressed as a duration specification. Default value is \*(L"0\*(R".
.Sp
When delta is specified a key-frame will start a new segment if its
\&\s-1PTS\s0 satisfies the relation:
.Sp
.Vb 1
\&        PTS >= start_time \- time_delta
.Ve
.Sp
This option is useful when splitting video content, which is always
split at \s-1GOP\s0 boundaries, in case a key frame is found just before the
specified split time.
.Sp
In particular may be used in combination with the \fIffmpeg\fR option
\&\fIforce_key_frames\fR. The key frame times specified by
\&\fIforce_key_frames\fR may not be set accurately because of rounding
issues, with the consequence that a key frame time may result set just
before the specified time. For constant frame rate videos a value of
1/2*\fIframe_rate\fR should address the worst case mismatch between
the specified time and the time set by \fIforce_key_frames\fR.
.IP "\fBsegment_times\fR \fItimes\fR" 4
.IX Item "segment_times times"
Specify a list of split points. \fItimes\fR contains a list of comma
separated duration specifications, in increasing order. See also
the \fBsegment_time\fR option.
.IP "\fBsegment_frames\fR \fIframes\fR" 4
.IX Item "segment_frames frames"
Specify a list of split video frame numbers. \fIframes\fR contains a
list of comma separated integer numbers, in increasing order.
.Sp
This option specifies to start a new segment whenever a reference
stream key frame is found and the sequential number (starting from 0)
of the frame is greater or equal to the next value in the list.
.IP "\fBsegment_wrap\fR \fIlimit\fR" 4
.IX Item "segment_wrap limit"
Wrap around segment index once it reaches \fIlimit\fR.
.IP "\fBsegment_start_number\fR \fInumber\fR" 4
.IX Item "segment_start_number number"
Set the sequence number of the first segment. Defaults to \f(CW0\fR.
.IP "\fBreset_timestamps\fR \fI1|0\fR" 4
.IX Item "reset_timestamps 1|0"
Reset timestamps at the begin of each segment, so that each segment
will start with near-zero timestamps. It is meant to ease the playback
of the generated segments. May not work with some combinations of
muxers/codecs. It is set to \f(CW0\fR by default.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
To remux the content of file \fIin.mkv\fR to a list of segments
\&\fIout\-000.nut\fR, \fIout\-001.nut\fR, etc., and write the list of
generated segments to \fIout.list\fR:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.list out%03d.nut
.Ve
.IP "\(bu" 4
As the example above, but segment the input file according to the split
points specified by the \fIsegment_times\fR option:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.csv \-segment_times 1,2,3,5,8,13,21 out%03d.nut
.Ve
.IP "\(bu" 4
As the example above, but use the \f(CW\*(C`ffmpeg\*(C'\fR \fIforce_key_frames\fR
option to force key frames in the input at the specified location, together
with the segment option \fIsegment_time_delta\fR to account for
possible roundings operated when setting key frame times.
.Sp
.Vb 2
\&        ffmpeg \-i in.mkv \-force_key_frames 1,2,3,5,8,13,21 \-codec:v mpeg4 \-codec:a pcm_s16le \-map 0 \e
\&        \-f segment \-segment_list out.csv \-segment_times 1,2,3,5,8,13,21 \-segment_time_delta 0.05 out%03d.nut
.Ve
.Sp
In order to force key frames on the input file, transcoding is
required.
.IP "\(bu" 4
Segment the input file by splitting the input file according to the
frame numbers sequence specified with the \fIsegment_frames\fR option:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.csv \-segment_frames 100,200,300,500,800 out%03d.nut
.Ve
.IP "\(bu" 4
To convert the \fIin.mkv\fR to \s-1TS\s0 segments using the \f(CW\*(C`libx264\*(C'\fR
and \f(CW\*(C`libfaac\*(C'\fR encoders:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-map 0 \-codec:v libx264 \-codec:a libfaac \-f ssegment \-segment_list out.list out%03d.ts
.Ve
.IP "\(bu" 4
Segment the input file, and create an M3U8 live playlist (can be used
as live \s-1HLS\s0 source):
.Sp
.Vb 2
\&        ffmpeg \-re \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list playlist.m3u8 \e
\&        \-segment_list_flags +live \-segment_time 10 out%03d.mkv
.Ve
.SS "mp3"
.IX Subsection "mp3"
The \s-1MP3\s0 muxer writes a raw \s-1MP3\s0 stream with an ID3v2 header at the beginning and
optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
\&\f(CW\*(C`id3v2_version\*(C'\fR option controls which one is used. The legacy ID3v1 tag is
not written by default, but may be enabled with the \f(CW\*(C`write_id3v1\*(C'\fR option.
.PP
For seekable output the muxer also writes a Xing frame at the beginning, which
contains the number of frames in the file. It is useful for computing duration
of \s-1VBR\s0 files.
.PP
The muxer supports writing ID3v2 attached pictures (\s-1APIC\s0 frames). The pictures
are supplied to the muxer in form of a video stream with a single packet. There
can be any number of those streams, each will correspond to a single \s-1APIC\s0 frame.
The stream metadata tags \fItitle\fR and \fIcomment\fR map to \s-1APIC\s0
\&\fIdescription\fR and \fIpicture type\fR respectively. See
<\fBhttp://id3.org/id3v2.4.0\-frames\fR> for allowed picture types.
.PP
Note that the \s-1APIC\s0 frames must be written at the beginning, so the muxer will
buffer the audio frames until it gets all the pictures. It is therefore advised
to provide the pictures as soon as possible to avoid excessive buffering.
.PP
Examples:
.PP
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-id3v2_version 3 \-write_id3v1 1 out.mp3
.Ve
.PP
To attach a picture to an mp3 file select both the audio and the picture stream
with \f(CW\*(C`map\*(C'\fR:
.PP
.Vb 2
\&        ffmpeg \-i input.mp3 \-i cover.png \-c copy \-map 0 \-map 1
\&        \-metadata:s:v title="Album cover" \-metadata:s:v comment="Cover (Front)" out.mp3
.Ve
.SS "ogg"
.IX Subsection "ogg"
Ogg container muxer.
.IP "\fB\-page_duration\fR \fIduration\fR" 4
.IX Item "-page_duration duration"
Preferred page duration, in microseconds. The muxer will attempt to create
pages that are approximately \fIduration\fR microseconds long. This allows the
user to compromise between seek granularity and container overhead. The default
is 1 second. A value of 0 will fill all segments, making pages as large as
possible. A value of 1 will effectively use 1 packet-per-page in most
situations, giving a small seek granularity at the cost of additional container
overhead.
.SS "tee"
.IX Subsection "tee"
The tee muxer can be used to write the same data to several files or any
other kind of muxer. It can be used, for example, to both stream a video to
the network and save it to disk at the same time.
.PP
It is different from specifying several outputs to the \fBffmpeg\fR
command-line tool because the audio and video data will be encoded only once
with the tee muxer; encoding can be a very expensive process. It is not
useful when using the libavformat \s-1API\s0 directly because it is then possible
to feed the same packets to several muxers directly.
.PP
The slave outputs are specified in the file name given to the muxer,
separated by '|'. If any of the slave name contains the '|' separator,
leading or trailing spaces or any special character, it must be
escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
manual).
.PP
Options can be specified for each slave by prepending them as a list of
\&\fIkey\fR=\fIvalue\fR pairs separated by ':', between square brackets. If
the options values contain a special character or the ':' separator, they
must be escaped; note that this is a second level escaping.
.PP
Example: encode something and both archive it in a WebM file and stream it
as MPEG-TS over \s-1UDP\s0 (the streams need to be explicitly mapped):
.PP
.Vb 2
\&        ffmpeg \-i ... \-c:v libx264 \-c:a mp2 \-f tee \-map 0:v \-map 0:a
\&          "archive\-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
.Ve
.PP
Note: some codecs may need different options depending on the output format;
the auto-detection of this can not work with the tee muxer. The main example
is the \fBglobal_header\fR flag.
.SH "METADATA"
.IX Header "METADATA"
FFmpeg is able to dump metadata from media files into a simple UTF\-8\-encoded
INI-like text file and then load it back using the metadata muxer/demuxer.
.PP
The file format is as follows:
.IP "1." 4
A file consists of a header and a number of metadata tags divided into sections,
each on its own line.
.IP "2." 4
The header is a ';FFMETADATA' string, followed by a version number (now 1).
.IP "3." 4
Metadata tags are of the form 'key=value'
.IP "4." 4
Immediately after header follows global metadata
.IP "5." 4
After global metadata there may be sections with per\-stream/per\-chapter
metadata.
.IP "6." 4
A section starts with the section name in uppercase (i.e. \s-1STREAM\s0 or \s-1CHAPTER\s0) in
brackets ('[', ']') and ends with next section or end of file.
.IP "7." 4
At the beginning of a chapter section there may be an optional timebase to be
used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
den are integers. If the timebase is missing then start/end times are assumed to
be in milliseconds.
Next a chapter section must contain chapter start and end times in form
\&'START=num', 'END=num', where num is a positive integer.
.IP "8." 4
Empty lines and lines starting with ';' or '#' are ignored.
.IP "9." 4
Metadata keys or values containing special characters ('=', ';', '#', '\e' and a
newline) must be escaped with a backslash '\e'.
.IP "10." 4
Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
the tag (in the example above key is 'foo ', value is ' bar').
.PP
A ffmetadata file might look like this:
.PP
.Vb 4
\&        ;FFMETADATA1
\&        title=bike\e\eshed
\&        ;this is a comment
\&        artist=FFmpeg troll team
\&        
\&        [CHAPTER]
\&        TIMEBASE=1/1000
\&        START=0
\&        #chapter ends at 0:01:00
\&        END=60000
\&        title=chapter \e#1
\&        [STREAM]
\&        title=multi\e
\&        line
.Ve
.SH "PROTOCOLS"
.IX Header "PROTOCOLS"
Protocols are configured elements in FFmpeg which allow to access
resources which require the use of a particular protocol.
.PP
When you configure your FFmpeg build, all the supported protocols are
enabled by default. You can list all available ones using the
configure option \*(L"\-\-list\-protocols\*(R".
.PP
You can disable all the protocols using the configure option
\&\*(L"\-\-disable\-protocols\*(R", and selectively enable a protocol using the
option "\-\-enable\-protocol=\fI\s-1PROTOCOL\s0\fR\*(L", or you can disable a
particular protocol using the option
\&\*(R"\-\-disable\-protocol=\fI\s-1PROTOCOL\s0\fR".
.PP
The option \*(L"\-protocols\*(R" of the ff* tools will display the list of
supported protocols.
.PP
A description of the currently available protocols follows.
.SS "bluray"
.IX Subsection "bluray"
Read BluRay playlist.
.PP
The accepted options are:
.IP "\fBangle\fR" 4
.IX Item "angle"
BluRay angle
.IP "\fBchapter\fR" 4
.IX Item "chapter"
Start chapter (1...N)
.IP "\fBplaylist\fR" 4
.IX Item "playlist"
Playlist to read (\s-1BDMV/PLAYLIST/\s0?????.mpls)
.PP
Examples:
.PP
Read longest playlist from BluRay mounted to /mnt/bluray:
.PP
.Vb 1
\&        bluray:/mnt/bluray
.Ve
.PP
Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
.PP
.Vb 1
\&        \-playlist 4 \-angle 2 \-chapter 2 bluray:/mnt/bluray
.Ve
.SS "concat"
.IX Subsection "concat"
Physical concatenation protocol.
.PP
Allow to read and seek from many resource in sequence as if they were
a unique resource.
.PP
A \s-1URL\s0 accepted by this protocol has the syntax:
.PP
.Vb 1
\&        concat:<URL1>|<URL2>|...|<URLN>
.Ve
.PP
where \fI\s-1URL1\s0\fR, \fI\s-1URL2\s0\fR, ..., \fI\s-1URLN\s0\fR are the urls of the
resource to be concatenated, each one possibly specifying a distinct
protocol.
.PP
For example to read a sequence of files \fIsplit1.mpeg\fR,
\&\fIsplit2.mpeg\fR, \fIsplit3.mpeg\fR with \fBffplay\fR use the
command:
.PP
.Vb 1
\&        ffplay concat:split1.mpeg\e|split2.mpeg\e|split3.mpeg
.Ve
.PP
Note that you may need to escape the character \*(L"|\*(R" which is special for
many shells.
.SS "data"
.IX Subsection "data"
Data in-line in the \s-1URI\s0. See <\fBhttp://en.wikipedia.org/wiki/Data_URI_scheme\fR>.
.PP
For example, to convert a \s-1GIF\s0 file given inline with \fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
.Ve
.SS "file"
.IX Subsection "file"
File access protocol.
.PP
Allow to read from or read to a file.
.PP
For example to read from a file \fIinput.mpeg\fR with \fBffmpeg\fR
use the command:
.PP
.Vb 1
\&        ffmpeg \-i file:input.mpeg output.mpeg
.Ve
.PP
The ff* tools default to the file protocol, that is a resource
specified with the name \*(L"\s-1FILE\s0.mpeg\*(R" is interpreted as the \s-1URL\s0
\&\*(L"file:FILE.mpeg\*(R".
.SS "gopher"
.IX Subsection "gopher"
Gopher protocol.
.SS "hls"
.IX Subsection "hls"
Read Apple \s-1HTTP\s0 Live Streaming compliant segmented stream as
a uniform one. The M3U8 playlists describing the segments can be
remote \s-1HTTP\s0 resources or local files, accessed using the standard
file protocol.
The nested protocol is declared by specifying
"+\fIproto\fR" after the hls \s-1URI\s0 scheme name, where \fIproto\fR
is either \*(L"file\*(R" or \*(L"http\*(R".
.PP
.Vb 2
\&        hls+http://host/path/to/remote/resource.m3u8
\&        hls+file://path/to/local/resource.m3u8
.Ve
.PP
Using this protocol is discouraged \- the hls demuxer should work
just as well (if not, please report the issues) and is more complete.
To use the hls demuxer instead, simply use the direct URLs to the
m3u8 files.
.SS "http"
.IX Subsection "http"
\&\s-1HTTP\s0 (Hyper Text Transfer Protocol).
.PP
This protocol accepts the following options.
.IP "\fBseekable\fR" 4
.IX Item "seekable"
Control seekability of connection. If set to 1 the resource is
supposed to be seekable, if set to 0 it is assumed not to be seekable,
if set to \-1 it will try to autodetect if it is seekable. Default
value is \-1.
.IP "\fBchunked_post\fR" 4
.IX Item "chunked_post"
If set to 1 use chunked transfer-encoding for posts, default is 1.
.IP "\fBheaders\fR" 4
.IX Item "headers"
Set custom \s-1HTTP\s0 headers, can override built in default headers. The
value must be a string encoding the headers.
.IP "\fBcontent_type\fR" 4
.IX Item "content_type"
Force a content type.
.IP "\fBuser-agent\fR" 4
.IX Item "user-agent"
Override User-Agent header. If not specified the protocol will use a
string describing the libavformat build.
.IP "\fBmultiple_requests\fR" 4
.IX Item "multiple_requests"
Use persistent connections if set to 1. By default it is 0.
.IP "\fBpost_data\fR" 4
.IX Item "post_data"
Set custom \s-1HTTP\s0 post data.
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Set timeout of socket I/O operations used by the underlying low level
operation. By default it is set to \-1, which means that the timeout is
not specified.
.IP "\fBmime_type\fR" 4
.IX Item "mime_type"
Set \s-1MIME\s0 type.
.IP "\fBcookies\fR" 4
.IX Item "cookies"
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie \s-1HTTP\s0 response field. Multiple cookies can be
delimited by a newline character.
.PP
\fI\s-1HTTP\s0 Cookies\fR
.IX Subsection "HTTP Cookies"
.PP
Some \s-1HTTP\s0 requests will be denied unless cookie values are passed in with the
request. The \fBcookies\fR option allows these cookies to be specified. At
the very least, each cookie must specify a value along with a path and domain.
\&\s-1HTTP\s0 requests that match both the domain and path will automatically include the
cookie value in the \s-1HTTP\s0 Cookie header field. Multiple cookies can be delimited
by a newline.
.PP
The required syntax to play a stream specifying a cookie is:
.PP
.Vb 1
\&        ffplay \-cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
.Ve
.SS "mmst"
.IX Subsection "mmst"
\&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1TCP\s0.
.SS "mmsh"
.IX Subsection "mmsh"
\&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1HTTP\s0.
.PP
The required syntax is:
.PP
.Vb 1
\&        mmsh://<server>[:<port>][/<app>][/<playpath>]
.Ve
.SS "md5"
.IX Subsection "md5"
\&\s-1MD5\s0 output protocol.
.PP
Computes the \s-1MD5\s0 hash of the data to be written, and on close writes
this to the designated output or stdout if none is specified. It can
be used to test muxers without writing an actual file.
.PP
Some examples follow.
.PP
.Vb 2
\&        # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
\&        ffmpeg \-i input.flv \-f avi \-y md5:output.avi.md5
\&        
\&        # Write the MD5 hash of the encoded AVI file to stdout.
\&        ffmpeg \-i input.flv \-f avi \-y md5:
.Ve
.PP
Note that some formats (typically \s-1MOV\s0) require the output protocol to
be seekable, so they will fail with the \s-1MD5\s0 output protocol.
.SS "pipe"
.IX Subsection "pipe"
\&\s-1UNIX\s0 pipe access protocol.
.PP
Allow to read and write from \s-1UNIX\s0 pipes.
.PP
The accepted syntax is:
.PP
.Vb 1
\&        pipe:[<number>]
.Ve
.PP
\&\fInumber\fR is the number corresponding to the file descriptor of the
pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If \fInumber\fR
is not specified, by default the stdout file descriptor will be used
for writing, stdin for reading.
.PP
For example to read from stdin with \fBffmpeg\fR:
.PP
.Vb 3
\&        cat test.wav | ffmpeg \-i pipe:0
\&        # ...this is the same as...
\&        cat test.wav | ffmpeg \-i pipe:
.Ve
.PP
For writing to stdout with \fBffmpeg\fR:
.PP
.Vb 3
\&        ffmpeg \-i test.wav \-f avi pipe:1 | cat > test.avi
\&        # ...this is the same as...
\&        ffmpeg \-i test.wav \-f avi pipe: | cat > test.avi
.Ve
.PP
Note that some formats (typically \s-1MOV\s0), require the output protocol to
be seekable, so they will fail with the pipe output protocol.
.SS "rtmp"
.IX Subsection "rtmp"
Real-Time Messaging Protocol.
.PP
The Real-Time Messaging Protocol (\s-1RTMP\s0) is used for streaming multimedia
content across a \s-1TCP/IP\s0 network.
.PP
The required syntax is:
.PP
.Vb 1
\&        rtmp://<server>[:<port>][/<app>][/<instance>][/<playpath>]
.Ve
.PP
The accepted parameters are:
.IP "\fBserver\fR" 4
.IX Item "server"
The address of the \s-1RTMP\s0 server.
.IP "\fBport\fR" 4
.IX Item "port"
The number of the \s-1TCP\s0 port to use (by default is 1935).
.IP "\fBapp\fR" 4
.IX Item "app"
It is the name of the application to access. It usually corresponds to
the path where the application is installed on the \s-1RTMP\s0 server
(e.g. \fI/ondemand/\fR, \fI/flash/live/\fR, etc.). You can override
the value parsed from the \s-1URI\s0 through the \f(CW\*(C`rtmp_app\*(C'\fR option, too.
.IP "\fBplaypath\fR" 4
.IX Item "playpath"
It is the path or name of the resource to play with reference to the
application specified in \fIapp\fR, may be prefixed by \*(L"mp4:\*(R". You
can override the value parsed from the \s-1URI\s0 through the \f(CW\*(C`rtmp_playpath\*(C'\fR
option, too.
.IP "\fBlisten\fR" 4
.IX Item "listen"
Act as a server, listening for an incoming connection.
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Maximum time to wait for the incoming connection. Implies listen.
.PP
Additionally, the following parameters can be set via command line options
(or in code via \f(CW\*(C`AVOption\*(C'\fRs):
.IP "\fBrtmp_app\fR" 4
.IX Item "rtmp_app"
Name of application to connect on the \s-1RTMP\s0 server. This option
overrides the parameter specified in the \s-1URI\s0.
.IP "\fBrtmp_buffer\fR" 4
.IX Item "rtmp_buffer"
Set the client buffer time in milliseconds. The default is 3000.
.IP "\fBrtmp_conn\fR" 4
.IX Item "rtmp_conn"
Extra arbitrary \s-1AMF\s0 connection parameters, parsed from a string,
e.g. like \f(CW\*(C`B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0\*(C'\fR.
Each value is prefixed by a single character denoting the type,
B for Boolean, N for number, S for string, O for object, or Z for null,
followed by a colon. For Booleans the data must be either 0 or 1 for
\&\s-1FALSE\s0 or \s-1TRUE\s0, respectively.  Likewise for Objects the data must be 0 or
1 to end or begin an object, respectively. Data items in subobjects may
be named, by prefixing the type with 'N' and specifying the name before
the value (i.e. \f(CW\*(C`NB:myFlag:1\*(C'\fR). This option may be used multiple
times to construct arbitrary \s-1AMF\s0 sequences.
.IP "\fBrtmp_flashver\fR" 4
.IX Item "rtmp_flashver"
Version of the Flash plugin used to run the \s-1SWF\s0 player. The default
is \s-1LNX\s0 9,0,124,2.
.IP "\fBrtmp_flush_interval\fR" 4
.IX Item "rtmp_flush_interval"
Number of packets flushed in the same request (\s-1RTMPT\s0 only). The default
is 10.
.IP "\fBrtmp_live\fR" 4
.IX Item "rtmp_live"
Specify that the media is a live stream. No resuming or seeking in
live streams is possible. The default value is \f(CW\*(C`any\*(C'\fR, which means the
subscriber first tries to play the live stream specified in the
playpath. If a live stream of that name is not found, it plays the
recorded stream. The other possible values are \f(CW\*(C`live\*(C'\fR and
\&\f(CW\*(C`recorded\*(C'\fR.
.IP "\fBrtmp_pageurl\fR" 4
.IX Item "rtmp_pageurl"
\&\s-1URL\s0 of the web page in which the media was embedded. By default no
value will be sent.
.IP "\fBrtmp_playpath\fR" 4
.IX Item "rtmp_playpath"
Stream identifier to play or to publish. This option overrides the
parameter specified in the \s-1URI\s0.
.IP "\fBrtmp_subscribe\fR" 4
.IX Item "rtmp_subscribe"
Name of live stream to subscribe to. By default no value will be sent.
It is only sent if the option is specified or if rtmp_live
is set to live.
.IP "\fBrtmp_swfhash\fR" 4
.IX Item "rtmp_swfhash"
\&\s-1SHA256\s0 hash of the decompressed \s-1SWF\s0 file (32 bytes).
.IP "\fBrtmp_swfsize\fR" 4
.IX Item "rtmp_swfsize"
Size of the decompressed \s-1SWF\s0 file, required for SWFVerification.
.IP "\fBrtmp_swfurl\fR" 4
.IX Item "rtmp_swfurl"
\&\s-1URL\s0 of the \s-1SWF\s0 player for the media. By default no value will be sent.
.IP "\fBrtmp_swfverify\fR" 4
.IX Item "rtmp_swfverify"
\&\s-1URL\s0 to player swf file, compute hash/size automatically.
.IP "\fBrtmp_tcurl\fR" 4
.IX Item "rtmp_tcurl"
\&\s-1URL\s0 of the target stream. Defaults to proto://host[:port]/app.
.PP
For example to read with \fBffplay\fR a multimedia resource named
\&\*(L"sample\*(R" from the application \*(L"vod\*(R" from an \s-1RTMP\s0 server \*(L"myserver\*(R":
.PP
.Vb 1
\&        ffplay rtmp://myserver/vod/sample
.Ve
.SS "rtmpe"
.IX Subsection "rtmpe"
Encrypted Real-Time Messaging Protocol.
.PP
The Encrypted Real-Time Messaging Protocol (\s-1RTMPE\s0) is used for
streaming multimedia content within standard cryptographic primitives,
consisting of Diffie-Hellman key exchange and \s-1HMACSHA256\s0, generating
a pair of \s-1RC4\s0 keys.
.SS "rtmps"
.IX Subsection "rtmps"
Real-Time Messaging Protocol over a secure \s-1SSL\s0 connection.
.PP
The Real-Time Messaging Protocol (\s-1RTMPS\s0) is used for streaming
multimedia content across an encrypted connection.
.SS "rtmpt"
.IX Subsection "rtmpt"
Real-Time Messaging Protocol tunneled through \s-1HTTP\s0.
.PP
The Real-Time Messaging Protocol tunneled through \s-1HTTP\s0 (\s-1RTMPT\s0) is used
for streaming multimedia content within \s-1HTTP\s0 requests to traverse
firewalls.
.SS "rtmpte"
.IX Subsection "rtmpte"
Encrypted Real-Time Messaging Protocol tunneled through \s-1HTTP\s0.
.PP
The Encrypted Real-Time Messaging Protocol tunneled through \s-1HTTP\s0 (\s-1RTMPTE\s0)
is used for streaming multimedia content within \s-1HTTP\s0 requests to traverse
firewalls.
.SS "rtmpts"
.IX Subsection "rtmpts"
Real-Time Messaging Protocol tunneled through \s-1HTTPS\s0.
.PP
The Real-Time Messaging Protocol tunneled through \s-1HTTPS\s0 (\s-1RTMPTS\s0) is used
for streaming multimedia content within \s-1HTTPS\s0 requests to traverse
firewalls.
.SS "rtmp, rtmpe, rtmps, rtmpt, rtmpte"
.IX Subsection "rtmp, rtmpe, rtmps, rtmpt, rtmpte"
Real-Time Messaging Protocol and its variants supported through
librtmp.
.PP
Requires the presence of the librtmp headers and library during
configuration. You need to explicitly configure the build with
\&\*(L"\-\-enable\-librtmp\*(R". If enabled this will replace the native \s-1RTMP\s0
protocol.
.PP
This protocol provides most client functions and a few server
functions needed to support \s-1RTMP\s0, \s-1RTMP\s0 tunneled in \s-1HTTP\s0 (\s-1RTMPT\s0),
encrypted \s-1RTMP\s0 (\s-1RTMPE\s0), \s-1RTMP\s0 over \s-1SSL/TLS\s0 (\s-1RTMPS\s0) and tunneled
variants of these encrypted types (\s-1RTMPTE\s0, \s-1RTMPTS\s0).
.PP
The required syntax is:
.PP
.Vb 1
\&        <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
.Ve
.PP
where \fIrtmp_proto\fR is one of the strings \*(L"rtmp\*(R", \*(L"rtmpt\*(R", \*(L"rtmpe\*(R",
\&\*(L"rtmps\*(R", \*(L"rtmpte\*(R", \*(L"rtmpts\*(R" corresponding to each \s-1RTMP\s0 variant, and
\&\fIserver\fR, \fIport\fR, \fIapp\fR and \fIplaypath\fR have the same
meaning as specified for the \s-1RTMP\s0 native protocol.
\&\fIoptions\fR contains a list of space-separated options of the form
\&\fIkey\fR=\fIval\fR.
.PP
See the librtmp manual page (man 3 librtmp) for more information.
.PP
For example, to stream a file in real-time to an \s-1RTMP\s0 server using
\&\fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-re \-i myfile \-f flv rtmp://myserver/live/mystream
.Ve
.PP
To play the same stream using \fBffplay\fR:
.PP
.Vb 1
\&        ffplay "rtmp://myserver/live/mystream live=1"
.Ve
.SS "rtp"
.IX Subsection "rtp"
Real-Time Protocol.
.SS "rtsp"
.IX Subsection "rtsp"
\&\s-1RTSP\s0 is not technically a protocol handler in libavformat, it is a demuxer
and muxer. The demuxer supports both normal \s-1RTSP\s0 (with data transferred
over \s-1RTP\s0; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
data transferred over \s-1RDT\s0).
.PP
The muxer can be used to send a stream using \s-1RTSP\s0 \s-1ANNOUNCE\s0 to a server
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
<\fBhttp://github.com/revmischa/rtsp\-server\fR>).
.PP
The required syntax for a \s-1RTSP\s0 url is:
.PP
.Vb 1
\&        rtsp://<hostname>[:<port>]/<path>
.Ve
.PP
The following options (set on the \fBffmpeg\fR/\fBffplay\fR command
line, or set in code via \f(CW\*(C`AVOption\*(C'\fRs or in \f(CW\*(C`avformat_open_input\*(C'\fR),
are supported:
.PP
Flags for \f(CW\*(C`rtsp_transport\*(C'\fR:
.IP "\fBudp\fR" 4
.IX Item "udp"
Use \s-1UDP\s0 as lower transport protocol.
.IP "\fBtcp\fR" 4
.IX Item "tcp"
Use \s-1TCP\s0 (interleaving within the \s-1RTSP\s0 control channel) as lower
transport protocol.
.IP "\fBudp_multicast\fR" 4
.IX Item "udp_multicast"
Use \s-1UDP\s0 multicast as lower transport protocol.
.IP "\fBhttp\fR" 4
.IX Item "http"
Use \s-1HTTP\s0 tunneling as lower transport protocol, which is useful for
passing proxies.
.PP
Multiple lower transport protocols may be specified, in that case they are
tried one at a time (if the setup of one fails, the next one is tried).
For the muxer, only the \f(CW\*(C`tcp\*(C'\fR and \f(CW\*(C`udp\*(C'\fR options are supported.
.PP
Flags for \f(CW\*(C`rtsp_flags\*(C'\fR:
.IP "\fBfilter_src\fR" 4
.IX Item "filter_src"
Accept packets only from negotiated peer address and port.
.IP "\fBlisten\fR" 4
.IX Item "listen"
Act as a server, listening for an incoming connection.
.PP
When receiving data over \s-1UDP\s0, the demuxer tries to reorder received packets
(since they may arrive out of order, or packets may get lost totally). This
can be disabled by setting the maximum demuxing delay to zero (via
the \f(CW\*(C`max_delay\*(C'\fR field of AVFormatContext).
.PP
When watching multi-bitrate Real-RTSP streams with \fBffplay\fR, the
streams to display can be chosen with \f(CW\*(C`\-vst\*(C'\fR \fIn\fR and
\&\f(CW\*(C`\-ast\*(C'\fR \fIn\fR for video and audio respectively, and can be switched
on the fly by pressing \f(CW\*(C`v\*(C'\fR and \f(CW\*(C`a\*(C'\fR.
.PP
Example command lines:
.PP
To watch a stream over \s-1UDP\s0, with a max reordering delay of 0.5 seconds:
.PP
.Vb 1
\&        ffplay \-max_delay 500000 \-rtsp_transport udp rtsp://server/video.mp4
.Ve
.PP
To watch a stream tunneled over \s-1HTTP:\s0
.PP
.Vb 1
\&        ffplay \-rtsp_transport http rtsp://server/video.mp4
.Ve
.PP
To send a stream in realtime to a \s-1RTSP\s0 server, for others to watch:
.PP
.Vb 1
\&        ffmpeg \-re \-i <input> \-f rtsp \-muxdelay 0.1 rtsp://server/live.sdp
.Ve
.PP
To receive a stream in realtime:
.PP
.Vb 1
\&        ffmpeg \-rtsp_flags listen \-i rtsp://ownaddress/live.sdp <output>
.Ve
.IP "\fBstimeout\fR" 4
.IX Item "stimeout"
Socket \s-1IO\s0 timeout in micro seconds.
.SS "sap"
.IX Subsection "sap"
Session Announcement Protocol (\s-1RFC\s0 2974). This is not technically a
protocol handler in libavformat, it is a muxer and demuxer.
It is used for signalling of \s-1RTP\s0 streams, by announcing the \s-1SDP\s0 for the
streams regularly on a separate port.
.PP
\fIMuxer\fR
.IX Subsection "Muxer"
.PP
The syntax for a \s-1SAP\s0 url given to the muxer is:
.PP
.Vb 1
\&        sap://<destination>[:<port>][?<options>]
.Ve
.PP
The \s-1RTP\s0 packets are sent to \fIdestination\fR on port \fIport\fR,
or to port 5004 if no port is specified.
\&\fIoptions\fR is a \f(CW\*(C`&\*(C'\fR\-separated list. The following options
are supported:
.IP "\fBannounce_addr=\fR\fIaddress\fR" 4
.IX Item "announce_addr=address"
Specify the destination \s-1IP\s0 address for sending the announcements to.
If omitted, the announcements are sent to the commonly used \s-1SAP\s0
announcement multicast address 224.2.127.254 (sap.mcast.net), or
ff0e::2:7ffe if \fIdestination\fR is an IPv6 address.
.IP "\fBannounce_port=\fR\fIport\fR" 4
.IX Item "announce_port=port"
Specify the port to send the announcements on, defaults to
9875 if not specified.
.IP "\fBttl=\fR\fIttl\fR" 4
.IX Item "ttl=ttl"
Specify the time to live value for the announcements and \s-1RTP\s0 packets,
defaults to 255.
.IP "\fBsame_port=\fR\fI0|1\fR" 4
.IX Item "same_port=0|1"
If set to 1, send all \s-1RTP\s0 streams on the same port pair. If zero (the
default), all streams are sent on unique ports, with each stream on a
port 2 numbers higher than the previous.
VLC/Live555 requires this to be set to 1, to be able to receive the stream.
The \s-1RTP\s0 stack in libavformat for receiving requires all streams to be sent
on unique ports.
.PP
Example command lines follow.
.PP
To broadcast a stream on the local subnet, for watching in \s-1VLC:\s0
.PP
.Vb 1
\&        ffmpeg \-re \-i <input> \-f sap sap://224.0.0.255?same_port=1
.Ve
.PP
Similarly, for watching in \fBffplay\fR:
.PP
.Vb 1
\&        ffmpeg \-re \-i <input> \-f sap sap://224.0.0.255
.Ve
.PP
And for watching in \fBffplay\fR, over IPv6:
.PP
.Vb 1
\&        ffmpeg \-re \-i <input> \-f sap sap://[ff0e::1:2:3:4]
.Ve
.PP
\fIDemuxer\fR
.IX Subsection "Demuxer"
.PP
The syntax for a \s-1SAP\s0 url given to the demuxer is:
.PP
.Vb 1
\&        sap://[<address>][:<port>]
.Ve
.PP
\&\fIaddress\fR is the multicast address to listen for announcements on,
if omitted, the default 224.2.127.254 (sap.mcast.net) is used. \fIport\fR
is the port that is listened on, 9875 if omitted.
.PP
The demuxers listens for announcements on the given address and port.
Once an announcement is received, it tries to receive that particular stream.
.PP
Example command lines follow.
.PP
To play back the first stream announced on the normal \s-1SAP\s0 multicast address:
.PP
.Vb 1
\&        ffplay sap://
.Ve
.PP
To play back the first stream announced on one the default IPv6 \s-1SAP\s0 multicast address:
.PP
.Vb 1
\&        ffplay sap://[ff0e::2:7ffe]
.Ve
.SS "tcp"
.IX Subsection "tcp"
Trasmission Control Protocol.
.PP
The required syntax for a \s-1TCP\s0 url is:
.PP
.Vb 1
\&        tcp://<hostname>:<port>[?<options>]
.Ve
.IP "\fBlisten\fR" 4
.IX Item "listen"
Listen for an incoming connection
.IP "\fBtimeout=\fR\fImicroseconds\fR" 4
.IX Item "timeout=microseconds"
In read mode: if no data arrived in more than this time interval, raise error.
In write mode: if socket cannot be written in more than this time interval, raise error.
This also sets timeout on \s-1TCP\s0 connection establishing.
.Sp
.Vb 2
\&        ffmpeg \-i <input> \-f <format> tcp://<hostname>:<port>?listen
\&        ffplay tcp://<hostname>:<port>
.Ve
.SS "tls"
.IX Subsection "tls"
Transport Layer Security/Secure Sockets Layer
.PP
The required syntax for a \s-1TLS/SSL\s0 url is:
.PP
.Vb 1
\&        tls://<hostname>:<port>[?<options>]
.Ve
.IP "\fBlisten\fR" 4
.IX Item "listen"
Act as a server, listening for an incoming connection.
.IP "\fBcafile=\fR\fIfilename\fR" 4
.IX Item "cafile=filename"
Certificate authority file. The file must be in OpenSSL \s-1PEM\s0 format.
.IP "\fBcert=\fR\fIfilename\fR" 4
.IX Item "cert=filename"
Certificate file. The file must be in OpenSSL \s-1PEM\s0 format.
.IP "\fBkey=\fR\fIfilename\fR" 4
.IX Item "key=filename"
Private key file.
.IP "\fBverify=\fR\fI0|1\fR" 4
.IX Item "verify=0|1"
Verify the peer's certificate.
.PP
Example command lines:
.PP
To create a \s-1TLS/SSL\s0 server that serves an input stream.
.PP
.Vb 1
\&        ffmpeg \-i <input> \-f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key>
.Ve
.PP
To play back a stream from the \s-1TLS/SSL\s0 server using \fBffplay\fR:
.PP
.Vb 1
\&        ffplay tls://<hostname>:<port>
.Ve
.SS "udp"
.IX Subsection "udp"
User Datagram Protocol.
.PP
The required syntax for a \s-1UDP\s0 url is:
.PP
.Vb 1
\&        udp://<hostname>:<port>[?<options>]
.Ve
.PP
\&\fIoptions\fR contains a list of &\-separated options of the form \fIkey\fR=\fIval\fR.
.PP
In case threading is enabled on the system, a circular buffer is used
to store the incoming data, which allows to reduce loss of data due to
\&\s-1UDP\s0 socket buffer overruns. The \fIfifo_size\fR and
\&\fIoverrun_nonfatal\fR options are related to this buffer.
.PP
The list of supported options follows.
.IP "\fBbuffer_size=\fR\fIsize\fR" 4
.IX Item "buffer_size=size"
Set the \s-1UDP\s0 socket buffer size in bytes. This is used both for the
receiving and the sending buffer size.
.IP "\fBlocalport=\fR\fIport\fR" 4
.IX Item "localport=port"
Override the local \s-1UDP\s0 port to bind with.
.IP "\fBlocaladdr=\fR\fIaddr\fR" 4
.IX Item "localaddr=addr"
Choose the local \s-1IP\s0 address. This is useful e.g. if sending multicast
and the host has multiple interfaces, where the user can choose
which interface to send on by specifying the \s-1IP\s0 address of that interface.
.IP "\fBpkt_size=\fR\fIsize\fR" 4
.IX Item "pkt_size=size"
Set the size in bytes of \s-1UDP\s0 packets.
.IP "\fBreuse=\fR\fI1|0\fR" 4
.IX Item "reuse=1|0"
Explicitly allow or disallow reusing \s-1UDP\s0 sockets.
.IP "\fBttl=\fR\fIttl\fR" 4
.IX Item "ttl=ttl"
Set the time to live value (for multicast only).
.IP "\fBconnect=\fR\fI1|0\fR" 4
.IX Item "connect=1|0"
Initialize the \s-1UDP\s0 socket with \f(CW\*(C`connect()\*(C'\fR. In this case, the
destination address can't be changed with ff_udp_set_remote_url later.
If the destination address isn't known at the start, this option can
be specified in ff_udp_set_remote_url, too.
This allows finding out the source address for the packets with getsockname,
and makes writes return with \s-1AVERROR\s0(\s-1ECONNREFUSED\s0) if \*(L"destination
unreachable\*(R" is received.
For receiving, this gives the benefit of only receiving packets from
the specified peer address/port.
.IP "\fBsources=\fR\fIaddress\fR\fB[,\fR\fIaddress\fR\fB]\fR" 4
.IX Item "sources=address[,address]"
Only receive packets sent to the multicast group from one of the
specified sender \s-1IP\s0 addresses.
.IP "\fBblock=\fR\fIaddress\fR\fB[,\fR\fIaddress\fR\fB]\fR" 4
.IX Item "block=address[,address]"
Ignore packets sent to the multicast group from the specified
sender \s-1IP\s0 addresses.
.IP "\fBfifo_size=\fR\fIunits\fR" 4
.IX Item "fifo_size=units"
Set the \s-1UDP\s0 receiving circular buffer size, expressed as a number of
packets with size of 188 bytes. If not specified defaults to 7*4096.
.IP "\fBoverrun_nonfatal=\fR\fI1|0\fR" 4
.IX Item "overrun_nonfatal=1|0"
Survive in case of \s-1UDP\s0 receiving circular buffer overrun. Default
value is 0.
.IP "\fBtimeout=\fR\fImicroseconds\fR" 4
.IX Item "timeout=microseconds"
In read mode: if no data arrived in more than this time interval, raise error.
.PP
Some usage examples of the \s-1UDP\s0 protocol with \fBffmpeg\fR follow.
.PP
To stream over \s-1UDP\s0 to a remote endpoint:
.PP
.Vb 1
\&        ffmpeg \-i <input> \-f <format> udp://<hostname>:<port>
.Ve
.PP
To stream in mpegts format over \s-1UDP\s0 using 188 sized \s-1UDP\s0 packets, using a large input buffer:
.PP
.Vb 1
\&        ffmpeg \-i <input> \-f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
.Ve
.PP
To receive over \s-1UDP\s0 from a remote endpoint:
.PP
.Vb 1
\&        ffmpeg \-i udp://[<multicast\-address>]:<port>
.Ve
.SH "DEVICE OPTIONS"
.IX Header "DEVICE OPTIONS"
The libavdevice library provides the same interface as
libavformat. Namely, an input device is considered like a demuxer, and
an output device like a muxer, and the interface and generic device
options are the same provided by libavformat (see the ffmpeg-formats
manual).
.PP
In addition each input or output device may support so-called private
options, which are specific for that component.
.PP
Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
FFmpeg tools, or by setting the value explicitly in the device
\&\f(CW\*(C`AVFormatContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0
for programmatic use.
.SH "INPUT DEVICES"
.IX Header "INPUT DEVICES"
Input devices are configured elements in FFmpeg which allow to access
the data coming from a multimedia device attached to your system.
.PP
When you configure your FFmpeg build, all the supported input devices
are enabled by default. You can list all available ones using the
configure option \*(L"\-\-list\-indevs\*(R".
.PP
You can disable all the input devices using the configure option
\&\*(L"\-\-disable\-indevs\*(R", and selectively enable an input device using the
option "\-\-enable\-indev=\fI\s-1INDEV\s0\fR\*(L", or you can disable a particular
input device using the option \*(R"\-\-disable\-indev=\fI\s-1INDEV\s0\fR".
.PP
The option \*(L"\-formats\*(R" of the ff* tools will display the list of
supported input devices (amongst the demuxers).
.PP
A description of the currently available input devices follows.
.SS "alsa"
.IX Subsection "alsa"
\&\s-1ALSA\s0 (Advanced Linux Sound Architecture) input device.
.PP
To enable this input device during configuration you need libasound
installed on your system.
.PP
This device allows capturing from an \s-1ALSA\s0 device. The name of the
device to capture has to be an \s-1ALSA\s0 card identifier.
.PP
An \s-1ALSA\s0 identifier has the syntax:
.PP
.Vb 1
\&        hw:<CARD>[,<DEV>[,<SUBDEV>]]
.Ve
.PP
where the \fI\s-1DEV\s0\fR and \fI\s-1SUBDEV\s0\fR components are optional.
.PP
The three arguments (in order: \fI\s-1CARD\s0\fR,\fI\s-1DEV\s0\fR,\fI\s-1SUBDEV\s0\fR)
specify card number or identifier, device number and subdevice number
(\-1 means any).
.PP
To see the list of cards currently recognized by your system check the
files \fI/proc/asound/cards\fR and \fI/proc/asound/devices\fR.
.PP
For example to capture with \fBffmpeg\fR from an \s-1ALSA\s0 device with
card id 0, you may run the command:
.PP
.Vb 1
\&        ffmpeg \-f alsa \-i hw:0 alsaout.wav
.Ve
.PP
For more information see:
<\fBhttp://www.alsa\-project.org/alsa\-doc/alsa\-lib/pcm.html\fR>
.SS "bktr"
.IX Subsection "bktr"
\&\s-1BSD\s0 video input device.
.SS "dshow"
.IX Subsection "dshow"
Windows DirectShow input device.
.PP
DirectShow support is enabled when FFmpeg is built with the mingw\-w64 project.
Currently only audio and video devices are supported.
.PP
Multiple devices may be opened as separate inputs, but they may also be
opened on the same input, which should improve synchronism between them.
.PP
The input name should be in the format:
.PP
.Vb 1
\&        <TYPE>=<NAME>[:<TYPE>=<NAME>]
.Ve
.PP
where \fI\s-1TYPE\s0\fR can be either \fIaudio\fR or \fIvideo\fR,
and \fI\s-1NAME\s0\fR is the device's name.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
If no options are specified, the device's defaults are used.
If the device does not support the requested options, it will
fail to open.
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video size in the captured video.
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the frame rate in the captured video.
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Set the sample rate (in Hz) of the captured audio.
.IP "\fBsample_size\fR" 4
.IX Item "sample_size"
Set the sample size (in bits) of the captured audio.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of channels in the captured audio.
.IP "\fBlist_devices\fR" 4
.IX Item "list_devices"
If set to \fBtrue\fR, print a list of devices and exit.
.IP "\fBlist_options\fR" 4
.IX Item "list_options"
If set to \fBtrue\fR, print a list of selected device's options
and exit.
.IP "\fBvideo_device_number\fR" 4
.IX Item "video_device_number"
Set video device number for devices with same name (starts at 0,
defaults to 0).
.IP "\fBaudio_device_number\fR" 4
.IX Item "audio_device_number"
Set audio device number for devices with same name (starts at 0,
defaults to 0).
.IP "\fBpixel_format\fR" 4
.IX Item "pixel_format"
Select pixel format to be used by DirectShow. This may only be set when
the video codec is not set or set to rawvideo.
.IP "\fBaudio_buffer_size\fR" 4
.IX Item "audio_buffer_size"
Set audio device buffer size in milliseconds (which can directly
impact latency, depending on the device).
Defaults to using the audio device's
default buffer size (typically some multiple of 500ms).
Setting this value too low can degrade performance.
See also
<\fBhttp://msdn.microsoft.com/en\-us/library/windows/desktop/dd377582(v=vs.85).aspx\fR>
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Print the list of DirectShow supported devices and exit:
.Sp
.Vb 1
\&        $ ffmpeg \-list_devices true \-f dshow \-i dummy
.Ve
.IP "\(bu" 4
Open video device \fICamera\fR:
.Sp
.Vb 1
\&        $ ffmpeg \-f dshow \-i video="Camera"
.Ve
.IP "\(bu" 4
Open second video device with name \fICamera\fR:
.Sp
.Vb 1
\&        $ ffmpeg \-f dshow \-video_device_number 1 \-i video="Camera"
.Ve
.IP "\(bu" 4
Open video device \fICamera\fR and audio device \fIMicrophone\fR:
.Sp
.Vb 1
\&        $ ffmpeg \-f dshow \-i video="Camera":audio="Microphone"
.Ve
.IP "\(bu" 4
Print the list of supported options in selected device and exit:
.Sp
.Vb 1
\&        $ ffmpeg \-list_options true \-f dshow \-i video="Camera"
.Ve
.SS "dv1394"
.IX Subsection "dv1394"
Linux \s-1DV\s0 1394 input device.
.SS "fbdev"
.IX Subsection "fbdev"
Linux framebuffer input device.
.PP
The Linux framebuffer is a graphic hardware-independent abstraction
layer to show graphics on a computer monitor, typically on the
console. It is accessed through a file device node, usually
\&\fI/dev/fb0\fR.
.PP
For more detailed information read the file
Documentation/fb/framebuffer.txt included in the Linux source tree.
.PP
To record from the framebuffer device \fI/dev/fb0\fR with
\&\fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-f fbdev \-r 10 \-i /dev/fb0 out.avi
.Ve
.PP
You can take a single screenshot image with the command:
.PP
.Vb 1
\&        ffmpeg \-f fbdev \-frames:v 1 \-r 1 \-i /dev/fb0 screenshot.jpeg
.Ve
.PP
See also <\fBhttp://linux\-fbdev.sourceforge.net/\fR>, and \fIfbset\fR\|(1).
.SS "iec61883"
.IX Subsection "iec61883"
FireWire \s-1DV/HDV\s0 input device using libiec61883.
.PP
To enable this input device, you need libiec61883, libraw1394 and
libavc1394 installed on your system. Use the configure option
\&\f(CW\*(C`\-\-enable\-libiec61883\*(C'\fR to compile with the device enabled.
.PP
The iec61883 capture device supports capturing from a video device
connected via \s-1IEEE1394\s0 (FireWire), using libiec61883 and the new Linux
FireWire stack (juju). This is the default \s-1DV/HDV\s0 input method in Linux
Kernel 2.6.37 and later, since the old FireWire stack was removed.
.PP
Specify the FireWire port to be used as input file, or \*(L"auto\*(R"
to choose the first port connected.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBdvtype\fR" 4
.IX Item "dvtype"
Override autodetection of \s-1DV/HDV\s0. This should only be used if auto
detection does not work, or if usage of a different device type
should be prohibited. Treating a \s-1DV\s0 device as \s-1HDV\s0 (or vice versa) will
not work and result in undefined behavior.
The values \fBauto\fR, \fBdv\fR and \fBhdv\fR are supported.
.IP "\fBdvbuffer\fR" 4
.IX Item "dvbuffer"
Set maxiumum size of buffer for incoming data, in frames. For \s-1DV\s0, this
is an exact value. For \s-1HDV\s0, it is not frame exact, since \s-1HDV\s0 does
not have a fixed frame size.
.IP "\fBdvguid\fR" 4
.IX Item "dvguid"
Select the capture device by specifying it's \s-1GUID\s0. Capturing will only
be performed from the specified device and fails if no device with the
given \s-1GUID\s0 is found. This is useful to select the input if multiple
devices are connected at the same time.
Look at /sys/bus/firewire/devices to find out the GUIDs.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Grab and show the input of a FireWire \s-1DV/HDV\s0 device.
.Sp
.Vb 1
\&        ffplay \-f iec61883 \-i auto
.Ve
.IP "\(bu" 4
Grab and record the input of a FireWire \s-1DV/HDV\s0 device,
using a packet buffer of 100000 packets if the source is \s-1HDV\s0.
.Sp
.Vb 1
\&        ffmpeg \-f iec61883 \-i auto \-hdvbuffer 100000 out.mpg
.Ve
.SS "jack"
.IX Subsection "jack"
\&\s-1JACK\s0 input device.
.PP
To enable this input device during configuration you need libjack
installed on your system.
.PP
A \s-1JACK\s0 input device creates one or more \s-1JACK\s0 writable clients, one for
each audio channel, with name \fIclient_name\fR:input_\fIN\fR, where
\&\fIclient_name\fR is the name provided by the application, and \fIN\fR
is a number which identifies the channel.
Each writable client will send the acquired data to the FFmpeg input
device.
.PP
Once you have created one or more \s-1JACK\s0 readable clients, you need to
connect them to one or more \s-1JACK\s0 writable clients.
.PP
To connect or disconnect \s-1JACK\s0 clients you can use the \fBjack_connect\fR
and \fBjack_disconnect\fR programs, or do it through a graphical interface,
for example with \fBqjackctl\fR.
.PP
To list the \s-1JACK\s0 clients and their properties you can invoke the command
\&\fBjack_lsp\fR.
.PP
Follows an example which shows how to capture a \s-1JACK\s0 readable client
with \fBffmpeg\fR.
.PP
.Vb 2
\&        # Create a JACK writable client with name "ffmpeg".
\&        $ ffmpeg \-f jack \-i ffmpeg \-y out.wav
\&        
\&        # Start the sample jack_metro readable client.
\&        $ jack_metro \-b 120 \-d 0.2 \-f 4000
\&        
\&        # List the current JACK clients.
\&        $ jack_lsp \-c
\&        system:capture_1
\&        system:capture_2
\&        system:playback_1
\&        system:playback_2
\&        ffmpeg:input_1
\&        metro:120_bpm
\&        
\&        # Connect metro to the ffmpeg writable client.
\&        $ jack_connect metro:120_bpm ffmpeg:input_1
.Ve
.PP
For more information read:
<\fBhttp://jackaudio.org/\fR>
.SS "lavfi"
.IX Subsection "lavfi"
Libavfilter input virtual device.
.PP
This input device reads data from the open output pads of a libavfilter
filtergraph.
.PP
For each filtergraph open output, the input device will create a
corresponding stream which is mapped to the generated output. Currently
only video data is supported. The filtergraph is specified through the
option \fBgraph\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBgraph\fR" 4
.IX Item "graph"
Specify the filtergraph to use as input. Each video open output must be
labelled by a unique string of the form "out\fIN\fR", where \fIN\fR is a
number starting from 0 corresponding to the mapped input stream
generated by the device.
The first unlabelled output is automatically assigned to the \*(L"out0\*(R"
label, but all the others need to be specified explicitly.
.Sp
If not specified defaults to the filename specified for the input
device.
.IP "\fBgraph_file\fR" 4
.IX Item "graph_file"
Set the filename of the filtergraph to be read and sent to the other
filters. Syntax of the filtergraph is the same as the one specified by
the option \fIgraph\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Create a color video stream and play it back with \fBffplay\fR:
.Sp
.Vb 1
\&        ffplay \-f lavfi \-graph "color=c=pink [out0]" dummy
.Ve
.IP "\(bu" 4
As the previous example, but use filename for specifying the graph
description, and omit the \*(L"out0\*(R" label:
.Sp
.Vb 1
\&        ffplay \-f lavfi color=c=pink
.Ve
.IP "\(bu" 4
Create three different video test filtered sources and play them:
.Sp
.Vb 1
\&        ffplay \-f lavfi \-graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
.Ve
.IP "\(bu" 4
Read an audio stream from a file using the amovie source and play it
back with \fBffplay\fR:
.Sp
.Vb 1
\&        ffplay \-f lavfi "amovie=test.wav"
.Ve
.IP "\(bu" 4
Read an audio stream and a video stream and play it back with
\&\fBffplay\fR:
.Sp
.Vb 1
\&        ffplay \-f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
.Ve
.SS "libdc1394"
.IX Subsection "libdc1394"
\&\s-1IIDC1394\s0 input device, based on libdc1394 and libraw1394.
.SS "openal"
.IX Subsection "openal"
The OpenAL input device provides audio capture on all systems with a
working OpenAL 1.1 implementation.
.PP
To enable this input device during configuration, you need OpenAL
headers and libraries installed on your system, and need to configure
FFmpeg with \f(CW\*(C`\-\-enable\-openal\*(C'\fR.
.PP
OpenAL headers and libraries should be provided as part of your OpenAL
implementation, or as an additional download (an \s-1SDK\s0). Depending on your
installation you may need to specify additional flags via the
\&\f(CW\*(C`\-\-extra\-cflags\*(C'\fR and \f(CW\*(C`\-\-extra\-ldflags\*(C'\fR for allowing the build
system to locate the OpenAL headers and libraries.
.PP
An incomplete list of OpenAL implementations follows:
.IP "\fBCreative\fR" 4
.IX Item "Creative"
The official Windows implementation, providing hardware acceleration
with supported devices and software fallback.
See <\fBhttp://openal.org/\fR>.
.IP "\fBOpenAL Soft\fR" 4
.IX Item "OpenAL Soft"
Portable, open source (\s-1LGPL\s0) software implementation. Includes
backends for the most common sound APIs on the Windows, Linux,
Solaris, and \s-1BSD\s0 operating systems.
See <\fBhttp://kcat.strangesoft.net/openal.html\fR>.
.IP "\fBApple\fR" 4
.IX Item "Apple"
OpenAL is part of Core Audio, the official Mac \s-1OS\s0 X Audio interface.
See <\fBhttp://developer.apple.com/technologies/mac/audio\-and\-video.html\fR>
.PP
This device allows to capture from an audio input device handled
through OpenAL.
.PP
You need to specify the name of the device to capture in the provided
filename. If the empty string is provided, the device will
automatically select the default device. You can get the list of the
supported devices by using the option \fIlist_devices\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of channels in the captured audio. Only the values
\&\fB1\fR (monaural) and \fB2\fR (stereo) are currently supported.
Defaults to \fB2\fR.
.IP "\fBsample_size\fR" 4
.IX Item "sample_size"
Set the sample size (in bits) of the captured audio. Only the values
\&\fB8\fR and \fB16\fR are currently supported. Defaults to
\&\fB16\fR.
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Set the sample rate (in Hz) of the captured audio.
Defaults to \fB44.1k\fR.
.IP "\fBlist_devices\fR" 4
.IX Item "list_devices"
If set to \fBtrue\fR, print a list of devices and exit.
Defaults to \fBfalse\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Print the list of OpenAL supported devices and exit:
.PP
.Vb 1
\&        $ ffmpeg \-list_devices true \-f openal \-i dummy out.ogg
.Ve
.PP
Capture from the OpenAL device \fI\s-1DR\-BT101\s0 via PulseAudio\fR:
.PP
.Vb 1
\&        $ ffmpeg \-f openal \-i \*(AqDR\-BT101 via PulseAudio\*(Aq out.ogg
.Ve
.PP
Capture from the default device (note the empty string '' as filename):
.PP
.Vb 1
\&        $ ffmpeg \-f openal \-i \*(Aq\*(Aq out.ogg
.Ve
.PP
Capture from two devices simultaneously, writing to two different files,
within the same \fBffmpeg\fR command:
.PP
.Vb 1
\&        $ ffmpeg \-f openal \-i \*(AqDR\-BT101 via PulseAudio\*(Aq out1.ogg \-f openal \-i \*(AqALSA Default\*(Aq out2.ogg
.Ve
.PP
Note: not all OpenAL implementations support multiple simultaneous capture \-
try the latest OpenAL Soft if the above does not work.
.SS "oss"
.IX Subsection "oss"
Open Sound System input device.
.PP
The filename to provide to the input device is the device node
representing the \s-1OSS\s0 input device, and is usually set to
\&\fI/dev/dsp\fR.
.PP
For example to grab from \fI/dev/dsp\fR using \fBffmpeg\fR use the
command:
.PP
.Vb 1
\&        ffmpeg \-f oss \-i /dev/dsp /tmp/oss.wav
.Ve
.PP
For more information about \s-1OSS\s0 see:
<\fBhttp://manuals.opensound.com/usersguide/dsp.html\fR>
.SS "pulse"
.IX Subsection "pulse"
pulseaudio input device.
.PP
To enable this input device during configuration you need libpulse-simple
installed in your system.
.PP
The filename to provide to the input device is a source device or the
string \*(L"default\*(R"
.PP
To list the pulse source devices and their properties you can invoke
the command \fBpactl list sources\fR.
.PP
.Vb 1
\&        ffmpeg \-f pulse \-i default /tmp/pulse.wav
.Ve
.PP
\fI\fIserver\fI AVOption\fR
.IX Subsection "server AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-server <server name>
.Ve
.PP
Connects to a specific server.
.PP
\fI\fIname\fI AVOption\fR
.IX Subsection "name AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-name <application name>
.Ve
.PP
Specify the application name pulse will use when showing active clients,
by default it is the \s-1LIBAVFORMAT_IDENT\s0 string
.PP
\fI\fIstream_name\fI AVOption\fR
.IX Subsection "stream_name AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-stream_name <stream name>
.Ve
.PP
Specify the stream name pulse will use when showing active streams,
by default it is \*(L"record\*(R"
.PP
\fI\fIsample_rate\fI AVOption\fR
.IX Subsection "sample_rate AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-sample_rate <samplerate>
.Ve
.PP
Specify the samplerate in Hz, by default 48kHz is used.
.PP
\fI\fIchannels\fI AVOption\fR
.IX Subsection "channels AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-channels <N>
.Ve
.PP
Specify the channels in use, by default 2 (stereo) is set.
.PP
\fI\fIframe_size\fI AVOption\fR
.IX Subsection "frame_size AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-frame_size <bytes>
.Ve
.PP
Specify the number of byte per frame, by default it is set to 1024.
.PP
\fI\fIfragment_size\fI AVOption\fR
.IX Subsection "fragment_size AVOption"
.PP
The syntax is:
.PP
.Vb 1
\&        \-fragment_size <bytes>
.Ve
.PP
Specify the minimal buffering fragment in pulseaudio, it will affect the
audio latency. By default it is unset.
.SS "sndio"
.IX Subsection "sndio"
sndio input device.
.PP
To enable this input device during configuration you need libsndio
installed on your system.
.PP
The filename to provide to the input device is the device node
representing the sndio input device, and is usually set to
\&\fI/dev/audio0\fR.
.PP
For example to grab from \fI/dev/audio0\fR using \fBffmpeg\fR use the
command:
.PP
.Vb 1
\&        ffmpeg \-f sndio \-i /dev/audio0 /tmp/oss.wav
.Ve
.SS "video4linux2, v4l2"
.IX Subsection "video4linux2, v4l2"
Video4Linux2 input video device.
.PP
\&\*(L"v4l2\*(R" can be used as alias for \*(L"video4linux2\*(R".
.PP
If FFmpeg is built with v4l\-utils support (by using the
\&\f(CW\*(C`\-\-enable\-libv4l2\*(C'\fR configure option), the device will always rely
on libv4l2.
.PP
The name of the device to grab is a file device node, usually Linux
systems tend to automatically create such nodes when the device
(e.g. an \s-1USB\s0 webcam) is plugged into the system, and has a name of the
kind \fI/dev/video\fIN\fI\fR, where \fIN\fR is a number associated to
the device.
.PP
Video4Linux2 devices usually support a limited set of
\&\fIwidth\fRx\fIheight\fR sizes and frame rates. You can check which are
supported using \fB\-list_formats all\fR for Video4Linux2 devices.
Some devices, like \s-1TV\s0 cards, support one or more standards. It is possible
to list all the supported standards using \fB\-list_standards all\fR.
.PP
The time base for the timestamps is 1 microsecond. Depending on the kernel
version and configuration, the timestamps may be derived from the real time
clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
boot time, unaffected by \s-1NTP\s0 or manual changes to the clock). The
\&\fB\-timestamps abs\fR or \fB\-ts abs\fR option can be used to force
conversion into the real time clock.
.PP
Some usage examples of the video4linux2 device with \fBffmpeg\fR
and \fBffplay\fR:
.IP "\(bu" 4
Grab and show the input of a video4linux2 device:
.Sp
.Vb 1
\&        ffplay \-f video4linux2 \-framerate 30 \-video_size hd720 /dev/video0
.Ve
.IP "\(bu" 4
Grab and record the input of a video4linux2 device, leave the
frame rate and size as previously set:
.Sp
.Vb 1
\&        ffmpeg \-f video4linux2 \-input_format mjpeg \-i /dev/video0 out.mpeg
.Ve
.PP
For more information about Video4Linux, check <\fBhttp://linuxtv.org/\fR>.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBstandard\fR" 4
.IX Item "standard"
Set the standard. Must be the name of a supported standard. To get a
list of the supported standards, use the \fBlist_standards\fR
option.
.IP "\fBchannel\fR" 4
.IX Item "channel"
Set the input channel number. Default to \-1, which means using the
previously selected channel.
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video frame size. The argument must be a string in the form
\&\fI\s-1WIDTH\s0\fRx\fI\s-1HEIGHT\s0\fR or a valid size abbreviation.
.IP "\fBpixel_format\fR" 4
.IX Item "pixel_format"
Select the pixel format (only valid for raw video input).
.IP "\fBinput_format\fR" 4
.IX Item "input_format"
Set the preferred pixel format (for raw video) or a codec name.
This option allows to select the input format, when several are
available.
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the preferred video frame rate.
.IP "\fBlist_formats\fR" 4
.IX Item "list_formats"
List available formats (supported pixel formats, codecs, and frame
sizes) and exit.
.Sp
Available values are:
.RS 4
.IP "\fBall\fR" 4
.IX Item "all"
Show all available (compressed and non-compressed) formats.
.IP "\fBraw\fR" 4
.IX Item "raw"
Show only raw video (non-compressed) formats.
.IP "\fBcompressed\fR" 4
.IX Item "compressed"
Show only compressed formats.
.RE
.RS 4
.RE
.IP "\fBlist_standards\fR" 4
.IX Item "list_standards"
List supported standards and exit.
.Sp
Available values are:
.RS 4
.IP "\fBall\fR" 4
.IX Item "all"
Show all supported standards.
.RE
.RS 4
.RE
.IP "\fBtimestamps, ts\fR" 4
.IX Item "timestamps, ts"
Set type of timestamps for grabbed frames.
.Sp
Available values are:
.RS 4
.IP "\fBdefault\fR" 4
.IX Item "default"
Use timestamps from the kernel.
.IP "\fBabs\fR" 4
.IX Item "abs"
Use absolute timestamps (wall clock).
.IP "\fBmono2abs\fR" 4
.IX Item "mono2abs"
Force conversion from monotonic to absolute timestamps.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`default\*(C'\fR.
.RE
.SS "vfwcap"
.IX Subsection "vfwcap"
VfW (Video for Windows) capture input device.
.PP
The filename passed as input is the capture driver number, ranging from
0 to 9. You may use \*(L"list\*(R" as filename to print a list of drivers. Any
other filename will be interpreted as device number 0.
.SS "x11grab"
.IX Subsection "x11grab"
X11 video input device.
.PP
This device allows to capture a region of an X11 display.
.PP
The filename passed as input has the syntax:
.PP
.Vb 1
\&        [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
.Ve
.PP
\&\fIhostname\fR:\fIdisplay_number\fR.\fIscreen_number\fR specifies the
X11 display name of the screen to grab from. \fIhostname\fR can be
omitted, and defaults to \*(L"localhost\*(R". The environment variable
\&\fB\s-1DISPLAY\s0\fR contains the default display name.
.PP
\&\fIx_offset\fR and \fIy_offset\fR specify the offsets of the grabbed
area with respect to the top-left border of the X11 screen. They
default to 0.
.PP
Check the X11 documentation (e.g. man X) for more detailed information.
.PP
Use the \fBdpyinfo\fR program for getting basic information about the
properties of your X11 display (e.g. grep for \*(L"name\*(R" or \*(L"dimensions\*(R").
.PP
For example to grab from \fI:0.0\fR using \fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-f x11grab \-r 25 \-s cif \-i :0.0 out.mpg
.Ve
.PP
Grab at position \f(CW\*(C`10,20\*(C'\fR:
.PP
.Vb 1
\&        ffmpeg \-f x11grab \-r 25 \-s cif \-i :0.0+10,20 out.mpg
.Ve
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBdraw_mouse\fR" 4
.IX Item "draw_mouse"
Specify whether to draw the mouse pointer. A value of \f(CW0\fR specify
not to draw the pointer. Default value is \f(CW1\fR.
.IP "\fBfollow_mouse\fR" 4
.IX Item "follow_mouse"
Make the grabbed area follow the mouse. The argument can be
\&\f(CW\*(C`centered\*(C'\fR or a number of pixels \fI\s-1PIXELS\s0\fR.
.Sp
When it is specified with \*(L"centered\*(R", the grabbing region follows the mouse
pointer and keeps the pointer at the center of region; otherwise, the region
follows only when the mouse pointer reaches within \fI\s-1PIXELS\s0\fR (greater than
zero) to the edge of region.
.Sp
For example:
.Sp
.Vb 1
\&        ffmpeg \-f x11grab \-follow_mouse centered \-r 25 \-s cif \-i :0.0 out.mpg
.Ve
.Sp
To follow only when the mouse pointer reaches within 100 pixels to edge:
.Sp
.Vb 1
\&        ffmpeg \-f x11grab \-follow_mouse 100 \-r 25 \-s cif \-i :0.0 out.mpg
.Ve
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the grabbing frame rate. Default value is \f(CW\*(C`ntsc\*(C'\fR,
corresponding to a frame rate of \f(CW\*(C`30000/1001\*(C'\fR.
.IP "\fBshow_region\fR" 4
.IX Item "show_region"
Show grabbed region on screen.
.Sp
If \fIshow_region\fR is specified with \f(CW1\fR, then the grabbing
region will be indicated on screen. With this option, it is easy to
know what is being grabbed if only a portion of the screen is grabbed.
.Sp
For example:
.Sp
.Vb 1
\&        ffmpeg \-f x11grab \-show_region 1 \-r 25 \-s cif \-i :0.0+10,20 out.mpg
.Ve
.Sp
With \fIfollow_mouse\fR:
.Sp
.Vb 1
\&        ffmpeg \-f x11grab \-follow_mouse centered \-show_region 1 \-r 25 \-s cif \-i :0.0 out.mpg
.Ve
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video frame size. Default value is \f(CW\*(C`vga\*(C'\fR.
.SH "OUTPUT DEVICES"
.IX Header "OUTPUT DEVICES"
Output devices are configured elements in FFmpeg which allow to write
multimedia data to an output device attached to your system.
.PP
When you configure your FFmpeg build, all the supported output devices
are enabled by default. You can list all available ones using the
configure option \*(L"\-\-list\-outdevs\*(R".
.PP
You can disable all the output devices using the configure option
\&\*(L"\-\-disable\-outdevs\*(R", and selectively enable an output device using the
option "\-\-enable\-outdev=\fI\s-1OUTDEV\s0\fR\*(L", or you can disable a particular
input device using the option \*(R"\-\-disable\-outdev=\fI\s-1OUTDEV\s0\fR".
.PP
The option \*(L"\-formats\*(R" of the ff* tools will display the list of
enabled output devices (amongst the muxers).
.PP
A description of the currently available output devices follows.
.SS "alsa"
.IX Subsection "alsa"
\&\s-1ALSA\s0 (Advanced Linux Sound Architecture) output device.
.SS "caca"
.IX Subsection "caca"
\&\s-1CACA\s0 output device.
.PP
This output devices allows to show a video stream in \s-1CACA\s0 window.
Only one \s-1CACA\s0 window is allowed per application, so you can
have only one instance of this output device in an application.
.PP
To enable this output device you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libcaca\*(C'\fR.
libcaca is a graphics library that outputs text instead of pixels.
.PP
For more information about libcaca, check:
<\fBhttp://caca.zoy.org/wiki/libcaca\fR>
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBwindow_title\fR" 4
.IX Item "window_title"
Set the \s-1CACA\s0 window title, if not specified default to the filename
specified for the output device.
.IP "\fBwindow_size\fR" 4
.IX Item "window_size"
Set the \s-1CACA\s0 window size, can be a string of the form
\&\fIwidth\fRx\fIheight\fR or a video size abbreviation.
If not specified it defaults to the size of the input video.
.IP "\fBdriver\fR" 4
.IX Item "driver"
Set display driver.
.IP "\fBalgorithm\fR" 4
.IX Item "algorithm"
Set dithering algorithm. Dithering is necessary
because the picture being rendered has usually far more colours than
the available palette.
The accepted values are listed with \f(CW\*(C`\-list_dither algorithms\*(C'\fR.
.IP "\fBantialias\fR" 4
.IX Item "antialias"
Set antialias method. Antialiasing smoothens the rendered
image and avoids the commonly seen staircase effect.
The accepted values are listed with \f(CW\*(C`\-list_dither antialiases\*(C'\fR.
.IP "\fBcharset\fR" 4
.IX Item "charset"
Set which characters are going to be used when rendering text.
The accepted values are listed with \f(CW\*(C`\-list_dither charsets\*(C'\fR.
.IP "\fBcolor\fR" 4
.IX Item "color"
Set color to be used when rendering text.
The accepted values are listed with \f(CW\*(C`\-list_dither colors\*(C'\fR.
.IP "\fBlist_drivers\fR" 4
.IX Item "list_drivers"
If set to \fBtrue\fR, print a list of available drivers and exit.
.IP "\fBlist_dither\fR" 4
.IX Item "list_dither"
List available dither options related to the argument.
The argument must be one of \f(CW\*(C`algorithms\*(C'\fR, \f(CW\*(C`antialiases\*(C'\fR,
\&\f(CW\*(C`charsets\*(C'\fR, \f(CW\*(C`colors\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
The following command shows the \fBffmpeg\fR output is an
\&\s-1CACA\s0 window, forcing its size to 80x25:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-vcodec rawvideo \-pix_fmt rgb24 \-window_size 80x25 \-f caca \-
.Ve
.IP "\(bu" 4
Show the list of available drivers and exit:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-pix_fmt rgb24 \-f caca \-list_drivers true \-
.Ve
.IP "\(bu" 4
Show the list of available dither colors and exit:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-pix_fmt rgb24 \-f caca \-list_dither colors \-
.Ve
.SS "oss"
.IX Subsection "oss"
\&\s-1OSS\s0 (Open Sound System) output device.
.SS "sdl"
.IX Subsection "sdl"
\&\s-1SDL\s0 (Simple DirectMedia Layer) output device.
.PP
This output devices allows to show a video stream in an \s-1SDL\s0
window. Only one \s-1SDL\s0 window is allowed per application, so you can
have only one instance of this output device in an application.
.PP
To enable this output device you need libsdl installed on your system
when configuring your build.
.PP
For more information about \s-1SDL\s0, check:
<\fBhttp://www.libsdl.org/\fR>
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBwindow_title\fR" 4
.IX Item "window_title"
Set the \s-1SDL\s0 window title, if not specified default to the filename
specified for the output device.
.IP "\fBicon_title\fR" 4
.IX Item "icon_title"
Set the name of the iconified \s-1SDL\s0 window, if not specified it is set
to the same value of \fIwindow_title\fR.
.IP "\fBwindow_size\fR" 4
.IX Item "window_size"
Set the \s-1SDL\s0 window size, can be a string of the form
\&\fIwidth\fRx\fIheight\fR or a video size abbreviation.
If not specified it defaults to the size of the input video,
downscaled according to the aspect ratio.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
The following command shows the \fBffmpeg\fR output is an
\&\s-1SDL\s0 window, forcing its size to the qcif format:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-vcodec rawvideo \-pix_fmt yuv420p \-window_size qcif \-f sdl "SDL output"
.Ve
.SS "sndio"
.IX Subsection "sndio"
sndio audio output device.
.SH "RESAMPLER OPTIONS"
.IX Header "RESAMPLER OPTIONS"
The audio resampler supports the following named options.
.PP
Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
FFmpeg tools, \fIoption\fR=\fIvalue\fR for the aresample filter,
by setting the value explicitly in the
\&\f(CW\*(C`SwrContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0 for
programmatic use.
.IP "\fBich, in_channel_count\fR" 4
.IX Item "ich, in_channel_count"
Set the number of input channels. Default value is 0. Setting this
value is not mandatory if the corresponding channel layout
\&\fBin_channel_layout\fR is set.
.IP "\fBoch, out_channel_count\fR" 4
.IX Item "och, out_channel_count"
Set the number of output channels. Default value is 0. Setting this
value is not mandatory if the corresponding channel layout
\&\fBout_channel_layout\fR is set.
.IP "\fBuch, used_channel_count\fR" 4
.IX Item "uch, used_channel_count"
Set the number of used input channels. Default value is 0. This option is
only used for special remapping.
.IP "\fBisr, in_sample_rate\fR" 4
.IX Item "isr, in_sample_rate"
Set the input sample rate. Default value is 0.
.IP "\fBosr, out_sample_rate\fR" 4
.IX Item "osr, out_sample_rate"
Set the output sample rate. Default value is 0.
.IP "\fBisf, in_sample_fmt\fR" 4
.IX Item "isf, in_sample_fmt"
Specify the input sample format. It is set by default to \f(CW\*(C`none\*(C'\fR.
.IP "\fBosf, out_sample_fmt\fR" 4
.IX Item "osf, out_sample_fmt"
Specify the output sample format. It is set by default to \f(CW\*(C`none\*(C'\fR.
.IP "\fBtsf, internal_sample_fmt\fR" 4
.IX Item "tsf, internal_sample_fmt"
Set the internal sample format. Default value is \f(CW\*(C`none\*(C'\fR.
This will automatically be chosen when it is not explicitly set.
.IP "\fBicl, in_channel_layout\fR" 4
.IX Item "icl, in_channel_layout"
Set the input channel layout.
.IP "\fBocl, out_channel_layout\fR" 4
.IX Item "ocl, out_channel_layout"
Set the output channel layout.
.IP "\fBclev, center_mix_level\fR" 4
.IX Item "clev, center_mix_level"
Set the center mix level. It is a value expressed in deciBel, and must be
in the interval [\-32,32].
.IP "\fBslev, surround_mix_level\fR" 4
.IX Item "slev, surround_mix_level"
Set the surround mix level. It is a value expressed in deciBel, and must
be in the interval [\-32,32].
.IP "\fBlfe_mix_level\fR" 4
.IX Item "lfe_mix_level"
Set \s-1LFE\s0 mix into non \s-1LFE\s0 level. It is used when there is a \s-1LFE\s0 input but no
\&\s-1LFE\s0 output. It is a value expressed in deciBel, and must
be in the interval [\-32,32].
.IP "\fBrmvol, rematrix_volume\fR" 4
.IX Item "rmvol, rematrix_volume"
Set rematrix volume. Default value is 1.0.
.IP "\fBflags, swr_flags\fR" 4
.IX Item "flags, swr_flags"
Set flags used by the converter. Default value is 0.
.Sp
It supports the following individual flags:
.RS 4
.IP "\fBres\fR" 4
.IX Item "res"
force resampling, this flag forces resampling to be used even when the
input and output sample rates match.
.RE
.RS 4
.RE
.IP "\fBdither_scale\fR" 4
.IX Item "dither_scale"
Set the dither scale. Default value is 1.
.IP "\fBdither_method\fR" 4
.IX Item "dither_method"
Set dither method. Default value is 0.
.Sp
Supported values:
.RS 4
.IP "\fBrectangular\fR" 4
.IX Item "rectangular"
select rectangular dither
.IP "\fBtriangular\fR" 4
.IX Item "triangular"
select triangular dither
.IP "\fBtriangular_hp\fR" 4
.IX Item "triangular_hp"
select triangular dither with high pass
.IP "\fBlipshitz\fR" 4
.IX Item "lipshitz"
select lipshitz noise shaping dither
.IP "\fBshibata\fR" 4
.IX Item "shibata"
select shibata noise shaping dither
.IP "\fBlow_shibata\fR" 4
.IX Item "low_shibata"
select low shibata noise shaping dither
.IP "\fBhigh_shibata\fR" 4
.IX Item "high_shibata"
select high shibata noise shaping dither
.IP "\fBf_weighted\fR" 4
.IX Item "f_weighted"
select f\-weighted noise shaping dither
.IP "\fBmodified_e_weighted\fR" 4
.IX Item "modified_e_weighted"
select modified-e-weighted noise shaping dither
.IP "\fBimproved_e_weighted\fR" 4
.IX Item "improved_e_weighted"
select improved-e-weighted noise shaping dither
.RE
.RS 4
.RE
.IP "\fBresampler\fR" 4
.IX Item "resampler"
Set resampling engine. Default value is swr.
.Sp
Supported values:
.RS 4
.IP "\fBswr\fR" 4
.IX Item "swr"
select the native \s-1SW\s0 Resampler; filter options precision and cheby are not
applicable in this case.
.IP "\fBsoxr\fR" 4
.IX Item "soxr"
select the SoX Resampler (where available); compensation, and filter options
filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
case.
.RE
.RS 4
.RE
.IP "\fBfilter_size\fR" 4
.IX Item "filter_size"
For swr only, set resampling filter size, default value is 32.
.IP "\fBphase_shift\fR" 4
.IX Item "phase_shift"
For swr only, set resampling phase shift, default value is 10, and must be in
the interval [0,30].
.IP "\fBlinear_interp\fR" 4
.IX Item "linear_interp"
Use Linear Interpolation if set to 1, default value is 0.
.IP "\fBcutoff\fR" 4
.IX Item "cutoff"
Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
.IP "\fBprecision\fR" 4
.IX Item "precision"
For soxr only, the precision in bits to which the resampled signal will be
calculated.  The default value of 20 (which, with suitable dithering, is
appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
value of 28 gives SoX's 'Very High Quality'.
.IP "\fBcheby\fR" 4
.IX Item "cheby"
For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
approximation for 'irrational' ratios. Default value is 0.
.IP "\fBasync\fR" 4
.IX Item "async"
For swr only, simple 1 parameter audio sync to timestamps using stretching,
squeezing, filling and trimming. Setting this to 1 will enable filling and
trimming, larger values represent the maximum amount in samples that the data
may be stretched or squeezed for each second.
Default value is 0, thus no compensation is applied to make the samples match
the audio timestamps.
.IP "\fBfirst_pts\fR" 4
.IX Item "first_pts"
For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
This allows for padding/trimming at the start of stream. By default, no
assumption is made about the first frame's expected pts, so no padding or
trimming is done. For example, this could be set to 0 to pad the beginning with
silence if an audio stream starts after the video stream or to trim any samples
with a negative pts due to encoder delay.
.IP "\fBmin_comp\fR" 4
.IX Item "min_comp"
For swr only, set the minimum difference between timestamps and audio data (in
seconds) to trigger stretching/squeezing/filling or trimming of the
data to make it match the timestamps. The default is that
stretching/squeezing/filling and trimming is disabled
(\fBmin_comp\fR = \f(CW\*(C`FLT_MAX\*(C'\fR).
.IP "\fBmin_hard_comp\fR" 4
.IX Item "min_hard_comp"
For swr only, set the minimum difference between timestamps and audio data (in
seconds) to trigger adding/dropping samples to make it match the
timestamps.  This option effectively is a threshold to select between
hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
all compensation is by default disabled through \fBmin_comp\fR.
The default is 0.1.
.IP "\fBcomp_duration\fR" 4
.IX Item "comp_duration"
For swr only, set duration (in seconds) over which data is stretched/squeezed
to make it match the timestamps. Must be a non-negative double float value,
default value is 1.0.
.IP "\fBmax_soft_comp\fR" 4
.IX Item "max_soft_comp"
For swr only, set maximum factor by which data is stretched/squeezed to make it
match the timestamps. Must be a non-negative double float value, default value
is 0.
.IP "\fBmatrix_encoding\fR" 4
.IX Item "matrix_encoding"
Select matrixed stereo encoding.
.Sp
It accepts the following values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
select none
.IP "\fBdolby\fR" 4
.IX Item "dolby"
select Dolby
.IP "\fBdplii\fR" 4
.IX Item "dplii"
select Dolby Pro Logic \s-1II\s0
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`none\*(C'\fR.
.RE
.IP "\fBfilter_type\fR" 4
.IX Item "filter_type"
For swr only, select resampling filter type. This only affects resampling
operations.
.Sp
It accepts the following values:
.RS 4
.IP "\fBcubic\fR" 4
.IX Item "cubic"
select cubic
.IP "\fBblackman_nuttall\fR" 4
.IX Item "blackman_nuttall"
select Blackman Nuttall Windowed Sinc
.IP "\fBkaiser\fR" 4
.IX Item "kaiser"
select Kaiser Windowed Sinc
.RE
.RS 4
.RE
.IP "\fBkaiser_beta\fR" 4
.IX Item "kaiser_beta"
For swr only, set Kaiser Window Beta value. Must be an integer in the
interval [2,16], default value is 9.
.SH "SCALER OPTIONS"
.IX Header "SCALER OPTIONS"
The video scaler supports the following named options.
.PP
Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
FFmpeg tools. For programmatic use, they can be set explicitly in the
\&\f(CW\*(C`SwsContext\*(C'\fR options or through the \fIlibavutil/opt.h\fR \s-1API\s0.
.IP "\fBsws_flags\fR" 4
.IX Item "sws_flags"
Set the scaler flags. This is also used to set the scaling
algorithm. Only a single algorithm should be selected.
.Sp
It accepts the following values:
.RS 4
.IP "\fBfast_bilinear\fR" 4
.IX Item "fast_bilinear"
Select fast bilinear scaling algorithm.
.IP "\fBbilinear\fR" 4
.IX Item "bilinear"
Select bilinear scaling algorithm.
.IP "\fBbicubic\fR" 4
.IX Item "bicubic"
Select bicubic scaling algorithm.
.IP "\fBexperimental\fR" 4
.IX Item "experimental"
Select experimental scaling algorithm.
.IP "\fBneighbor\fR" 4
.IX Item "neighbor"
Select nearest neighbor rescaling algorithm.
.IP "\fBarea\fR" 4
.IX Item "area"
Select averaging area rescaling algorithm.
.IP "\fBbicubiclin\fR" 4
.IX Item "bicubiclin"
Select bicubic scaling algorithm for the luma component, bilinear for
chroma components.
.IP "\fBgauss\fR" 4
.IX Item "gauss"
Select Gaussian rescaling algorithm.
.IP "\fBsinc\fR" 4
.IX Item "sinc"
Select sinc rescaling algorithm.
.IP "\fBlanczos\fR" 4
.IX Item "lanczos"
Select lanczos rescaling algorithm.
.IP "\fBspline\fR" 4
.IX Item "spline"
Select natural bicubic spline rescaling algorithm.
.IP "\fBprint_info\fR" 4
.IX Item "print_info"
Enable printing/debug logging.
.IP "\fBaccurate_rnd\fR" 4
.IX Item "accurate_rnd"
Enable accurate rounding.
.IP "\fBfull_chroma_int\fR" 4
.IX Item "full_chroma_int"
Enable full chroma interpolation.
.IP "\fBfull_chroma_inp\fR" 4
.IX Item "full_chroma_inp"
Select full chroma input.
.IP "\fBbitexact\fR" 4
.IX Item "bitexact"
Enable bitexact output.
.RE
.RS 4
.RE
.IP "\fBsrcw\fR" 4
.IX Item "srcw"
Set source width.
.IP "\fBsrch\fR" 4
.IX Item "srch"
Set source height.
.IP "\fBdstw\fR" 4
.IX Item "dstw"
Set destination width.
.IP "\fBdsth\fR" 4
.IX Item "dsth"
Set destination height.
.IP "\fBsrc_format\fR" 4
.IX Item "src_format"
Set source pixel format (must be expressed as an integer).
.IP "\fBdst_format\fR" 4
.IX Item "dst_format"
Set destination pixel format (must be expressed as an integer).
.IP "\fBsrc_range\fR" 4
.IX Item "src_range"
Select source range.
.IP "\fBdst_range\fR" 4
.IX Item "dst_range"
Select destination range.
.IP "\fBparam0, param1\fR" 4
.IX Item "param0, param1"
Set scaling algorithm parameters. The specified values are specific of
some scaling algorithms and ignored by others. The specified values
are floating point number values.
.SH "FILTERING INTRODUCTION"
.IX Header "FILTERING INTRODUCTION"
Filtering in FFmpeg is enabled through the libavfilter library.
.PP
In libavfilter, a filter can have multiple inputs and multiple
outputs.
To illustrate the sorts of things that are possible, we consider the
following filtergraph.
.PP
.Vb 4
\&        input \-\-> split \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> overlay \-\-> output
\&                    |                             ^
\&                    |                             |
\&                    +\-\-\-\-\-> crop \-\-> vflip \-\-\-\-\-\-\-+
.Ve
.PP
This filtergraph splits the input stream in two streams, sends one
stream through the crop filter and the vflip filter before merging it
back with the other stream by overlaying it on top. You can use the
following command to achieve this:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
.Ve
.PP
The result will be that in output the top half of the video is mirrored
onto the bottom half.
.PP
Filters in the same linear chain are separated by commas, and distinct
linear chains of filters are separated by semicolons. In our example,
\&\fIcrop,vflip\fR are in one linear chain, \fIsplit\fR and
\&\fIoverlay\fR are separately in another. The points where the linear
chains join are labelled by names enclosed in square brackets. In the
example, the split filter generates two outputs that are associated to
the labels \fI[main]\fR and \fI[tmp]\fR.
.PP
The stream sent to the second output of \fIsplit\fR, labelled as
\&\fI[tmp]\fR, is processed through the \fIcrop\fR filter, which crops
away the lower half part of the video, and then vertically flipped. The
\&\fIoverlay\fR filter takes in input the first unchanged output of the
split filter (which was labelled as \fI[main]\fR), and overlay on its
lower half the output generated by the \fIcrop,vflip\fR filterchain.
.PP
Some filters take in input a list of parameters: they are specified
after the filter name and an equal sign, and are separated from each other
by a colon.
.PP
There exist so-called \fIsource filters\fR that do not have an
audio/video input, and \fIsink filters\fR that will not have audio/video
output.
.SH "GRAPH"
.IX Header "GRAPH"
The \fIgraph2dot\fR program included in the FFmpeg \fItools\fR
directory can be used to parse a filtergraph description and issue a
corresponding textual representation in the dot language.
.PP
Invoke the command:
.PP
.Vb 1
\&        graph2dot \-h
.Ve
.PP
to see how to use \fIgraph2dot\fR.
.PP
You can then pass the dot description to the \fIdot\fR program (from
the graphviz suite of programs) and obtain a graphical representation
of the filtergraph.
.PP
For example the sequence of commands:
.PP
.Vb 4
\&        echo <GRAPH_DESCRIPTION> | \e
\&        tools/graph2dot \-o graph.tmp && \e
\&        dot \-Tpng graph.tmp \-o graph.png && \e
\&        display graph.png
.Ve
.PP
can be used to create and display an image representing the graph
described by the \fI\s-1GRAPH_DESCRIPTION\s0\fR string. Note that this string must be
a complete self-contained graph, with its inputs and outputs explicitly defined.
For example if your command line is of the form:
.PP
.Vb 1
\&        ffmpeg \-i infile \-vf scale=640:360 outfile
.Ve
.PP
your \fI\s-1GRAPH_DESCRIPTION\s0\fR string will need to be of the form:
.PP
.Vb 1
\&        nullsrc,scale=640:360,nullsink
.Ve
.PP
you may also need to set the \fInullsrc\fR parameters and add a \fIformat\fR
filter in order to simulate a specific input file.
.SH "FILTERGRAPH DESCRIPTION"
.IX Header "FILTERGRAPH DESCRIPTION"
A filtergraph is a directed graph of connected filters. It can contain
cycles, and there can be multiple links between a pair of
filters. Each link has one input pad on one side connecting it to one
filter from which it takes its input, and one output pad on the other
side connecting it to the one filter accepting its output.
.PP
Each filter in a filtergraph is an instance of a filter class
registered in the application, which defines the features and the
number of input and output pads of the filter.
.PP
A filter with no input pads is called a \*(L"source\*(R", a filter with no
output pads is called a \*(L"sink\*(R".
.SS "Filtergraph syntax"
.IX Subsection "Filtergraph syntax"
A filtergraph can be represented using a textual representation, which is
recognized by the \fB\-filter\fR/\fB\-vf\fR and \fB\-filter_complex\fR
options in \fBffmpeg\fR and \fB\-vf\fR in \fBffplay\fR, and by the
\&\f(CW\*(C`avfilter_graph_parse()\*(C'\fR/\f(CW\*(C`avfilter_graph_parse2()\*(C'\fR function defined in
\&\fIlibavfilter/avfilter.h\fR.
.PP
A filterchain consists of a sequence of connected filters, each one
connected to the previous one in the sequence. A filterchain is
represented by a list of \*(L",\*(R"\-separated filter descriptions.
.PP
A filtergraph consists of a sequence of filterchains. A sequence of
filterchains is represented by a list of \*(L";\*(R"\-separated filterchain
descriptions.
.PP
A filter is represented by a string of the form:
[\fIin_link_1\fR]...[\fIin_link_N\fR]\fIfilter_name\fR=\fIarguments\fR[\fIout_link_1\fR]...[\fIout_link_M\fR]
.PP
\&\fIfilter_name\fR is the name of the filter class of which the
described filter is an instance of, and has to be the name of one of
the filter classes registered in the program.
The name of the filter class is optionally followed by a string
"=\fIarguments\fR".
.PP
\&\fIarguments\fR is a string which contains the parameters used to
initialize the filter instance. It may have one of the following forms:
.IP "\(bu" 4
A ':'\-separated list of \fIkey=value\fR pairs.
.IP "\(bu" 4
A ':'\-separated list of \fIvalue\fR. In this case, the keys are assumed to be
the option names in the order they are declared. E.g. the \f(CW\*(C`fade\*(C'\fR filter
declares three options in this order \*(-- \fBtype\fR, \fBstart_frame\fR and
\&\fBnb_frames\fR. Then the parameter list \fIin:0:30\fR means that the value
\&\fIin\fR is assigned to the option \fBtype\fR, \fI0\fR to
\&\fBstart_frame\fR and \fI30\fR to \fBnb_frames\fR.
.IP "\(bu" 4
A ':'\-separated list of mixed direct \fIvalue\fR and long \fIkey=value\fR
pairs. The direct \fIvalue\fR must precede the \fIkey=value\fR pairs, and
follow the same constraints order of the previous point. The following
\&\fIkey=value\fR pairs can be set in any preferred order.
.PP
If the option value itself is a list of items (e.g. the \f(CW\*(C`format\*(C'\fR filter
takes a list of pixel formats), the items in the list are usually separated by
\&'|'.
.PP
The list of arguments can be quoted using the character \*(L"'\*(R" as initial
and ending mark, and the character '\e' for escaping the characters
within the quoted text; otherwise the argument string is considered
terminated when the next special character (belonging to the set
\&\*(L"[]=;,\*(R") is encountered.
.PP
The name and arguments of the filter are optionally preceded and
followed by a list of link labels.
A link label allows to name a link and associate it to a filter output
or input pad. The preceding labels \fIin_link_1\fR
\&... \fIin_link_N\fR, are associated to the filter input pads,
the following labels \fIout_link_1\fR ... \fIout_link_M\fR, are
associated to the output pads.
.PP
When two link labels with the same name are found in the
filtergraph, a link between the corresponding input and output pad is
created.
.PP
If an output pad is not labelled, it is linked by default to the first
unlabelled input pad of the next filter in the filterchain.
For example in the filterchain:
.PP
.Vb 1
\&        nullsrc, split[L1], [L2]overlay, nullsink
.Ve
.PP
the split filter instance has two output pads, and the overlay filter
instance two input pads. The first output pad of split is labelled
\&\*(L"L1\*(R", the first input pad of overlay is labelled \*(L"L2\*(R", and the second
output pad of split is linked to the second input pad of overlay,
which are both unlabelled.
.PP
In a complete filterchain all the unlabelled filter input and output
pads must be connected. A filtergraph is considered valid if all the
filter input and output pads of all the filterchains are connected.
.PP
Libavfilter will automatically insert scale filters where format
conversion is required. It is possible to specify swscale flags
for those automatically inserted scalers by prepending
\&\f(CW\*(C`sws_flags=\f(CIflags\f(CW;\*(C'\fR
to the filtergraph description.
.PP
Follows a \s-1BNF\s0 description for the filtergraph syntax:
.PP
.Vb 7
\&        <NAME>             ::= sequence of alphanumeric characters and \*(Aq_\*(Aq
\&        <LINKLABEL>        ::= "[" <NAME> "]"
\&        <LINKLABELS>       ::= <LINKLABEL> [<LINKLABELS>]
\&        <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
\&        <FILTER>           ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
\&        <FILTERCHAIN>      ::= <FILTER> [,<FILTERCHAIN>]
\&        <FILTERGRAPH>      ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
.Ve
.SS "Notes on filtergraph escaping"
.IX Subsection "Notes on filtergraph escaping"
Some filter arguments require the use of special characters, typically
\&\f(CW\*(C`:\*(C'\fR to separate key=value pairs in a named options list. In this
case the user should perform a first level escaping when specifying
the filter arguments. For example, consider the following literal
string to be embedded in the drawtext filter arguments:
.PP
.Vb 1
\&        this is a \*(Aqstring\*(Aq: may contain one, or more, special characters
.Ve
.PP
Since \f(CW\*(C`:\*(C'\fR is special for the filter arguments syntax, it needs to
be escaped, so you get:
.PP
.Vb 1
\&        text=this is a \e\*(Aqstring\e\*(Aq\e: may contain one, or more, special characters
.Ve
.PP
A second level of escaping is required when embedding the filter
arguments in a filtergraph description, in order to escape all the
filtergraph special characters. Thus the example above becomes:
.PP
.Vb 1
\&        drawtext=text=this is a \e\e\e\*(Aqstring\e\e\e\*(Aq\e\e: may contain one\e, or more\e, special characters
.Ve
.PP
Finally an additional level of escaping may be needed when writing the
filtergraph description in a shell command, which depends on the
escaping rules of the adopted shell. For example, assuming that
\&\f(CW\*(C`\e\*(C'\fR is special and needs to be escaped with another \f(CW\*(C`\e\*(C'\fR, the
previous string will finally result in:
.PP
.Vb 1
\&        \-vf "drawtext=text=this is a \e\e\e\e\e\e\*(Aqstring\e\e\e\e\e\e\*(Aq\e\e\e\e: may contain one\e\e, or more\e\e, special characters"
.Ve
.PP
Sometimes, it might be more convenient to employ quoting in place of
escaping. For example the string:
.PP
.Vb 1
\&        Caesar: tu quoque, Brute, fili mi
.Ve
.PP
Can be quoted in the filter arguments as:
.PP
.Vb 1
\&        text=\*(AqCaesar: tu quoque, Brute, fili mi\*(Aq
.Ve
.PP
And finally inserted in a filtergraph like:
.PP
.Vb 1
\&        drawtext=text=\e\*(AqCaesar: tu quoque\e, Brute\e, fili mi\e\*(Aq
.Ve
.PP
See the ``Quoting and escaping'' section in the ffmpeg-utils manual
for more information about the escaping and quoting rules adopted by
FFmpeg.
.SH "AUDIO FILTERS"
.IX Header "AUDIO FILTERS"
When you configure your FFmpeg build, you can disable any of the
existing filters using \f(CW\*(C`\-\-disable\-filters\*(C'\fR.
The configure output will show the audio filters included in your
build.
.PP
Below is a description of the currently available audio filters.
.SS "aconvert"
.IX Subsection "aconvert"
Convert the input audio format to the specified formats.
.PP
\&\fIThis filter is deprecated. Use aformat\fR instead.
.PP
The filter accepts a string of the form:
"\fIsample_format\fR:\fIchannel_layout\fR".
.PP
\&\fIsample_format\fR specifies the sample format, and can be a string or the
corresponding numeric value defined in \fIlibavutil/samplefmt.h\fR. Use 'p'
suffix for a planar sample format.
.PP
\&\fIchannel_layout\fR specifies the channel layout, and can be a string
or the corresponding number value defined in \fIlibavutil/channel_layout.h\fR.
.PP
The special parameter \*(L"auto\*(R", signifies that the filter will
automatically select the output format depending on the output filter.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Convert input to float, planar, stereo:
.Sp
.Vb 1
\&        aconvert=fltp:stereo
.Ve
.IP "\(bu" 4
Convert input to unsigned 8\-bit, automatically select out channel layout:
.Sp
.Vb 1
\&        aconvert=u8:auto
.Ve
.SS "allpass"
.IX Subsection "allpass"
Apply a two-pole all-pass filter with central frequency (in Hz)
\&\fIfrequency\fR, and filter-width \fIwidth\fR.
An all-pass filter changes the audio's frequency to phase relationship
without changing its frequency to amplitude relationship.
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set frequency in Hz.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Specify the band-width of a filter in width_type units.
.SS "highpass"
.IX Subsection "highpass"
Apply a high-pass filter with 3dB point frequency.
The filter can be either single-pole, or double-pole (the default).
The filter roll off at 6dB per pole per octave (20dB per pole per decade).
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set frequency in Hz. Default is 3000.
.IP "\fBpoles, p\fR" 4
.IX Item "poles, p"
Set number of poles. Default is 2.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Specify the band-width of a filter in width_type units.
Applies only to double-pole filter.
The default is 0.707q and gives a Butterworth response.
.SS "lowpass"
.IX Subsection "lowpass"
Apply a low-pass filter with 3dB point frequency.
The filter can be either single-pole or double-pole (the default).
The filter roll off at 6dB per pole per octave (20dB per pole per decade).
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set frequency in Hz. Default is 500.
.IP "\fBpoles, p\fR" 4
.IX Item "poles, p"
Set number of poles. Default is 2.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Specify the band-width of a filter in width_type units.
Applies only to double-pole filter.
The default is 0.707q and gives a Butterworth response.
.SS "bass"
.IX Subsection "bass"
Boost or cut the bass (lower) frequencies of the audio using a two-pole
shelving filter with a response similar to that of a standard
hi-fi's tone-controls. This is also known as shelving equalisation (\s-1EQ\s0).
.PP
The filter accepts the following options:
.IP "\fBgain, g\fR" 4
.IX Item "gain, g"
Give the gain at 0 Hz. Its useful range is about \-20
(for a large cut) to +20 (for a large boost).
Beware of clipping when using a positive gain.
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set the filter's central frequency and so can be used
to extend or reduce the frequency range to be boosted or cut.
The default value is \f(CW100\fR Hz.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Determine how steep is the filter's shelf transition.
.SS "treble"
.IX Subsection "treble"
Boost or cut treble (upper) frequencies of the audio using a two-pole
shelving filter with a response similar to that of a standard
hi-fi's tone-controls. This is also known as shelving equalisation (\s-1EQ\s0).
.PP
The filter accepts the following options:
.IP "\fBgain, g\fR" 4
.IX Item "gain, g"
Give the gain at whichever is the lower of ~22 kHz and the
Nyquist frequency. Its useful range is about \-20 (for a large cut)
to +20 (for a large boost). Beware of clipping when using a positive gain.
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set the filter's central frequency and so can be used
to extend or reduce the frequency range to be boosted or cut.
The default value is \f(CW3000\fR Hz.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Determine how steep is the filter's shelf transition.
.SS "bandpass"
.IX Subsection "bandpass"
Apply a two-pole Butterworth band-pass filter with central
frequency \fIfrequency\fR, and (3dB\-point) band-width width.
The \fIcsg\fR option selects a constant skirt gain (peak gain = Q)
instead of the default: constant 0dB peak gain.
The filter roll off at 6dB per octave (20dB per decade).
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set the filter's central frequency. Default is \f(CW3000\fR.
.IP "\fBcsg\fR" 4
.IX Item "csg"
Constant skirt gain if set to 1. Defaults to 0.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Specify the band-width of a filter in width_type units.
.SS "bandreject"
.IX Subsection "bandreject"
Apply a two-pole Butterworth band-reject filter with central
frequency \fIfrequency\fR, and (3dB\-point) band-width \fIwidth\fR.
The filter roll off at 6dB per octave (20dB per decade).
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set the filter's central frequency. Default is \f(CW3000\fR.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Specify the band-width of a filter in width_type units.
.SS "biquad"
.IX Subsection "biquad"
Apply a biquad \s-1IIR\s0 filter with the given coefficients.
Where \fIb0\fR, \fIb1\fR, \fIb2\fR and \fIa0\fR, \fIa1\fR, \fIa2\fR
are the numerator and denominator coefficients respectively.
.SS "equalizer"
.IX Subsection "equalizer"
Apply a two-pole peaking equalisation (\s-1EQ\s0) filter. With this
filter, the signal-level at and around a selected frequency can
be increased or decreased, whilst (unlike bandpass and bandreject
filters) that at all other frequencies is unchanged.
.PP
In order to produce complex equalisation curves, this filter can
be given several times, each with a different central frequency.
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set the filter's central frequency in Hz.
.IP "\fBwidth_type\fR" 4
.IX Item "width_type"
Set method to specify band-width of filter.
.RS 4
.IP "\fBh\fR" 4
.IX Item "h"
Hz
.IP "\fBq\fR" 4
.IX Item "q"
Q\-Factor
.IP "\fBo\fR" 4
.IX Item "o"
octave
.IP "\fBs\fR" 4
.IX Item "s"
slope
.RE
.RS 4
.RE
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Specify the band-width of a filter in width_type units.
.IP "\fBgain, g\fR" 4
.IX Item "gain, g"
Set the required gain or attenuation in dB.
Beware of clipping when using a positive gain.
.SS "afade"
.IX Subsection "afade"
Apply fade\-in/out effect to input audio.
.PP
A description of the accepted parameters follows.
.IP "\fBtype, t\fR" 4
.IX Item "type, t"
Specify the effect type, can be either \f(CW\*(C`in\*(C'\fR for fade-in, or
\&\f(CW\*(C`out\*(C'\fR for a fade-out effect. Default is \f(CW\*(C`in\*(C'\fR.
.IP "\fBstart_sample, ss\fR" 4
.IX Item "start_sample, ss"
Specify the number of the start sample for starting to apply the fade
effect. Default is 0.
.IP "\fBnb_samples, ns\fR" 4
.IX Item "nb_samples, ns"
Specify the number of samples for which the fade effect has to last. At
the end of the fade-in effect the output audio will have the same
volume as the input audio, at the end of the fade-out transition
the output audio will be silence. Default is 44100.
.IP "\fBstart_time, st\fR" 4
.IX Item "start_time, st"
Specify time for starting to apply the fade effect. Default is 0.
The accepted syntax is:
.Sp
.Vb 2
\&        [\-]HH[:MM[:SS[.m...]]]
\&        [\-]S+[.m...]
.Ve
.Sp
See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
If set this option is used instead of \fIstart_sample\fR one.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Specify the duration for which the fade effect has to last. Default is 0.
The accepted syntax is:
.Sp
.Vb 2
\&        [\-]HH[:MM[:SS[.m...]]]
\&        [\-]S+[.m...]
.Ve
.Sp
See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
At the end of the fade-in effect the output audio will have the same
volume as the input audio, at the end of the fade-out transition
the output audio will be silence.
If set this option is used instead of \fInb_samples\fR one.
.IP "\fBcurve\fR" 4
.IX Item "curve"
Set curve for fade transition.
.Sp
It accepts the following values:
.RS 4
.IP "\fBtri\fR" 4
.IX Item "tri"
select triangular, linear slope (default)
.IP "\fBqsin\fR" 4
.IX Item "qsin"
select quarter of sine wave
.IP "\fBhsin\fR" 4
.IX Item "hsin"
select half of sine wave
.IP "\fBesin\fR" 4
.IX Item "esin"
select exponential sine wave
.IP "\fBlog\fR" 4
.IX Item "log"
select logarithmic
.IP "\fBpar\fR" 4
.IX Item "par"
select inverted parabola
.IP "\fBqua\fR" 4
.IX Item "qua"
select quadratic
.IP "\fBcub\fR" 4
.IX Item "cub"
select cubic
.IP "\fBsqu\fR" 4
.IX Item "squ"
select square root
.IP "\fBcbr\fR" 4
.IX Item "cbr"
select cubic root
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Fade in first 15 seconds of audio:
.Sp
.Vb 1
\&        afade=t=in:ss=0:d=15
.Ve
.IP "\(bu" 4
Fade out last 25 seconds of a 900 seconds audio:
.Sp
.Vb 1
\&        afade=t=out:ss=875:d=25
.Ve
.SS "aformat"
.IX Subsection "aformat"
Set output format constraints for the input audio. The framework will
negotiate the most appropriate format to minimize conversions.
.PP
The filter accepts the following named parameters:
.IP "\fBsample_fmts\fR" 4
.IX Item "sample_fmts"
A '|'\-separated list of requested sample formats.
.IP "\fBsample_rates\fR" 4
.IX Item "sample_rates"
A '|'\-separated list of requested sample rates.
.IP "\fBchannel_layouts\fR" 4
.IX Item "channel_layouts"
A '|'\-separated list of requested channel layouts.
.PP
If a parameter is omitted, all values are allowed.
.PP
For example to force the output to either unsigned 8\-bit or signed 16\-bit stereo:
.PP
.Vb 1
\&        aformat=sample_fmts=u8|s16:channel_layouts=stereo
.Ve
.SS "amerge"
.IX Subsection "amerge"
Merge two or more audio streams into a single multi-channel stream.
.PP
The filter accepts the following options:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
Set the number of inputs. Default is 2.
.PP
If the channel layouts of the inputs are disjoint, and therefore compatible,
the channel layout of the output will be set accordingly and the channels
will be reordered as necessary. If the channel layouts of the inputs are not
disjoint, the output will have all the channels of the first input then all
the channels of the second input, in that order, and the channel layout of
the output will be the default value corresponding to the total number of
channels.
.PP
For example, if the first input is in 2.1 (\s-1FL+FR+LF\s0) and the second input
is \s-1FC+BL+BR\s0, then the output will be in 5.1, with the channels in the
following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
first input, b1 is the first channel of the second input).
.PP
On the other hand, if both input are in stereo, the output channels will be
in the default order: a1, a2, b1, b2, and the channel layout will be
arbitrarily set to 4.0, which may or may not be the expected value.
.PP
All inputs must have the same sample rate, and format.
.PP
If inputs do not have the same duration, the output will stop with the
shortest.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Merge two mono files into a stereo stream:
.Sp
.Vb 1
\&        amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
.Ve
.IP "\(bu" 4
Multiple merges assuming 1 video stream and 6 audio streams in \fIinput.mkv\fR:
.Sp
.Vb 1
\&        ffmpeg \-i input.mkv \-filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" \-c:a pcm_s16le output.mkv
.Ve
.SS "amix"
.IX Subsection "amix"
Mixes multiple audio inputs into a single output.
.PP
For example
.PP
.Vb 1
\&        ffmpeg \-i INPUT1 \-i INPUT2 \-i INPUT3 \-filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
.Ve
.PP
will mix 3 input audio streams to a single output with the same duration as the
first input and a dropout transition time of 3 seconds.
.PP
The filter accepts the following named parameters:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
Number of inputs. If unspecified, it defaults to 2.
.IP "\fBduration\fR" 4
.IX Item "duration"
How to determine the end-of-stream.
.RS 4
.IP "\fBlongest\fR" 4
.IX Item "longest"
Duration of longest input. (default)
.IP "\fBshortest\fR" 4
.IX Item "shortest"
Duration of shortest input.
.IP "\fBfirst\fR" 4
.IX Item "first"
Duration of first input.
.RE
.RS 4
.RE
.IP "\fBdropout_transition\fR" 4
.IX Item "dropout_transition"
Transition time, in seconds, for volume renormalization when an input
stream ends. The default value is 2 seconds.
.SS "anull"
.IX Subsection "anull"
Pass the audio source unchanged to the output.
.SS "apad"
.IX Subsection "apad"
Pad the end of a audio stream with silence, this can be used together with
\&\-shortest to extend audio streams to the same length as the video stream.
.SS "aphaser"
.IX Subsection "aphaser"
Add a phasing effect to the input audio.
.PP
A phaser filter creates series of peaks and troughs in the frequency spectrum.
The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
.PP
A description of the accepted parameters follows.
.IP "\fBin_gain\fR" 4
.IX Item "in_gain"
Set input gain. Default is 0.4.
.IP "\fBout_gain\fR" 4
.IX Item "out_gain"
Set output gain. Default is 0.74
.IP "\fBdelay\fR" 4
.IX Item "delay"
Set delay in milliseconds. Default is 3.0.
.IP "\fBdecay\fR" 4
.IX Item "decay"
Set decay. Default is 0.4.
.IP "\fBspeed\fR" 4
.IX Item "speed"
Set modulation speed in Hz. Default is 0.5.
.IP "\fBtype\fR" 4
.IX Item "type"
Set modulation type. Default is triangular.
.Sp
It accepts the following values:
.RS 4
.IP "\fBtriangular, t\fR" 4
.IX Item "triangular, t"
.PD 0
.IP "\fBsinusoidal, s\fR" 4
.IX Item "sinusoidal, s"
.RE
.RS 4
.RE
.PD
.SS "aresample"
.IX Subsection "aresample"
Resample the input audio to the specified parameters, using the
libswresample library. If none are specified then the filter will
automatically convert between its input and output.
.PP
This filter is also able to stretch/squeeze the audio data to make it match
the timestamps or to inject silence / cut out audio to make it match the
timestamps, do a combination of both or do neither.
.PP
The filter accepts the syntax
[\fIsample_rate\fR:]\fIresampler_options\fR, where \fIsample_rate\fR
expresses a sample rate and \fIresampler_options\fR is a list of
\&\fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". See the
ffmpeg-resampler manual for the complete list of supported options.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Resample the input audio to 44100Hz:
.Sp
.Vb 1
\&        aresample=44100
.Ve
.IP "\(bu" 4
Stretch/squeeze samples to the given timestamps, with a maximum of 1000
samples per second compensation:
.Sp
.Vb 1
\&        aresample=async=1000
.Ve
.SS "asetnsamples"
.IX Subsection "asetnsamples"
Set the number of samples per each output audio frame.
.PP
The last output packet may contain a different number of samples, as
the filter will flush all the remaining samples when the input audio
signal its end.
.PP
The filter accepts the following options:
.IP "\fBnb_out_samples, n\fR" 4
.IX Item "nb_out_samples, n"
Set the number of frames per each output audio frame. The number is
intended as the number of samples \fIper each channel\fR.
Default value is 1024.
.IP "\fBpad, p\fR" 4
.IX Item "pad, p"
If set to 1, the filter will pad the last audio frame with zeroes, so
that the last frame will contain the same number of samples as the
previous ones. Default value is 1.
.PP
For example, to set the number of per-frame samples to 1234 and
disable padding for the last frame, use:
.PP
.Vb 1
\&        asetnsamples=n=1234:p=0
.Ve
.SS "ashowinfo"
.IX Subsection "ashowinfo"
Show a line containing various information for each input audio frame.
The input audio is not modified.
.PP
The shown line contains a sequence of key/value pairs of the form
\&\fIkey\fR:\fIvalue\fR.
.PP
A description of each shown parameter follows:
.IP "\fBn\fR" 4
.IX Item "n"
sequential number of the input frame, starting from 0
.IP "\fBpts\fR" 4
.IX Item "pts"
Presentation timestamp of the input frame, in time base units; the time base
depends on the filter input pad, and is usually 1/\fIsample_rate\fR.
.IP "\fBpts_time\fR" 4
.IX Item "pts_time"
presentation timestamp of the input frame in seconds
.IP "\fBpos\fR" 4
.IX Item "pos"
position of the frame in the input stream, \-1 if this information in
unavailable and/or meaningless (for example in case of synthetic audio)
.IP "\fBfmt\fR" 4
.IX Item "fmt"
sample format
.IP "\fBchlayout\fR" 4
.IX Item "chlayout"
channel layout
.IP "\fBrate\fR" 4
.IX Item "rate"
sample rate for the audio frame
.IP "\fBnb_samples\fR" 4
.IX Item "nb_samples"
number of samples (per channel) in the frame
.IP "\fBchecksum\fR" 4
.IX Item "checksum"
Adler\-32 checksum (printed in hexadecimal) of the audio data. For planar audio
the data is treated as if all the planes were concatenated.
.IP "\fBplane_checksums\fR" 4
.IX Item "plane_checksums"
A list of Adler\-32 checksums for each data plane.
.SS "astreamsync"
.IX Subsection "astreamsync"
Forward two audio streams and control the order the buffers are forwarded.
.PP
The filter accepts the following options:
.IP "\fBexpr, e\fR" 4
.IX Item "expr, e"
Set the expression deciding which stream should be
forwarded next: if the result is negative, the first stream is forwarded; if
the result is positive or zero, the second stream is forwarded. It can use
the following variables:
.RS 4
.IP "\fIb1 b2\fR" 4
.IX Item "b1 b2"
number of buffers forwarded so far on each stream
.IP "\fIs1 s2\fR" 4
.IX Item "s1 s2"
number of samples forwarded so far on each stream
.IP "\fIt1 t2\fR" 4
.IX Item "t1 t2"
current timestamp of each stream
.RE
.RS 4
.Sp
The default value is \f(CW\*(C`t1\-t2\*(C'\fR, which means to always forward the stream
that has a smaller timestamp.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Stress-test \f(CW\*(C`amerge\*(C'\fR by randomly sending buffers on the wrong
input, while avoiding too much of a desynchronization:
.PP
.Vb 3
\&        amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
\&        [a] [b] astreamsync=(2*random(1))\-1+tanh(5*(t1\-t2)) [a2] [b2] ;
\&        [a2] [b2] amerge
.Ve
.SS "atempo"
.IX Subsection "atempo"
Adjust audio tempo.
.PP
The filter accepts exactly one parameter, the audio tempo. If not
specified then the filter will assume nominal 1.0 tempo. Tempo must
be in the [0.5, 2.0] range.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Slow down audio to 80% tempo:
.Sp
.Vb 1
\&        atempo=0.8
.Ve
.IP "\(bu" 4
To speed up audio to 125% tempo:
.Sp
.Vb 1
\&        atempo=1.25
.Ve
.SS "earwax"
.IX Subsection "earwax"
Make audio easier to listen to on headphones.
.PP
This filter adds `cues' to 44.1kHz stereo (i.e. audio \s-1CD\s0 format) audio
so that when listened to on headphones the stereo image is moved from
inside your head (standard for headphones) to outside and in front of
the listener (standard for speakers).
.PP
Ported from SoX.
.SS "pan"
.IX Subsection "pan"
Mix channels with specific gain levels. The filter accepts the output
channel layout followed by a set of channels definitions.
.PP
This filter is also designed to remap efficiently the channels of an audio
stream.
.PP
The filter accepts parameters of the form:
"\fIl\fR:\fIoutdef\fR:\fIoutdef\fR:..."
.IP "\fBl\fR" 4
.IX Item "l"
output channel layout or number of channels
.IP "\fBoutdef\fR" 4
.IX Item "outdef"
output channel specification, of the form:
"\fIout_name\fR=[\fIgain\fR*]\fIin_name\fR[+[\fIgain\fR*]\fIin_name\fR...]"
.IP "\fBout_name\fR" 4
.IX Item "out_name"
output channel to define, either a channel name (\s-1FL\s0, \s-1FR\s0, etc.) or a channel
number (c0, c1, etc.)
.IP "\fBgain\fR" 4
.IX Item "gain"
multiplicative coefficient for the channel, 1 leaving the volume unchanged
.IP "\fBin_name\fR" 4
.IX Item "in_name"
input channel to use, see out_name for details; it is not possible to mix
named and numbered input channels
.PP
If the `=' in a channel specification is replaced by `<', then the gains for
that specification will be renormalized so that the total is 1, thus
avoiding clipping noise.
.PP
\fIMixing examples\fR
.IX Subsection "Mixing examples"
.PP
For example, if you want to down-mix from stereo to mono, but with a bigger
factor for the left channel:
.PP
.Vb 1
\&        pan=1:c0=0.9*c0+0.1*c1
.Ve
.PP
A customized down-mix to stereo that works automatically for 3\-, 4\-, 5\- and
7\-channels surround:
.PP
.Vb 1
\&        pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
.Ve
.PP
Note that \fBffmpeg\fR integrates a default down-mix (and up-mix) system
that should be preferred (see \*(L"\-ac\*(R" option) unless you have very specific
needs.
.PP
\fIRemapping examples\fR
.IX Subsection "Remapping examples"
.PP
The channel remapping will be effective if, and only if:
.IP "*<gain coefficients are zeroes or ones,>" 4
.IX Item "*<gain coefficients are zeroes or ones,>"
.PD 0
.IP "*<only one input per channel output,>" 4
.IX Item "*<only one input per channel output,>"
.PD
.PP
If all these conditions are satisfied, the filter will notify the user (\*(L"Pure
channel mapping detected\*(R"), and use an optimized and lossless method to do the
remapping.
.PP
For example, if you have a 5.1 source and want a stereo audio stream by
dropping the extra channels:
.PP
.Vb 1
\&        pan="stereo: c0=FL : c1=FR"
.Ve
.PP
Given the same source, you can also switch front left and front right channels
and keep the input channel layout:
.PP
.Vb 1
\&        pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
.Ve
.PP
If the input is a stereo audio stream, you can mute the front left channel (and
still keep the stereo channel layout) with:
.PP
.Vb 1
\&        pan="stereo:c1=c1"
.Ve
.PP
Still with a stereo audio stream input, you can copy the right channel in both
front left and right:
.PP
.Vb 1
\&        pan="stereo: c0=FR : c1=FR"
.Ve
.SS "silencedetect"
.IX Subsection "silencedetect"
Detect silence in an audio stream.
.PP
This filter logs a message when it detects that the input audio volume is less
or equal to a noise tolerance value for a duration greater or equal to the
minimum detected noise duration.
.PP
The printed times and duration are expressed in seconds.
.PP
The filter accepts the following options:
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Set silence duration until notification (default is 2 seconds).
.IP "\fBnoise, n\fR" 4
.IX Item "noise, n"
Set noise tolerance. Can be specified in dB (in case \*(L"dB\*(R" is appended to the
specified value) or amplitude ratio. Default is \-60dB, or 0.001.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Detect 5 seconds of silence with \-50dB noise tolerance:
.Sp
.Vb 1
\&        silencedetect=n=\-50dB:d=5
.Ve
.IP "\(bu" 4
Complete example with \fBffmpeg\fR to detect silence with 0.0001 noise
tolerance in \fIsilence.mp3\fR:
.Sp
.Vb 1
\&        ffmpeg \-i silence.mp3 \-af silencedetect=noise=0.0001 \-f null \-
.Ve
.SS "asyncts"
.IX Subsection "asyncts"
Synchronize audio data with timestamps by squeezing/stretching it and/or
dropping samples/adding silence when needed.
.PP
This filter is not built by default, please use aresample to do squeezing/stretching.
.PP
The filter accepts the following named parameters:
.IP "\fBcompensate\fR" 4
.IX Item "compensate"
Enable stretching/squeezing the data to make it match the timestamps. Disabled
by default. When disabled, time gaps are covered with silence.
.IP "\fBmin_delta\fR" 4
.IX Item "min_delta"
Minimum difference between timestamps and audio data (in seconds) to trigger
adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
this filter, try setting this parameter to 0.
.IP "\fBmax_comp\fR" 4
.IX Item "max_comp"
Maximum compensation in samples per second. Relevant only with compensate=1.
Default value 500.
.IP "\fBfirst_pts\fR" 4
.IX Item "first_pts"
Assume the first pts should be this value. The time base is 1 / sample rate.
This allows for padding/trimming at the start of stream. By default, no
assumption is made about the first frame's expected pts, so no padding or
trimming is done. For example, this could be set to 0 to pad the beginning with
silence if an audio stream starts after the video stream or to trim any samples
with a negative pts due to encoder delay.
.SS "channelsplit"
.IX Subsection "channelsplit"
Split each channel in input audio stream into a separate output stream.
.PP
This filter accepts the following named parameters:
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
Channel layout of the input stream. Default is \*(L"stereo\*(R".
.PP
For example, assuming a stereo input \s-1MP3\s0 file
.PP
.Vb 1
\&        ffmpeg \-i in.mp3 \-filter_complex channelsplit out.mkv
.Ve
.PP
will create an output Matroska file with two audio streams, one containing only
the left channel and the other the right channel.
.PP
To split a 5.1 \s-1WAV\s0 file into per-channel files
.PP
.Vb 5
\&        ffmpeg \-i in.wav \-filter_complex
\&        \*(Aqchannelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]\*(Aq
\&        \-map \*(Aq[FL]\*(Aq front_left.wav \-map \*(Aq[FR]\*(Aq front_right.wav \-map \*(Aq[FC]\*(Aq
\&        front_center.wav \-map \*(Aq[LFE]\*(Aq lfe.wav \-map \*(Aq[SL]\*(Aq side_left.wav \-map \*(Aq[SR]\*(Aq
\&        side_right.wav
.Ve
.SS "channelmap"
.IX Subsection "channelmap"
Remap input channels to new locations.
.PP
This filter accepts the following named parameters:
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
Channel layout of the output stream.
.IP "\fBmap\fR" 4
.IX Item "map"
Map channels from input to output. The argument is a '|'\-separated list of
mappings, each in the \f(CW\*(C`\f(CIin_channel\f(CW\-\f(CIout_channel\f(CW\*(C'\fR or
\&\fIin_channel\fR form. \fIin_channel\fR can be either the name of the input
channel (e.g. \s-1FL\s0 for front left) or its index in the input channel layout.
\&\fIout_channel\fR is the name of the output channel or its index in the output
channel layout. If \fIout_channel\fR is not given then it is implicitly an
index, starting with zero and increasing by one for each mapping.
.PP
If no mapping is present, the filter will implicitly map input channels to
output channels preserving index.
.PP
For example, assuming a 5.1+downmix input \s-1MOV\s0 file
.PP
.Vb 1
\&        ffmpeg \-i in.mov \-filter \*(Aqchannelmap=map=DL\-FL|DR\-FR\*(Aq out.wav
.Ve
.PP
will create an output \s-1WAV\s0 file tagged as stereo from the downmix channels of
the input.
.PP
To fix a 5.1 \s-1WAV\s0 improperly encoded in \s-1AAC\s0's native channel order
.PP
.Vb 1
\&        ffmpeg \-i in.wav \-filter \*(Aqchannelmap=1|2|0|5|3|4:channel_layout=5.1\*(Aq out.wav
.Ve
.SS "join"
.IX Subsection "join"
Join multiple input streams into one multi-channel stream.
.PP
The filter accepts the following named parameters:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
Number of input streams. Defaults to 2.
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
Desired output channel layout. Defaults to stereo.
.IP "\fBmap\fR" 4
.IX Item "map"
Map channels from inputs to output. The argument is a '|'\-separated list of
mappings, each in the \f(CW\*(C`\f(CIinput_idx\f(CW.\f(CIin_channel\f(CW\-\f(CIout_channel\f(CW\*(C'\fR
form. \fIinput_idx\fR is the 0\-based index of the input stream. \fIin_channel\fR
can be either the name of the input channel (e.g. \s-1FL\s0 for front left) or its
index in the specified input stream. \fIout_channel\fR is the name of the output
channel.
.PP
The filter will attempt to guess the mappings when those are not specified
explicitly. It does so by first trying to find an unused matching input channel
and if that fails it picks the first unused input channel.
.PP
E.g. to join 3 inputs (with properly set channel layouts)
.PP
.Vb 1
\&        ffmpeg \-i INPUT1 \-i INPUT2 \-i INPUT3 \-filter_complex join=inputs=3 OUTPUT
.Ve
.PP
To build a 5.1 output from 6 single-channel streams:
.PP
.Vb 3
\&        ffmpeg \-i fl \-i fr \-i fc \-i sl \-i sr \-i lfe \-filter_complex
\&        \*(Aqjoin=inputs=6:channel_layout=5.1:map=0.0\-FL|1.0\-FR|2.0\-FC|3.0\-SL|4.0\-SR|5.0\-LFE\*(Aq
\&        out
.Ve
.SS "resample"
.IX Subsection "resample"
Convert the audio sample format, sample rate and channel layout. This filter is
not meant to be used directly.
.SS "volume"
.IX Subsection "volume"
Adjust the input audio volume.
.PP
The filter accepts the following options:
.IP "\fBvolume\fR" 4
.IX Item "volume"
Expresses how the audio volume will be increased or decreased.
.Sp
Output values are clipped to the maximum value.
.Sp
The output audio volume is given by the relation:
.Sp
.Vb 1
\&        <output_volume> = <volume> * <input_volume>
.Ve
.Sp
Default value for \fIvolume\fR is 1.0.
.IP "\fBprecision\fR" 4
.IX Item "precision"
Set the mathematical precision.
.Sp
This determines which input sample formats will be allowed, which affects the
precision of the volume scaling.
.RS 4
.IP "\fBfixed\fR" 4
.IX Item "fixed"
8\-bit fixed-point; limits input sample format to U8, S16, and S32.
.IP "\fBfloat\fR" 4
.IX Item "float"
32\-bit floating-point; limits input sample format to \s-1FLT\s0. (default)
.IP "\fBdouble\fR" 4
.IX Item "double"
64\-bit floating-point; limits input sample format to \s-1DBL\s0.
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Halve the input audio volume:
.Sp
.Vb 3
\&        volume=volume=0.5
\&        volume=volume=1/2
\&        volume=volume=\-6.0206dB
.Ve
.Sp
In all the above example the named key for \fBvolume\fR can be
omitted, for example like in:
.Sp
.Vb 1
\&        volume=0.5
.Ve
.IP "\(bu" 4
Increase input audio power by 6 decibels using fixed-point precision:
.Sp
.Vb 1
\&        volume=volume=6dB:precision=fixed
.Ve
.SS "volumedetect"
.IX Subsection "volumedetect"
Detect the volume of the input video.
.PP
The filter has no parameters. The input is not modified. Statistics about
the volume will be printed in the log when the input stream end is reached.
.PP
In particular it will show the mean volume (root mean square), maximum
volume (on a per-sample basis), and the beginning of an histogram of the
registered volume values (from the maximum value to a cumulated 1/1000 of
the samples).
.PP
All volumes are in decibels relative to the maximum \s-1PCM\s0 value.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Here is an excerpt of the output:
.PP
.Vb 9
\&        [Parsed_volumedetect_0  0xa23120] mean_volume: \-27 dB
\&        [Parsed_volumedetect_0  0xa23120] max_volume: \-4 dB
\&        [Parsed_volumedetect_0  0xa23120] histogram_4db: 6
\&        [Parsed_volumedetect_0  0xa23120] histogram_5db: 62
\&        [Parsed_volumedetect_0  0xa23120] histogram_6db: 286
\&        [Parsed_volumedetect_0  0xa23120] histogram_7db: 1042
\&        [Parsed_volumedetect_0  0xa23120] histogram_8db: 2551
\&        [Parsed_volumedetect_0  0xa23120] histogram_9db: 4609
\&        [Parsed_volumedetect_0  0xa23120] histogram_10db: 8409
.Ve
.PP
It means that:
.IP "\(bu" 4
The mean square energy is approximately \-27 dB, or 10^\-2.7.
.IP "\(bu" 4
The largest sample is at \-4 dB, or more precisely between \-4 dB and \-5 dB.
.IP "\(bu" 4
There are 6 samples at \-4 dB, 62 at \-5 dB, 286 at \-6 dB, etc.
.PP
In other words, raising the volume by +4 dB does not cause any clipping,
raising it by +5 dB causes clipping for 6 samples, etc.
.SH "AUDIO SOURCES"
.IX Header "AUDIO SOURCES"
Below is a description of the currently available audio sources.
.SS "abuffer"
.IX Subsection "abuffer"
Buffer audio frames, and make them available to the filter chain.
.PP
This source is mainly intended for a programmatic use, in particular
through the interface defined in \fIlibavfilter/asrc_abuffer.h\fR.
.PP
It accepts the following named parameters:
.IP "\fBtime_base\fR" 4
.IX Item "time_base"
Timebase which will be used for timestamps of submitted frames. It must be
either a floating-point number or in \fInumerator\fR/\fIdenominator\fR form.
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
The sample rate of the incoming audio buffers.
.IP "\fBsample_fmt\fR" 4
.IX Item "sample_fmt"
The sample format of the incoming audio buffers.
Either a sample format name or its corresponging integer representation from
the enum AVSampleFormat in \fIlibavutil/samplefmt.h\fR
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
The channel layout of the incoming audio buffers.
Either a channel layout name from channel_layout_map in
\&\fIlibavutil/channel_layout.c\fR or its corresponding integer representation
from the AV_CH_LAYOUT_* macros in \fIlibavutil/channel_layout.h\fR
.IP "\fBchannels\fR" 4
.IX Item "channels"
The number of channels of the incoming audio buffers.
If both \fIchannels\fR and \fIchannel_layout\fR are specified, then they
must be consistent.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
.Vb 1
\&        abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
.Ve
.PP
will instruct the source to accept planar 16bit signed stereo at 44100Hz.
Since the sample format with name \*(L"s16p\*(R" corresponds to the number
6 and the \*(L"stereo\*(R" channel layout corresponds to the value 0x3, this is
equivalent to:
.PP
.Vb 1
\&        abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
.Ve
.SS "aevalsrc"
.IX Subsection "aevalsrc"
Generate an audio signal specified by an expression.
.PP
This source accepts in input one or more expressions (one for each
channel), which are evaluated and used to generate a corresponding
audio signal.
.PP
This source accepts the following options:
.IP "\fBexprs\fR" 4
.IX Item "exprs"
Set the '|'\-separated expressions list for each separate channel. In case the
\&\fBchannel_layout\fR option is not specified, the selected channel layout
depends on the number of provided expressions.
.IP "\fBchannel_layout, c\fR" 4
.IX Item "channel_layout, c"
Set the channel layout. The number of channels in the specified layout
must be equal to the number of specified expressions.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Set the minimum duration of the sourced audio. See the function
\&\f(CW\*(C`av_parse_time()\*(C'\fR for the accepted format.
Note that the resulting duration may be greater than the specified
duration, as the generated audio is always cut at the end of a
complete frame.
.Sp
If not specified, or the expressed duration is negative, the audio is
supposed to be generated forever.
.IP "\fBnb_samples, n\fR" 4
.IX Item "nb_samples, n"
Set the number of samples per channel per each output frame,
default to 1024.
.IP "\fBsample_rate, s\fR" 4
.IX Item "sample_rate, s"
Specify the sample rate, default to 44100.
.PP
Each expression in \fIexprs\fR can contain the following constants:
.IP "\fBn\fR" 4
.IX Item "n"
number of the evaluated sample, starting from 0
.IP "\fBt\fR" 4
.IX Item "t"
time of the evaluated sample expressed in seconds, starting from 0
.IP "\fBs\fR" 4
.IX Item "s"
sample rate
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Generate silence:
.Sp
.Vb 1
\&        aevalsrc=0
.Ve
.IP "\(bu" 4
Generate a sin signal with frequency of 440 Hz, set sample rate to
8000 Hz:
.Sp
.Vb 1
\&        aevalsrc="sin(440*2*PI*t):s=8000"
.Ve
.IP "\(bu" 4
Generate a two channels signal, specify the channel layout (Front
Center + Back Center) explicitly:
.Sp
.Vb 1
\&        aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
.Ve
.IP "\(bu" 4
Generate white noise:
.Sp
.Vb 1
\&        aevalsrc="\-2+random(0)"
.Ve
.IP "\(bu" 4
Generate an amplitude modulated signal:
.Sp
.Vb 1
\&        aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
.Ve
.IP "\(bu" 4
Generate 2.5 Hz binaural beats on a 360 Hz carrier:
.Sp
.Vb 1
\&        aevalsrc="0.1*sin(2*PI*(360\-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
.Ve
.SS "anullsrc"
.IX Subsection "anullsrc"
Null audio source, return unprocessed audio frames. It is mainly useful
as a template and to be employed in analysis / debugging tools, or as
the source for filters which ignore the input data (for example the sox
synth filter).
.PP
This source accepts the following options:
.IP "\fBchannel_layout, cl\fR" 4
.IX Item "channel_layout, cl"
Specify the channel layout, and can be either an integer or a string
representing a channel layout. The default value of \fIchannel_layout\fR
is \*(L"stereo\*(R".
.Sp
Check the channel_layout_map definition in
\&\fIlibavutil/channel_layout.c\fR for the mapping between strings and
channel layout values.
.IP "\fBsample_rate, r\fR" 4
.IX Item "sample_rate, r"
Specify the sample rate, and defaults to 44100.
.IP "\fBnb_samples, n\fR" 4
.IX Item "nb_samples, n"
Set the number of samples per requested frames.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Set the sample rate to 48000 Hz and the channel layout to \s-1AV_CH_LAYOUT_MONO\s0.
.Sp
.Vb 1
\&        anullsrc=r=48000:cl=4
.Ve
.IP "\(bu" 4
Do the same operation with a more obvious syntax:
.Sp
.Vb 1
\&        anullsrc=r=48000:cl=mono
.Ve
.SS "abuffer"
.IX Subsection "abuffer"
Buffer audio frames, and make them available to the filter chain.
.PP
This source is not intended to be part of user-supplied graph descriptions but
for insertion by calling programs through the interface defined in
\&\fIlibavfilter/buffersrc.h\fR.
.PP
It accepts the following named parameters:
.IP "\fBtime_base\fR" 4
.IX Item "time_base"
Timebase which will be used for timestamps of submitted frames. It must be
either a floating-point number or in \fInumerator\fR/\fIdenominator\fR form.
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Audio sample rate.
.IP "\fBsample_fmt\fR" 4
.IX Item "sample_fmt"
Name of the sample format, as returned by \f(CW\*(C`av_get_sample_fmt_name()\*(C'\fR.
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
Channel layout of the audio data, in the form that can be accepted by
\&\f(CW\*(C`av_get_channel_layout()\*(C'\fR.
.PP
All the parameters need to be explicitly defined.
.SS "flite"
.IX Subsection "flite"
Synthesize a voice utterance using the libflite library.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libflite\*(C'\fR.
.PP
Note that the flite library is not thread-safe.
.PP
The filter accepts the following options:
.IP "\fBlist_voices\fR" 4
.IX Item "list_voices"
If set to 1, list the names of the available voices and exit
immediately. Default value is 0.
.IP "\fBnb_samples, n\fR" 4
.IX Item "nb_samples, n"
Set the maximum number of samples per frame. Default value is 512.
.IP "\fBtextfile\fR" 4
.IX Item "textfile"
Set the filename containing the text to speak.
.IP "\fBtext\fR" 4
.IX Item "text"
Set the text to speak.
.IP "\fBvoice, v\fR" 4
.IX Item "voice, v"
Set the voice to use for the speech synthesis. Default value is
\&\f(CW\*(C`kal\*(C'\fR. See also the \fIlist_voices\fR option.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Read from file \fIspeech.txt\fR, and synthetize the text using the
standard flite voice:
.Sp
.Vb 1
\&        flite=textfile=speech.txt
.Ve
.IP "\(bu" 4
Read the specified text selecting the \f(CW\*(C`slt\*(C'\fR voice:
.Sp
.Vb 1
\&        flite=text=\*(AqSo fare thee well, poor devil of a Sub\-Sub, whose commentator I am\*(Aq:voice=slt
.Ve
.IP "\(bu" 4
Input text to ffmpeg:
.Sp
.Vb 1
\&        ffmpeg \-f lavfi \-i flite=text=\*(AqSo fare thee well, poor devil of a Sub\-Sub, whose commentator I am\*(Aq:voice=slt
.Ve
.IP "\(bu" 4
Make \fIffplay\fR speak the specified text, using \f(CW\*(C`flite\*(C'\fR and
the \f(CW\*(C`lavfi\*(C'\fR device:
.Sp
.Vb 1
\&        ffplay \-f lavfi flite=text=\*(AqNo more be grieved for which that thou hast done.\*(Aq
.Ve
.PP
For more information about libflite, check:
<\fBhttp://www.speech.cs.cmu.edu/flite/\fR>
.SS "sine"
.IX Subsection "sine"
Generate an audio signal made of a sine wave with amplitude 1/8.
.PP
The audio signal is bit-exact.
.PP
The filter accepts the following options:
.IP "\fBfrequency, f\fR" 4
.IX Item "frequency, f"
Set the carrier frequency. Default is 440 Hz.
.IP "\fBbeep_factor, b\fR" 4
.IX Item "beep_factor, b"
Enable a periodic beep every second with frequency \fIbeep_factor\fR times
the carrier frequency. Default is 0, meaning the beep is disabled.
.IP "\fBsample_rate, s\fR" 4
.IX Item "sample_rate, s"
Specify the sample rate, default is 44100.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Specify the duration of the generated audio stream.
.IP "\fBsamples_per_frame\fR" 4
.IX Item "samples_per_frame"
Set the number of samples per output frame, default is 1024.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Generate a simple 440 Hz sine wave:
.Sp
.Vb 1
\&        sine
.Ve
.IP "\(bu" 4
Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
.Sp
.Vb 3
\&        sine=220:4:d=5
\&        sine=f=220:b=4:d=5
\&        sine=frequency=220:beep_factor=4:duration=5
.Ve
.SH "AUDIO SINKS"
.IX Header "AUDIO SINKS"
Below is a description of the currently available audio sinks.
.SS "abuffersink"
.IX Subsection "abuffersink"
Buffer audio frames, and make them available to the end of filter chain.
.PP
This sink is mainly intended for programmatic use, in particular
through the interface defined in \fIlibavfilter/buffersink.h\fR
or the options system.
.PP
It accepts a pointer to an AVABufferSinkContext structure, which
defines the incoming buffers' formats, to be passed as the opaque
parameter to \f(CW\*(C`avfilter_init_filter\*(C'\fR for initialization.
.SS "anullsink"
.IX Subsection "anullsink"
Null audio sink, do absolutely nothing with the input audio. It is
mainly useful as a template and to be employed in analysis / debugging
tools.
.SH "VIDEO FILTERS"
.IX Header "VIDEO FILTERS"
When you configure your FFmpeg build, you can disable any of the
existing filters using \f(CW\*(C`\-\-disable\-filters\*(C'\fR.
The configure output will show the video filters included in your
build.
.PP
Below is a description of the currently available video filters.
.SS "alphaextract"
.IX Subsection "alphaextract"
Extract the alpha component from the input as a grayscale video. This
is especially useful with the \fIalphamerge\fR filter.
.SS "alphamerge"
.IX Subsection "alphamerge"
Add or replace the alpha component of the primary input with the
grayscale value of a second input. This is intended for use with
\&\fIalphaextract\fR to allow the transmission or storage of frame
sequences that have alpha in a format that doesn't support an alpha
channel.
.PP
For example, to reconstruct full frames from a normal YUV-encoded video
and a separate video created with \fIalphaextract\fR, you might use:
.PP
.Vb 1
\&        movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
.Ve
.PP
Since this filter is designed for reconstruction, it operates on frame
sequences without considering timestamps, and terminates when either
input reaches end of stream. This will cause problems if your encoding
pipeline drops frames. If you're trying to apply an image as an
overlay to a video stream, consider the \fIoverlay\fR filter instead.
.SS "ass"
.IX Subsection "ass"
Same as the subtitles filter, except that it doesn't require libavcodec
and libavformat to work. On the other hand, it is limited to \s-1ASS\s0 (Advanced
Substation Alpha) subtitles files.
.SS "bbox"
.IX Subsection "bbox"
Compute the bounding box for the non-black pixels in the input frame
luminance plane.
.PP
This filter computes the bounding box containing all the pixels with a
luminance value greater than the minimum allowed value.
The parameters describing the bounding box are printed on the filter
log.
.SS "blackdetect"
.IX Subsection "blackdetect"
Detect video intervals that are (almost) completely black. Can be
useful to detect chapter transitions, commercials, or invalid
recordings. Output lines contains the time for the start, end and
duration of the detected black interval expressed in seconds.
.PP
In order to display the output lines, you need to set the loglevel at
least to the \s-1AV_LOG_INFO\s0 value.
.PP
The filter accepts the following options:
.IP "\fBblack_min_duration, d\fR" 4
.IX Item "black_min_duration, d"
Set the minimum detected black duration expressed in seconds. It must
be a non-negative floating point number.
.Sp
Default value is 2.0.
.IP "\fBpicture_black_ratio_th, pic_th\fR" 4
.IX Item "picture_black_ratio_th, pic_th"
Set the threshold for considering a picture \*(L"black\*(R".
Express the minimum value for the ratio:
.Sp
.Vb 1
\&        <nb_black_pixels> / <nb_pixels>
.Ve
.Sp
for which a picture is considered black.
Default value is 0.98.
.IP "\fBpixel_black_th, pix_th\fR" 4
.IX Item "pixel_black_th, pix_th"
Set the threshold for considering a pixel \*(L"black\*(R".
.Sp
The threshold expresses the maximum pixel luminance value for which a
pixel is considered \*(L"black\*(R". The provided value is scaled according to
the following equation:
.Sp
.Vb 1
\&        <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
.Ve
.Sp
\&\fIluminance_range_size\fR and \fIluminance_minimum_value\fR depend on
the input video format, the range is [0\-255] for \s-1YUV\s0 full-range
formats and [16\-235] for \s-1YUV\s0 non full-range formats.
.Sp
Default value is 0.10.
.PP
The following example sets the maximum pixel threshold to the minimum
value, and detects only black intervals of 2 or more seconds:
.PP
.Vb 1
\&        blackdetect=d=2:pix_th=0.00
.Ve
.SS "blackframe"
.IX Subsection "blackframe"
Detect frames that are (almost) completely black. Can be useful to
detect chapter transitions or commercials. Output lines consist of
the frame number of the detected frame, the percentage of blackness,
the position in the file if known or \-1 and the timestamp in seconds.
.PP
In order to display the output lines, you need to set the loglevel at
least to the \s-1AV_LOG_INFO\s0 value.
.PP
The filter accepts the following options:
.IP "\fBamount\fR" 4
.IX Item "amount"
Set the percentage of the pixels that have to be below the threshold, defaults
to \f(CW98\fR.
.IP "\fBthreshold, thresh\fR" 4
.IX Item "threshold, thresh"
Set the threshold below which a pixel value is considered black, defaults to
\&\f(CW32\fR.
.SS "blend"
.IX Subsection "blend"
Blend two video frames into each other.
.PP
It takes two input streams and outputs one stream, the first input is the
\&\*(L"top\*(R" layer and second input is \*(L"bottom\*(R" layer.
Output terminates when shortest input terminates.
.PP
A description of the accepted options follows.
.IP "\fBc0_mode\fR" 4
.IX Item "c0_mode"
.PD 0
.IP "\fBc1_mode\fR" 4
.IX Item "c1_mode"
.IP "\fBc2_mode\fR" 4
.IX Item "c2_mode"
.IP "\fBc3_mode\fR" 4
.IX Item "c3_mode"
.IP "\fBall_mode\fR" 4
.IX Item "all_mode"
.PD
Set blend mode for specific pixel component or all pixel components in case
of \fIall_mode\fR. Default value is \f(CW\*(C`normal\*(C'\fR.
.Sp
Available values for component modes are:
.RS 4
.IP "\fBaddition\fR" 4
.IX Item "addition"
.PD 0
.IP "\fBand\fR" 4
.IX Item "and"
.IP "\fBaverage\fR" 4
.IX Item "average"
.IP "\fBburn\fR" 4
.IX Item "burn"
.IP "\fBdarken\fR" 4
.IX Item "darken"
.IP "\fBdifference\fR" 4
.IX Item "difference"
.IP "\fBdivide\fR" 4
.IX Item "divide"
.IP "\fBdodge\fR" 4
.IX Item "dodge"
.IP "\fBexclusion\fR" 4
.IX Item "exclusion"
.IP "\fBhardlight\fR" 4
.IX Item "hardlight"
.IP "\fBlighten\fR" 4
.IX Item "lighten"
.IP "\fBmultiply\fR" 4
.IX Item "multiply"
.IP "\fBnegation\fR" 4
.IX Item "negation"
.IP "\fBnormal\fR" 4
.IX Item "normal"
.IP "\fBor\fR" 4
.IX Item "or"
.IP "\fBoverlay\fR" 4
.IX Item "overlay"
.IP "\fBphoenix\fR" 4
.IX Item "phoenix"
.IP "\fBpinlight\fR" 4
.IX Item "pinlight"
.IP "\fBreflect\fR" 4
.IX Item "reflect"
.IP "\fBscreen\fR" 4
.IX Item "screen"
.IP "\fBsoftlight\fR" 4
.IX Item "softlight"
.IP "\fBsubtract\fR" 4
.IX Item "subtract"
.IP "\fBvividlight\fR" 4
.IX Item "vividlight"
.IP "\fBxor\fR" 4
.IX Item "xor"
.RE
.RS 4
.RE
.IP "\fBc0_opacity\fR" 4
.IX Item "c0_opacity"
.IP "\fBc1_opacity\fR" 4
.IX Item "c1_opacity"
.IP "\fBc2_opacity\fR" 4
.IX Item "c2_opacity"
.IP "\fBc3_opacity\fR" 4
.IX Item "c3_opacity"
.IP "\fBall_opacity\fR" 4
.IX Item "all_opacity"
.PD
Set blend opacity for specific pixel component or all pixel components in case
of \fIall_opacity\fR. Only used in combination with pixel component blend modes.
.IP "\fBc0_expr\fR" 4
.IX Item "c0_expr"
.PD 0
.IP "\fBc1_expr\fR" 4
.IX Item "c1_expr"
.IP "\fBc2_expr\fR" 4
.IX Item "c2_expr"
.IP "\fBc3_expr\fR" 4
.IX Item "c3_expr"
.IP "\fBall_expr\fR" 4
.IX Item "all_expr"
.PD
Set blend expression for specific pixel component or all pixel components in case
of \fIall_expr\fR. Note that related mode options will be ignored if those are set.
.Sp
The expressions can use the following variables:
.RS 4
.IP "\fBN\fR" 4
.IX Item "N"
The sequential number of the filtered frame, starting from \f(CW0\fR.
.IP "\fBX\fR" 4
.IX Item "X"
.PD 0
.IP "\fBY\fR" 4
.IX Item "Y"
.PD
the coordinates of the current sample
.IP "\fBW\fR" 4
.IX Item "W"
.PD 0
.IP "\fBH\fR" 4
.IX Item "H"
.PD
the width and height of currently filtered plane
.IP "\fB\s-1SW\s0\fR" 4
.IX Item "SW"
.PD 0
.IP "\fB\s-1SH\s0\fR" 4
.IX Item "SH"
.PD
Width and height scale depending on the currently filtered plane. It is the
ratio between the corresponding luma plane number of pixels and the current
plane ones. E.g. for \s-1YUV4:2:0\s0 the values are \f(CW\*(C`1,1\*(C'\fR for the luma plane, and
\&\f(CW\*(C`0.5,0.5\*(C'\fR for chroma planes.
.IP "\fBT\fR" 4
.IX Item "T"
Time of the current frame, expressed in seconds.
.IP "\fB\s-1TOP\s0, A\fR" 4
.IX Item "TOP, A"
Value of pixel component at current location for first video frame (top layer).
.IP "\fB\s-1BOTTOM\s0, B\fR" 4
.IX Item "BOTTOM, B"
Value of pixel component at current location for second video frame (bottom layer).
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply transition from bottom layer to top layer in first 10 seconds:
.Sp
.Vb 1
\&        blend=all_expr=\*(AqA*(if(gte(T,10),1,T/10))+B*(1\-(if(gte(T,10),1,T/10)))\*(Aq
.Ve
.IP "\(bu" 4
Apply 1x1 checkerboard effect:
.Sp
.Vb 1
\&        blend=all_expr=\*(Aqif(eq(mod(X,2),mod(Y,2)),A,B)\*(Aq
.Ve
.SS "boxblur"
.IX Subsection "boxblur"
Apply boxblur algorithm to the input video.
.PP
The filter accepts the following options:
.IP "\fBluma_radius, lr\fR" 4
.IX Item "luma_radius, lr"
.PD 0
.IP "\fBluma_power, lp\fR" 4
.IX Item "luma_power, lp"
.IP "\fBchroma_radius, cr\fR" 4
.IX Item "chroma_radius, cr"
.IP "\fBchroma_power, cp\fR" 4
.IX Item "chroma_power, cp"
.IP "\fBalpha_radius, ar\fR" 4
.IX Item "alpha_radius, ar"
.IP "\fBalpha_power, ap\fR" 4
.IX Item "alpha_power, ap"
.PD
.PP
A description of the accepted options follows.
.IP "\fBluma_radius, lr\fR" 4
.IX Item "luma_radius, lr"
.PD 0
.IP "\fBchroma_radius, cr\fR" 4
.IX Item "chroma_radius, cr"
.IP "\fBalpha_radius, ar\fR" 4
.IX Item "alpha_radius, ar"
.PD
Set an expression for the box radius in pixels used for blurring the
corresponding input plane.
.Sp
The radius value must be a non-negative number, and must not be
greater than the value of the expression \f(CW\*(C`min(w,h)/2\*(C'\fR for the
luma and alpha planes, and of \f(CW\*(C`min(cw,ch)/2\*(C'\fR for the chroma
planes.
.Sp
Default value for \fBluma_radius\fR is \*(L"2\*(R". If not specified,
\&\fBchroma_radius\fR and \fBalpha_radius\fR default to the
corresponding value set for \fBluma_radius\fR.
.Sp
The expressions can contain the following constants:
.RS 4
.IP "\fBw, h\fR" 4
.IX Item "w, h"
the input width and height in pixels
.IP "\fBcw, ch\fR" 4
.IX Item "cw, ch"
the input chroma image width and height in pixels
.IP "\fBhsub, vsub\fR" 4
.IX Item "hsub, vsub"
horizontal and vertical chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.RE
.RS 4
.RE
.IP "\fBluma_power, lp\fR" 4
.IX Item "luma_power, lp"
.PD 0
.IP "\fBchroma_power, cp\fR" 4
.IX Item "chroma_power, cp"
.IP "\fBalpha_power, ap\fR" 4
.IX Item "alpha_power, ap"
.PD
Specify how many times the boxblur filter is applied to the
corresponding plane.
.Sp
Default value for \fBluma_power\fR is 2. If not specified,
\&\fBchroma_power\fR and \fBalpha_power\fR default to the
corresponding value set for \fBluma_power\fR.
.Sp
A value of 0 will disable the effect.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply a boxblur filter with luma, chroma, and alpha radius
set to 2:
.Sp
.Vb 2
\&        boxblur=luma_radius=2:luma_power=1
\&        boxblur=2:1
.Ve
.IP "\(bu" 4
Set luma radius to 2, alpha and chroma radius to 0:
.Sp
.Vb 1
\&        boxblur=2:1:cr=0:ar=0
.Ve
.IP "\(bu" 4
Set luma and chroma radius to a fraction of the video dimension:
.Sp
.Vb 1
\&        boxblur=luma_radius=min(h\e,w)/10:luma_power=1:chroma_radius=min(cw\e,ch)/10:chroma_power=1
.Ve
.SS "colorbalance"
.IX Subsection "colorbalance"
Modify intensity of primary colors (red, green and blue) of input frames.
.PP
The filter allows an input frame to be adjusted in the shadows, midtones or highlights
regions for the red-cyan, green-magenta or blue-yellow balance.
.PP
A positive adjustment value shifts the balance towards the primary color, a negative
value towards the complementary color.
.PP
The filter accepts the following options:
.IP "\fBrs\fR" 4
.IX Item "rs"
.PD 0
.IP "\fBgs\fR" 4
.IX Item "gs"
.IP "\fBbs\fR" 4
.IX Item "bs"
.PD
Adjust red, green and blue shadows (darkest pixels).
.IP "\fBrm\fR" 4
.IX Item "rm"
.PD 0
.IP "\fBgm\fR" 4
.IX Item "gm"
.IP "\fBbm\fR" 4
.IX Item "bm"
.PD
Adjust red, green and blue midtones (medium pixels).
.IP "\fBrh\fR" 4
.IX Item "rh"
.PD 0
.IP "\fBgh\fR" 4
.IX Item "gh"
.IP "\fBbh\fR" 4
.IX Item "bh"
.PD
Adjust red, green and blue highlights (brightest pixels).
.Sp
Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Add red color cast to shadows:
.Sp
.Vb 1
\&        colorbalance=rs=.3
.Ve
.SS "colorchannelmixer"
.IX Subsection "colorchannelmixer"
Adjust video input frames by re-mixing color channels.
.PP
This filter modifies a color channel by adding the values associated to
the other channels of the same pixels. For example if the value to
modify is red, the output value will be:
.PP
.Vb 1
\&        <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
.Ve
.PP
The filter accepts the following options:
.IP "\fBrr\fR" 4
.IX Item "rr"
.PD 0
.IP "\fBrg\fR" 4
.IX Item "rg"
.IP "\fBrb\fR" 4
.IX Item "rb"
.IP "\fBra\fR" 4
.IX Item "ra"
.PD
Adjust contribution of input red, green, blue and alpha channels for output red channel.
Default is \f(CW1\fR for \fIrr\fR, and \f(CW0\fR for \fIrg\fR, \fIrb\fR and \fIra\fR.
.IP "\fBgr\fR" 4
.IX Item "gr"
.PD 0
.IP "\fBgg\fR" 4
.IX Item "gg"
.IP "\fBgb\fR" 4
.IX Item "gb"
.IP "\fBga\fR" 4
.IX Item "ga"
.PD
Adjust contribution of input red, green, blue and alpha channels for output green channel.
Default is \f(CW1\fR for \fIgg\fR, and \f(CW0\fR for \fIgr\fR, \fIgb\fR and \fIga\fR.
.IP "\fBbr\fR" 4
.IX Item "br"
.PD 0
.IP "\fBbg\fR" 4
.IX Item "bg"
.IP "\fBbb\fR" 4
.IX Item "bb"
.IP "\fBba\fR" 4
.IX Item "ba"
.PD
Adjust contribution of input red, green, blue and alpha channels for output blue channel.
Default is \f(CW1\fR for \fIbb\fR, and \f(CW0\fR for \fIbr\fR, \fIbg\fR and \fIba\fR.
.IP "\fBar\fR" 4
.IX Item "ar"
.PD 0
.IP "\fBag\fR" 4
.IX Item "ag"
.IP "\fBab\fR" 4
.IX Item "ab"
.IP "\fBaa\fR" 4
.IX Item "aa"
.PD
Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
Default is \f(CW1\fR for \fIaa\fR, and \f(CW0\fR for \fIar\fR, \fIag\fR and \fIab\fR.
.Sp
Allowed ranges for options are \f(CW\*(C`[\-2.0, 2.0]\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Convert source to grayscale:
.Sp
.Vb 1
\&        colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
.Ve
.SS "colormatrix"
.IX Subsection "colormatrix"
Convert color matrix.
.PP
The filter accepts the following options:
.IP "\fBsrc\fR" 4
.IX Item "src"
.PD 0
.IP "\fBdst\fR" 4
.IX Item "dst"
.PD
Specify the source and destination color matrix. Both values must be
specified.
.Sp
The accepted values are:
.RS 4
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT\s0.709
.IP "\fBbt601\fR" 4
.IX Item "bt601"
\&\s-1BT\s0.601
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBfcc\fR" 4
.IX Item "fcc"
\&\s-1FCC\s0
.RE
.RS 4
.RE
.PP
For example to convert from \s-1BT\s0.601 to \s-1SMPTE\-240M\s0, use the command:
.PP
.Vb 1
\&        colormatrix=bt601:smpte240m
.Ve
.SS "copy"
.IX Subsection "copy"
Copy the input source unchanged to the output. Mainly useful for
testing purposes.
.SS "crop"
.IX Subsection "crop"
Crop the input video to given dimensions.
.PP
The filter accepts the following options:
.IP "\fBw, out_w\fR" 4
.IX Item "w, out_w"
Width of the output video. It defaults to \f(CW\*(C`iw\*(C'\fR.
This expression is evaluated only once during the filter
configuration.
.IP "\fBh, out_h\fR" 4
.IX Item "h, out_h"
Height of the output video. It defaults to \f(CW\*(C`ih\*(C'\fR.
This expression is evaluated only once during the filter
configuration.
.IP "\fBx\fR" 4
.IX Item "x"
Horizontal position, in the input video, of the left edge of the output video.
It defaults to \f(CW\*(C`(in_w\-out_w)/2\*(C'\fR.
This expression is evaluated per-frame.
.IP "\fBy\fR" 4
.IX Item "y"
Vertical position, in the input video, of the top edge of the output video.
It defaults to \f(CW\*(C`(in_h\-out_h)/2\*(C'\fR.
This expression is evaluated per-frame.
.IP "\fBkeep_aspect\fR" 4
.IX Item "keep_aspect"
If set to 1 will force the output display aspect ratio
to be the same of the input, by changing the output sample aspect
ratio. It defaults to 0.
.PP
The \fIout_w\fR, \fIout_h\fR, \fIx\fR, \fIy\fR parameters are
expressions containing the following constants:
.IP "\fBx, y\fR" 4
.IX Item "x, y"
the computed values for \fIx\fR and \fIy\fR. They are evaluated for
each new frame.
.IP "\fBin_w, in_h\fR" 4
.IX Item "in_w, in_h"
the input width and height
.IP "\fBiw, ih\fR" 4
.IX Item "iw, ih"
same as \fIin_w\fR and \fIin_h\fR
.IP "\fBout_w, out_h\fR" 4
.IX Item "out_w, out_h"
the output (cropped) width and height
.IP "\fBow, oh\fR" 4
.IX Item "ow, oh"
same as \fIout_w\fR and \fIout_h\fR
.IP "\fBa\fR" 4
.IX Item "a"
same as \fIiw\fR / \fIih\fR
.IP "\fBsar\fR" 4
.IX Item "sar"
input sample aspect ratio
.IP "\fBdar\fR" 4
.IX Item "dar"
input display aspect ratio, it is the same as (\fIiw\fR / \fIih\fR) * \fIsar\fR
.IP "\fBhsub, vsub\fR" 4
.IX Item "hsub, vsub"
horizontal and vertical chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.IP "\fBn\fR" 4
.IX Item "n"
the number of input frame, starting from 0
.IP "\fBpos\fR" 4
.IX Item "pos"
the position in the file of the input frame, \s-1NAN\s0 if unknown
.IP "\fBt\fR" 4
.IX Item "t"
timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
.PP
The expression for \fIout_w\fR may depend on the value of \fIout_h\fR,
and the expression for \fIout_h\fR may depend on \fIout_w\fR, but they
cannot depend on \fIx\fR and \fIy\fR, as \fIx\fR and \fIy\fR are
evaluated after \fIout_w\fR and \fIout_h\fR.
.PP
The \fIx\fR and \fIy\fR parameters specify the expressions for the
position of the top-left corner of the output (non-cropped) area. They
are evaluated for each frame. If the evaluated value is not valid, it
is approximated to the nearest valid value.
.PP
The expression for \fIx\fR may depend on \fIy\fR, and the expression
for \fIy\fR may depend on \fIx\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Crop area with size 100x100 at position (12,34).
.Sp
.Vb 1
\&        crop=100:100:12:34
.Ve
.Sp
Using named options, the example above becomes:
.Sp
.Vb 1
\&        crop=w=100:h=100:x=12:y=34
.Ve
.IP "\(bu" 4
Crop the central input area with size 100x100:
.Sp
.Vb 1
\&        crop=100:100
.Ve
.IP "\(bu" 4
Crop the central input area with size 2/3 of the input video:
.Sp
.Vb 1
\&        crop=2/3*in_w:2/3*in_h
.Ve
.IP "\(bu" 4
Crop the input video central square:
.Sp
.Vb 2
\&        crop=out_w=in_h
\&        crop=in_h
.Ve
.IP "\(bu" 4
Delimit the rectangle with the top-left corner placed at position
100:100 and the right-bottom corner corresponding to the right-bottom
corner of the input image:
.Sp
.Vb 1
\&        crop=in_w\-100:in_h\-100:100:100
.Ve
.IP "\(bu" 4
Crop 10 pixels from the left and right borders, and 20 pixels from
the top and bottom borders
.Sp
.Vb 1
\&        crop=in_w\-2*10:in_h\-2*20
.Ve
.IP "\(bu" 4
Keep only the bottom right quarter of the input image:
.Sp
.Vb 1
\&        crop=in_w/2:in_h/2:in_w/2:in_h/2
.Ve
.IP "\(bu" 4
Crop height for getting Greek harmony:
.Sp
.Vb 1
\&        crop=in_w:1/PHI*in_w
.Ve
.IP "\(bu" 4
Appply trembling effect:
.Sp
.Vb 1
\&        crop=in_w/2:in_h/2:(in_w\-out_w)/2+((in_w\-out_w)/2)*sin(n/10):(in_h\-out_h)/2 +((in_h\-out_h)/2)*sin(n/7)
.Ve
.IP "\(bu" 4
Apply erratic camera effect depending on timestamp:
.Sp
.Vb 1
\&        crop=in_w/2:in_h/2:(in_w\-out_w)/2+((in_w\-out_w)/2)*sin(t*10):(in_h\-out_h)/2 +((in_h\-out_h)/2)*sin(t*13)"
.Ve
.IP "\(bu" 4
Set x depending on the value of y:
.Sp
.Vb 1
\&        crop=in_w/2:in_h/2:y:10+10*sin(n/10)
.Ve
.SS "cropdetect"
.IX Subsection "cropdetect"
Auto-detect crop size.
.PP
Calculate necessary cropping parameters and prints the recommended
parameters through the logging system. The detected dimensions
correspond to the non-black area of the input video.
.PP
The filter accepts the following options:
.IP "\fBlimit\fR" 4
.IX Item "limit"
Set higher black value threshold, which can be optionally specified
from nothing (0) to everything (255). An intensity value greater
to the set value is considered non-black. Default value is 24.
.IP "\fBround\fR" 4
.IX Item "round"
Set the value for which the width/height should be divisible by. The
offset is automatically adjusted to center the video. Use 2 to get
only even dimensions (needed for 4:2:2 video). 16 is best when
encoding to most video codecs. Default value is 16.
.IP "\fBreset_count, reset\fR" 4
.IX Item "reset_count, reset"
Set the counter that determines after how many frames cropdetect will
reset the previously detected largest video area and start over to
detect the current optimal crop area. Default value is 0.
.Sp
This can be useful when channel logos distort the video area. 0
indicates never reset and return the largest area encountered during
playback.
.SS "curves"
.IX Subsection "curves"
Apply color adjustments using curves.
.PP
This filter is similar to the Adobe Photoshop and \s-1GIMP\s0 curves tools. Each
component (red, green and blue) has its values defined by \fIN\fR key points
tied from each other using a smooth curve. The x\-axis represents the pixel
values from the input frame, and the y\-axis the new pixel values to be set for
the output frame.
.PP
By default, a component curve is defined by the two points \fI(0;0)\fR and
\&\fI(1;1)\fR. This creates a straight line where each original pixel value is
\&\*(L"adjusted\*(R" to its own value, which means no change to the image.
.PP
The filter allows you to redefine these two points and add some more. A new
curve (using a natural cubic spline interpolation) will be define to pass
smoothly through all these new coordinates. The new defined points needs to be
strictly increasing over the x\-axis, and their \fIx\fR and \fIy\fR values must
be in the \fI[0;1]\fR interval.  If the computed curves happened to go outside
the vector spaces, the values will be clipped accordingly.
.PP
If there is no key point defined in \f(CW\*(C`x=0\*(C'\fR, the filter will automatically
insert a \fI(0;0)\fR point. In the same way, if there is no key point defined
in \f(CW\*(C`x=1\*(C'\fR, the filter will automatically insert a \fI(1;1)\fR point.
.PP
The filter accepts the following options:
.IP "\fBpreset\fR" 4
.IX Item "preset"
Select one of the available color presets. This option can be used in addition
to the \fBr\fR, \fBg\fR, \fBb\fR parameters; in this case, the later
options takes priority on the preset values.
Available presets are:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBcolor_negative\fR" 4
.IX Item "color_negative"
.IP "\fBcross_process\fR" 4
.IX Item "cross_process"
.IP "\fBdarker\fR" 4
.IX Item "darker"
.IP "\fBincrease_contrast\fR" 4
.IX Item "increase_contrast"
.IP "\fBlighter\fR" 4
.IX Item "lighter"
.IP "\fBlinear_contrast\fR" 4
.IX Item "linear_contrast"
.IP "\fBmedium_contrast\fR" 4
.IX Item "medium_contrast"
.IP "\fBnegative\fR" 4
.IX Item "negative"
.IP "\fBstrong_contrast\fR" 4
.IX Item "strong_contrast"
.IP "\fBvintage\fR" 4
.IX Item "vintage"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`none\*(C'\fR.
.RE
.IP "\fBmaster, m\fR" 4
.IX Item "master, m"
Set the master key points. These points will define a second pass mapping. It
is sometimes called a \*(L"luminance\*(R" or \*(L"value\*(R" mapping. It can be used with
\&\fBr\fR, \fBg\fR, \fBb\fR or \fBall\fR since it acts like a
post-processing \s-1LUT\s0.
.IP "\fBred, r\fR" 4
.IX Item "red, r"
Set the key points for the red component.
.IP "\fBgreen, g\fR" 4
.IX Item "green, g"
Set the key points for the green component.
.IP "\fBblue, b\fR" 4
.IX Item "blue, b"
Set the key points for the blue component.
.IP "\fBall\fR" 4
.IX Item "all"
Set the key points for all components (not including master).
Can be used in addition to the other key points component
options. In this case, the unset component(s) will fallback on this
\&\fBall\fR setting.
.IP "\fBpsfile\fR" 4
.IX Item "psfile"
Specify a Photoshop curves file (\f(CW\*(C`.asv\*(C'\fR) to import the settings from.
.PP
To avoid some filtergraph syntax conflicts, each key points list need to be
defined using the following syntax: \f(CW\*(C`x0/y0 x1/y1 x2/y2 ...\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Increase slightly the middle level of blue:
.Sp
.Vb 1
\&        curves=blue=\*(Aq0.5/0.58\*(Aq
.Ve
.IP "\(bu" 4
Vintage effect:
.Sp
.Vb 1
\&        curves=r=\*(Aq0/0.11 .42/.51 1/0.95\*(Aq:g=\*(Aq0.50/0.48\*(Aq:b=\*(Aq0/0.22 .49/.44 1/0.8\*(Aq
.Ve
.Sp
Here we obtain the following coordinates for each components:
.RS 4
.IP "\fIred\fR" 4
.IX Item "red"
\&\f(CW\*(C`(0;0.11) (0.42;0.51) (1;0.95)\*(C'\fR
.IP "\fIgreen\fR" 4
.IX Item "green"
\&\f(CW\*(C`(0;0) (0.50;0.48) (1;1)\*(C'\fR
.IP "\fIblue\fR" 4
.IX Item "blue"
\&\f(CW\*(C`(0;0.22) (0.49;0.44) (1;0.80)\*(C'\fR
.RE
.RS 4
.RE
.IP "\(bu" 4
The previous example can also be achieved with the associated built-in preset:
.Sp
.Vb 1
\&        curves=preset=vintage
.Ve
.IP "\(bu" 4
Or simply:
.Sp
.Vb 1
\&        curves=vintage
.Ve
.IP "\(bu" 4
Use a Photoshop preset and redefine the points of the green component:
.Sp
.Vb 1
\&        curves=psfile=\*(AqMyCurvesPresets/purple.asv\*(Aq:green=\*(Aq0.45/0.53\*(Aq
.Ve
.SS "decimate"
.IX Subsection "decimate"
Drop duplicated frames at regular intervals.
.PP
The filter accepts the following options:
.IP "\fBcycle\fR" 4
.IX Item "cycle"
Set the number of frames from which one will be dropped. Setting this to
\&\fIN\fR means one frame in every batch of \fIN\fR frames will be dropped.
Default is \f(CW5\fR.
.IP "\fBdupthresh\fR" 4
.IX Item "dupthresh"
Set the threshold for duplicate detection. If the difference metric for a frame
is less than or equal to this value, then it is declared as duplicate. Default
is \f(CW1.1\fR
.IP "\fBscthresh\fR" 4
.IX Item "scthresh"
Set scene change threshold. Default is \f(CW15\fR.
.IP "\fBblockx\fR" 4
.IX Item "blockx"
.PD 0
.IP "\fBblocky\fR" 4
.IX Item "blocky"
.PD
Set the size of the x and y\-axis blocks used during metric calculations.
Larger blocks give better noise suppression, but also give worse detection of
small movements. Must be a power of two. Default is \f(CW32\fR.
.IP "\fBppsrc\fR" 4
.IX Item "ppsrc"
Mark main input as a pre-processed input and activate clean source input
stream. This allows the input to be pre-processed with various filters to help
the metrics calculation while keeping the frame selection lossless. When set to
\&\f(CW1\fR, the first stream is for the pre-processed input, and the second
stream is the clean source from where the kept frames are chosen. Default is
\&\f(CW0\fR.
.IP "\fBchroma\fR" 4
.IX Item "chroma"
Set whether or not chroma is considered in the metric calculations. Default is
\&\f(CW1\fR.
.SS "delogo"
.IX Subsection "delogo"
Suppress a \s-1TV\s0 station logo by a simple interpolation of the surrounding
pixels. Just set a rectangle covering the logo and watch it disappear
(and sometimes something even uglier appear \- your mileage may vary).
.PP
This filter accepts the following options:
.IP "\fBx, y\fR" 4
.IX Item "x, y"
Specify the top left corner coordinates of the logo. They must be
specified.
.IP "\fBw, h\fR" 4
.IX Item "w, h"
Specify the width and height of the logo to clear. They must be
specified.
.IP "\fBband, t\fR" 4
.IX Item "band, t"
Specify the thickness of the fuzzy edge of the rectangle (added to
\&\fIw\fR and \fIh\fR). The default value is 4.
.IP "\fBshow\fR" 4
.IX Item "show"
When set to 1, a green rectangle is drawn on the screen to simplify
finding the right \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR parameters, and
\&\fIband\fR is set to 4. The default value is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Set a rectangle covering the area with top left corner coordinates 0,0
and size 100x77, setting a band of size 10:
.Sp
.Vb 1
\&        delogo=x=0:y=0:w=100:h=77:band=10
.Ve
.SS "deshake"
.IX Subsection "deshake"
Attempt to fix small changes in horizontal and/or vertical shift. This
filter helps remove camera shake from hand-holding a camera, bumping a
tripod, moving on a vehicle, etc.
.PP
The filter accepts the following options:
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.IP "\fBw\fR" 4
.IX Item "w"
.IP "\fBh\fR" 4
.IX Item "h"
.PD
Specify a rectangular area where to limit the search for motion
vectors.
If desired the search for motion vectors can be limited to a
rectangular area of the frame defined by its top left corner, width
and height. These parameters have the same meaning as the drawbox
filter which can be used to visualise the position of the bounding
box.
.Sp
This is useful when simultaneous movement of subjects within the frame
might be confused for camera motion by the motion vector search.
.Sp
If any or all of \fIx\fR, \fIy\fR, \fIw\fR and \fIh\fR are set to \-1
then the full frame is used. This allows later options to be set
without specifying the bounding box for the motion vector search.
.Sp
Default \- search the whole frame.
.IP "\fBrx\fR" 4
.IX Item "rx"
.PD 0
.IP "\fBry\fR" 4
.IX Item "ry"
.PD
Specify the maximum extent of movement in x and y directions in the
range 0\-64 pixels. Default 16.
.IP "\fBedge\fR" 4
.IX Item "edge"
Specify how to generate pixels to fill blanks at the edge of the
frame. Available values are:
.RS 4
.IP "\fBblank, 0\fR" 4
.IX Item "blank, 0"
Fill zeroes at blank locations
.IP "\fBoriginal, 1\fR" 4
.IX Item "original, 1"
Original image at blank locations
.IP "\fBclamp, 2\fR" 4
.IX Item "clamp, 2"
Extruded edge value at blank locations
.IP "\fBmirror, 3\fR" 4
.IX Item "mirror, 3"
Mirrored edge at blank locations
.RE
.RS 4
.Sp
Default value is \fBmirror\fR.
.RE
.IP "\fBblocksize\fR" 4
.IX Item "blocksize"
Specify the blocksize to use for motion search. Range 4\-128 pixels,
default 8.
.IP "\fBcontrast\fR" 4
.IX Item "contrast"
Specify the contrast threshold for blocks. Only blocks with more than
the specified contrast (difference between darkest and lightest
pixels) will be considered. Range 1\-255, default 125.
.IP "\fBsearch\fR" 4
.IX Item "search"
Specify the search strategy. Available values are:
.RS 4
.IP "\fBexhaustive, 0\fR" 4
.IX Item "exhaustive, 0"
Set exhaustive search
.IP "\fBless, 1\fR" 4
.IX Item "less, 1"
Set less exhaustive search.
.RE
.RS 4
.Sp
Default value is \fBexhaustive\fR.
.RE
.IP "\fBfilename\fR" 4
.IX Item "filename"
If set then a detailed log of the motion search is written to the
specified file.
.IP "\fBopencl\fR" 4
.IX Item "opencl"
If set to 1, specify using OpenCL capabilities, only available if
FFmpeg was configured with \f(CW\*(C`\-\-enable\-opencl\*(C'\fR. Default value is 0.
.SS "drawbox"
.IX Subsection "drawbox"
Draw a colored box on the input image.
.PP
This filter accepts the following options:
.IP "\fBx, y\fR" 4
.IX Item "x, y"
Specify the top left corner coordinates of the box. Default to 0.
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
Specify the width and height of the box, if 0 they are interpreted as
the input width and height. Default to 0.
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Specify the color of the box to write, it can be the name of a color
(case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence. If the special
value \f(CW\*(C`invert\*(C'\fR is used, the box edge color is the same as the
video with inverted luma.
.IP "\fBthickness, t\fR" 4
.IX Item "thickness, t"
Set the thickness of the box edge. Default value is \f(CW4\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Draw a black box around the edge of the input image:
.Sp
.Vb 1
\&        drawbox
.Ve
.IP "\(bu" 4
Draw a box with color red and an opacity of 50%:
.Sp
.Vb 1
\&        drawbox=10:20:200:60:red@0.5
.Ve
.Sp
The previous example can be specified as:
.Sp
.Vb 1
\&        drawbox=x=10:y=20:w=200:h=60:color=red@0.5
.Ve
.IP "\(bu" 4
Fill the box with pink color:
.Sp
.Vb 1
\&        drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
.Ve
.SS "drawtext"
.IX Subsection "drawtext"
Draw text string or text from specified file on top of video using the
libfreetype library.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libfreetype\*(C'\fR.
.PP
\fISyntax\fR
.IX Subsection "Syntax"
.PP
The description of the accepted parameters follows.
.IP "\fBbox\fR" 4
.IX Item "box"
Used to draw a box around text using background color.
Value should be either 1 (enable) or 0 (disable).
The default value of \fIbox\fR is 0.
.IP "\fBboxcolor\fR" 4
.IX Item "boxcolor"
The color to be used for drawing box around text.
Either a string (e.g. \*(L"yellow\*(R") or in 0xRRGGBB[\s-1AA\s0] format
(e.g. \*(L"0xff00ff\*(R"), possibly followed by an alpha specifier.
The default value of \fIboxcolor\fR is \*(L"white\*(R".
.IP "\fBdraw\fR" 4
.IX Item "draw"
Set an expression which specifies if the text should be drawn. If the
expression evaluates to 0, the text is not drawn. This is useful for
specifying that the text should be drawn only when specific conditions
are met.
.Sp
Default value is \*(L"1\*(R".
.Sp
See below for the list of accepted constants and functions.
.IP "\fBexpansion\fR" 4
.IX Item "expansion"
Select how the \fItext\fR is expanded. Can be either \f(CW\*(C`none\*(C'\fR,
\&\f(CW\*(C`strftime\*(C'\fR (deprecated) or
\&\f(CW\*(C`normal\*(C'\fR (default). See the drawtext_expansion, Text expansion section
below for details.
.IP "\fBfix_bounds\fR" 4
.IX Item "fix_bounds"
If true, check and fix text coords to avoid clipping.
.IP "\fBfontcolor\fR" 4
.IX Item "fontcolor"
The color to be used for drawing fonts.
Either a string (e.g. \*(L"red\*(R") or in 0xRRGGBB[\s-1AA\s0] format
(e.g. \*(L"0xff000033\*(R"), possibly followed by an alpha specifier.
The default value of \fIfontcolor\fR is \*(L"black\*(R".
.IP "\fBfontfile\fR" 4
.IX Item "fontfile"
The font file to be used for drawing text. Path must be included.
This parameter is mandatory.
.IP "\fBfontsize\fR" 4
.IX Item "fontsize"
The font size to be used for drawing text.
The default value of \fIfontsize\fR is 16.
.IP "\fBft_load_flags\fR" 4
.IX Item "ft_load_flags"
Flags to be used for loading the fonts.
.Sp
The flags map the corresponding flags supported by libfreetype, and are
a combination of the following values:
.RS 4
.IP "\fIdefault\fR" 4
.IX Item "default"
.PD 0
.IP "\fIno_scale\fR" 4
.IX Item "no_scale"
.IP "\fIno_hinting\fR" 4
.IX Item "no_hinting"
.IP "\fIrender\fR" 4
.IX Item "render"
.IP "\fIno_bitmap\fR" 4
.IX Item "no_bitmap"
.IP "\fIvertical_layout\fR" 4
.IX Item "vertical_layout"
.IP "\fIforce_autohint\fR" 4
.IX Item "force_autohint"
.IP "\fIcrop_bitmap\fR" 4
.IX Item "crop_bitmap"
.IP "\fIpedantic\fR" 4
.IX Item "pedantic"
.IP "\fIignore_global_advance_width\fR" 4
.IX Item "ignore_global_advance_width"
.IP "\fIno_recurse\fR" 4
.IX Item "no_recurse"
.IP "\fIignore_transform\fR" 4
.IX Item "ignore_transform"
.IP "\fImonochrome\fR" 4
.IX Item "monochrome"
.IP "\fIlinear_design\fR" 4
.IX Item "linear_design"
.IP "\fIno_autohint\fR" 4
.IX Item "no_autohint"
.IP "\fIend table\fR" 4
.IX Item "end table"
.RE
.RS 4
.PD
.Sp
Default value is \*(L"render\*(R".
.Sp
For more information consult the documentation for the FT_LOAD_*
libfreetype flags.
.RE
.IP "\fBshadowcolor\fR" 4
.IX Item "shadowcolor"
The color to be used for drawing a shadow behind the drawn text.  It
can be a color name (e.g. \*(L"yellow\*(R") or a string in the 0xRRGGBB[\s-1AA\s0]
form (e.g. \*(L"0xff00ff\*(R"), possibly followed by an alpha specifier.
The default value of \fIshadowcolor\fR is \*(L"black\*(R".
.IP "\fBshadowx, shadowy\fR" 4
.IX Item "shadowx, shadowy"
The x and y offsets for the text shadow position with respect to the
position of the text. They can be either positive or negative
values. Default value for both is \*(L"0\*(R".
.IP "\fBtabsize\fR" 4
.IX Item "tabsize"
The size in number of spaces to use for rendering the tab.
Default value is 4.
.IP "\fBtimecode\fR" 4
.IX Item "timecode"
Set the initial timecode representation in \*(L"hh:mm:ss[:;.]ff\*(R"
format. It can be used with or without text parameter. \fItimecode_rate\fR
option must be specified.
.IP "\fBtimecode_rate, rate, r\fR" 4
.IX Item "timecode_rate, rate, r"
Set the timecode frame rate (timecode only).
.IP "\fBtext\fR" 4
.IX Item "text"
The text string to be drawn. The text must be a sequence of \s-1UTF\-8\s0
encoded characters.
This parameter is mandatory if no file is specified with the parameter
\&\fItextfile\fR.
.IP "\fBtextfile\fR" 4
.IX Item "textfile"
A text file containing text to be drawn. The text must be a sequence
of \s-1UTF\-8\s0 encoded characters.
.Sp
This parameter is mandatory if no text string is specified with the
parameter \fItext\fR.
.Sp
If both \fItext\fR and \fItextfile\fR are specified, an error is thrown.
.IP "\fBreload\fR" 4
.IX Item "reload"
If set to 1, the \fItextfile\fR will be reloaded before each frame.
Be sure to update it atomically, or it may be read partially, or even fail.
.IP "\fBx, y\fR" 4
.IX Item "x, y"
The expressions which specify the offsets where text will be drawn
within the video frame. They are relative to the top/left border of the
output image.
.Sp
The default value of \fIx\fR and \fIy\fR is \*(L"0\*(R".
.Sp
See below for the list of accepted constants and functions.
.PP
The parameters for \fIx\fR and \fIy\fR are expressions containing the
following constants and functions:
.IP "\fBdar\fR" 4
.IX Item "dar"
input display aspect ratio, it is the same as (\fIw\fR / \fIh\fR) * \fIsar\fR
.IP "\fBhsub, vsub\fR" 4
.IX Item "hsub, vsub"
horizontal and vertical chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.IP "\fBline_h, lh\fR" 4
.IX Item "line_h, lh"
the height of each text line
.IP "\fBmain_h, h, H\fR" 4
.IX Item "main_h, h, H"
the input height
.IP "\fBmain_w, w, W\fR" 4
.IX Item "main_w, w, W"
the input width
.IP "\fBmax_glyph_a, ascent\fR" 4
.IX Item "max_glyph_a, ascent"
the maximum distance from the baseline to the highest/upper grid
coordinate used to place a glyph outline point, for all the rendered
glyphs.
It is a positive value, due to the grid's orientation with the Y axis
upwards.
.IP "\fBmax_glyph_d, descent\fR" 4
.IX Item "max_glyph_d, descent"
the maximum distance from the baseline to the lowest grid coordinate
used to place a glyph outline point, for all the rendered glyphs.
This is a negative value, due to the grid's orientation, with the Y axis
upwards.
.IP "\fBmax_glyph_h\fR" 4
.IX Item "max_glyph_h"
maximum glyph height, that is the maximum height for all the glyphs
contained in the rendered text, it is equivalent to \fIascent\fR \-
\&\fIdescent\fR.
.IP "\fBmax_glyph_w\fR" 4
.IX Item "max_glyph_w"
maximum glyph width, that is the maximum width for all the glyphs
contained in the rendered text
.IP "\fBn\fR" 4
.IX Item "n"
the number of input frame, starting from 0
.IP "\fBrand(min, max)\fR" 4
.IX Item "rand(min, max)"
return a random number included between \fImin\fR and \fImax\fR
.IP "\fBsar\fR" 4
.IX Item "sar"
input sample aspect ratio
.IP "\fBt\fR" 4
.IX Item "t"
timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
.IP "\fBtext_h, th\fR" 4
.IX Item "text_h, th"
the height of the rendered text
.IP "\fBtext_w, tw\fR" 4
.IX Item "text_w, tw"
the width of the rendered text
.IP "\fBx, y\fR" 4
.IX Item "x, y"
the x and y offset coordinates where the text is drawn.
.Sp
These parameters allow the \fIx\fR and \fIy\fR expressions to refer
each other, so you can for example specify \f(CW\*(C`y=x/dar\*(C'\fR.
.PP
If libavfilter was built with \f(CW\*(C`\-\-enable\-fontconfig\*(C'\fR, then
\&\fBfontfile\fR can be a fontconfig pattern or omitted.
.PP
\fIText expansion\fR
.IX Subsection "Text expansion"
.PP
If \fBexpansion\fR is set to \f(CW\*(C`strftime\*(C'\fR,
the filter recognizes \fIstrftime()\fR sequences in the provided text and
expands them accordingly. Check the documentation of \fIstrftime()\fR. This
feature is deprecated.
.PP
If \fBexpansion\fR is set to \f(CW\*(C`none\*(C'\fR, the text is printed verbatim.
.PP
If \fBexpansion\fR is set to \f(CW\*(C`normal\*(C'\fR (which is the default),
the following expansion mechanism is used.
.PP
The backslash character '\e', followed by any character, always expands to
the second character.
.PP
Sequence of the form \f(CW\*(C`%{...}\*(C'\fR are expanded. The text between the
braces is a function name, possibly followed by arguments separated by ':'.
If the arguments contain special characters or delimiters (':' or '}'),
they should be escaped.
.PP
Note that they probably must also be escaped as the value for the
\&\fBtext\fR option in the filter argument string and as the filter
argument in the filtergraph description, and possibly also for the shell,
that makes up to four levels of escaping; using a text file avoids these
problems.
.PP
The following functions are available:
.IP "\fBexpr, e\fR" 4
.IX Item "expr, e"
The expression evaluation result.
.Sp
It must take one argument specifying the expression to be evaluated,
which accepts the same constants and functions as the \fIx\fR and
\&\fIy\fR values. Note that not all constants should be used, for
example the text size is not known when evaluating the expression, so
the constants \fItext_w\fR and \fItext_h\fR will have an undefined
value.
.IP "\fBgmtime\fR" 4
.IX Item "gmtime"
The time at which the filter is running, expressed in \s-1UTC\s0.
It can accept an argument: a \fIstrftime()\fR format string.
.IP "\fBlocaltime\fR" 4
.IX Item "localtime"
The time at which the filter is running, expressed in the local time zone.
It can accept an argument: a \fIstrftime()\fR format string.
.IP "\fBn, frame_num\fR" 4
.IX Item "n, frame_num"
The frame number, starting from 0.
.IP "\fBpts\fR" 4
.IX Item "pts"
The timestamp of the current frame, in seconds, with microsecond accuracy.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Draw \*(L"Test Text\*(R" with font FreeSerif, using the default values for the
optional parameters.
.Sp
.Vb 1
\&        drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=\*(AqTest Text\*(Aq"
.Ve
.IP "\(bu" 4
Draw 'Test Text' with font FreeSerif of size 24 at position x=100
and y=50 (counting from the top-left corner of the screen), text is
yellow with a red box around it. Both the text and the box have an
opacity of 20%.
.Sp
.Vb 2
\&        drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=\*(AqTest Text\*(Aq:\e
\&                  x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
.Ve
.Sp
Note that the double quotes are not necessary if spaces are not used
within the parameter list.
.IP "\(bu" 4
Show the text at the center of the video frame:
.Sp
.Vb 1
\&        drawtext="fontsize=30:fontfile=FreeSerif.ttf:text=\*(Aqhello world\*(Aq:x=(w\-text_w)/2:y=(h\-text_h\-line_h)/2"
.Ve
.IP "\(bu" 4
Show a text line sliding from right to left in the last row of the video
frame. The file \fI\s-1LONG_LINE\s0\fR is assumed to contain a single line
with no newlines.
.Sp
.Vb 1
\&        drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h\-line_h:x=\-50*t"
.Ve
.IP "\(bu" 4
Show the content of file \fI\s-1CREDITS\s0\fR off the bottom of the frame and scroll up.
.Sp
.Vb 1
\&        drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h\-20*t"
.Ve
.IP "\(bu" 4
Draw a single green letter \*(L"g\*(R", at the center of the input video.
The glyph baseline is placed at half screen height.
.Sp
.Vb 1
\&        drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w\-max_glyph_w)/2:y=h/2\-ascent"
.Ve
.IP "\(bu" 4
Show text for 1 second every 3 seconds:
.Sp
.Vb 1
\&        drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\e,3)\e,1):text=\*(Aqblink\*(Aq"
.Ve
.IP "\(bu" 4
Use fontconfig to set the font. Note that the colons need to be escaped.
.Sp
.Vb 1
\&        drawtext=\*(Aqfontfile=Linux Libertine O\-40\e:style=Semibold:text=FFmpeg\*(Aq
.Ve
.IP "\(bu" 4
Print the date of a real-time encoding (see \fIstrftime\fR\|(3)):
.Sp
.Vb 1
\&        drawtext=\*(Aqfontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}\*(Aq
.Ve
.PP
For more information about libfreetype, check:
<\fBhttp://www.freetype.org/\fR>.
.PP
For more information about fontconfig, check:
<\fBhttp://freedesktop.org/software/fontconfig/fontconfig\-user.html\fR>.
.SS "edgedetect"
.IX Subsection "edgedetect"
Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
.PP
The filter accepts the following options:
.IP "\fBlow, high\fR" 4
.IX Item "low, high"
Set low and high threshold values used by the Canny thresholding
algorithm.
.Sp
The high threshold selects the \*(L"strong\*(R" edge pixels, which are then
connected through 8\-connectivity with the \*(L"weak\*(R" edge pixels selected
by the low threshold.
.Sp
\&\fIlow\fR and \fIhigh\fR threshold values must be choosen in the range
[0,1], and \fIlow\fR should be lesser or equal to \fIhigh\fR.
.Sp
Default value for \fIlow\fR is \f(CW\*(C`20/255\*(C'\fR, and default value for \fIhigh\fR
is \f(CW\*(C`50/255\*(C'\fR.
.PP
Example:
.PP
.Vb 1
\&        edgedetect=low=0.1:high=0.4
.Ve
.SS "fade"
.IX Subsection "fade"
Apply fade\-in/out effect to input video.
.PP
This filter accepts the following options:
.IP "\fBtype, t\fR" 4
.IX Item "type, t"
The effect type \*(-- can be either \*(L"in\*(R" for fade-in, or \*(L"out\*(R" for a fade-out
effect.
Default is \f(CW\*(C`in\*(C'\fR.
.IP "\fBstart_frame, s\fR" 4
.IX Item "start_frame, s"
Specify the number of the start frame for starting to apply the fade
effect. Default is 0.
.IP "\fBnb_frames, n\fR" 4
.IX Item "nb_frames, n"
The number of frames for which the fade effect has to last. At the end of the
fade-in effect the output video will have the same intensity as the input video,
at the end of the fade-out transition the output video will be completely black.
Default is 25.
.IP "\fBalpha\fR" 4
.IX Item "alpha"
If set to 1, fade only alpha channel, if one exists on the input.
Default value is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Fade in first 30 frames of video:
.Sp
.Vb 1
\&        fade=in:0:30
.Ve
.Sp
The command above is equivalent to:
.Sp
.Vb 1
\&        fade=t=in:s=0:n=30
.Ve
.IP "\(bu" 4
Fade out last 45 frames of a 200\-frame video:
.Sp
.Vb 2
\&        fade=out:155:45
\&        fade=type=out:start_frame=155:nb_frames=45
.Ve
.IP "\(bu" 4
Fade in first 25 frames and fade out last 25 frames of a 1000\-frame video:
.Sp
.Vb 1
\&        fade=in:0:25, fade=out:975:25
.Ve
.IP "\(bu" 4
Make first 5 frames black, then fade in from frame 5\-24:
.Sp
.Vb 1
\&        fade=in:5:20
.Ve
.IP "\(bu" 4
Fade in alpha over first 25 frames of video:
.Sp
.Vb 1
\&        fade=in:0:25:alpha=1
.Ve
.SS "field"
.IX Subsection "field"
Extract a single field from an interlaced image using stride
arithmetic to avoid wasting \s-1CPU\s0 time. The output frames are marked as
non-interlaced.
.PP
The filter accepts the following options:
.IP "\fBtype\fR" 4
.IX Item "type"
Specify whether to extract the top (if the value is \f(CW0\fR or
\&\f(CW\*(C`top\*(C'\fR) or the bottom field (if the value is \f(CW1\fR or
\&\f(CW\*(C`bottom\*(C'\fR).
.SS "fieldmatch"
.IX Subsection "fieldmatch"
Field matching filter for inverse telecine. It is meant to reconstruct the
progressive frames from a telecined stream. The filter does not drop duplicated
frames, so to achieve a complete inverse telecine \f(CW\*(C`fieldmatch\*(C'\fR needs to be
followed by a decimation filter such as decimate in the filtergraph.
.PP
The separation of the field matching and the decimation is notably motivated by
the possibility of inserting a de-interlacing filter fallback between the two.
If the source has mixed telecined and real interlaced content,
\&\f(CW\*(C`fieldmatch\*(C'\fR will not be able to match fields for the interlaced parts.
But these remaining combed frames will be marked as interlaced, and thus can be
de-interlaced by a later filter such as yadif before decimation.
.PP
In addition to the various configuration options, \f(CW\*(C`fieldmatch\*(C'\fR can take an
optional second stream, activated through the \fBppsrc\fR option. If
enabled, the frames reconstruction will be based on the fields and frames from
this second stream. This allows the first input to be pre-processed in order to
help the various algorithms of the filter, while keeping the output lossless
(assuming the fields are matched properly). Typically, a field-aware denoiser,
or brightness/contrast adjustments can help.
.PP
Note that this filter uses the same algorithms as \s-1TIVTC/TFM\s0 (AviSynth project)
and \s-1VIVTC/VFM\s0 (VapourSynth project). The later is a light clone of \s-1TFM\s0 from
which \f(CW\*(C`fieldmatch\*(C'\fR is based on. While the semantic and usage are very
close, some behaviour and options names can differ.
.PP
The filter accepts the following options:
.IP "\fBorder\fR" 4
.IX Item "order"
Specify the assumed field order of the input stream. Available values are:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
Auto detect parity (use FFmpeg's internal parity value).
.IP "\fBbff\fR" 4
.IX Item "bff"
Assume bottom field first.
.IP "\fBtff\fR" 4
.IX Item "tff"
Assume top field first.
.RE
.RS 4
.Sp
Note that it is sometimes recommended not to trust the parity announced by the
stream.
.Sp
Default value is \fIauto\fR.
.RE
.IP "\fBmode\fR" 4
.IX Item "mode"
Set the matching mode or strategy to use. \fBpc\fR mode is the safest in the
sense that it wont risk creating jerkiness due to duplicate frames when
possible, but if there are bad edits or blended fields it will end up
outputting combed frames when a good match might actually exist. On the other
hand, \fBpcn_ub\fR mode is the most risky in terms of creating jerkiness,
but will almost always find a good frame if there is one. The other values are
all somewhere in between \fBpc\fR and \fBpcn_ub\fR in terms of risking
jerkiness and creating duplicate frames versus finding good matches in sections
with bad edits, orphaned fields, blended fields, etc.
.Sp
More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
.Sp
Available values are:
.RS 4
.IP "\fBpc\fR" 4
.IX Item "pc"
2\-way matching (p/c)
.IP "\fBpc_n\fR" 4
.IX Item "pc_n"
2\-way matching, and trying 3rd match if still combed (p/c + n)
.IP "\fBpc_u\fR" 4
.IX Item "pc_u"
2\-way matching, and trying 3rd match (same order) if still combed (p/c + u)
.IP "\fBpc_n_ub\fR" 4
.IX Item "pc_n_ub"
2\-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
still combed (p/c + n + u/b)
.IP "\fBpcn\fR" 4
.IX Item "pcn"
3\-way matching (p/c/n)
.IP "\fBpcn_ub\fR" 4
.IX Item "pcn_ub"
3\-way matching, and trying 4th/5th matches if all 3 of the original matches are
detected as combed (p/c/n + u/b)
.RE
.RS 4
.Sp
The parenthesis at the end indicate the matches that would be used for that
mode assuming \fBorder\fR=\fItff\fR (and \fBfield\fR on \fIauto\fR or
\&\fItop\fR).
.Sp
In terms of speed \fBpc\fR mode is by far the fastest and \fBpcn_ub\fR is
the slowest.
.Sp
Default value is \fIpc_n\fR.
.RE
.IP "\fBppsrc\fR" 4
.IX Item "ppsrc"
Mark the main input stream as a pre-processed input, and enable the secondary
input stream as the clean source to pick the fields from. See the filter
introduction for more details. It is similar to the \fBclip2\fR feature from
\&\s-1VFM/TFM\s0.
.Sp
Default value is \f(CW0\fR (disabled).
.IP "\fBfield\fR" 4
.IX Item "field"
Set the field to match from. It is recommended to set this to the same value as
\&\fBorder\fR unless you experience matching failures with that setting. In
certain circumstances changing the field that is used to match from can have a
large impact on matching performance. Available values are:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
Automatic (same value as \fBorder\fR).
.IP "\fBbottom\fR" 4
.IX Item "bottom"
Match from the bottom field.
.IP "\fBtop\fR" 4
.IX Item "top"
Match from the top field.
.RE
.RS 4
.Sp
Default value is \fIauto\fR.
.RE
.IP "\fBmchroma\fR" 4
.IX Item "mchroma"
Set whether or not chroma is included during the match comparisons. In most
cases it is recommended to leave this enabled. You should set this to \f(CW0\fR
only if your clip has bad chroma problems such as heavy rainbowing or other
artifacts. Setting this to \f(CW0\fR could also be used to speed things up at
the cost of some accuracy.
.Sp
Default value is \f(CW1\fR.
.IP "\fBy0\fR" 4
.IX Item "y0"
.PD 0
.IP "\fBy1\fR" 4
.IX Item "y1"
.PD
These define an exclusion band which excludes the lines between \fBy0\fR and
\&\fBy1\fR from being included in the field matching decision. An exclusion
band can be used to ignore subtitles, a logo, or other things that may
interfere with the matching. \fBy0\fR sets the starting scan line and
\&\fBy1\fR sets the ending line; all lines in between \fBy0\fR and
\&\fBy1\fR (including \fBy0\fR and \fBy1\fR) will be ignored. Setting
\&\fBy0\fR and \fBy1\fR to the same value will disable the feature.
\&\fBy0\fR and \fBy1\fR defaults to \f(CW0\fR.
.IP "\fBscthresh\fR" 4
.IX Item "scthresh"
Set the scene change detection threshold as a percentage of maximum change on
the luma plane. Good values are in the \f(CW\*(C`[8.0, 14.0]\*(C'\fR range. Scene change
detection is only relevant in case \fBcombmatch\fR=\fIsc\fR.  The range for
\&\fBscthresh\fR is \f(CW\*(C`[0.0, 100.0]\*(C'\fR.
.Sp
Default value is \f(CW12.0\fR.
.IP "\fBcombmatch\fR" 4
.IX Item "combmatch"
When \fBcombatch\fR is not \fInone\fR, \f(CW\*(C`fieldmatch\*(C'\fR will take into
account the combed scores of matches when deciding what match to use as the
final match. Available values are:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
No final matching based on combed scores.
.IP "\fBsc\fR" 4
.IX Item "sc"
Combed scores are only used when a scene change is detected.
.IP "\fBfull\fR" 4
.IX Item "full"
Use combed scores all the time.
.RE
.RS 4
.Sp
Default is \fIsc\fR.
.RE
.IP "\fBcombdbg\fR" 4
.IX Item "combdbg"
Force \f(CW\*(C`fieldmatch\*(C'\fR to calculate the combed metrics for certain matches and
print them. This setting is known as \fBmicout\fR in \s-1TFM/VFM\s0 vocabulary.
Available values are:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
No forced calculation.
.IP "\fBpcn\fR" 4
.IX Item "pcn"
Force p/c/n calculations.
.IP "\fBpcnub\fR" 4
.IX Item "pcnub"
Force p/c/n/u/b calculations.
.RE
.RS 4
.Sp
Default value is \fInone\fR.
.RE
.IP "\fBcthresh\fR" 4
.IX Item "cthresh"
This is the area combing threshold used for combed frame detection. This
essentially controls how \*(L"strong\*(R" or \*(L"visible\*(R" combing must be to be detected.
Larger values mean combing must be more visible and smaller values mean combing
can be less visible or strong and still be detected. Valid settings are from
\&\f(CW\*(C`\-1\*(C'\fR (every pixel will be detected as combed) to \f(CW255\fR (no pixel will
be detected as combed). This is basically a pixel difference value. A good
range is \f(CW\*(C`[8, 12]\*(C'\fR.
.Sp
Default value is \f(CW9\fR.
.IP "\fBchroma\fR" 4
.IX Item "chroma"
Sets whether or not chroma is considered in the combed frame decision.  Only
disable this if your source has chroma problems (rainbowing, etc.) that are
causing problems for the combed frame detection with chroma enabled. Actually,
using \fBchroma\fR=\fI0\fR is usually more reliable, except for the case
where there is chroma only combing in the source.
.Sp
Default value is \f(CW0\fR.
.IP "\fBblockx\fR" 4
.IX Item "blockx"
.PD 0
.IP "\fBblocky\fR" 4
.IX Item "blocky"
.PD
Respectively set the x\-axis and y\-axis size of the window used during combed
frame detection. This has to do with the size of the area in which
\&\fBcombpel\fR pixels are required to be detected as combed for a frame to be
declared combed. See the \fBcombpel\fR parameter description for more info.
Possible values are any number that is a power of 2 starting at 4 and going up
to 512.
.Sp
Default value is \f(CW16\fR.
.IP "\fBcombpel\fR" 4
.IX Item "combpel"
The number of combed pixels inside any of the \fBblocky\fR by
\&\fBblockx\fR size blocks on the frame for the frame to be detected as
combed. While \fBcthresh\fR controls how \*(L"visible\*(R" the combing must be, this
setting controls \*(L"how much\*(R" combing there must be in any localized area (a
window defined by the \fBblockx\fR and \fBblocky\fR settings) on the
frame. Minimum value is \f(CW0\fR and maximum is \f(CW\*(C`blocky x blockx\*(C'\fR (at
which point no frames will ever be detected as combed). This setting is known
as \fB\s-1MI\s0\fR in \s-1TFM/VFM\s0 vocabulary.
.Sp
Default value is \f(CW80\fR.
.PP
\fIp/c/n/u/b meaning\fR
.IX Subsection "p/c/n/u/b meaning"
.PP
p/c/n
.IX Subsection "p/c/n"
.PP
We assume the following telecined stream:
.PP
.Vb 2
\&        Top fields:     1 2 2 3 4
\&        Bottom fields:  1 2 3 4 4
.Ve
.PP
The numbers correspond to the progressive frame the fields relate to. Here, the
first two frames are progressive, the 3rd and 4th are combed, and so on.
.PP
When \f(CW\*(C`fieldmatch\*(C'\fR is configured to run a matching from bottom
(\fBfield\fR=\fIbottom\fR) this is how this input stream get transformed:
.PP
.Vb 3
\&        Input stream:
\&                        T     1 2 2 3 4
\&                        B     1 2 3 4 4   <\-\- matching reference
\&        
\&        Matches:              c c n n c
\&        
\&        Output stream:
\&                        T     1 2 3 4 4
\&                        B     1 2 3 4 4
.Ve
.PP
As a result of the field matching, we can see that some frames get duplicated.
To perform a complete inverse telecine, you need to rely on a decimation filter
after this operation. See for instance the decimate filter.
.PP
The same operation now matching from top fields (\fBfield\fR=\fItop\fR)
looks like this:
.PP
.Vb 3
\&        Input stream:
\&                        T     1 2 2 3 4   <\-\- matching reference
\&                        B     1 2 3 4 4
\&        
\&        Matches:              c c p p c
\&        
\&        Output stream:
\&                        T     1 2 2 3 4
\&                        B     1 2 2 3 4
.Ve
.PP
In these examples, we can see what \fIp\fR, \fIc\fR and \fIn\fR mean;
basically, they refer to the frame and field of the opposite parity:
.IP "*<\fIp\fR matches the field of the opposite parity in the previous frame>" 4
.IX Item "*<p matches the field of the opposite parity in the previous frame>"
.PD 0
.IP "*<\fIc\fR matches the field of the opposite parity in the current frame>" 4
.IX Item "*<c matches the field of the opposite parity in the current frame>"
.IP "*<\fIn\fR matches the field of the opposite parity in the next frame>" 4
.IX Item "*<n matches the field of the opposite parity in the next frame>"
.PD
.PP
u/b
.IX Subsection "u/b"
.PP
The \fIu\fR and \fIb\fR matching are a bit special in the sense that they match
from the opposite parity flag. In the following examples, we assume that we are
currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
\&'x' is placed above and below each matched fields.
.PP
With bottom matching (\fBfield\fR=\fIbottom\fR):
.PP
.Vb 1
\&        Match:           c         p           n          b          u
\&        
\&                         x       x               x        x          x
\&          Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
\&          Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
\&                         x         x           x        x              x
\&        
\&        Output frames:
\&                         2          1          2          2          2
\&                         2          2          2          1          3
.Ve
.PP
With top matching (\fBfield\fR=\fItop\fR):
.PP
.Vb 1
\&        Match:           c         p           n          b          u
\&        
\&                         x         x           x        x              x
\&          Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
\&          Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
\&                         x       x               x        x          x
\&        
\&        Output frames:
\&                         2          2          2          1          2
\&                         2          1          3          2          2
.Ve
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Simple \s-1IVTC\s0 of a top field first telecined stream:
.PP
.Vb 1
\&        fieldmatch=order=tff:combmatch=none, decimate
.Ve
.PP
Advanced \s-1IVTC\s0, with fallback on yadif for still combed frames:
.PP
.Vb 1
\&        fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
.Ve
.SS "fieldorder"
.IX Subsection "fieldorder"
Transform the field order of the input video.
.PP
This filter accepts the following options:
.IP "\fBorder\fR" 4
.IX Item "order"
Output field order. Valid values are \fItff\fR for top field first or \fIbff\fR
for bottom field first.
.PP
Default value is \fBtff\fR.
.PP
Transformation is achieved by shifting the picture content up or down
by one line, and filling the remaining line with appropriate picture content.
This method is consistent with most broadcast field order converters.
.PP
If the input video is not flagged as being interlaced, or it is already
flagged as being of the required output field order then this filter does
not alter the incoming video.
.PP
This filter is very useful when converting to or from \s-1PAL\s0 \s-1DV\s0 material,
which is bottom field first.
.PP
For example:
.PP
.Vb 1
\&        ffmpeg \-i in.vob \-vf "fieldorder=bff" out.dv
.Ve
.SS "fifo"
.IX Subsection "fifo"
Buffer input images and send them when they are requested.
.PP
This filter is mainly useful when auto-inserted by the libavfilter
framework.
.PP
The filter does not take parameters.
.SS "format"
.IX Subsection "format"
Convert the input video to one of the specified pixel formats.
Libavfilter will try to pick one that is supported for the input to
the next filter.
.PP
This filter accepts the following parameters:
.IP "\fBpix_fmts\fR" 4
.IX Item "pix_fmts"
A '|'\-separated list of pixel format names, for example
\&\*(L"pix_fmts=yuv420p|monow|rgb24\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Convert the input video to the format \fIyuv420p\fR
.Sp
.Vb 1
\&        format=pix_fmts=yuv420p
.Ve
.Sp
Convert the input video to any of the formats in the list
.Sp
.Vb 1
\&        format=pix_fmts=yuv420p|yuv444p|yuv410p
.Ve
.SS "fps"
.IX Subsection "fps"
Convert the video to specified constant frame rate by duplicating or dropping
frames as necessary.
.PP
This filter accepts the following named parameters:
.IP "\fBfps\fR" 4
.IX Item "fps"
Desired output frame rate. The default is \f(CW25\fR.
.IP "\fBround\fR" 4
.IX Item "round"
Rounding method.
.Sp
Possible values are:
.RS 4
.IP "\fBzero\fR" 4
.IX Item "zero"
zero round towards 0
.IP "\fBinf\fR" 4
.IX Item "inf"
round away from 0
.IP "\fBdown\fR" 4
.IX Item "down"
round towards \-infinity
.IP "\fBup\fR" 4
.IX Item "up"
round towards +infinity
.IP "\fBnear\fR" 4
.IX Item "near"
round to nearest
.RE
.RS 4
.Sp
The default is \f(CW\*(C`near\*(C'\fR.
.RE
.PP
Alternatively, the options can be specified as a flat string:
\&\fIfps\fR[:\fIround\fR].
.PP
See also the setpts filter.
.SS "framestep"
.IX Subsection "framestep"
Select one frame every N\-th frame.
.PP
This filter accepts the following option:
.IP "\fBstep\fR" 4
.IX Item "step"
Select frame after every \f(CW\*(C`step\*(C'\fR frames.
Allowed values are positive integers higher than 0. Default value is \f(CW1\fR.
.SS "frei0r"
.IX Subsection "frei0r"
Apply a frei0r effect to the input video.
.PP
To enable compilation of this filter you need to install the frei0r
header and configure FFmpeg with \f(CW\*(C`\-\-enable\-frei0r\*(C'\fR.
.PP
This filter accepts the following options:
.IP "\fBfilter_name\fR" 4
.IX Item "filter_name"
The name to the frei0r effect to load. If the environment variable
\&\fB\s-1FREI0R_PATH\s0\fR is defined, the frei0r effect is searched in each one of the
directories specified by the colon separated list in \fB\s-1FREIOR_PATH\s0\fR,
otherwise in the standard frei0r paths, which are in this order:
\&\fI\s-1HOME/\s0.frei0r\-1/lib/\fR, \fI/usr/local/lib/frei0r\-1/\fR,
\&\fI/usr/lib/frei0r\-1/\fR.
.IP "\fBfilter_params\fR" 4
.IX Item "filter_params"
A '|'\-separated list of parameters to pass to the frei0r effect.
.PP
A frei0r effect parameter can be a boolean (whose values are specified
with \*(L"y\*(R" and \*(L"n\*(R"), a double, a color (specified by the syntax
\&\fIR\fR/\fIG\fR/\fIB\fR, \fIR\fR, \fIG\fR, and \fIB\fR being float
numbers from 0.0 to 1.0) or by an \f(CW\*(C`av_parse_color()\*(C'\fR color
description), a position (specified by the syntax \fIX\fR/\fIY\fR,
\&\fIX\fR and \fIY\fR being float numbers) and a string.
.PP
The number and kind of parameters depend on the loaded effect. If an
effect parameter is not specified the default value is set.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply the distort0r effect, set the first two double parameters:
.Sp
.Vb 1
\&        frei0r=filter_name=distort0r:filter_params=0.5|0.01
.Ve
.IP "\(bu" 4
Apply the colordistance effect, take a color as first parameter:
.Sp
.Vb 3
\&        frei0r=colordistance:0.2/0.3/0.4
\&        frei0r=colordistance:violet
\&        frei0r=colordistance:0x112233
.Ve
.IP "\(bu" 4
Apply the perspective effect, specify the top left and top right image
positions:
.Sp
.Vb 1
\&        frei0r=perspective:0.2/0.2|0.8/0.2
.Ve
.PP
For more information see:
<\fBhttp://frei0r.dyne.org\fR>
.SS "geq"
.IX Subsection "geq"
The filter accepts the following options:
.IP "\fBlum_expr\fR" 4
.IX Item "lum_expr"
the luminance expression
.IP "\fBcb_expr\fR" 4
.IX Item "cb_expr"
the chrominance blue expression
.IP "\fBcr_expr\fR" 4
.IX Item "cr_expr"
the chrominance red expression
.IP "\fBalpha_expr\fR" 4
.IX Item "alpha_expr"
the alpha expression
.PP
If one of the chrominance expression is not defined, it falls back on the other
one. If no alpha expression is specified it will evaluate to opaque value.
If none of chrominance expressions are
specified, they will evaluate the luminance expression.
.PP
The expressions can use the following variables and functions:
.IP "\fBN\fR" 4
.IX Item "N"
The sequential number of the filtered frame, starting from \f(CW0\fR.
.IP "\fBX\fR" 4
.IX Item "X"
.PD 0
.IP "\fBY\fR" 4
.IX Item "Y"
.PD
The coordinates of the current sample.
.IP "\fBW\fR" 4
.IX Item "W"
.PD 0
.IP "\fBH\fR" 4
.IX Item "H"
.PD
The width and height of the image.
.IP "\fB\s-1SW\s0\fR" 4
.IX Item "SW"
.PD 0
.IP "\fB\s-1SH\s0\fR" 4
.IX Item "SH"
.PD
Width and height scale depending on the currently filtered plane. It is the
ratio between the corresponding luma plane number of pixels and the current
plane ones. E.g. for \s-1YUV4:2:0\s0 the values are \f(CW\*(C`1,1\*(C'\fR for the luma plane, and
\&\f(CW\*(C`0.5,0.5\*(C'\fR for chroma planes.
.IP "\fBT\fR" 4
.IX Item "T"
Time of the current frame, expressed in seconds.
.IP "\fBp(x, y)\fR" 4
.IX Item "p(x, y)"
Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the current
plane.
.IP "\fBlum(x, y)\fR" 4
.IX Item "lum(x, y)"
Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the luminance
plane.
.IP "\fBcb(x, y)\fR" 4
.IX Item "cb(x, y)"
Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the
blue-difference chroma plane. Returns 0 if there is no such plane.
.IP "\fBcr(x, y)\fR" 4
.IX Item "cr(x, y)"
Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the
red-difference chroma plane. Returns 0 if there is no such plane.
.IP "\fBalpha(x, y)\fR" 4
.IX Item "alpha(x, y)"
Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the alpha
plane. Returns 0 if there is no such plane.
.PP
For functions, if \fIx\fR and \fIy\fR are outside the area, the value will be
automatically clipped to the closer edge.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Flip the image horizontally:
.Sp
.Vb 1
\&        geq=p(W\-X\e,Y)
.Ve
.IP "\(bu" 4
Generate a bidimensional sine wave, with angle \f(CW\*(C`PI/3\*(C'\fR and a
wavelength of 100 pixels:
.Sp
.Vb 1
\&        geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X\-50*T) + sin(PI/3)*Y)):128:128
.Ve
.IP "\(bu" 4
Generate a fancy enigmatic moving light:
.Sp
.Vb 1
\&        nullsrc=s=256x256,geq=random(1)/hypot(X\-cos(N*0.07)*W/2\-W/2\e,Y\-sin(N*0.09)*H/2\-H/2)^2*1000000*sin(N*0.02):128:128
.Ve
.IP "\(bu" 4
Generate a quick emboss effect:
.Sp
.Vb 1
\&        format=gray,geq=lum_expr=\*(Aq(p(X,Y)+(256\-p(X\-4,Y\-4)))/2\*(Aq
.Ve
.SS "gradfun"
.IX Subsection "gradfun"
Fix the banding artifacts that are sometimes introduced into nearly flat
regions by truncation to 8bit color depth.
Interpolate the gradients that should go where the bands are, and
dither them.
.PP
This filter is designed for playback only.  Do not use it prior to
lossy compression, because compression tends to lose the dither and
bring back the bands.
.PP
This filter accepts the following options:
.IP "\fBstrength\fR" 4
.IX Item "strength"
The maximum amount by which the filter will change any one pixel. Also the
threshold for detecting nearly flat regions. Acceptable values range from .51 to
64, default value is 1.2, out-of-range values will be clipped to the valid
range.
.IP "\fBradius\fR" 4
.IX Item "radius"
The neighborhood to fit the gradient to. A larger radius makes for smoother
gradients, but also prevents the filter from modifying the pixels near detailed
regions. Acceptable values are 8\-32, default value is 16, out-of-range values
will be clipped to the valid range.
.PP
Alternatively, the options can be specified as a flat string:
\&\fIstrength\fR[:\fIradius\fR]
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply the filter with a \f(CW3.5\fR strength and radius of \f(CW8\fR:
.Sp
.Vb 1
\&        gradfun=3.5:8
.Ve
.IP "\(bu" 4
Specify radius, omitting the strength (which will fall-back to the default
value):
.Sp
.Vb 1
\&        gradfun=radius=8
.Ve
.SS "hflip"
.IX Subsection "hflip"
Flip the input video horizontally.
.PP
For example to horizontally flip the input video with \fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-i in.avi \-vf "hflip" out.avi
.Ve
.SS "histeq"
.IX Subsection "histeq"
This filter applies a global color histogram equalization on a
per-frame basis.
.PP
It can be used to correct video that has a compressed range of pixel
intensities.  The filter redistributes the pixel intensities to
equalize their distribution across the intensity range. It may be
viewed as an \*(L"automatically adjusting contrast filter\*(R". This filter is
useful only for correcting degraded or poorly captured source
video.
.PP
The filter accepts the following options:
.IP "\fBstrength\fR" 4
.IX Item "strength"
Determine the amount of equalization to be applied.  As the strength
is reduced, the distribution of pixel intensities more-and-more
approaches that of the input frame. The value must be a float number
in the range [0,1] and defaults to 0.200.
.IP "\fBintensity\fR" 4
.IX Item "intensity"
Set the maximum intensity that can generated and scale the output
values appropriately.  The strength should be set as desired and then
the intensity can be limited if needed to avoid washing-out. The value
must be a float number in the range [0,1] and defaults to 0.210.
.IP "\fBantibanding\fR" 4
.IX Item "antibanding"
Set the antibanding level. If enabled the filter will randomly vary
the luminance of output pixels by a small amount to avoid banding of
the histogram. Possible values are \f(CW\*(C`none\*(C'\fR, \f(CW\*(C`weak\*(C'\fR or
\&\f(CW\*(C`strong\*(C'\fR. It defaults to \f(CW\*(C`none\*(C'\fR.
.SS "histogram"
.IX Subsection "histogram"
Compute and draw a color distribution histogram for the input video.
.PP
The computed histogram is a representation of distribution of color components
in an image.
.PP
The filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Set histogram mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlevels\fR" 4
.IX Item "levels"
standard histogram that display color components distribution in an image.
Displays color graph for each color component. Shows distribution
of the Y, U, V, A or G, B, R components, depending on input format,
in current frame. Bellow each graph is color component scale meter.
.IP "\fBcolor\fR" 4
.IX Item "color"
chroma values in vectorscope, if brighter more such chroma values are
distributed in an image.
Displays chroma values (U/V color placement) in two dimensional graph
(which is called a vectorscope). It can be used to read of the hue and
saturation of the current frame. At a same time it is a histogram.
The whiter a pixel in the vectorscope, the more pixels of the input frame
correspond to that pixel (that is the more pixels have this chroma value).
The V component is displayed on the horizontal (X) axis, with the leftmost
side being V = 0 and the rightmost side being V = 255.
The U component is displayed on the vertical (Y) axis, with the top
representing U = 0 and the bottom representing U = 255.
.Sp
The position of a white pixel in the graph corresponds to the chroma value
of a pixel of the input clip. So the graph can be used to read of the
hue (color flavor) and the saturation (the dominance of the hue in the color).
As the hue of a color changes, it moves around the square. At the center of
the square, the saturation is zero, which means that the corresponding pixel
has no color. If you increase the amount of a specific color, while leaving
the other colors unchanged, the saturation increases, and you move towards
the edge of the square.
.IP "\fBcolor2\fR" 4
.IX Item "color2"
chroma values in vectorscope, similar as \f(CW\*(C`color\*(C'\fR but actual chroma values
are displayed.
.IP "\fBwaveform\fR" 4
.IX Item "waveform"
per row/column color component graph. In row mode graph in the left side represents
color component value 0 and right side represents value = 255. In column mode top
side represents color component value = 0 and bottom side represents value = 255.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`levels\*(C'\fR.
.RE
.IP "\fBlevel_height\fR" 4
.IX Item "level_height"
Set height of level in \f(CW\*(C`levels\*(C'\fR. Default value is \f(CW200\fR.
Allowed range is [50, 2048].
.IP "\fBscale_height\fR" 4
.IX Item "scale_height"
Set height of color scale in \f(CW\*(C`levels\*(C'\fR. Default value is \f(CW12\fR.
Allowed range is [0, 40].
.IP "\fBstep\fR" 4
.IX Item "step"
Set step for \f(CW\*(C`waveform\*(C'\fR mode. Smaller values are useful to find out how much
of same luminance values across input rows/columns are distributed.
Default value is \f(CW10\fR. Allowed range is [1, 255].
.IP "\fBwaveform_mode\fR" 4
.IX Item "waveform_mode"
Set mode for \f(CW\*(C`waveform\*(C'\fR. Can be either \f(CW\*(C`row\*(C'\fR, or \f(CW\*(C`column\*(C'\fR.
Default is \f(CW\*(C`row\*(C'\fR.
.IP "\fBdisplay_mode\fR" 4
.IX Item "display_mode"
Set display mode for \f(CW\*(C`waveform\*(C'\fR and \f(CW\*(C`levels\*(C'\fR.
It accepts the following values:
.RS 4
.IP "\fBparade\fR" 4
.IX Item "parade"
Display separate graph for the color components side by side in
\&\f(CW\*(C`row\*(C'\fR waveform mode or one below other in \f(CW\*(C`column\*(C'\fR waveform mode
for \f(CW\*(C`waveform\*(C'\fR histogram mode. For \f(CW\*(C`levels\*(C'\fR histogram mode
per color component graphs are placed one bellow other.
.Sp
This display mode in \f(CW\*(C`waveform\*(C'\fR histogram mode makes it easy to spot
color casts in the highlights and shadows of an image, by comparing the
contours of the top and the bottom of each waveform.
Since whites, grays, and blacks are characterized by
exactly equal amounts of red, green, and blue, neutral areas of the
picture should display three waveforms of roughly equal width/height.
If not, the correction is easy to make by making adjustments to level the
three waveforms.
.IP "\fBoverlay\fR" 4
.IX Item "overlay"
Presents information that's identical to that in the \f(CW\*(C`parade\*(C'\fR, except
that the graphs representing color components are superimposed directly
over one another.
.Sp
This display mode in \f(CW\*(C`waveform\*(C'\fR histogram mode can make it easier to spot
the relative differences or similarities in overlapping areas of the color
components that are supposed to be identical, such as neutral whites, grays,
or blacks.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`parade\*(C'\fR.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Calculate and draw histogram:
.Sp
.Vb 1
\&        ffplay \-i input \-vf histogram
.Ve
.SS "hqdn3d"
.IX Subsection "hqdn3d"
High precision/quality 3d denoise filter. This filter aims to reduce
image noise producing smooth images and making still images really
still. It should enhance compressibility.
.PP
It accepts the following optional parameters:
.IP "\fBluma_spatial\fR" 4
.IX Item "luma_spatial"
a non-negative float number which specifies spatial luma strength,
defaults to 4.0
.IP "\fBchroma_spatial\fR" 4
.IX Item "chroma_spatial"
a non-negative float number which specifies spatial chroma strength,
defaults to 3.0*\fIluma_spatial\fR/4.0
.IP "\fBluma_tmp\fR" 4
.IX Item "luma_tmp"
a float number which specifies luma temporal strength, defaults to
6.0*\fIluma_spatial\fR/4.0
.IP "\fBchroma_tmp\fR" 4
.IX Item "chroma_tmp"
a float number which specifies chroma temporal strength, defaults to
\&\fIluma_tmp\fR*\fIchroma_spatial\fR/\fIluma_spatial\fR
.SS "hue"
.IX Subsection "hue"
Modify the hue and/or the saturation of the input.
.PP
This filter accepts the following options:
.IP "\fBh\fR" 4
.IX Item "h"
Specify the hue angle as a number of degrees. It accepts an expression,
and defaults to \*(L"0\*(R".
.IP "\fBs\fR" 4
.IX Item "s"
Specify the saturation in the [\-10,10] range. It accepts a float number and
defaults to \*(L"1\*(R".
.IP "\fBH\fR" 4
.IX Item "H"
Specify the hue angle as a number of radians. It accepts a float
number or an expression, and defaults to \*(L"0\*(R".
.PP
\&\fBh\fR and \fBH\fR are mutually exclusive, and can't be
specified at the same time.
.PP
The \fBh\fR, \fBH\fR and \fBs\fR option values are
expressions containing the following constants:
.IP "\fBn\fR" 4
.IX Item "n"
frame count of the input frame starting from 0
.IP "\fBpts\fR" 4
.IX Item "pts"
presentation timestamp of the input frame expressed in time base units
.IP "\fBr\fR" 4
.IX Item "r"
frame rate of the input video, \s-1NAN\s0 if the input frame rate is unknown
.IP "\fBt\fR" 4
.IX Item "t"
timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
.IP "\fBtb\fR" 4
.IX Item "tb"
time base of the input video
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Set the hue to 90 degrees and the saturation to 1.0:
.Sp
.Vb 1
\&        hue=h=90:s=1
.Ve
.IP "\(bu" 4
Same command but expressing the hue in radians:
.Sp
.Vb 1
\&        hue=H=PI/2:s=1
.Ve
.IP "\(bu" 4
Rotate hue and make the saturation swing between 0
and 2 over a period of 1 second:
.Sp
.Vb 1
\&        hue="H=2*PI*t: s=sin(2*PI*t)+1"
.Ve
.IP "\(bu" 4
Apply a 3 seconds saturation fade-in effect starting at 0:
.Sp
.Vb 1
\&        hue="s=min(t/3\e,1)"
.Ve
.Sp
The general fade-in expression can be written as:
.Sp
.Vb 1
\&        hue="s=min(0\e, max((t\-START)/DURATION\e, 1))"
.Ve
.IP "\(bu" 4
Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
.Sp
.Vb 1
\&        hue="s=max(0\e, min(1\e, (8\-t)/3))"
.Ve
.Sp
The general fade-out expression can be written as:
.Sp
.Vb 1
\&        hue="s=max(0\e, min(1\e, (START+DURATION\-t)/DURATION))"
.Ve
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBs\fR" 4
.IX Item "s"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.IP "\fBH\fR" 4
.IX Item "H"
.PD
Modify the hue and/or the saturation of the input video.
The command accepts the same syntax of the corresponding option.
.Sp
If the specified expression is not valid, it is kept at its current
value.
.SS "idet"
.IX Subsection "idet"
Detect video interlacing type.
.PP
This filter tries to detect if the input is interlaced or progressive,
top or bottom field first.
.PP
The filter accepts the following options:
.IP "\fBintl_thres\fR" 4
.IX Item "intl_thres"
Set interlacing threshold.
.IP "\fBprog_thres\fR" 4
.IX Item "prog_thres"
Set progressive threshold.
.SS "il"
.IX Subsection "il"
Deinterleave or interleave fields.
.PP
This filter allows to process interlaced images fields without
deinterlacing them. Deinterleaving splits the input frame into 2
fields (so called half pictures). Odd lines are moved to the top
half of the output image, even lines to the bottom half.
You can process (filter) them independently and then re-interleave them.
.PP
The filter accepts the following options:
.IP "\fBluma_mode, l\fR" 4
.IX Item "luma_mode, l"
.PD 0
.IP "\fBchroma_mode, s\fR" 4
.IX Item "chroma_mode, s"
.IP "\fBalpha_mode, a\fR" 4
.IX Item "alpha_mode, a"
.PD
Available values for \fIluma_mode\fR, \fIchroma_mode\fR and
\&\fIalpha_mode\fR are:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Do nothing.
.IP "\fBdeinterleave, d\fR" 4
.IX Item "deinterleave, d"
Deinterleave fields, placing one above the other.
.IP "\fBinterleave, i\fR" 4
.IX Item "interleave, i"
Interleave fields. Reverse the effect of deinterleaving.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`none\*(C'\fR.
.RE
.IP "\fBluma_swap, ls\fR" 4
.IX Item "luma_swap, ls"
.PD 0
.IP "\fBchroma_swap, cs\fR" 4
.IX Item "chroma_swap, cs"
.IP "\fBalpha_swap, as\fR" 4
.IX Item "alpha_swap, as"
.PD
Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is \f(CW0\fR.
.SS "interlace"
.IX Subsection "interlace"
Simple interlacing filter from progressive contents. This interleaves upper (or
lower) lines from odd frames with lower (or upper) lines from even frames,
halving the frame rate and preserving image height.
.PP
.Vb 9
\&           Original        Original             New Frame
\&           Frame \*(Aqj\*(Aq      Frame \*(Aqj+1\*(Aq             (tff)
\&          ==========      ===========       ==================
\&            Line 0  \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->    Frame \*(Aqj\*(Aq Line 0
\&            Line 1          Line 1  \-\-\-\->   Frame \*(Aqj+1\*(Aq Line 1
\&            Line 2 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->    Frame \*(Aqj\*(Aq Line 2
\&            Line 3          Line 3  \-\-\-\->   Frame \*(Aqj+1\*(Aq Line 3
\&             ...             ...                   ...
\&        New Frame + 1 will be generated by Frame \*(Aqj+2\*(Aq and Frame \*(Aqj+3\*(Aq and so on
.Ve
.PP
It accepts the following optional parameters:
.IP "\fBscan\fR" 4
.IX Item "scan"
determines whether the interlaced frame is taken from the even (tff \- default)
or odd (bff) lines of the progressive frame.
.IP "\fBlowpass\fR" 4
.IX Item "lowpass"
Enable (default) or disable the vertical lowpass filter to avoid twitter
interlacing and reduce moire patterns.
.SS "kerndeint"
.IX Subsection "kerndeint"
Deinterlace input video by applying Donald Graft's adaptive kernel
deinterling. Work on interlaced parts of a video to produce
progressive frames.
.PP
The description of the accepted parameters follows.
.IP "\fBthresh\fR" 4
.IX Item "thresh"
Set the threshold which affects the filter's tolerance when
determining if a pixel line must be processed. It must be an integer
in the range [0,255] and defaults to 10. A value of 0 will result in
applying the process on every pixels.
.IP "\fBmap\fR" 4
.IX Item "map"
Paint pixels exceeding the threshold value to white if set to 1.
Default is 0.
.IP "\fBorder\fR" 4
.IX Item "order"
Set the fields order. Swap fields if set to 1, leave fields alone if
0. Default is 0.
.IP "\fBsharp\fR" 4
.IX Item "sharp"
Enable additional sharpening if set to 1. Default is 0.
.IP "\fBtwoway\fR" 4
.IX Item "twoway"
Enable twoway sharpening if set to 1. Default is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply default values:
.Sp
.Vb 1
\&        kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
.Ve
.IP "\(bu" 4
Enable additional sharpening:
.Sp
.Vb 1
\&        kerndeint=sharp=1
.Ve
.IP "\(bu" 4
Paint processed pixels in white:
.Sp
.Vb 1
\&        kerndeint=map=1
.Ve
.SS "lut, lutrgb, lutyuv"
.IX Subsection "lut, lutrgb, lutyuv"
Compute a look-up table for binding each pixel component input value
to an output value, and apply it to input video.
.PP
\&\fIlutyuv\fR applies a lookup table to a \s-1YUV\s0 input video, \fIlutrgb\fR
to an \s-1RGB\s0 input video.
.PP
These filters accept the following options:
.IP "\fBc0\fR" 4
.IX Item "c0"
set first pixel component expression
.IP "\fBc1\fR" 4
.IX Item "c1"
set second pixel component expression
.IP "\fBc2\fR" 4
.IX Item "c2"
set third pixel component expression
.IP "\fBc3\fR" 4
.IX Item "c3"
set fourth pixel component expression, corresponds to the alpha component
.IP "\fBr\fR" 4
.IX Item "r"
set red component expression
.IP "\fBg\fR" 4
.IX Item "g"
set green component expression
.IP "\fBb\fR" 4
.IX Item "b"
set blue component expression
.IP "\fBa\fR" 4
.IX Item "a"
alpha component expression
.IP "\fBy\fR" 4
.IX Item "y"
set Y/luminance component expression
.IP "\fBu\fR" 4
.IX Item "u"
set U/Cb component expression
.IP "\fBv\fR" 4
.IX Item "v"
set V/Cr component expression
.PP
Each of them specifies the expression to use for computing the lookup table for
the corresponding pixel component values.
.PP
The exact component associated to each of the \fIc*\fR options depends on the
format in input.
.PP
The \fIlut\fR filter requires either \s-1YUV\s0 or \s-1RGB\s0 pixel formats in input,
\&\fIlutrgb\fR requires \s-1RGB\s0 pixel formats in input, and \fIlutyuv\fR requires \s-1YUV\s0.
.PP
The expressions can contain the following constants and functions:
.IP "\fBw, h\fR" 4
.IX Item "w, h"
the input width and height
.IP "\fBval\fR" 4
.IX Item "val"
input value for the pixel component
.IP "\fBclipval\fR" 4
.IX Item "clipval"
the input value clipped in the \fIminval\fR\-\fImaxval\fR range
.IP "\fBmaxval\fR" 4
.IX Item "maxval"
maximum value for the pixel component
.IP "\fBminval\fR" 4
.IX Item "minval"
minimum value for the pixel component
.IP "\fBnegval\fR" 4
.IX Item "negval"
the negated value for the pixel component value clipped in the
\&\fIminval\fR\-\fImaxval\fR range , it corresponds to the expression
\&\*(L"maxval\-clipval+minval\*(R"
.IP "\fBclip(val)\fR" 4
.IX Item "clip(val)"
the computed value in \fIval\fR clipped in the
\&\fIminval\fR\-\fImaxval\fR range
.IP "\fBgammaval(gamma)\fR" 4
.IX Item "gammaval(gamma)"
the computed gamma correction value of the pixel component value
clipped in the \fIminval\fR\-\fImaxval\fR range, corresponds to the
expression
"pow((clipval\-minval)/(maxval\-minval)\e,\fIgamma\fR)*(maxval\-minval)+minval"
.PP
All expressions default to \*(L"val\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Negate input video:
.Sp
.Vb 2
\&        lutrgb="r=maxval+minval\-val:g=maxval+minval\-val:b=maxval+minval\-val"
\&        lutyuv="y=maxval+minval\-val:u=maxval+minval\-val:v=maxval+minval\-val"
.Ve
.Sp
The above is the same as:
.Sp
.Vb 2
\&        lutrgb="r=negval:g=negval:b=negval"
\&        lutyuv="y=negval:u=negval:v=negval"
.Ve
.IP "\(bu" 4
Negate luminance:
.Sp
.Vb 1
\&        lutyuv=y=negval
.Ve
.IP "\(bu" 4
Remove chroma components, turns the video into a graytone image:
.Sp
.Vb 1
\&        lutyuv="u=128:v=128"
.Ve
.IP "\(bu" 4
Apply a luma burning effect:
.Sp
.Vb 1
\&        lutyuv="y=2*val"
.Ve
.IP "\(bu" 4
Remove green and blue components:
.Sp
.Vb 1
\&        lutrgb="g=0:b=0"
.Ve
.IP "\(bu" 4
Set a constant alpha channel value on input:
.Sp
.Vb 1
\&        format=rgba,lutrgb=a="maxval\-minval/2"
.Ve
.IP "\(bu" 4
Correct luminance gamma by a 0.5 factor:
.Sp
.Vb 1
\&        lutyuv=y=gammaval(0.5)
.Ve
.IP "\(bu" 4
Discard least significant bits of luma:
.Sp
.Vb 1
\&        lutyuv=y=\*(Aqbitand(val, 128+64+32)\*(Aq
.Ve
.SS "mp"
.IX Subsection "mp"
Apply an MPlayer filter to the input video.
.PP
This filter provides a wrapper around most of the filters of
MPlayer/MEncoder.
.PP
This wrapper is considered experimental. Some of the wrapped filters
may not work properly and we may drop support for them, as they will
be implemented natively into FFmpeg. Thus you should avoid
depending on them when writing portable scripts.
.PP
The filters accepts the parameters:
\&\fIfilter_name\fR[:=]\fIfilter_params\fR
.PP
\&\fIfilter_name\fR is the name of a supported MPlayer filter,
\&\fIfilter_params\fR is a string containing the parameters accepted by
the named filter.
.PP
The list of the currently supported filters follows:
.IP "\fIdint\fR" 4
.IX Item "dint"
.PD 0
.IP "\fIdown3dright\fR" 4
.IX Item "down3dright"
.IP "\fIeq2\fR" 4
.IX Item "eq2"
.IP "\fIeq\fR" 4
.IX Item "eq"
.IP "\fIfil\fR" 4
.IX Item "fil"
.IP "\fIfspp\fR" 4
.IX Item "fspp"
.IP "\fIilpack\fR" 4
.IX Item "ilpack"
.IP "\fImcdeint\fR" 4
.IX Item "mcdeint"
.IP "\fIow\fR" 4
.IX Item "ow"
.IP "\fIperspective\fR" 4
.IX Item "perspective"
.IP "\fIphase\fR" 4
.IX Item "phase"
.IP "\fIpp7\fR" 4
.IX Item "pp7"
.IP "\fIpullup\fR" 4
.IX Item "pullup"
.IP "\fIqp\fR" 4
.IX Item "qp"
.IP "\fIsab\fR" 4
.IX Item "sab"
.IP "\fIsoftpulldown\fR" 4
.IX Item "softpulldown"
.IP "\fIspp\fR" 4
.IX Item "spp"
.IP "\fItinterlace\fR" 4
.IX Item "tinterlace"
.IP "\fIuspp\fR" 4
.IX Item "uspp"
.PD
.PP
The parameter syntax and behavior for the listed filters are the same
of the corresponding MPlayer filters. For detailed instructions check
the \*(L"\s-1VIDEO\s0 \s-1FILTERS\s0\*(R" section in the MPlayer manual.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Adjust gamma, brightness, contrast:
.Sp
.Vb 1
\&        mp=eq2=1.0:2:0.5
.Ve
.PP
See also \fImplayer\fR\|(1), <\fBhttp://www.mplayerhq.hu/\fR>.
.SS "mpdecimate"
.IX Subsection "mpdecimate"
Drop frames that do not differ greatly from the previous frame in
order to reduce frame rate.
.PP
The main use of this filter is for very-low-bitrate encoding
(e.g. streaming over dialup modem), but it could in theory be used for
fixing movies that were inverse-telecined incorrectly.
.PP
A description of the accepted options follows.
.IP "\fBmax\fR" 4
.IX Item "max"
Set the maximum number of consecutive frames which can be dropped (if
positive), or the minimum interval between dropped frames (if
negative). If the value is 0, the frame is dropped unregarding the
number of previous sequentially dropped frames.
.Sp
Default value is 0.
.IP "\fBhi\fR" 4
.IX Item "hi"
.PD 0
.IP "\fBlo\fR" 4
.IX Item "lo"
.IP "\fBfrac\fR" 4
.IX Item "frac"
.PD
Set the dropping threshold values.
.Sp
Values for \fBhi\fR and \fBlo\fR are for 8x8 pixel blocks and
represent actual pixel value differences, so a threshold of 64
corresponds to 1 unit of difference for each pixel, or the same spread
out differently over the block.
.Sp
A frame is a candidate for dropping if no 8x8 blocks differ by more
than a threshold of \fBhi\fR, and if no more than \fBfrac\fR blocks (1
meaning the whole image) differ by more than a threshold of \fBlo\fR.
.Sp
Default value for \fBhi\fR is 64*12, default value for \fBlo\fR is
64*5, and default value for \fBfrac\fR is 0.33.
.SS "negate"
.IX Subsection "negate"
Negate input video.
.PP
This filter accepts an integer in input, if non-zero it negates the
alpha component (if available). The default value in input is 0.
.SS "noformat"
.IX Subsection "noformat"
Force libavfilter not to use any of the specified pixel formats for the
input to the next filter.
.PP
This filter accepts the following parameters:
.IP "\fBpix_fmts\fR" 4
.IX Item "pix_fmts"
A '|'\-separated list of pixel format names, for example
\&\*(L"pix_fmts=yuv420p|monow|rgb24\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Force libavfilter to use a format different from \fIyuv420p\fR for the
input to the vflip filter:
.Sp
.Vb 1
\&        noformat=pix_fmts=yuv420p,vflip
.Ve
.IP "\(bu" 4
Convert the input video to any of the formats not contained in the list:
.Sp
.Vb 1
\&        noformat=yuv420p|yuv444p|yuv410p
.Ve
.SS "noise"
.IX Subsection "noise"
Add noise on video input frame.
.PP
The filter accepts the following options:
.IP "\fBall_seed\fR" 4
.IX Item "all_seed"
.PD 0
.IP "\fBc0_seed\fR" 4
.IX Item "c0_seed"
.IP "\fBc1_seed\fR" 4
.IX Item "c1_seed"
.IP "\fBc2_seed\fR" 4
.IX Item "c2_seed"
.IP "\fBc3_seed\fR" 4
.IX Item "c3_seed"
.PD
Set noise seed for specific pixel component or all pixel components in case
of \fIall_seed\fR. Default value is \f(CW123457\fR.
.IP "\fBall_strength, alls\fR" 4
.IX Item "all_strength, alls"
.PD 0
.IP "\fBc0_strength, c0s\fR" 4
.IX Item "c0_strength, c0s"
.IP "\fBc1_strength, c1s\fR" 4
.IX Item "c1_strength, c1s"
.IP "\fBc2_strength, c2s\fR" 4
.IX Item "c2_strength, c2s"
.IP "\fBc3_strength, c3s\fR" 4
.IX Item "c3_strength, c3s"
.PD
Set noise strength for specific pixel component or all pixel components in case
\&\fIall_strength\fR. Default value is \f(CW0\fR. Allowed range is [0, 100].
.IP "\fBall_flags, allf\fR" 4
.IX Item "all_flags, allf"
.PD 0
.IP "\fBc0_flags, c0f\fR" 4
.IX Item "c0_flags, c0f"
.IP "\fBc1_flags, c1f\fR" 4
.IX Item "c1_flags, c1f"
.IP "\fBc2_flags, c2f\fR" 4
.IX Item "c2_flags, c2f"
.IP "\fBc3_flags, c3f\fR" 4
.IX Item "c3_flags, c3f"
.PD
Set pixel component flags or set flags for all components if \fIall_flags\fR.
Available values for component flags are:
.RS 4
.IP "\fBa\fR" 4
.IX Item "a"
averaged temporal noise (smoother)
.IP "\fBp\fR" 4
.IX Item "p"
mix random noise with a (semi)regular pattern
.IP "\fBq\fR" 4
.IX Item "q"
higher quality (slightly better looking, slightly slower)
.IP "\fBt\fR" 4
.IX Item "t"
temporal noise (noise pattern changes between frames)
.IP "\fBu\fR" 4
.IX Item "u"
uniform noise (gaussian otherwise)
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Add temporal and uniform noise to input video:
.PP
.Vb 1
\&        noise=alls=20:allf=t+u
.Ve
.SS "null"
.IX Subsection "null"
Pass the video source unchanged to the output.
.SS "ocv"
.IX Subsection "ocv"
Apply video transform using libopencv.
.PP
To enable this filter install libopencv library and headers and
configure FFmpeg with \f(CW\*(C`\-\-enable\-libopencv\*(C'\fR.
.PP
This filter accepts the following parameters:
.IP "\fBfilter_name\fR" 4
.IX Item "filter_name"
The name of the libopencv filter to apply.
.IP "\fBfilter_params\fR" 4
.IX Item "filter_params"
The parameters to pass to the libopencv filter. If not specified the default
values are assumed.
.PP
Refer to the official libopencv documentation for more precise
information:
<\fBhttp://opencv.willowgarage.com/documentation/c/image_filtering.html\fR>
.PP
Follows the list of supported libopencv filters.
.PP
\fIdilate\fR
.IX Subsection "dilate"
.PP
Dilate an image by using a specific structuring element.
This filter corresponds to the libopencv function \f(CW\*(C`cvDilate\*(C'\fR.
.PP
It accepts the parameters: \fIstruct_el\fR|\fInb_iterations\fR.
.PP
\&\fIstruct_el\fR represents a structuring element, and has the syntax:
\&\fIcols\fRx\fIrows\fR+\fIanchor_x\fRx\fIanchor_y\fR/\fIshape\fR
.PP
\&\fIcols\fR and \fIrows\fR represent the number of columns and rows of
the structuring element, \fIanchor_x\fR and \fIanchor_y\fR the anchor
point, and \fIshape\fR the shape for the structuring element, and
can be one of the values \*(L"rect\*(R", \*(L"cross\*(R", \*(L"ellipse\*(R", \*(L"custom\*(R".
.PP
If the value for \fIshape\fR is \*(L"custom\*(R", it must be followed by a
string of the form "=\fIfilename\fR". The file with name
\&\fIfilename\fR is assumed to represent a binary image, with each
printable character corresponding to a bright pixel. When a custom
\&\fIshape\fR is used, \fIcols\fR and \fIrows\fR are ignored, the number
or columns and rows of the read file are assumed instead.
.PP
The default value for \fIstruct_el\fR is \*(L"3x3+0x0/rect\*(R".
.PP
\&\fInb_iterations\fR specifies the number of times the transform is
applied to the image, and defaults to 1.
.PP
Follow some example:
.PP
.Vb 2
\&        # use the default values
\&        ocv=dilate
\&        
\&        # dilate using a structuring element with a 5x5 cross, iterate two times
\&        ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
\&        
\&        # read the shape from the file diamond.shape, iterate two times
\&        # the file diamond.shape may contain a pattern of characters like this:
\&        #   *
\&        #  ***
\&        # *****
\&        #  ***
\&        #   *
\&        # the specified cols and rows are ignored (but not the anchor point coordinates)
\&        ocv=dilate:0x0+2x2/custom=diamond.shape|2
.Ve
.PP
\fIerode\fR
.IX Subsection "erode"
.PP
Erode an image by using a specific structuring element.
This filter corresponds to the libopencv function \f(CW\*(C`cvErode\*(C'\fR.
.PP
The filter accepts the parameters: \fIstruct_el\fR:\fInb_iterations\fR,
with the same syntax and semantics as the dilate filter.
.PP
\fIsmooth\fR
.IX Subsection "smooth"
.PP
Smooth the input video.
.PP
The filter takes the following parameters:
\&\fItype\fR|\fIparam1\fR|\fIparam2\fR|\fIparam3\fR|\fIparam4\fR.
.PP
\&\fItype\fR is the type of smooth filter to apply, and can be one of
the following values: \*(L"blur\*(R", \*(L"blur_no_scale\*(R", \*(L"median\*(R", \*(L"gaussian\*(R",
\&\*(L"bilateral\*(R". The default value is \*(L"gaussian\*(R".
.PP
\&\fIparam1\fR, \fIparam2\fR, \fIparam3\fR, and \fIparam4\fR are
parameters whose meanings depend on smooth type. \fIparam1\fR and
\&\fIparam2\fR accept integer positive values or 0, \fIparam3\fR and
\&\fIparam4\fR accept float values.
.PP
The default value for \fIparam1\fR is 3, the default value for the
other parameters is 0.
.PP
These parameters correspond to the parameters assigned to the
libopencv function \f(CW\*(C`cvSmooth\*(C'\fR.
.SS "overlay"
.IX Subsection "overlay"
Overlay one video on top of another.
.PP
It takes two inputs and one output, the first input is the \*(L"main\*(R"
video on which the second input is overlayed.
.PP
This filter accepts the following parameters:
.PP
A description of the accepted options follows.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
Set the expression for the x and y coordinates of the overlayed video
on the main video. Default value is \*(L"0\*(R" for both expressions. In case
the expression is invalid, it is set to a huge value (meaning that the
overlay will not be displayed within the output visible area).
.IP "\fBenable\fR" 4
.IX Item "enable"
Set the expression which enables the overlay. If the evaluation is
different from 0, the overlay is displayed on top of the input
frame. By default it is \*(L"1\*(R".
.IP "\fBeval\fR" 4
.IX Item "eval"
Set when the expressions for \fBx\fR, \fBy\fR, and
\&\fBenable\fR are evaluated.
.Sp
It accepts the following values:
.RS 4
.IP "\fBinit\fR" 4
.IX Item "init"
only evaluate expressions once during the filter initialization or
when a command is processed
.IP "\fBframe\fR" 4
.IX Item "frame"
evaluate expressions for each incoming frame
.RE
.RS 4
.Sp
Default value is \fBframe\fR.
.RE
.IP "\fBshortest\fR" 4
.IX Item "shortest"
If set to 1, force the output to terminate when the shortest input
terminates. Default value is 0.
.IP "\fBformat\fR" 4
.IX Item "format"
Set the format for the output video.
.Sp
It accepts the following values:
.RS 4
.IP "\fByuv420\fR" 4
.IX Item "yuv420"
force \s-1YUV420\s0 output
.IP "\fByuv444\fR" 4
.IX Item "yuv444"
force \s-1YUV444\s0 output
.IP "\fBrgb\fR" 4
.IX Item "rgb"
force \s-1RGB\s0 output
.RE
.RS 4
.Sp
Default value is \fByuv420\fR.
.RE
.IP "\fBrgb\fR \fI(deprecated)\fR" 4
.IX Item "rgb (deprecated)"
If set to 1, force the filter to accept inputs in the \s-1RGB\s0
color space. Default value is 0. This option is deprecated, use
\&\fBformat\fR instead.
.IP "\fBrepeatlast\fR" 4
.IX Item "repeatlast"
If set to 1, force the filter to draw the last overlay frame over the
main input until the end of the stream. A value of 0 disables this
behavior, which is enabled by default.
.PP
The \fBx\fR, \fBy\fR, and \fBenable\fR expressions can
contain the following parameters.
.IP "\fBmain_w, W\fR" 4
.IX Item "main_w, W"
.PD 0
.IP "\fBmain_h, H\fR" 4
.IX Item "main_h, H"
.PD
main input width and height
.IP "\fBoverlay_w, w\fR" 4
.IX Item "overlay_w, w"
.PD 0
.IP "\fBoverlay_h, h\fR" 4
.IX Item "overlay_h, h"
.PD
overlay input width and height
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
the computed values for \fIx\fR and \fIy\fR. They are evaluated for
each new frame.
.IP "\fBhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
horizontal and vertical chroma subsample values of the output
format. For example for the pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and
\&\fIvsub\fR is 1.
.IP "\fBn\fR" 4
.IX Item "n"
the number of input frame, starting from 0
.IP "\fBpos\fR" 4
.IX Item "pos"
the position in the file of the input frame, \s-1NAN\s0 if unknown
.IP "\fBt\fR" 4
.IX Item "t"
timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
.PP
Note that the \fIn\fR, \fIpos\fR, \fIt\fR variables are available only
when evaluation is done \fIper frame\fR, and will evaluate to \s-1NAN\s0
when \fBeval\fR is set to \fBinit\fR.
.PP
Be aware that frames are taken from each input video in timestamp
order, hence, if their initial timestamps differ, it is a a good idea
to pass the two inputs through a \fIsetpts=PTS\-STARTPTS\fR filter to
have them begin in the same zero timestamp, as it does the example for
the \fImovie\fR filter.
.PP
You can chain together more overlays but you should test the
efficiency of such approach.
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.IP "\fBenable\fR" 4
.IX Item "enable"
.PD
Modify the x/y and enable overlay of the overlay input.
The command accepts the same syntax of the corresponding option.
.Sp
If the specified expression is not valid, it is kept at its current
value.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Draw the overlay at 10 pixels from the bottom right corner of the main
video:
.Sp
.Vb 1
\&        overlay=main_w\-overlay_w\-10:main_h\-overlay_h\-10
.Ve
.Sp
Using named options the example above becomes:
.Sp
.Vb 1
\&        overlay=x=main_w\-overlay_w\-10:y=main_h\-overlay_h\-10
.Ve
.IP "\(bu" 4
Insert a transparent \s-1PNG\s0 logo in the bottom left corner of the input,
using the \fBffmpeg\fR tool with the \f(CW\*(C`\-filter_complex\*(C'\fR option:
.Sp
.Vb 1
\&        ffmpeg \-i input \-i logo \-filter_complex \*(Aqoverlay=10:main_h\-overlay_h\-10\*(Aq output
.Ve
.IP "\(bu" 4
Insert 2 different transparent \s-1PNG\s0 logos (second logo on bottom
right corner) using the \fBffmpeg\fR tool:
.Sp
.Vb 1
\&        ffmpeg \-i input \-i logo1 \-i logo2 \-filter_complex \*(Aqoverlay=x=10:y=H\-h\-10,overlay=x=W\-w\-10:y=H\-h\-10\*(Aq output
.Ve
.IP "\(bu" 4
Add a transparent color layer on top of the main video, \f(CW\*(C`WxH\*(C'\fR
must specify the size of the main input to the overlay filter:
.Sp
.Vb 1
\&        color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
.Ve
.IP "\(bu" 4
Play an original video and a filtered version (here with the deshake
filter) side by side using the \fBffplay\fR tool:
.Sp
.Vb 1
\&        ffplay input.avi \-vf \*(Aqsplit[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w\*(Aq
.Ve
.Sp
The above command is the same as:
.Sp
.Vb 1
\&        ffplay input.avi \-vf \*(Aqsplit[b], pad=iw*2[src], [b]deshake, [src]overlay=w\*(Aq
.Ve
.IP "\(bu" 4
Make a sliding overlay appearing from the left to the right top part of the
screen starting since time 2:
.Sp
.Vb 1
\&        overlay=x=\*(Aqif(gte(t,2), \-w+(t\-2)*20, NAN)\*(Aq:y=0
.Ve
.IP "\(bu" 4
Compose output by putting two input videos side to side:
.Sp
.Vb 7
\&        ffmpeg \-i left.avi \-i right.avi \-filter_complex "
\&        nullsrc=size=200x100 [background];
\&        [0:v] setpts=PTS\-STARTPTS, scale=100x100 [left];
\&        [1:v] setpts=PTS\-STARTPTS, scale=100x100 [right];
\&        [background][left]       overlay=shortest=1       [background+left];
\&        [background+left][right] overlay=shortest=1:x=100 [left+right]
\&        "
.Ve
.IP "\(bu" 4
Chain several overlays in cascade:
.Sp
.Vb 6
\&        nullsrc=s=200x200 [bg];
\&        testsrc=s=100x100, split=4 [in0][in1][in2][in3];
\&        [in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
\&        [in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
\&        [in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
\&        [in3] null,       [mid2] overlay=100:100 [out0]
.Ve
.SS "pad"
.IX Subsection "pad"
Add paddings to the input image, and place the original input at the
given coordinates \fIx\fR, \fIy\fR.
.PP
This filter accepts the following parameters:
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
Specify an expression for the size of the output image with the
paddings added. If the value for \fIwidth\fR or \fIheight\fR is 0, the
corresponding input size is used for the output.
.Sp
The \fIwidth\fR expression can reference the value set by the
\&\fIheight\fR expression, and vice versa.
.Sp
The default value of \fIwidth\fR and \fIheight\fR is 0.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
Specify an expression for the offsets where to place the input image
in the padded area with respect to the top/left border of the output
image.
.Sp
The \fIx\fR expression can reference the value set by the \fIy\fR
expression, and vice versa.
.Sp
The default value of \fIx\fR and \fIy\fR is 0.
.IP "\fBcolor\fR" 4
.IX Item "color"
Specify the color of the padded area, it can be the name of a color
(case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence.
.Sp
The default value of \fIcolor\fR is \*(L"black\*(R".
.PP
The value for the \fIwidth\fR, \fIheight\fR, \fIx\fR, and \fIy\fR
options are expressions containing the following constants:
.IP "\fBin_w, in_h\fR" 4
.IX Item "in_w, in_h"
the input video width and height
.IP "\fBiw, ih\fR" 4
.IX Item "iw, ih"
same as \fIin_w\fR and \fIin_h\fR
.IP "\fBout_w, out_h\fR" 4
.IX Item "out_w, out_h"
the output width and height, that is the size of the padded area as
specified by the \fIwidth\fR and \fIheight\fR expressions
.IP "\fBow, oh\fR" 4
.IX Item "ow, oh"
same as \fIout_w\fR and \fIout_h\fR
.IP "\fBx, y\fR" 4
.IX Item "x, y"
x and y offsets as specified by the \fIx\fR and \fIy\fR
expressions, or \s-1NAN\s0 if not yet specified
.IP "\fBa\fR" 4
.IX Item "a"
same as \fIiw\fR / \fIih\fR
.IP "\fBsar\fR" 4
.IX Item "sar"
input sample aspect ratio
.IP "\fBdar\fR" 4
.IX Item "dar"
input display aspect ratio, it is the same as (\fIiw\fR / \fIih\fR) * \fIsar\fR
.IP "\fBhsub, vsub\fR" 4
.IX Item "hsub, vsub"
horizontal and vertical chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Add paddings with color \*(L"violet\*(R" to the input video. Output video
size is 640x480, the top-left corner of the input video is placed at
column 0, row 40:
.Sp
.Vb 1
\&        pad=640:480:0:40:violet
.Ve
.Sp
The example above is equivalent to the following command:
.Sp
.Vb 1
\&        pad=width=640:height=480:x=0:y=40:color=violet
.Ve
.IP "\(bu" 4
Pad the input to get an output with dimensions increased by 3/2,
and put the input video at the center of the padded area:
.Sp
.Vb 1
\&        pad="3/2*iw:3/2*ih:(ow\-iw)/2:(oh\-ih)/2"
.Ve
.IP "\(bu" 4
Pad the input to get a squared output with size equal to the maximum
value between the input width and height, and put the input video at
the center of the padded area:
.Sp
.Vb 1
\&        pad="max(iw\e,ih):ow:(ow\-iw)/2:(oh\-ih)/2"
.Ve
.IP "\(bu" 4
Pad the input to get a final w/h ratio of 16:9:
.Sp
.Vb 1
\&        pad="ih*16/9:ih:(ow\-iw)/2:(oh\-ih)/2"
.Ve
.IP "\(bu" 4
In case of anamorphic video, in order to set the output display aspect
correctly, it is necessary to use \fIsar\fR in the expression,
according to the relation:
.Sp
.Vb 2
\&        (ih * X / ih) * sar = output_dar
\&        X = output_dar / sar
.Ve
.Sp
Thus the previous example needs to be modified to:
.Sp
.Vb 1
\&        pad="ih*16/9/sar:ih:(ow\-iw)/2:(oh\-ih)/2"
.Ve
.IP "\(bu" 4
Double output size and put the input video in the bottom-right
corner of the output padded area:
.Sp
.Vb 1
\&        pad="2*iw:2*ih:ow\-iw:oh\-ih"
.Ve
.SS "pixdesctest"
.IX Subsection "pixdesctest"
Pixel format descriptor test filter, mainly useful for internal
testing. The output video should be equal to the input video.
.PP
For example:
.PP
.Vb 1
\&        format=monow, pixdesctest
.Ve
.PP
can be used to test the monowhite pixel format descriptor definition.
.SS "pp"
.IX Subsection "pp"
Enable the specified chain of postprocessing subfilters using libpostproc. This
library should be automatically selected with a \s-1GPL\s0 build (\f(CW\*(C`\-\-enable\-gpl\*(C'\fR).
Subfilters must be separated by '/' and can be disabled by prepending a '\-'.
Each subfilter and some options have a short and a long name that can be used
interchangeably, i.e. dr/dering are the same.
.PP
The filters accept the following options:
.IP "\fBsubfilters\fR" 4
.IX Item "subfilters"
Set postprocessing subfilters string.
.PP
All subfilters share common options to determine their scope:
.IP "\fBa/autoq\fR" 4
.IX Item "a/autoq"
Honor the quality commands for this subfilter.
.IP "\fBc/chrom\fR" 4
.IX Item "c/chrom"
Do chrominance filtering, too (default).
.IP "\fBy/nochrom\fR" 4
.IX Item "y/nochrom"
Do luminance filtering only (no chrominance).
.IP "\fBn/noluma\fR" 4
.IX Item "n/noluma"
Do chrominance filtering only (no luminance).
.PP
These options can be appended after the subfilter name, separated by a '|'.
.PP
Available subfilters are:
.IP "\fBhb/hdeblock[|difference[|flatness]]\fR" 4
.IX Item "hb/hdeblock[|difference[|flatness]]"
Horizontal deblocking filter
.RS 4
.IP "\fBdifference\fR" 4
.IX Item "difference"
Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
.IP "\fBflatness\fR" 4
.IX Item "flatness"
Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
.RE
.RS 4
.RE
.IP "\fBvb/vdeblock[|difference[|flatness]]\fR" 4
.IX Item "vb/vdeblock[|difference[|flatness]]"
Vertical deblocking filter
.RS 4
.IP "\fBdifference\fR" 4
.IX Item "difference"
Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
.IP "\fBflatness\fR" 4
.IX Item "flatness"
Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
.RE
.RS 4
.RE
.IP "\fBha/hadeblock[|difference[|flatness]]\fR" 4
.IX Item "ha/hadeblock[|difference[|flatness]]"
Accurate horizontal deblocking filter
.RS 4
.IP "\fBdifference\fR" 4
.IX Item "difference"
Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
.IP "\fBflatness\fR" 4
.IX Item "flatness"
Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
.RE
.RS 4
.RE
.IP "\fBva/vadeblock[|difference[|flatness]]\fR" 4
.IX Item "va/vadeblock[|difference[|flatness]]"
Accurate vertical deblocking filter
.RS 4
.IP "\fBdifference\fR" 4
.IX Item "difference"
Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
.IP "\fBflatness\fR" 4
.IX Item "flatness"
Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
.RE
.RS 4
.RE
.PP
The horizontal and vertical deblocking filters share the difference and
flatness values so you cannot set different horizontal and vertical
thresholds.
.IP "\fBh1/x1hdeblock\fR" 4
.IX Item "h1/x1hdeblock"
Experimental horizontal deblocking filter
.IP "\fBv1/x1vdeblock\fR" 4
.IX Item "v1/x1vdeblock"
Experimental vertical deblocking filter
.IP "\fBdr/dering\fR" 4
.IX Item "dr/dering"
Deringing filter
.IP "\fBtn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer\fR" 4
.IX Item "tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer"
.RS 4
.PD 0
.IP "\fBthreshold1\fR" 4
.IX Item "threshold1"
.PD
larger \-> stronger filtering
.IP "\fBthreshold2\fR" 4
.IX Item "threshold2"
larger \-> stronger filtering
.IP "\fBthreshold3\fR" 4
.IX Item "threshold3"
larger \-> stronger filtering
.RE
.RS 4
.RE
.IP "\fBal/autolevels[:f/fullyrange], automatic brightness / contrast correction\fR" 4
.IX Item "al/autolevels[:f/fullyrange], automatic brightness / contrast correction"
.RS 4
.PD 0
.IP "\fBf/fullyrange\fR" 4
.IX Item "f/fullyrange"
.PD
Stretch luminance to \f(CW\*(C`0\-255\*(C'\fR.
.RE
.RS 4
.RE
.IP "\fBlb/linblenddeint\fR" 4
.IX Item "lb/linblenddeint"
Linear blend deinterlacing filter that deinterlaces the given block by
filtering all lines with a \f(CW\*(C`(1 2 1)\*(C'\fR filter.
.IP "\fBli/linipoldeint\fR" 4
.IX Item "li/linipoldeint"
Linear interpolating deinterlacing filter that deinterlaces the given block by
linearly interpolating every second line.
.IP "\fBci/cubicipoldeint\fR" 4
.IX Item "ci/cubicipoldeint"
Cubic interpolating deinterlacing filter deinterlaces the given block by
cubically interpolating every second line.
.IP "\fBmd/mediandeint\fR" 4
.IX Item "md/mediandeint"
Median deinterlacing filter that deinterlaces the given block by applying a
median filter to every second line.
.IP "\fBfd/ffmpegdeint\fR" 4
.IX Item "fd/ffmpegdeint"
FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
second line with a \f(CW\*(C`(\-1 4 2 4 \-1)\*(C'\fR filter.
.IP "\fBl5/lowpass5\fR" 4
.IX Item "l5/lowpass5"
Vertically applied \s-1FIR\s0 lowpass deinterlacing filter that deinterlaces the given
block by filtering all lines with a \f(CW\*(C`(\-1 2 6 2 \-1)\*(C'\fR filter.
.IP "\fBfq/forceQuant[|quantizer]\fR" 4
.IX Item "fq/forceQuant[|quantizer]"
Overrides the quantizer table from the input with the constant quantizer you
specify.
.RS 4
.IP "\fBquantizer\fR" 4
.IX Item "quantizer"
Quantizer to use
.RE
.RS 4
.RE
.IP "\fBde/default\fR" 4
.IX Item "de/default"
Default pp filter combination (\f(CW\*(C`hb|a,vb|a,dr|a\*(C'\fR)
.IP "\fBfa/fast\fR" 4
.IX Item "fa/fast"
Fast pp filter combination (\f(CW\*(C`h1|a,v1|a,dr|a\*(C'\fR)
.IP "\fBac\fR" 4
.IX Item "ac"
High quality pp filter combination (\f(CW\*(C`ha|a|128|7,va|a,dr|a\*(C'\fR)
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply horizontal and vertical deblocking, deringing and automatic
brightness/contrast:
.Sp
.Vb 1
\&        pp=hb/vb/dr/al
.Ve
.IP "\(bu" 4
Apply default filters without brightness/contrast correction:
.Sp
.Vb 1
\&        pp=de/\-al
.Ve
.IP "\(bu" 4
Apply default filters and temporal denoiser:
.Sp
.Vb 1
\&        pp=default/tmpnoise|1|2|3
.Ve
.IP "\(bu" 4
Apply deblocking on luminance only, and switch vertical deblocking on or off
automatically depending on available \s-1CPU\s0 time:
.Sp
.Vb 1
\&        pp=hb|y/vb|a
.Ve
.SS "removelogo"
.IX Subsection "removelogo"
Suppress a \s-1TV\s0 station logo, using an image file to determine which
pixels comprise the logo. It works by filling in the pixels that
comprise the logo with neighboring pixels.
.PP
The filters accept the following options:
.IP "\fBfilename, f\fR" 4
.IX Item "filename, f"
Set the filter bitmap file, which can be any image format supported by
libavformat. The width and height of the image file must match those of the
video stream being processed.
.PP
Pixels in the provided bitmap image with a value of zero are not
considered part of the logo, non-zero pixels are considered part of
the logo. If you use white (255) for the logo and black (0) for the
rest, you will be safe. For making the filter bitmap, it is
recommended to take a screen capture of a black frame with the logo
visible, and then using a threshold filter followed by the erode
filter once or twice.
.PP
If needed, little splotches can be fixed manually. Remember that if
logo pixels are not covered, the filter quality will be much
reduced. Marking too many pixels as part of the logo does not hurt as
much, but it will increase the amount of blurring needed to cover over
the image and will destroy more information than necessary, and extra
pixels will slow things down on a large logo.
.SS "scale"
.IX Subsection "scale"
Scale (resize) the input video, using the libswscale library.
.PP
The scale filter forces the output display aspect ratio to be the same
of the input, by changing the output sample aspect ratio.
.PP
The filter accepts the following options:
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
Output video width.
default value is \f(CW\*(C`iw\*(C'\fR. See below
for the list of accepted constants.
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
Output video height.
default value is \f(CW\*(C`ih\*(C'\fR.
See below for the list of accepted constants.
.IP "\fBinterl\fR" 4
.IX Item "interl"
Set the interlacing. It accepts the following values:
.RS 4
.IP "\fB1\fR" 4
.IX Item "1"
force interlaced aware scaling
.IP "\fB0\fR" 4
.IX Item "0"
do not apply interlaced scaling
.IP "\fB\-1\fR" 4
.IX Item "-1"
select interlaced aware scaling depending on whether the source frames
are flagged as interlaced or not
.RE
.RS 4
.Sp
Default value is \f(CW0\fR.
.RE
.IP "\fBflags\fR" 4
.IX Item "flags"
Set libswscale scaling flags. If not explictly specified the filter
applies a bilinear scaling algorithm.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the video size, the value must be a valid abbreviation or in the
form \fIwidth\fRx\fIheight\fR.
.PP
The values of the \fIw\fR and \fIh\fR options are expressions
containing the following constants:
.IP "\fBin_w, in_h\fR" 4
.IX Item "in_w, in_h"
the input width and height
.IP "\fBiw, ih\fR" 4
.IX Item "iw, ih"
same as \fIin_w\fR and \fIin_h\fR
.IP "\fBout_w, out_h\fR" 4
.IX Item "out_w, out_h"
the output (cropped) width and height
.IP "\fBow, oh\fR" 4
.IX Item "ow, oh"
same as \fIout_w\fR and \fIout_h\fR
.IP "\fBa\fR" 4
.IX Item "a"
same as \fIiw\fR / \fIih\fR
.IP "\fBsar\fR" 4
.IX Item "sar"
input sample aspect ratio
.IP "\fBdar\fR" 4
.IX Item "dar"
input display aspect ratio, it is the same as (\fIiw\fR / \fIih\fR) * \fIsar\fR
.IP "\fBhsub, vsub\fR" 4
.IX Item "hsub, vsub"
horizontal and vertical chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.PP
If the input image format is different from the format requested by
the next filter, the scale filter will convert the input to the
requested format.
.PP
If the value for \fIw\fR or \fIh\fR is 0, the respective input
size is used for the output.
.PP
If the value for \fIw\fR or \fIh\fR is \-1, the scale filter will use, for the
respective output size, a value that maintains the aspect ratio of the input
image.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Scale the input video to a size of 200x100:
.Sp
.Vb 1
\&        scale=w=200:h=100
.Ve
.Sp
This is equivalent to:
.Sp
.Vb 1
\&        scale=w=200:h=100
.Ve
.Sp
or:
.Sp
.Vb 1
\&        scale=200x100
.Ve
.IP "\(bu" 4
Specify a size abbreviation for the output size:
.Sp
.Vb 1
\&        scale=qcif
.Ve
.Sp
which can also be written as:
.Sp
.Vb 1
\&        scale=size=qcif
.Ve
.IP "\(bu" 4
Scale the input to 2x:
.Sp
.Vb 1
\&        scale=w=2*iw:h=2*ih
.Ve
.IP "\(bu" 4
The above is the same as:
.Sp
.Vb 1
\&        scale=2*in_w:2*in_h
.Ve
.IP "\(bu" 4
Scale the input to 2x with forced interlaced scaling:
.Sp
.Vb 1
\&        scale=2*iw:2*ih:interl=1
.Ve
.IP "\(bu" 4
Scale the input to half size:
.Sp
.Vb 1
\&        scale=w=iw/2:h=ih/2
.Ve
.IP "\(bu" 4
Increase the width, and set the height to the same size:
.Sp
.Vb 1
\&        scale=3/2*iw:ow
.Ve
.IP "\(bu" 4
Seek for Greek harmony:
.Sp
.Vb 2
\&        scale=iw:1/PHI*iw
\&        scale=ih*PHI:ih
.Ve
.IP "\(bu" 4
Increase the height, and set the width to 3/2 of the height:
.Sp
.Vb 1
\&        scale=w=3/2*oh:h=3/5*ih
.Ve
.IP "\(bu" 4
Increase the size, but make the size a multiple of the chroma
subsample values:
.Sp
.Vb 1
\&        scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
.Ve
.IP "\(bu" 4
Increase the width to a maximum of 500 pixels, keep the same input
aspect ratio:
.Sp
.Vb 1
\&        scale=w=\*(Aqmin(500\e, iw*3/2):h=\-1\*(Aq
.Ve
.SS "separatefields"
.IX Subsection "separatefields"
The \f(CW\*(C`separatefields\*(C'\fR takes a frame-based video input and splits
each frame into its components fields, producing a new half height clip
with twice the frame rate and twice the frame count.
.PP
This filter use field-dominance information in frame to decide which
of each pair of fields to place first in the output.
If it gets it wrong use setfield filter before \f(CW\*(C`separatefields\*(C'\fR filter.
.SS "setdar, setsar"
.IX Subsection "setdar, setsar"
The \f(CW\*(C`setdar\*(C'\fR filter sets the Display Aspect Ratio for the filter
output video.
.PP
This is done by changing the specified Sample (aka Pixel) Aspect
Ratio, according to the following equation:
.PP
.Vb 1
\&        <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
.Ve
.PP
Keep in mind that the \f(CW\*(C`setdar\*(C'\fR filter does not modify the pixel
dimensions of the video frame. Also the display aspect ratio set by
this filter may be changed by later filters in the filterchain,
e.g. in case of scaling or if another \*(L"setdar\*(R" or a \*(L"setsar\*(R" filter is
applied.
.PP
The \f(CW\*(C`setsar\*(C'\fR filter sets the Sample (aka Pixel) Aspect Ratio for
the filter output video.
.PP
Note that as a consequence of the application of this filter, the
output display aspect ratio will change according to the equation
above.
.PP
Keep in mind that the sample aspect ratio set by the \f(CW\*(C`setsar\*(C'\fR
filter may be changed by later filters in the filterchain, e.g. if
another \*(L"setsar\*(R" or a \*(L"setdar\*(R" filter is applied.
.PP
The filters accept the following options:
.ie n .IP "\fBr, ratio, dar (\fB""setdar""\fB only), sar (\f(BI""setsar""\fB only)\fR" 4
.el .IP "\fBr, ratio, dar (\f(CBsetdar\fB only), sar (\f(CBsetsar\fB only)\fR" 4
.IX Item "r, ratio, dar (setdar only), sar (setsar only)"
Set the aspect ratio used by the filter.
.Sp
The parameter can be a floating point number string, an expression, or
a string of the form \fInum\fR:\fIden\fR, where \fInum\fR and
\&\fIden\fR are the numerator and denominator of the aspect ratio. If
the parameter is not specified, it is assumed the value \*(L"0\*(R".
In case the form "\fInum\fR:\fIden\fR" is used, the \f(CW\*(C`:\*(C'\fR character
should be escaped.
.IP "\fBmax\fR" 4
.IX Item "max"
Set the maximum integer value to use for expressing numerator and
denominator when reducing the expressed aspect ratio to a rational.
Default value is \f(CW100\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
To change the display aspect ratio to 16:9, specify one of the following:
.Sp
.Vb 3
\&        setdar=dar=1.77777
\&        setdar=dar=16/9
\&        setdar=dar=1.77777
.Ve
.IP "\(bu" 4
To change the sample aspect ratio to 10:11, specify:
.Sp
.Vb 1
\&        setsar=sar=10/11
.Ve
.IP "\(bu" 4
To set a display aspect ratio of 16:9, and specify a maximum integer value of
1000 in the aspect ratio reduction, use the command:
.Sp
.Vb 1
\&        setdar=ratio=16/9:max=1000
.Ve
.SS "setfield"
.IX Subsection "setfield"
Force field for the output video frame.
.PP
The \f(CW\*(C`setfield\*(C'\fR filter marks the interlace type field for the
output frames. It does not change the input frame, but only sets the
corresponding property, which affects how the frame is treated by
following filters (e.g. \f(CW\*(C`fieldorder\*(C'\fR or \f(CW\*(C`yadif\*(C'\fR).
.PP
The filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Available values are:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
Keep the same field property.
.IP "\fBbff\fR" 4
.IX Item "bff"
Mark the frame as bottom-field-first.
.IP "\fBtff\fR" 4
.IX Item "tff"
Mark the frame as top-field-first.
.IP "\fBprog\fR" 4
.IX Item "prog"
Mark the frame as progressive.
.RE
.RS 4
.RE
.SS "showinfo"
.IX Subsection "showinfo"
Show a line containing various information for each input video frame.
The input video is not modified.
.PP
The shown line contains a sequence of key/value pairs of the form
\&\fIkey\fR:\fIvalue\fR.
.PP
A description of each shown parameter follows:
.IP "\fBn\fR" 4
.IX Item "n"
sequential number of the input frame, starting from 0
.IP "\fBpts\fR" 4
.IX Item "pts"
Presentation TimeStamp of the input frame, expressed as a number of
time base units. The time base unit depends on the filter input pad.
.IP "\fBpts_time\fR" 4
.IX Item "pts_time"
Presentation TimeStamp of the input frame, expressed as a number of
seconds
.IP "\fBpos\fR" 4
.IX Item "pos"
position of the frame in the input stream, \-1 if this information in
unavailable and/or meaningless (for example in case of synthetic video)
.IP "\fBfmt\fR" 4
.IX Item "fmt"
pixel format name
.IP "\fBsar\fR" 4
.IX Item "sar"
sample aspect ratio of the input frame, expressed in the form
\&\fInum\fR/\fIden\fR
.IP "\fBs\fR" 4
.IX Item "s"
size of the input frame, expressed in the form
\&\fIwidth\fRx\fIheight\fR
.IP "\fBi\fR" 4
.IX Item "i"
interlaced mode (\*(L"P\*(R" for \*(L"progressive\*(R", \*(L"T\*(R" for top field first, \*(L"B\*(R"
for bottom field first)
.IP "\fBiskey\fR" 4
.IX Item "iskey"
1 if the frame is a key frame, 0 otherwise
.IP "\fBtype\fR" 4
.IX Item "type"
picture type of the input frame (\*(L"I\*(R" for an I\-frame, \*(L"P\*(R" for a
P\-frame, \*(L"B\*(R" for a B\-frame, \*(L"?\*(R" for unknown type).
Check also the documentation of the \f(CW\*(C`AVPictureType\*(C'\fR enum and of
the \f(CW\*(C`av_get_picture_type_char\*(C'\fR function defined in
\&\fIlibavutil/avutil.h\fR.
.IP "\fBchecksum\fR" 4
.IX Item "checksum"
Adler\-32 checksum (printed in hexadecimal) of all the planes of the input frame
.IP "\fBplane_checksum\fR" 4
.IX Item "plane_checksum"
Adler\-32 checksum (printed in hexadecimal) of each plane of the input frame,
expressed in the form "[\fIc0\fR \fIc1\fR \fIc2\fR \fIc3\fR]"
.SS "smartblur"
.IX Subsection "smartblur"
Blur the input video without impacting the outlines.
.PP
The filter accepts the following options:
.IP "\fBluma_radius, lr\fR" 4
.IX Item "luma_radius, lr"
Set the luma radius. The option value must be a float number in
the range [0.1,5.0] that specifies the variance of the gaussian filter
used to blur the image (slower if larger). Default value is 1.0.
.IP "\fBluma_strength, ls\fR" 4
.IX Item "luma_strength, ls"
Set the luma strength. The option value must be a float number
in the range [\-1.0,1.0] that configures the blurring. A value included
in [0.0,1.0] will blur the image whereas a value included in
[\-1.0,0.0] will sharpen the image. Default value is 1.0.
.IP "\fBluma_threshold, lt\fR" 4
.IX Item "luma_threshold, lt"
Set the luma threshold used as a coefficient to determine
whether a pixel should be blurred or not. The option value must be an
integer in the range [\-30,30]. A value of 0 will filter all the image,
a value included in [0,30] will filter flat areas and a value included
in [\-30,0] will filter edges. Default value is 0.
.IP "\fBchroma_radius, cr\fR" 4
.IX Item "chroma_radius, cr"
Set the chroma radius. The option value must be a float number in
the range [0.1,5.0] that specifies the variance of the gaussian filter
used to blur the image (slower if larger). Default value is 1.0.
.IP "\fBchroma_strength, cs\fR" 4
.IX Item "chroma_strength, cs"
Set the chroma strength. The option value must be a float number
in the range [\-1.0,1.0] that configures the blurring. A value included
in [0.0,1.0] will blur the image whereas a value included in
[\-1.0,0.0] will sharpen the image. Default value is 1.0.
.IP "\fBchroma_threshold, ct\fR" 4
.IX Item "chroma_threshold, ct"
Set the chroma threshold used as a coefficient to determine
whether a pixel should be blurred or not. The option value must be an
integer in the range [\-30,30]. A value of 0 will filter all the image,
a value included in [0,30] will filter flat areas and a value included
in [\-30,0] will filter edges. Default value is 0.
.PP
If a chroma option is not explicitly set, the corresponding luma value
is set.
.SS "stereo3d"
.IX Subsection "stereo3d"
Convert between different stereoscopic image formats.
.PP
The filters accept the following options:
.IP "\fBin\fR" 4
.IX Item "in"
Set stereoscopic image format of input.
.Sp
Available values for input image formats are:
.RS 4
.IP "\fBsbsl\fR" 4
.IX Item "sbsl"
side by side parallel (left eye left, right eye right)
.IP "\fBsbsr\fR" 4
.IX Item "sbsr"
side by side crosseye (right eye left, left eye right)
.IP "\fBsbs2l\fR" 4
.IX Item "sbs2l"
side by side parallel with half width resolution
(left eye left, right eye right)
.IP "\fBsbs2r\fR" 4
.IX Item "sbs2r"
side by side crosseye with half width resolution
(right eye left, left eye right)
.IP "\fBabl\fR" 4
.IX Item "abl"
above-below (left eye above, right eye below)
.IP "\fBabr\fR" 4
.IX Item "abr"
above-below (right eye above, left eye below)
.IP "\fBab2l\fR" 4
.IX Item "ab2l"
above-below with half height resolution
(left eye above, right eye below)
.IP "\fBab2r\fR" 4
.IX Item "ab2r"
above-below with half height resolution
(right eye above, left eye below)
.Sp
Default value is \fBsbsl\fR.
.RE
.RS 4
.RE
.IP "\fBout\fR" 4
.IX Item "out"
Set stereoscopic image format of output.
.Sp
Available values for output image formats are all the input formats as well as:
.RS 4
.IP "\fBarbg\fR" 4
.IX Item "arbg"
anaglyph red/blue gray
(red filter on left eye, blue filter on right eye)
.IP "\fBargg\fR" 4
.IX Item "argg"
anaglyph red/green gray
(red filter on left eye, green filter on right eye)
.IP "\fBarcg\fR" 4
.IX Item "arcg"
anaglyph red/cyan gray
(red filter on left eye, cyan filter on right eye)
.IP "\fBarch\fR" 4
.IX Item "arch"
anaglyph red/cyan half colored
(red filter on left eye, cyan filter on right eye)
.IP "\fBarcc\fR" 4
.IX Item "arcc"
anaglyph red/cyan color
(red filter on left eye, cyan filter on right eye)
.IP "\fBarcd\fR" 4
.IX Item "arcd"
anaglyph red/cyan color optimized with the least squares projection of dubois
(red filter on left eye, cyan filter on right eye)
.IP "\fBagmg\fR" 4
.IX Item "agmg"
anaglyph green/magenta gray
(green filter on left eye, magenta filter on right eye)
.IP "\fBagmh\fR" 4
.IX Item "agmh"
anaglyph green/magenta half colored
(green filter on left eye, magenta filter on right eye)
.IP "\fBagmc\fR" 4
.IX Item "agmc"
anaglyph green/magenta colored
(green filter on left eye, magenta filter on right eye)
.IP "\fBagmd\fR" 4
.IX Item "agmd"
anaglyph green/magenta color optimized with the least squares projection of dubois
(green filter on left eye, magenta filter on right eye)
.IP "\fBaybg\fR" 4
.IX Item "aybg"
anaglyph yellow/blue gray
(yellow filter on left eye, blue filter on right eye)
.IP "\fBaybh\fR" 4
.IX Item "aybh"
anaglyph yellow/blue half colored
(yellow filter on left eye, blue filter on right eye)
.IP "\fBaybc\fR" 4
.IX Item "aybc"
anaglyph yellow/blue colored
(yellow filter on left eye, blue filter on right eye)
.IP "\fBaybd\fR" 4
.IX Item "aybd"
anaglyph yellow/blue color optimized with the least squares projection of dubois
(yellow filter on left eye, blue filter on right eye)
.IP "\fBirl\fR" 4
.IX Item "irl"
interleaved rows (left eye has top row, right eye starts on next row)
.IP "\fBirr\fR" 4
.IX Item "irr"
interleaved rows (right eye has top row, left eye starts on next row)
.IP "\fBml\fR" 4
.IX Item "ml"
mono output (left eye only)
.IP "\fBmr\fR" 4
.IX Item "mr"
mono output (right eye only)
.RE
.RS 4
.Sp
Default value is \fBarcd\fR.
.RE
.SS "subtitles"
.IX Subsection "subtitles"
Draw subtitles on top of input video using the libass library.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libass\*(C'\fR. This filter also requires a build with libavcodec and
libavformat to convert the passed subtitles file to \s-1ASS\s0 (Advanced Substation
Alpha) subtitles format.
.PP
The filter accepts the following options:
.IP "\fBfilename, f\fR" 4
.IX Item "filename, f"
Set the filename of the subtitle file to read. It must be specified.
.IP "\fBoriginal_size\fR" 4
.IX Item "original_size"
Specify the size of the original video, the video for which the \s-1ASS\s0 file
was composed. Due to a misdesign in \s-1ASS\s0 aspect ratio arithmetic, this is
necessary to correctly scale the fonts if the aspect ratio has been changed.
.IP "\fBcharenc\fR" 4
.IX Item "charenc"
Set subtitles input character encoding. \f(CW\*(C`subtitles\*(C'\fR filter only. Only
useful if not \s-1UTF\-8\s0.
.PP
If the first key is not specified, it is assumed that the first value
specifies the \fBfilename\fR.
.PP
For example, to render the file \fIsub.srt\fR on top of the input
video, use the command:
.PP
.Vb 1
\&        subtitles=sub.srt
.Ve
.PP
which is equivalent to:
.PP
.Vb 1
\&        subtitles=filename=sub.srt
.Ve
.SS "super2xsai"
.IX Subsection "super2xsai"
Scale the input by 2x and smooth using the Super2xSaI (Scale and
Interpolate) pixel art scaling algorithm.
.PP
Useful for enlarging pixel art images without reducing sharpness.
.SS "swapuv"
.IX Subsection "swapuv"
Swap U & V plane.
.SS "telecine"
.IX Subsection "telecine"
Apply telecine process to the video.
.PP
This filter accepts the following options:
.IP "\fBfirst_field\fR" 4
.IX Item "first_field"
.RS 4
.PD 0
.IP "\fBtop, t\fR" 4
.IX Item "top, t"
.PD
top field first
.IP "\fBbottom, b\fR" 4
.IX Item "bottom, b"
bottom field first
The default value is \f(CW\*(C`top\*(C'\fR.
.RE
.RS 4
.RE
.IP "\fBpattern\fR" 4
.IX Item "pattern"
A string of numbers representing the pulldown pattern you wish to apply.
The default value is \f(CW23\fR.
.PP
.Vb 1
\&        Some typical patterns:
\&        
\&        NTSC output (30i):
\&        27.5p: 32222
\&        24p: 23 (classic)
\&        24p: 2332 (preferred)
\&        20p: 33
\&        18p: 334
\&        16p: 3444
\&        
\&        PAL output (25i):
\&        27.5p: 12222
\&        24p: 222222222223 ("Euro pulldown")
\&        16.67p: 33
\&        16p: 33333334
.Ve
.SS "thumbnail"
.IX Subsection "thumbnail"
Select the most representative frame in a given sequence of consecutive frames.
.PP
The filter accepts the following options:
.IP "\fBn\fR" 4
.IX Item "n"
Set the frames batch size to analyze; in a set of \fIn\fR frames, the filter
will pick one of them, and then handle the next batch of \fIn\fR frames until
the end. Default is \f(CW100\fR.
.PP
Since the filter keeps track of the whole frames sequence, a bigger \fIn\fR
value will result in a higher memory usage, so a high value is not recommended.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Extract one picture each 50 frames:
.Sp
.Vb 1
\&        thumbnail=50
.Ve
.IP "\(bu" 4
Complete example of a thumbnail creation with \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i in.avi \-vf thumbnail,scale=300:200 \-frames:v 1 out.png
.Ve
.SS "tile"
.IX Subsection "tile"
Tile several successive frames together.
.PP
The filter accepts the following options:
.IP "\fBlayout\fR" 4
.IX Item "layout"
Set the grid size (i.e. the number of lines and columns) in the form
"\fIw\fRx\fIh\fR".
.IP "\fBnb_frames\fR" 4
.IX Item "nb_frames"
Set the maximum number of frames to render in the given area. It must be less
than or equal to \fIw\fRx\fIh\fR. The default value is \f(CW0\fR, meaning all
the area will be used.
.IP "\fBmargin\fR" 4
.IX Item "margin"
Set the outer border margin in pixels.
.IP "\fBpadding\fR" 4
.IX Item "padding"
Set the inner border thickness (i.e. the number of pixels between frames). For
more advanced padding options (such as having different values for the edges),
refer to the pad video filter.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Produce 8x8 \s-1PNG\s0 tiles of all keyframes (\fB\-skip_frame nokey\fR) in a movie:
.Sp
.Vb 1
\&        ffmpeg \-skip_frame nokey \-i file.avi \-vf \*(Aqscale=128:72,tile=8x8\*(Aq \-an \-vsync 0 keyframes%03d.png
.Ve
.Sp
The \fB\-vsync 0\fR is necessary to prevent \fBffmpeg\fR from
duplicating each output frame to accomodate the originally detected frame
rate.
.IP "\(bu" 4
Display \f(CW5\fR pictures in an area of \f(CW\*(C`3x2\*(C'\fR frames,
with \f(CW7\fR pixels between them, and \f(CW2\fR pixels of initial margin, using
mixed flat and named options:
.Sp
.Vb 1
\&        tile=3x2:nb_frames=5:padding=7:margin=2
.Ve
.SS "tinterlace"
.IX Subsection "tinterlace"
Perform various types of temporal field interlacing.
.PP
Frames are counted starting from 1, so the first input frame is
considered odd.
.PP
The filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Specify the mode of the interlacing. This option can also be specified
as a value alone. See below for a list of values for this option.
.Sp
Available values are:
.RS 4
.IP "\fBmerge, 0\fR" 4
.IX Item "merge, 0"
Move odd frames into the upper field, even into the lower field,
generating a double height frame at half frame rate.
.IP "\fBdrop_odd, 1\fR" 4
.IX Item "drop_odd, 1"
Only output even frames, odd frames are dropped, generating a frame with
unchanged height at half frame rate.
.IP "\fBdrop_even, 2\fR" 4
.IX Item "drop_even, 2"
Only output odd frames, even frames are dropped, generating a frame with
unchanged height at half frame rate.
.IP "\fBpad, 3\fR" 4
.IX Item "pad, 3"
Expand each frame to full height, but pad alternate lines with black,
generating a frame with double height at the same input frame rate.
.IP "\fBinterleave_top, 4\fR" 4
.IX Item "interleave_top, 4"
Interleave the upper field from odd frames with the lower field from
even frames, generating a frame with unchanged height at half frame rate.
.IP "\fBinterleave_bottom, 5\fR" 4
.IX Item "interleave_bottom, 5"
Interleave the lower field from odd frames with the upper field from
even frames, generating a frame with unchanged height at half frame rate.
.IP "\fBinterlacex2, 6\fR" 4
.IX Item "interlacex2, 6"
Double frame rate with unchanged height. Frames are inserted each
containing the second temporal field from the previous input frame and
the first temporal field from the next input frame. This mode relies on
the top_field_first flag. Useful for interlaced video displays with no
field synchronisation.
.RE
.RS 4
.Sp
Numeric values are deprecated but are accepted for backward
compatibility reasons.
.Sp
Default mode is \f(CW\*(C`merge\*(C'\fR.
.RE
.IP "\fBflags\fR" 4
.IX Item "flags"
Specify flags influencing the filter process.
.Sp
Available value for \fIflags\fR is:
.RS 4
.IP "\fBlow_pass_filter, vlfp\fR" 4
.IX Item "low_pass_filter, vlfp"
Enable vertical low-pass filtering in the filter.
Vertical low-pass filtering is required when creating an interlaced
destination from a progressive source which contains high-frequency
vertical detail. Filtering will reduce interlace 'twitter' and Moire
patterning.
.Sp
Vertical low-pass filtering can only be enabled for \fBmode\fR
\&\fIinterleave_top\fR and \fIinterleave_bottom\fR.
.RE
.RS 4
.RE
.SS "transpose"
.IX Subsection "transpose"
Transpose rows with columns in the input video and optionally flip it.
.PP
This filter accepts the following options:
.IP "\fBdir\fR" 4
.IX Item "dir"
The direction of the transpose.
.RS 4
.IP "\fB0, 4, cclock_flip\fR" 4
.IX Item "0, 4, cclock_flip"
Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
.Sp
.Vb 3
\&        L.R     L.l
\&        . . \->  . .
\&        l.r     R.r
.Ve
.IP "\fB1, 5, clock\fR" 4
.IX Item "1, 5, clock"
Rotate by 90 degrees clockwise, that is:
.Sp
.Vb 3
\&        L.R     l.L
\&        . . \->  . .
\&        l.r     r.R
.Ve
.IP "\fB2, 6, cclock\fR" 4
.IX Item "2, 6, cclock"
Rotate by 90 degrees counterclockwise, that is:
.Sp
.Vb 3
\&        L.R     R.r
\&        . . \->  . .
\&        l.r     L.l
.Ve
.IP "\fB3, 7, clock_flip\fR" 4
.IX Item "3, 7, clock_flip"
Rotate by 90 degrees clockwise and vertically flip, that is:
.Sp
.Vb 3
\&        L.R     r.R
\&        . . \->  . .
\&        l.r     l.L
.Ve
.RE
.RS 4
.Sp
For values between 4\-7, the transposition is only done if the input
video geometry is portrait and not landscape. These values are
deprecated, the \f(CW\*(C`passthrough\*(C'\fR option should be used instead.
.RE
.IP "\fBpassthrough\fR" 4
.IX Item "passthrough"
Do not apply the transposition if the input geometry matches the one
specified by the specified value. It accepts the following values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Always apply transposition.
.IP "\fBportrait\fR" 4
.IX Item "portrait"
Preserve portrait geometry (when \fIheight\fR >= \fIwidth\fR).
.IP "\fBlandscape\fR" 4
.IX Item "landscape"
Preserve landscape geometry (when \fIwidth\fR >= \fIheight\fR).
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`none\*(C'\fR.
.RE
.PP
For example to rotate by 90 degrees clockwise and preserve portrait
layout:
.PP
.Vb 1
\&        transpose=dir=1:passthrough=portrait
.Ve
.PP
The command above can also be specified as:
.PP
.Vb 1
\&        transpose=1:portrait
.Ve
.SS "unsharp"
.IX Subsection "unsharp"
Sharpen or blur the input video.
.PP
It accepts the following parameters:
.IP "\fBluma_msize_x, lx\fR" 4
.IX Item "luma_msize_x, lx"
.PD 0
.IP "\fBchroma_msize_x, cx\fR" 4
.IX Item "chroma_msize_x, cx"
.PD
Set the luma/chroma matrix horizontal size. It must be an odd integer
between 3 and 63, default value is 5.
.IP "\fBluma_msize_y, ly\fR" 4
.IX Item "luma_msize_y, ly"
.PD 0
.IP "\fBchroma_msize_y, cy\fR" 4
.IX Item "chroma_msize_y, cy"
.PD
Set the luma/chroma matrix vertical size. It must be an odd integer
between 3 and 63, default value is 5.
.IP "\fBluma_amount, la\fR" 4
.IX Item "luma_amount, la"
.PD 0
.IP "\fBchroma_amount, ca\fR" 4
.IX Item "chroma_amount, ca"
.PD
Set the luma/chroma effect strength. It can be a float number,
reasonable values lay between \-1.5 and 1.5.
.Sp
Negative values will blur the input video, while positive values will
sharpen it, a value of zero will disable the effect.
.Sp
Default value is 1.0 for \fBluma_amount\fR, 0.0 for
\&\fBchroma_amount\fR.
.PP
All parameters are optional and default to the
equivalent of the string '5:5:1.0:5:5:0.0'.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply strong luma sharpen effect:
.Sp
.Vb 1
\&        unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
.Ve
.IP "\(bu" 4
Apply strong blur of both luma and chroma parameters:
.Sp
.Vb 1
\&        unsharp=7:7:\-2:7:7:\-2
.Ve
.SS "vflip"
.IX Subsection "vflip"
Flip the input video vertically.
.PP
.Vb 1
\&        ffmpeg \-i in.avi \-vf "vflip" out.avi
.Ve
.SS "yadif"
.IX Subsection "yadif"
Deinterlace the input video (\*(L"yadif\*(R" means \*(L"yet another deinterlacing
filter\*(R").
.PP
This filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
The interlacing mode to adopt, accepts one of the following values:
.RS 4
.IP "\fB0, send_frame\fR" 4
.IX Item "0, send_frame"
output 1 frame for each frame
.IP "\fB1, send_field\fR" 4
.IX Item "1, send_field"
output 1 frame for each field
.IP "\fB2, send_frame_nospatial\fR" 4
.IX Item "2, send_frame_nospatial"
like \f(CW\*(C`send_frame\*(C'\fR but skip spatial interlacing check
.IP "\fB3, send_field_nospatial\fR" 4
.IX Item "3, send_field_nospatial"
like \f(CW\*(C`send_field\*(C'\fR but skip spatial interlacing check
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`send_frame\*(C'\fR.
.RE
.IP "\fBparity\fR" 4
.IX Item "parity"
The picture field parity assumed for the input interlaced video, accepts one of
the following values:
.RS 4
.IP "\fB0, tff\fR" 4
.IX Item "0, tff"
assume top field first
.IP "\fB1, bff\fR" 4
.IX Item "1, bff"
assume bottom field first
.IP "\fB\-1, auto\fR" 4
.IX Item "-1, auto"
enable automatic detection
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`auto\*(C'\fR.
If interlacing is unknown or decoder does not export this information,
top field first will be assumed.
.RE
.IP "\fBdeint\fR" 4
.IX Item "deint"
Specify which frames to deinterlace. Accept one of the following
values:
.RS 4
.IP "\fB0, all\fR" 4
.IX Item "0, all"
deinterlace all frames
.IP "\fB1, interlaced\fR" 4
.IX Item "1, interlaced"
only deinterlace frames marked as interlaced
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`all\*(C'\fR.
.RE
.SH "VIDEO SOURCES"
.IX Header "VIDEO SOURCES"
Below is a description of the currently available video sources.
.SS "buffer"
.IX Subsection "buffer"
Buffer video frames, and make them available to the filter chain.
.PP
This source is mainly intended for a programmatic use, in particular
through the interface defined in \fIlibavfilter/vsrc_buffer.h\fR.
.PP
This source accepts the following options:
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Specify the size (width and height) of the buffered video frames.
.IP "\fBwidth\fR" 4
.IX Item "width"
Input video width.
.IP "\fBheight\fR" 4
.IX Item "height"
Input video height.
.IP "\fBpix_fmt\fR" 4
.IX Item "pix_fmt"
A string representing the pixel format of the buffered video frames.
It may be a number corresponding to a pixel format, or a pixel format
name.
.IP "\fBtime_base\fR" 4
.IX Item "time_base"
Specify the timebase assumed by the timestamps of the buffered frames.
.IP "\fBframe_rate\fR" 4
.IX Item "frame_rate"
Specify the frame rate expected for the video stream.
.IP "\fBpixel_aspect, sar\fR" 4
.IX Item "pixel_aspect, sar"
Specify the sample aspect ratio assumed by the video frames.
.IP "\fBsws_param\fR" 4
.IX Item "sws_param"
Specify the optional parameters to be used for the scale filter which
is automatically inserted when an input change is detected in the
input size or format.
.PP
For example:
.PP
.Vb 1
\&        buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
.Ve
.PP
will instruct the source to accept video frames with size 320x240 and
with format \*(L"yuv410p\*(R", assuming 1/24 as the timestamps timebase and
square pixels (1:1 sample aspect ratio).
Since the pixel format with name \*(L"yuv410p\*(R" corresponds to the number 6
(check the enum AVPixelFormat definition in \fIlibavutil/pixfmt.h\fR),
this example corresponds to:
.PP
.Vb 1
\&        buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
.Ve
.PP
Alternatively, the options can be specified as a flat string, but this
syntax is deprecated:
.PP
\&\fIwidth\fR:\fIheight\fR:\fIpix_fmt\fR:\fItime_base.num\fR:\fItime_base.den\fR:\fIpixel_aspect.num\fR:\fIpixel_aspect.den\fR[:\fIsws_param\fR]
.SS "cellauto"
.IX Subsection "cellauto"
Create a pattern generated by an elementary cellular automaton.
.PP
The initial state of the cellular automaton can be defined through the
\&\fBfilename\fR, and \fBpattern\fR options. If such options are
not specified an initial state is created randomly.
.PP
At each new frame a new row in the video is filled with the result of
the cellular automaton next generation. The behavior when the whole
frame is filled is defined by the \fBscroll\fR option.
.PP
This source accepts the following options:
.IP "\fBfilename, f\fR" 4
.IX Item "filename, f"
Read the initial cellular automaton state, i.e. the starting row, from
the specified file.
In the file, each non-whitespace character is considered an alive
cell, a newline will terminate the row, and further characters in the
file will be ignored.
.IP "\fBpattern, p\fR" 4
.IX Item "pattern, p"
Read the initial cellular automaton state, i.e. the starting row, from
the specified string.
.Sp
Each non-whitespace character in the string is considered an alive
cell, a newline will terminate the row, and further characters in the
string will be ignored.
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set the video rate, that is the number of frames generated per second.
Default is 25.
.IP "\fBrandom_fill_ratio, ratio\fR" 4
.IX Item "random_fill_ratio, ratio"
Set the random fill ratio for the initial cellular automaton row. It
is a floating point number value ranging from 0 to 1, defaults to
1/PHI.
.Sp
This option is ignored when a file or a pattern is specified.
.IP "\fBrandom_seed, seed\fR" 4
.IX Item "random_seed, seed"
Set the seed for filling randomly the initial row, must be an integer
included between 0 and \s-1UINT32_MAX\s0. If not specified, or if explicitly
set to \-1, the filter will try to use a good random seed on a best
effort basis.
.IP "\fBrule\fR" 4
.IX Item "rule"
Set the cellular automaton rule, it is a number ranging from 0 to 255.
Default value is 110.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the size of the output video.
.Sp
If \fBfilename\fR or \fBpattern\fR is specified, the size is set
by default to the width of the specified initial state row, and the
height is set to \fIwidth\fR * \s-1PHI\s0.
.Sp
If \fBsize\fR is set, it must contain the width of the specified
pattern string, and the specified pattern will be centered in the
larger row.
.Sp
If a filename or a pattern string is not specified, the size value
defaults to \*(L"320x518\*(R" (used for a randomly generated initial state).
.IP "\fBscroll\fR" 4
.IX Item "scroll"
If set to 1, scroll the output upward when all the rows in the output
have been already filled. If set to 0, the new generated row will be
written over the top row just after the bottom row is filled.
Defaults to 1.
.IP "\fBstart_full, full\fR" 4
.IX Item "start_full, full"
If set to 1, completely fill the output with generated rows before
outputting the first frame.
This is the default behavior, for disabling set the value to 0.
.IP "\fBstitch\fR" 4
.IX Item "stitch"
If set to 1, stitch the left and right row edges together.
This is the default behavior, for disabling set the value to 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Read the initial state from \fIpattern\fR, and specify an output of
size 200x400.
.Sp
.Vb 1
\&        cellauto=f=pattern:s=200x400
.Ve
.IP "\(bu" 4
Generate a random initial row with a width of 200 cells, with a fill
ratio of 2/3:
.Sp
.Vb 1
\&        cellauto=ratio=2/3:s=200x200
.Ve
.IP "\(bu" 4
Create a pattern generated by rule 18 starting by a single alive cell
centered on an initial row with width 100:
.Sp
.Vb 1
\&        cellauto=p=@s=100x400:full=0:rule=18
.Ve
.IP "\(bu" 4
Specify a more elaborated initial pattern:
.Sp
.Vb 1
\&        cellauto=p=\*(Aq@@ @ @@\*(Aq:s=100x400:full=0:rule=18
.Ve
.SS "mandelbrot"
.IX Subsection "mandelbrot"
Generate a Mandelbrot set fractal, and progressively zoom towards the
point specified with \fIstart_x\fR and \fIstart_y\fR.
.PP
This source accepts the following options:
.IP "\fBend_pts\fR" 4
.IX Item "end_pts"
Set the terminal pts value. Default value is 400.
.IP "\fBend_scale\fR" 4
.IX Item "end_scale"
Set the terminal scale value.
Must be a floating point value. Default value is 0.3.
.IP "\fBinner\fR" 4
.IX Item "inner"
Set the inner coloring mode, that is the algorithm used to draw the
Mandelbrot fractal internal region.
.Sp
It shall assume one of the following values:
.RS 4
.IP "\fBblack\fR" 4
.IX Item "black"
Set black mode.
.IP "\fBconvergence\fR" 4
.IX Item "convergence"
Show time until convergence.
.IP "\fBmincol\fR" 4
.IX Item "mincol"
Set color based on point closest to the origin of the iterations.
.IP "\fBperiod\fR" 4
.IX Item "period"
Set period mode.
.RE
.RS 4
.Sp
Default value is \fImincol\fR.
.RE
.IP "\fBbailout\fR" 4
.IX Item "bailout"
Set the bailout value. Default value is 10.0.
.IP "\fBmaxiter\fR" 4
.IX Item "maxiter"
Set the maximum of iterations performed by the rendering
algorithm. Default value is 7189.
.IP "\fBouter\fR" 4
.IX Item "outer"
Set outer coloring mode.
It shall assume one of following values:
.RS 4
.IP "\fBiteration_count\fR" 4
.IX Item "iteration_count"
Set iteration cound mode.
.IP "\fBnormalized_iteration_count\fR" 4
.IX Item "normalized_iteration_count"
set normalized iteration count mode.
.RE
.RS 4
.Sp
Default value is \fInormalized_iteration_count\fR.
.RE
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set frame rate, expressed as number of frames per second. Default
value is \*(L"25\*(R".
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set frame size. Default value is \*(L"640x480\*(R".
.IP "\fBstart_scale\fR" 4
.IX Item "start_scale"
Set the initial scale value. Default value is 3.0.
.IP "\fBstart_x\fR" 4
.IX Item "start_x"
Set the initial x position. Must be a floating point value between
\&\-100 and 100. Default value is \-0.743643887037158704752191506114774.
.IP "\fBstart_y\fR" 4
.IX Item "start_y"
Set the initial y position. Must be a floating point value between
\&\-100 and 100. Default value is \-0.131825904205311970493132056385139.
.SS "mptestsrc"
.IX Subsection "mptestsrc"
Generate various test patterns, as generated by the MPlayer test filter.
.PP
The size of the generated video is fixed, and is 256x256.
This source is useful in particular for testing encoding features.
.PP
This source accepts the following options:
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Specify the frame rate of the sourced video, as the number of frames
generated per second. It has to be a string in the format
\&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float
number or a valid video frame rate abbreviation. The default value is
\&\*(L"25\*(R".
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Set the video duration of the sourced video. The accepted syntax is:
.Sp
.Vb 2
\&        [\-]HH:MM:SS[.m...]
\&        [\-]S+[.m...]
.Ve
.Sp
See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
.Sp
If not specified, or the expressed duration is negative, the video is
supposed to be generated forever.
.IP "\fBtest, t\fR" 4
.IX Item "test, t"
Set the number or the name of the test to perform. Supported tests are:
.RS 4
.IP "\fBdc_luma\fR" 4
.IX Item "dc_luma"
.PD 0
.IP "\fBdc_chroma\fR" 4
.IX Item "dc_chroma"
.IP "\fBfreq_luma\fR" 4
.IX Item "freq_luma"
.IP "\fBfreq_chroma\fR" 4
.IX Item "freq_chroma"
.IP "\fBamp_luma\fR" 4
.IX Item "amp_luma"
.IP "\fBamp_chroma\fR" 4
.IX Item "amp_chroma"
.IP "\fBcbp\fR" 4
.IX Item "cbp"
.IP "\fBmv\fR" 4
.IX Item "mv"
.IP "\fBring1\fR" 4
.IX Item "ring1"
.IP "\fBring2\fR" 4
.IX Item "ring2"
.IP "\fBall\fR" 4
.IX Item "all"
.RE
.RS 4
.PD
.Sp
Default value is \*(L"all\*(R", which will cycle through the list of all tests.
.RE
.PP
For example the following:
.PP
.Vb 1
\&        testsrc=t=dc_luma
.Ve
.PP
will generate a \*(L"dc_luma\*(R" test pattern.
.SS "frei0r_src"
.IX Subsection "frei0r_src"
Provide a frei0r source.
.PP
To enable compilation of this filter you need to install the frei0r
header and configure FFmpeg with \f(CW\*(C`\-\-enable\-frei0r\*(C'\fR.
.PP
This source accepts the following options:
.IP "\fBsize\fR" 4
.IX Item "size"
The size of the video to generate, may be a string of the form
\&\fIwidth\fRx\fIheight\fR or a frame size abbreviation.
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Framerate of the generated video, may be a string of the form
\&\fInum\fR/\fIden\fR or a frame rate abbreviation.
.IP "\fBfilter_name\fR" 4
.IX Item "filter_name"
The name to the frei0r source to load. For more information regarding frei0r and
how to set the parameters read the section frei0r in the description of
the video filters.
.IP "\fBfilter_params\fR" 4
.IX Item "filter_params"
A '|'\-separated list of parameters to pass to the frei0r source.
.PP
For example, to generate a frei0r partik0l source with size 200x200
and frame rate 10 which is overlayed on the overlay filter main input:
.PP
.Vb 1
\&        frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
.Ve
.SS "life"
.IX Subsection "life"
Generate a life pattern.
.PP
This source is based on a generalization of John Conway's life game.
.PP
The sourced input represents a life grid, each pixel represents a cell
which can be in one of two possible states, alive or dead. Every cell
interacts with its eight neighbours, which are the cells that are
horizontally, vertically, or diagonally adjacent.
.PP
At each interaction the grid evolves according to the adopted rule,
which specifies the number of neighbor alive cells which will make a
cell stay alive or born. The \fBrule\fR option allows to specify
the rule to adopt.
.PP
This source accepts the following options:
.IP "\fBfilename, f\fR" 4
.IX Item "filename, f"
Set the file from which to read the initial grid state. In the file,
each non-whitespace character is considered an alive cell, and newline
is used to delimit the end of each row.
.Sp
If this option is not specified, the initial grid is generated
randomly.
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set the video rate, that is the number of frames generated per second.
Default is 25.
.IP "\fBrandom_fill_ratio, ratio\fR" 4
.IX Item "random_fill_ratio, ratio"
Set the random fill ratio for the initial random grid. It is a
floating point number value ranging from 0 to 1, defaults to 1/PHI.
It is ignored when a file is specified.
.IP "\fBrandom_seed, seed\fR" 4
.IX Item "random_seed, seed"
Set the seed for filling the initial random grid, must be an integer
included between 0 and \s-1UINT32_MAX\s0. If not specified, or if explicitly
set to \-1, the filter will try to use a good random seed on a best
effort basis.
.IP "\fBrule\fR" 4
.IX Item "rule"
Set the life rule.
.Sp
A rule can be specified with a code of the kind "S\fI\s-1NS\s0\fR/B\fI\s-1NB\s0\fR",
where \fI\s-1NS\s0\fR and \fI\s-1NB\s0\fR are sequences of numbers in the range 0\-8,
\&\fI\s-1NS\s0\fR specifies the number of alive neighbor cells which make a
live cell stay alive, and \fI\s-1NB\s0\fR the number of alive neighbor cells
which make a dead cell to become alive (i.e. to \*(L"born\*(R").
\&\*(L"s\*(R" and \*(L"b\*(R" can be used in place of \*(L"S\*(R" and \*(L"B\*(R", respectively.
.Sp
Alternatively a rule can be specified by an 18\-bits integer. The 9
high order bits are used to encode the next cell state if it is alive
for each number of neighbor alive cells, the low order bits specify
the rule for \*(L"borning\*(R" new cells. Higher order bits encode for an
higher number of neighbor cells.
For example the number 6153 = \f(CW\*(C`(12<<9)+9\*(C'\fR specifies a stay alive
rule of 12 and a born rule of 9, which corresponds to \*(L"S23/B03\*(R".
.Sp
Default value is \*(L"S23/B3\*(R", which is the original Conway's game of life
rule, and will keep a cell alive if it has 2 or 3 neighbor alive
cells, and will born a new cell if there are three alive cells around
a dead cell.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the size of the output video.
.Sp
If \fBfilename\fR is specified, the size is set by default to the
same size of the input file. If \fBsize\fR is set, it must contain
the size specified in the input file, and the initial grid defined in
that file is centered in the larger resulting area.
.Sp
If a filename is not specified, the size value defaults to \*(L"320x240\*(R"
(used for a randomly generated initial grid).
.IP "\fBstitch\fR" 4
.IX Item "stitch"
If set to 1, stitch the left and right grid edges together, and the
top and bottom edges also. Defaults to 1.
.IP "\fBmold\fR" 4
.IX Item "mold"
Set cell mold speed. If set, a dead cell will go from \fBdeath_color\fR to
\&\fBmold_color\fR with a step of \fBmold\fR. \fBmold\fR can have a
value from 0 to 255.
.IP "\fBlife_color\fR" 4
.IX Item "life_color"
Set the color of living (or new born) cells.
.IP "\fBdeath_color\fR" 4
.IX Item "death_color"
Set the color of dead cells. If \fBmold\fR is set, this is the first color
used to represent a dead cell.
.IP "\fBmold_color\fR" 4
.IX Item "mold_color"
Set mold color, for definitely dead and moldy cells.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Read a grid from \fIpattern\fR, and center it on a grid of size
300x300 pixels:
.Sp
.Vb 1
\&        life=f=pattern:s=300x300
.Ve
.IP "\(bu" 4
Generate a random grid of size 200x200, with a fill ratio of 2/3:
.Sp
.Vb 1
\&        life=ratio=2/3:s=200x200
.Ve
.IP "\(bu" 4
Specify a custom rule for evolving a randomly generated grid:
.Sp
.Vb 1
\&        life=rule=S14/B34
.Ve
.IP "\(bu" 4
Full example with slow death effect (mold) using \fBffplay\fR:
.Sp
.Vb 1
\&        ffplay \-f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
.Ve
.SS "color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc"
.IX Subsection "color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc"
The \f(CW\*(C`color\*(C'\fR source provides an uniformly colored input.
.PP
The \f(CW\*(C`nullsrc\*(C'\fR source returns unprocessed video frames. It is
mainly useful to be employed in analysis / debugging tools, or as the
source for filters which ignore the input data.
.PP
The \f(CW\*(C`rgbtestsrc\*(C'\fR source generates an \s-1RGB\s0 test pattern useful for
detecting \s-1RGB\s0 vs \s-1BGR\s0 issues. You should see a red, green and blue
stripe from top to bottom.
.PP
The \f(CW\*(C`smptebars\*(C'\fR source generates a color bars pattern, based on
the \s-1SMPTE\s0 Engineering Guideline \s-1EG\s0 1\-1990.
.PP
The \f(CW\*(C`smptehdbars\*(C'\fR source generates a color bars pattern, based on
the \s-1SMPTE\s0 \s-1RP\s0 219\-2002.
.PP
The \f(CW\*(C`testsrc\*(C'\fR source generates a test video pattern, showing a
color pattern, a scrolling gradient and a timestamp. This is mainly
intended for testing purposes.
.PP
The sources accept the following options:
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Specify the color of the source, only used in the \f(CW\*(C`color\*(C'\fR
source. It can be the name of a color (case insensitive match) or a
0xRRGGBB[\s-1AA\s0] sequence, possibly followed by an alpha specifier. The
default value is \*(L"black\*(R".
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify the size of the sourced video, it may be a string of the form
\&\fIwidth\fRx\fIheight\fR, or the name of a size abbreviation. The
default value is \*(L"320x240\*(R".
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Specify the frame rate of the sourced video, as the number of frames
generated per second. It has to be a string in the format
\&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float
number or a valid video frame rate abbreviation. The default value is
\&\*(L"25\*(R".
.IP "\fBsar\fR" 4
.IX Item "sar"
Set the sample aspect ratio of the sourced video.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Set the video duration of the sourced video. The accepted syntax is:
.Sp
.Vb 2
\&        [\-]HH[:MM[:SS[.m...]]]
\&        [\-]S+[.m...]
.Ve
.Sp
See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
.Sp
If not specified, or the expressed duration is negative, the video is
supposed to be generated forever.
.IP "\fBdecimals, n\fR" 4
.IX Item "decimals, n"
Set the number of decimals to show in the timestamp, only used in the
\&\f(CW\*(C`testsrc\*(C'\fR source.
.Sp
The displayed timestamp value will correspond to the original
timestamp value multiplied by the power of 10 of the specified
value. Default value is 0.
.PP
For example the following:
.PP
.Vb 1
\&        testsrc=duration=5.3:size=qcif:rate=10
.Ve
.PP
will generate a video with a duration of 5.3 seconds, with size
176x144 and a frame rate of 10 frames per second.
.PP
The following graph description will generate a red source
with an opacity of 0.2, with size \*(L"qcif\*(R" and a frame rate of 10
frames per second.
.PP
.Vb 1
\&        color=c=red@0.2:s=qcif:r=10
.Ve
.PP
If the input content is to be ignored, \f(CW\*(C`nullsrc\*(C'\fR can be used. The
following command generates noise in the luminance plane by employing
the \f(CW\*(C`geq\*(C'\fR filter:
.PP
.Vb 1
\&        nullsrc=s=256x256, geq=random(1)*255:128:128
.Ve
.SH "VIDEO SINKS"
.IX Header "VIDEO SINKS"
Below is a description of the currently available video sinks.
.SS "buffersink"
.IX Subsection "buffersink"
Buffer video frames, and make them available to the end of the filter
graph.
.PP
This sink is mainly intended for a programmatic use, in particular
through the interface defined in \fIlibavfilter/buffersink.h\fR
or the options system.
.PP
It accepts a pointer to an AVBufferSinkContext structure, which
defines the incoming buffers' formats, to be passed as the opaque
parameter to \f(CW\*(C`avfilter_init_filter\*(C'\fR for initialization.
.SS "nullsink"
.IX Subsection "nullsink"
Null video sink, do absolutely nothing with the input video. It is
mainly useful as a template and to be employed in analysis / debugging
tools.
.SH "MULTIMEDIA FILTERS"
.IX Header "MULTIMEDIA FILTERS"
Below is a description of the currently available multimedia filters.
.SS "aperms, perms"
.IX Subsection "aperms, perms"
Set read/write permissions for the output frames.
.PP
These filters are mainly aimed at developers to test direct path in the
following filter in the filtergraph.
.PP
The filters accept the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Select the permissions mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Do nothing. This is the default.
.IP "\fBro\fR" 4
.IX Item "ro"
Set all the output frames read-only.
.IP "\fBrw\fR" 4
.IX Item "rw"
Set all the output frames directly writable.
.IP "\fBtoggle\fR" 4
.IX Item "toggle"
Make the frame read-only if writable, and writable if read-only.
.IP "\fBrandom\fR" 4
.IX Item "random"
Set each output frame read-only or writable randomly.
.RE
.RS 4
.RE
.IP "\fBseed\fR" 4
.IX Item "seed"
Set the seed for the \fIrandom\fR mode, must be an integer included between
\&\f(CW0\fR and \f(CW\*(C`UINT32_MAX\*(C'\fR. If not specified, or if explicitly set to
\&\f(CW\*(C`\-1\*(C'\fR, the filter will try to use a good random seed on a best effort
basis.
.PP
Note: in case of auto-inserted filter between the permission filter and the
following one, the permission might not be received as expected in that
following filter. Inserting a format or aformat filter before the
perms/aperms filter can avoid this problem.
.SS "aselect, select"
.IX Subsection "aselect, select"
Select frames to pass in output.
.PP
This filter accepts the following options:
.IP "\fBexpr, e\fR" 4
.IX Item "expr, e"
Set expression, which is evaluated for each input frame.
.Sp
If the expression is evaluated to zero, the frame is discarded.
.Sp
If the evaluation result is negative or NaN, the frame is sent to the
first output; otherwise it is sent to the output with index
\&\f(CW\*(C`ceil(val)\-1\*(C'\fR, assuming that the input index starts from 0.
.Sp
For example a value of \f(CW1.2\fR corresponds to the output with index
\&\f(CW\*(C`ceil(1.2)\-1 = 2\-1 = 1\*(C'\fR, that is the second output.
.IP "\fBoutputs, n\fR" 4
.IX Item "outputs, n"
Set the number of outputs. The output to which to send the selected
frame is based on the result of the evaluation. Default value is 1.
.PP
The expression can contain the following constants:
.IP "\fBn\fR" 4
.IX Item "n"
the sequential number of the filtered frame, starting from 0
.IP "\fBselected_n\fR" 4
.IX Item "selected_n"
the sequential number of the selected frame, starting from 0
.IP "\fBprev_selected_n\fR" 4
.IX Item "prev_selected_n"
the sequential number of the last selected frame, \s-1NAN\s0 if undefined
.IP "\fB\s-1TB\s0\fR" 4
.IX Item "TB"
timebase of the input timestamps
.IP "\fBpts\fR" 4
.IX Item "pts"
the \s-1PTS\s0 (Presentation TimeStamp) of the filtered video frame,
expressed in \fI\s-1TB\s0\fR units, \s-1NAN\s0 if undefined
.IP "\fBt\fR" 4
.IX Item "t"
the \s-1PTS\s0 (Presentation TimeStamp) of the filtered video frame,
expressed in seconds, \s-1NAN\s0 if undefined
.IP "\fBprev_pts\fR" 4
.IX Item "prev_pts"
the \s-1PTS\s0 of the previously filtered video frame, \s-1NAN\s0 if undefined
.IP "\fBprev_selected_pts\fR" 4
.IX Item "prev_selected_pts"
the \s-1PTS\s0 of the last previously filtered video frame, \s-1NAN\s0 if undefined
.IP "\fBprev_selected_t\fR" 4
.IX Item "prev_selected_t"
the \s-1PTS\s0 of the last previously selected video frame, \s-1NAN\s0 if undefined
.IP "\fBstart_pts\fR" 4
.IX Item "start_pts"
the \s-1PTS\s0 of the first video frame in the video, \s-1NAN\s0 if undefined
.IP "\fBstart_t\fR" 4
.IX Item "start_t"
the time of the first video frame in the video, \s-1NAN\s0 if undefined
.IP "\fBpict_type\fR \fI(video only)\fR" 4
.IX Item "pict_type (video only)"
the type of the filtered frame, can assume one of the following
values:
.RS 4
.IP "\fBI\fR" 4
.IX Item "I"
.PD 0
.IP "\fBP\fR" 4
.IX Item "P"
.IP "\fBB\fR" 4
.IX Item "B"
.IP "\fBS\fR" 4
.IX Item "S"
.IP "\fB\s-1SI\s0\fR" 4
.IX Item "SI"
.IP "\fB\s-1SP\s0\fR" 4
.IX Item "SP"
.IP "\fB\s-1BI\s0\fR" 4
.IX Item "BI"
.RE
.RS 4
.RE
.IP "\fBinterlace_type\fR \fI(video only)\fR" 4
.IX Item "interlace_type (video only)"
.PD
the frame interlace type, can assume one of the following values:
.RS 4
.IP "\fB\s-1PROGRESSIVE\s0\fR" 4
.IX Item "PROGRESSIVE"
the frame is progressive (not interlaced)
.IP "\fB\s-1TOPFIRST\s0\fR" 4
.IX Item "TOPFIRST"
the frame is top-field-first
.IP "\fB\s-1BOTTOMFIRST\s0\fR" 4
.IX Item "BOTTOMFIRST"
the frame is bottom-field-first
.RE
.RS 4
.RE
.IP "\fBconsumed_sample_n\fR \fI(audio only)\fR" 4
.IX Item "consumed_sample_n (audio only)"
the number of selected samples before the current frame
.IP "\fBsamples_n\fR \fI(audio only)\fR" 4
.IX Item "samples_n (audio only)"
the number of samples in the current frame
.IP "\fBsample_rate\fR \fI(audio only)\fR" 4
.IX Item "sample_rate (audio only)"
the input sample rate
.IP "\fBkey\fR" 4
.IX Item "key"
1 if the filtered frame is a key-frame, 0 otherwise
.IP "\fBpos\fR" 4
.IX Item "pos"
the position in the file of the filtered frame, \-1 if the information
is not available (e.g. for synthetic video)
.IP "\fBscene\fR \fI(video only)\fR" 4
.IX Item "scene (video only)"
value between 0 and 1 to indicate a new scene; a low value reflects a low
probability for the current frame to introduce a new scene, while a higher
value means the current frame is more likely to be one (see the example below)
.PP
The default value of the select expression is \*(L"1\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Select all frames in input:
.Sp
.Vb 1
\&        select
.Ve
.Sp
The example above is the same as:
.Sp
.Vb 1
\&        select=1
.Ve
.IP "\(bu" 4
Skip all frames:
.Sp
.Vb 1
\&        select=0
.Ve
.IP "\(bu" 4
Select only I\-frames:
.Sp
.Vb 1
\&        select=\*(Aqeq(pict_type\e,I)\*(Aq
.Ve
.IP "\(bu" 4
Select one frame every 100:
.Sp
.Vb 1
\&        select=\*(Aqnot(mod(n\e,100))\*(Aq
.Ve
.IP "\(bu" 4
Select only frames contained in the 10\-20 time interval:
.Sp
.Vb 1
\&        select=\*(Aqgte(t\e,10)*lte(t\e,20)\*(Aq
.Ve
.IP "\(bu" 4
Select only I frames contained in the 10\-20 time interval:
.Sp
.Vb 1
\&        select=\*(Aqgte(t\e,10)*lte(t\e,20)*eq(pict_type\e,I)\*(Aq
.Ve
.IP "\(bu" 4
Select frames with a minimum distance of 10 seconds:
.Sp
.Vb 1
\&        select=\*(Aqisnan(prev_selected_t)+gte(t\-prev_selected_t\e,10)\*(Aq
.Ve
.IP "\(bu" 4
Use aselect to select only audio frames with samples number > 100:
.Sp
.Vb 1
\&        aselect=\*(Aqgt(samples_n\e,100)\*(Aq
.Ve
.IP "\(bu" 4
Create a mosaic of the first scenes:
.Sp
.Vb 1
\&        ffmpeg \-i video.avi \-vf select=\*(Aqgt(scene\e,0.4)\*(Aq,scale=160:120,tile \-frames:v 1 preview.png
.Ve
.Sp
Comparing \fIscene\fR against a value between 0.3 and 0.5 is generally a sane
choice.
.IP "\(bu" 4
Send even and odd frames to separate outputs, and compose them:
.Sp
.Vb 1
\&        select=n=2:e=\*(Aqmod(n, 2)+1\*(Aq [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
.Ve
.SS "asendcmd, sendcmd"
.IX Subsection "asendcmd, sendcmd"
Send commands to filters in the filtergraph.
.PP
These filters read commands to be sent to other filters in the
filtergraph.
.PP
\&\f(CW\*(C`asendcmd\*(C'\fR must be inserted between two audio filters,
\&\f(CW\*(C`sendcmd\*(C'\fR must be inserted between two video filters, but apart
from that they act the same way.
.PP
The specification of commands can be provided in the filter arguments
with the \fIcommands\fR option, or in a file specified by the
\&\fIfilename\fR option.
.PP
These filters accept the following options:
.IP "\fBcommands, c\fR" 4
.IX Item "commands, c"
Set the commands to be read and sent to the other filters.
.IP "\fBfilename, f\fR" 4
.IX Item "filename, f"
Set the filename of the commands to be read and sent to the other
filters.
.PP
\fICommands syntax\fR
.IX Subsection "Commands syntax"
.PP
A commands description consists of a sequence of interval
specifications, comprising a list of commands to be executed when a
particular event related to that interval occurs. The occurring event
is typically the current frame time entering or leaving a given time
interval.
.PP
An interval is specified by the following syntax:
.PP
.Vb 1
\&        <START>[\-<END>] <COMMANDS>;
.Ve
.PP
The time interval is specified by the \fI\s-1START\s0\fR and \fI\s-1END\s0\fR times.
\&\fI\s-1END\s0\fR is optional and defaults to the maximum time.
.PP
The current frame time is considered within the specified interval if
it is included in the interval [\fI\s-1START\s0\fR, \fI\s-1END\s0\fR), that is when
the time is greater or equal to \fI\s-1START\s0\fR and is lesser than
\&\fI\s-1END\s0\fR.
.PP
\&\fI\s-1COMMANDS\s0\fR consists of a sequence of one or more command
specifications, separated by \*(L",\*(R", relating to that interval.  The
syntax of a command specification is given by:
.PP
.Vb 1
\&        [<FLAGS>] <TARGET> <COMMAND> <ARG>
.Ve
.PP
\&\fI\s-1FLAGS\s0\fR is optional and specifies the type of events relating to
the time interval which enable sending the specified command, and must
be a non-null sequence of identifier flags separated by \*(L"+\*(R" or \*(L"|\*(R" and
enclosed between \*(L"[\*(R" and \*(L"]\*(R".
.PP
The following flags are recognized:
.IP "\fBenter\fR" 4
.IX Item "enter"
The command is sent when the current frame timestamp enters the
specified interval. In other words, the command is sent when the
previous frame timestamp was not in the given interval, and the
current is.
.IP "\fBleave\fR" 4
.IX Item "leave"
The command is sent when the current frame timestamp leaves the
specified interval. In other words, the command is sent when the
previous frame timestamp was in the given interval, and the
current is not.
.PP
If \fI\s-1FLAGS\s0\fR is not specified, a default value of \f(CW\*(C`[enter]\*(C'\fR is
assumed.
.PP
\&\fI\s-1TARGET\s0\fR specifies the target of the command, usually the name of
the filter class or a specific filter instance name.
.PP
\&\fI\s-1COMMAND\s0\fR specifies the name of the command for the target filter.
.PP
\&\fI\s-1ARG\s0\fR is optional and specifies the optional list of argument for
the given \fI\s-1COMMAND\s0\fR.
.PP
Between one interval specification and another, whitespaces, or
sequences of characters starting with \f(CW\*(C`#\*(C'\fR until the end of line,
are ignored and can be used to annotate comments.
.PP
A simplified \s-1BNF\s0 description of the commands specification syntax
follows:
.PP
.Vb 6
\&        <COMMAND_FLAG>  ::= "enter" | "leave"
\&        <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
\&        <COMMAND>       ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
\&        <COMMANDS>      ::= <COMMAND> [,<COMMANDS>]
\&        <INTERVAL>      ::= <START>[\-<END>] <COMMANDS>
\&        <INTERVALS>     ::= <INTERVAL>[;<INTERVALS>]
.Ve
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Specify audio tempo change at second 4:
.Sp
.Vb 1
\&        asendcmd=c=\*(Aq4.0 atempo tempo 1.5\*(Aq,atempo
.Ve
.IP "\(bu" 4
Specify a list of drawtext and hue commands in a file.
.Sp
.Vb 3
\&        # show text in the interval 5\-10
\&        5.0\-10.0 [enter] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=hello world\*(Aq,
\&                 [leave] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=\*(Aq;
\&        
\&        # desaturate the image in the interval 15\-20
\&        15.0\-20.0 [enter] hue s 0,
\&                  [enter] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=nocolor\*(Aq,
\&                  [leave] hue s 1,
\&                  [leave] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=color\*(Aq;
\&        
\&        # apply an exponential saturation fade\-out effect, starting from time 25
\&        25 [enter] hue s exp(25\-t)
.Ve
.Sp
A filtergraph allowing to read and process the above command list
stored in a file \fItest.cmd\fR, can be specified with:
.Sp
.Vb 1
\&        sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text=\*(Aq\*(Aq,hue
.Ve
.SS "asetpts, setpts"
.IX Subsection "asetpts, setpts"
Change the \s-1PTS\s0 (presentation timestamp) of the input frames.
.PP
\&\f(CW\*(C`asetpts\*(C'\fR works on audio frames, \f(CW\*(C`setpts\*(C'\fR on video frames.
.PP
This filter accepts the following options:
.IP "\fBexpr\fR" 4
.IX Item "expr"
The expression which is evaluated for each frame to construct its timestamp.
.PP
The expression is evaluated through the eval \s-1API\s0 and can contain the following
constants:
.IP "\fB\s-1FRAME_RATE\s0\fR" 4
.IX Item "FRAME_RATE"
frame rate, only defined for constant frame-rate video
.IP "\fB\s-1PTS\s0\fR" 4
.IX Item "PTS"
the presentation timestamp in input
.IP "\fBN\fR" 4
.IX Item "N"
the count of the input frame, starting from 0.
.IP "\fB\s-1NB_CONSUMED_SAMPLES\s0\fR" 4
.IX Item "NB_CONSUMED_SAMPLES"
the number of consumed samples, not including the current frame (only
audio)
.IP "\fB\s-1NB_SAMPLES\s0\fR" 4
.IX Item "NB_SAMPLES"
the number of samples in the current frame (only audio)
.IP "\fB\s-1SAMPLE_RATE\s0\fR" 4
.IX Item "SAMPLE_RATE"
audio sample rate
.IP "\fB\s-1STARTPTS\s0\fR" 4
.IX Item "STARTPTS"
the \s-1PTS\s0 of the first frame
.IP "\fB\s-1STARTT\s0\fR" 4
.IX Item "STARTT"
the time in seconds of the first frame
.IP "\fB\s-1INTERLACED\s0\fR" 4
.IX Item "INTERLACED"
tell if the current frame is interlaced
.IP "\fBT\fR" 4
.IX Item "T"
the time in seconds of the current frame
.IP "\fB\s-1TB\s0\fR" 4
.IX Item "TB"
the time base
.IP "\fB\s-1POS\s0\fR" 4
.IX Item "POS"
original position in the file of the frame, or undefined if undefined
for the current frame
.IP "\fB\s-1PREV_INPTS\s0\fR" 4
.IX Item "PREV_INPTS"
previous input \s-1PTS\s0
.IP "\fB\s-1PREV_INT\s0\fR" 4
.IX Item "PREV_INT"
previous input time in seconds
.IP "\fB\s-1PREV_OUTPTS\s0\fR" 4
.IX Item "PREV_OUTPTS"
previous output \s-1PTS\s0
.IP "\fB\s-1PREV_OUTT\s0\fR" 4
.IX Item "PREV_OUTT"
previous output time in seconds
.IP "\fB\s-1RTCTIME\s0\fR" 4
.IX Item "RTCTIME"
wallclock (\s-1RTC\s0) time in microseconds. This is deprecated, use \fItime\fR\|(0)
instead.
.IP "\fB\s-1RTCSTART\s0\fR" 4
.IX Item "RTCSTART"
wallclock (\s-1RTC\s0) time at the start of the movie in microseconds
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Start counting \s-1PTS\s0 from zero
.Sp
.Vb 1
\&        setpts=PTS\-STARTPTS
.Ve
.IP "\(bu" 4
Apply fast motion effect:
.Sp
.Vb 1
\&        setpts=0.5*PTS
.Ve
.IP "\(bu" 4
Apply slow motion effect:
.Sp
.Vb 1
\&        setpts=2.0*PTS
.Ve
.IP "\(bu" 4
Set fixed rate of 25 frames per second:
.Sp
.Vb 1
\&        setpts=N/(25*TB)
.Ve
.IP "\(bu" 4
Set fixed rate 25 fps with some jitter:
.Sp
.Vb 1
\&        setpts=\*(Aq1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))\*(Aq
.Ve
.IP "\(bu" 4
Apply an offset of 10 seconds to the input \s-1PTS:\s0
.Sp
.Vb 1
\&        setpts=PTS+10/TB
.Ve
.IP "\(bu" 4
Generate timestamps from a \*(L"live source\*(R" and rebase onto the current timebase:
.Sp
.Vb 1
\&        setpts=\*(Aq(RTCTIME \- RTCSTART) / (TB * 1000000)\*(Aq
.Ve
.SS "ebur128"
.IX Subsection "ebur128"
\&\s-1EBU\s0 R128 scanner filter. This filter takes an audio stream as input and outputs
it unchanged. By default, it logs a message at a frequency of 10Hz with the
Momentary loudness (identified by \f(CW\*(C`M\*(C'\fR), Short-term loudness (\f(CW\*(C`S\*(C'\fR),
Integrated loudness (\f(CW\*(C`I\*(C'\fR) and Loudness Range (\f(CW\*(C`LRA\*(C'\fR).
.PP
The filter also has a video output (see the \fIvideo\fR option) with a real
time graph to observe the loudness evolution. The graphic contains the logged
message mentioned above, so it is not printed anymore when this option is set,
unless the verbose logging is set. The main graphing area contains the
short-term loudness (3 seconds of analysis), and the gauge on the right is for
the momentary loudness (400 milliseconds).
.PP
More information about the Loudness Recommendation \s-1EBU\s0 R128 on
<\fBhttp://tech.ebu.ch/loudness\fR>.
.PP
The filter accepts the following options:
.IP "\fBvideo\fR" 4
.IX Item "video"
Activate the video output. The audio stream is passed unchanged whether this
option is set or no. The video stream will be the first output stream if
activated. Default is \f(CW0\fR.
.IP "\fBsize\fR" 4
.IX Item "size"
Set the video size. This option is for video only. Default and minimum
resolution is \f(CW\*(C`640x480\*(C'\fR.
.IP "\fBmeter\fR" 4
.IX Item "meter"
Set the \s-1EBU\s0 scale meter. Default is \f(CW9\fR. Common values are \f(CW9\fR and
\&\f(CW18\fR, respectively for \s-1EBU\s0 scale meter +9 and \s-1EBU\s0 scale meter +18. Any
other integer value between this range is allowed.
.IP "\fBmetadata\fR" 4
.IX Item "metadata"
Set metadata injection. If set to \f(CW1\fR, the audio input will be segmented
into 100ms output frames, each of them containing various loudness information
in metadata.  All the metadata keys are prefixed with \f(CW\*(C`lavfi.r128.\*(C'\fR.
.Sp
Default is \f(CW0\fR.
.IP "\fBframelog\fR" 4
.IX Item "framelog"
Force the frame logging level.
.Sp
Available values are:
.RS 4
.IP "\fBinfo\fR" 4
.IX Item "info"
information logging level
.IP "\fBverbose\fR" 4
.IX Item "verbose"
verbose logging level
.RE
.RS 4
.Sp
By default, the logging level is set to \fIinfo\fR. If the \fBvideo\fR or
the \fBmetadata\fR options are set, it switches to \fIverbose\fR.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Real-time graph using \fBffplay\fR, with a \s-1EBU\s0 scale meter +18:
.Sp
.Vb 1
\&        ffplay \-f lavfi \-i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
.Ve
.IP "\(bu" 4
Run an analysis with \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-nostats \-i input.mp3 \-filter_complex ebur128 \-f null \-
.Ve
.SS "settb, asettb"
.IX Subsection "settb, asettb"
Set the timebase to use for the output frames timestamps.
It is mainly useful for testing timebase configuration.
.PP
This filter accepts the following options:
.IP "\fBexpr, tb\fR" 4
.IX Item "expr, tb"
The expression which is evaluated into the output timebase.
.PP
The value for \fBtb\fR is an arithmetic expression representing a
rational. The expression can contain the constants \*(L"\s-1AVTB\s0\*(R" (the default
timebase), \*(L"intb\*(R" (the input timebase) and \*(L"sr\*(R" (the sample rate,
audio only). Default value is \*(L"intb\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Set the timebase to 1/25:
.Sp
.Vb 1
\&        settb=expr=1/25
.Ve
.IP "\(bu" 4
Set the timebase to 1/10:
.Sp
.Vb 1
\&        settb=expr=0.1
.Ve
.IP "\(bu" 4
Set the timebase to 1001/1000:
.Sp
.Vb 1
\&        settb=1+0.001
.Ve
.IP "\(bu" 4
Set the timebase to 2*intb:
.Sp
.Vb 1
\&        settb=2*intb
.Ve
.IP "\(bu" 4
Set the default timebase value:
.Sp
.Vb 1
\&        settb=AVTB
.Ve
.SS "concat"
.IX Subsection "concat"
Concatenate audio and video streams, joining them together one after the
other.
.PP
The filter works on segments of synchronized video and audio streams. All
segments must have the same number of streams of each type, and that will
also be the number of streams at output.
.PP
The filter accepts the following options:
.IP "\fBn\fR" 4
.IX Item "n"
Set the number of segments. Default is 2.
.IP "\fBv\fR" 4
.IX Item "v"
Set the number of output video streams, that is also the number of video
streams in each segment. Default is 1.
.IP "\fBa\fR" 4
.IX Item "a"
Set the number of output audio streams, that is also the number of video
streams in each segment. Default is 0.
.IP "\fBunsafe\fR" 4
.IX Item "unsafe"
Activate unsafe mode: do not fail if segments have a different format.
.PP
The filter has \fIv\fR+\fIa\fR outputs: first \fIv\fR video outputs, then
\&\fIa\fR audio outputs.
.PP
There are \fIn\fRx(\fIv\fR+\fIa\fR) inputs: first the inputs for the first
segment, in the same order as the outputs, then the inputs for the second
segment, etc.
.PP
Related streams do not always have exactly the same duration, for various
reasons including codec frame size or sloppy authoring. For that reason,
related synchronized streams (e.g. a video and its audio track) should be
concatenated at once. The concat filter will use the duration of the longest
stream in each segment (except the last one), and if necessary pad shorter
audio streams with silence.
.PP
For this filter to work correctly, all segments must start at timestamp 0.
.PP
All corresponding streams must have the same parameters in all segments; the
filtering system will automatically select a common pixel format for video
streams, and a common sample format, sample rate and channel layout for
audio streams, but other settings, such as resolution, must be converted
explicitly by the user.
.PP
Different frame rates are acceptable but will result in variable frame rate
at output; be sure to configure the output file to handle it.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Concatenate an opening, an episode and an ending, all in bilingual version
(video in stream 0, audio in streams 1 and 2):
.Sp
.Vb 4
\&        ffmpeg \-i opening.mkv \-i episode.mkv \-i ending.mkv \-filter_complex \e
\&          \*(Aq[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
\&           concat=n=3:v=1:a=2 [v] [a1] [a2]\*(Aq \e
\&          \-map \*(Aq[v]\*(Aq \-map \*(Aq[a1]\*(Aq \-map \*(Aq[a2]\*(Aq output.mkv
.Ve
.IP "\(bu" 4
Concatenate two parts, handling audio and video separately, using the
(a)movie sources, and adjusting the resolution:
.Sp
.Vb 3
\&        movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
\&        movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
\&        [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
.Ve
.Sp
Note that a desync will happen at the stitch if the audio and video streams
do not have exactly the same duration in the first file.
.SS "showspectrum"
.IX Subsection "showspectrum"
Convert input audio to a video output, representing the audio frequency
spectrum.
.PP
The filter accepts the following options:
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify the video size for the output. Default value is \f(CW\*(C`640x512\*(C'\fR.
.IP "\fBslide\fR" 4
.IX Item "slide"
Specify if the spectrum should slide along the window. Default value is
\&\f(CW0\fR.
.IP "\fBmode\fR" 4
.IX Item "mode"
Specify display mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBcombined\fR" 4
.IX Item "combined"
all channels are displayed in the same row
.IP "\fBseparate\fR" 4
.IX Item "separate"
all channels are displayed in separate rows
.RE
.RS 4
.Sp
Default value is \fBcombined\fR.
.RE
.IP "\fBcolor\fR" 4
.IX Item "color"
Specify display color mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBchannel\fR" 4
.IX Item "channel"
each channel is displayed in a separate color
.IP "\fBintensity\fR" 4
.IX Item "intensity"
each channel is is displayed using the same color scheme
.RE
.RS 4
.Sp
Default value is \fBchannel\fR.
.RE
.IP "\fBscale\fR" 4
.IX Item "scale"
Specify scale used for calculating intensity color values.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlin\fR" 4
.IX Item "lin"
linear
.IP "\fBsqrt\fR" 4
.IX Item "sqrt"
square root, default
.IP "\fBcbrt\fR" 4
.IX Item "cbrt"
cubic root
.IP "\fBlog\fR" 4
.IX Item "log"
logarithmic
.RE
.RS 4
.Sp
Default value is \fBsqrt\fR.
.RE
.IP "\fBsaturation\fR" 4
.IX Item "saturation"
Set saturation modifier for displayed colors. Negative values provide
alternative color scheme. \f(CW0\fR is no saturation at all.
Saturation must be in [\-10.0, 10.0] range.
Default value is \f(CW1\fR.
.PP
The usage is very similar to the showwaves filter; see the examples in that
section.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Large window with logarithmic color scaling:
.Sp
.Vb 1
\&        showspectrum=s=1280x480:scale=log
.Ve
.IP "\(bu" 4
Complete example for a colored and sliding spectrum per channel using \fBffplay\fR:
.Sp
.Vb 2
\&        ffplay \-f lavfi \*(Aqamovie=input.mp3, asplit [a][out1];
\&                     [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]\*(Aq
.Ve
.SS "showwaves"
.IX Subsection "showwaves"
Convert input audio to a video output, representing the samples waves.
.PP
The filter accepts the following options:
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify the video size for the output. Default value is \*(L"600x240\*(R".
.IP "\fBmode\fR" 4
.IX Item "mode"
Set display mode.
.Sp
Available values are:
.RS 4
.IP "\fBpoint\fR" 4
.IX Item "point"
Draw a point for each sample.
.IP "\fBline\fR" 4
.IX Item "line"
Draw a vertical line for each sample.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`point\*(C'\fR.
.RE
.IP "\fBn\fR" 4
.IX Item "n"
Set the number of samples which are printed on the same column. A
larger value will decrease the frame rate. Must be a positive
integer. This option can be set only if the value for \fIrate\fR
is not explicitly specified.
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set the (approximate) output frame rate. This is done by setting the
option \fIn\fR. Default value is \*(L"25\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Output the input file audio and the corresponding video representation
at the same time:
.Sp
.Vb 1
\&        amovie=a.mp3,asplit[out0],showwaves[out1]
.Ve
.IP "\(bu" 4
Create a synthetic signal and show it with showwaves, forcing a
frame rate of 30 frames per second:
.Sp
.Vb 1
\&        aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
.Ve
.SS "split, asplit"
.IX Subsection "split, asplit"
Split input into several identical outputs.
.PP
\&\f(CW\*(C`asplit\*(C'\fR works with audio input, \f(CW\*(C`split\*(C'\fR with video.
.PP
The filter accepts a single parameter which specifies the number of outputs. If
unspecified, it defaults to 2.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Create two separate outputs from the same input:
.Sp
.Vb 1
\&        [in] split [out0][out1]
.Ve
.IP "\(bu" 4
To create 3 or more outputs, you need to specify the number of
outputs, like in:
.Sp
.Vb 1
\&        [in] asplit=3 [out0][out1][out2]
.Ve
.IP "\(bu" 4
Create two separate outputs from the same input, one cropped and
one padded:
.Sp
.Vb 3
\&        [in] split [splitout1][splitout2];
\&        [splitout1] crop=100:100:0:0    [cropout];
\&        [splitout2] pad=200:200:100:100 [padout];
.Ve
.IP "\(bu" 4
Create 5 copies of the input audio with \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-filter_complex asplit=5 OUTPUT
.Ve
.SH "MULTIMEDIA SOURCES"
.IX Header "MULTIMEDIA SOURCES"
Below is a description of the currently available multimedia sources.
.SS "amovie"
.IX Subsection "amovie"
This is the same as movie source, except it selects an audio
stream by default.
.SS "movie"
.IX Subsection "movie"
Read audio and/or video stream(s) from a movie container.
.PP
This filter accepts the following options:
.IP "\fBfilename\fR" 4
.IX Item "filename"
The name of the resource to read (not necessarily a file but also a device or a
stream accessed through some protocol).
.IP "\fBformat_name, f\fR" 4
.IX Item "format_name, f"
Specifies the format assumed for the movie to read, and can be either
the name of a container or an input device. If not specified the
format is guessed from \fImovie_name\fR or by probing.
.IP "\fBseek_point, sp\fR" 4
.IX Item "seek_point, sp"
Specifies the seek point in seconds, the frames will be output
starting from this seek point, the parameter is evaluated with
\&\f(CW\*(C`av_strtod\*(C'\fR so the numerical value may be suffixed by an \s-1IS\s0
postfix. Default value is \*(L"0\*(R".
.IP "\fBstreams, s\fR" 4
.IX Item "streams, s"
Specifies the streams to read. Several streams can be specified,
separated by \*(L"+\*(R". The source will then have as many outputs, in the
same order. The syntax is explained in the ``Stream specifiers''
section in the ffmpeg manual. Two special names, \*(L"dv\*(R" and \*(L"da\*(R" specify
respectively the default (best suited) video and audio stream. Default
is \*(L"dv\*(R", or \*(L"da\*(R" if the filter is called as \*(L"amovie\*(R".
.IP "\fBstream_index, si\fR" 4
.IX Item "stream_index, si"
Specifies the index of the video stream to read. If the value is \-1,
the best suited video stream will be automatically selected. Default
value is \*(L"\-1\*(R". Deprecated. If the filter is called \*(L"amovie\*(R", it will select
audio instead of video.
.IP "\fBloop\fR" 4
.IX Item "loop"
Specifies how many times to read the stream in sequence.
If the value is less than 1, the stream will be read again and again.
Default value is \*(L"1\*(R".
.Sp
Note that when the movie is looped the source timestamps are not
changed, so it will generate non monotonically increasing timestamps.
.PP
This filter allows to overlay a second video on top of main input of
a filtergraph as shown in this graph:
.PP
.Vb 4
\&        input \-\-\-\-\-\-\-\-\-\-\-> deltapts0 \-\-> overlay \-\-> output
\&                                            ^
\&                                            |
\&        movie \-\-> scale\-\-> deltapts1 \-\-\-\-\-\-\-+
.Ve
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
on top of the input labelled as \*(L"in\*(R":
.Sp
.Vb 3
\&        movie=in.avi:seek_point=3.2, scale=180:\-1, setpts=PTS\-STARTPTS [over];
\&        [in] setpts=PTS\-STARTPTS [main];
\&        [main][over] overlay=16:16 [out]
.Ve
.IP "\(bu" 4
Read from a video4linux2 device, and overlay it on top of the input
labelled as \*(L"in\*(R":
.Sp
.Vb 3
\&        movie=/dev/video0:f=video4linux2, scale=180:\-1, setpts=PTS\-STARTPTS [over];
\&        [in] setpts=PTS\-STARTPTS [main];
\&        [main][over] overlay=16:16 [out]
.Ve
.IP "\(bu" 4
Read the first video stream and the audio stream with id 0x81 from
dvd.vob; the video is connected to the pad named \*(L"video\*(R" and the audio is
connected to the pad named \*(L"audio\*(R":
.Sp
.Vb 1
\&        movie=dvd.vob:s=v:0+#0x81 [video] [audio]
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIffmpeg\fR\|(1),
\&\fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1),
\&\fIffmpeg\-utils\fR\|(1), \fIffmpeg\-scaler\fR\|(1), \fIffmpeg\-resampler\fR\|(1),
\&\fIffmpeg\-codecs\fR\|(1), \fIffmpeg\-bitstream\-filters\fR\|(1), \fIffmpeg\-formats\fR\|(1),
\&\fIffmpeg\-devices\fR\|(1), \fIffmpeg\-protocols\fR\|(1), \fIffmpeg\-filters\fR\|(1)
.SH "AUTHORS"
.IX Header "AUTHORS"
The FFmpeg developers.
.PP
For details about the authorship, see the Git history of the project
(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
\&\fBgit log\fR in the FFmpeg source directory, or browsing the
online repository at <\fBhttp://source.ffmpeg.org\fR>.
.PP
Maintainers for the specific components are listed in the file
\&\fI\s-1MAINTAINERS\s0\fR in the source code tree.