403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/man/man1/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/man/man1/ffserver-all.1
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
.\"
.\" 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" ''
.    ds C`
.    ds C'
'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.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
.    if \nF \{
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" 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 "FFSERVER-ALL 1"
.TH FFSERVER-ALL 1 " " " " " "
.\" 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"
ffserver \- ffserver video server
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
ffserver [\fIoptions\fR]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBffserver\fR is a streaming server for both audio and video.
It supports several live feeds, streaming from files and time shifting
on live feeds. You can seek to positions in the past on each live
feed, provided you specify a big enough feed storage.
.PP
\&\fBffserver\fR is configured through a configuration file, which
is read at startup. If not explicitly specified, it will read from
\&\fI/etc/ffserver.conf\fR.
.PP
\&\fBffserver\fR receives prerecorded files or \s-1FFM\s0 streams from some
\&\fBffmpeg\fR instance as input, then streams them over
\&\s-1RTP/RTSP/HTTP.\s0
.PP
An \fBffserver\fR instance will listen on some port as specified
in the configuration file. You can launch one or more instances of
\&\fBffmpeg\fR and send one or more \s-1FFM\s0 streams to the port where
ffserver is expecting to receive them. Alternately, you can make
\&\fBffserver\fR launch such \fBffmpeg\fR instances at startup.
.PP
Input streams are called feeds, and each one is specified by a
\&\f(CW\*(C`<Feed>\*(C'\fR section in the configuration file.
.PP
For each feed you can have different output streams in various
formats, each one specified by a \f(CW\*(C`<Stream>\*(C'\fR section in the
configuration file.
.SH "DETAILED DESCRIPTION"
.IX Header "DETAILED DESCRIPTION"
\&\fBffserver\fR works by forwarding streams encoded by
\&\fBffmpeg\fR, or pre-recorded streams which are read from disk.
.PP
Precisely, \fBffserver\fR acts as an \s-1HTTP\s0 server, accepting \s-1POST\s0
requests from \fBffmpeg\fR to acquire the stream to publish, and
serving \s-1RTSP\s0 clients or \s-1HTTP\s0 clients \s-1GET\s0 requests with the stream
media content.
.PP
A feed is an \fB\s-1FFM\s0\fR stream created by \fBffmpeg\fR, and sent to
a port where \fBffserver\fR is listening.
.PP
Each feed is identified by a unique name, corresponding to the name
of the resource published on \fBffserver\fR, and is configured by
a dedicated \f(CW\*(C`Feed\*(C'\fR section in the configuration file.
.PP
The feed publish \s-1URL\s0 is given by:
.PP
.Vb 1
\&        http://<ffserver_ip_address>:<http_port>/<feed_name>
.Ve
.PP
where \fIffserver_ip_address\fR is the \s-1IP\s0 address of the machine where
\&\fBffserver\fR is installed, \fIhttp_port\fR is the port number of
the \s-1HTTP\s0 server (configured through the \fBHTTPPort\fR option), and
\&\fIfeed_name\fR is the name of the corresponding feed defined in the
configuration file.
.PP
Each feed is associated to a file which is stored on disk. This stored
file is used to send pre-recorded data to a player as fast as
possible when new content is added in real-time to the stream.
.PP
A \*(L"live-stream\*(R" or \*(L"stream\*(R" is a resource published by
\&\fBffserver\fR, and made accessible through the \s-1HTTP\s0 protocol to
clients.
.PP
A stream can be connected to a feed, or to a file. In the first case,
the published stream is forwarded from the corresponding feed
generated by a running instance of \fBffmpeg\fR, in the second
case the stream is read from a pre-recorded file.
.PP
Each stream is identified by a unique name, corresponding to the name
of the resource served by \fBffserver\fR, and is configured by
a dedicated \f(CW\*(C`Stream\*(C'\fR section in the configuration file.
.PP
The stream access \s-1HTTP URL\s0 is given by:
.PP
.Vb 1
\&        http://<ffserver_ip_address>:<http_port>/<stream_name>[<options>]
.Ve
.PP
The stream access \s-1RTSP URL\s0 is given by:
.PP
.Vb 1
\&        http://<ffserver_ip_address>:<rtsp_port>/<stream_name>[<options>]
.Ve
.PP
\&\fIstream_name\fR is the name of the corresponding stream defined in
the configuration file. \fIoptions\fR is a list of options specified
after the \s-1URL\s0 which affects how the stream is served by
\&\fBffserver\fR. \fIhttp_port\fR and \fIrtsp_port\fR are the \s-1HTTP\s0
and \s-1RTSP\s0 ports configured with the options \fIHTTPPort\fR and
\&\fIRTSPPort\fR respectively.
.PP
In case the stream is associated to a feed, the encoding parameters
must be configured in the stream configuration. They are sent to
\&\fBffmpeg\fR when setting up the encoding. This allows
\&\fBffserver\fR to define the encoding parameters used by
the \fBffmpeg\fR encoders.
.PP
The \fBffmpeg\fR \fBoverride_ffserver\fR commandline option
allows one to override the encoding parameters set by the server.
.PP
Multiple streams can be connected to the same feed.
.PP
For example, you can have a situation described by the following
graph:
.PP
.Vb 10
\&                       _\|_\|_\|_\|_\|_\|_\|_\|_       _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&                      |         |     |          |
\&        ffmpeg 1 \-\-\-\-\-| feed 1  |\-\-\-\-\-| stream 1 |
\&            \e         |_\|_\|_\|_\|_\|_\|_\|_\|_|\e    |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
\&             \e                    \e
\&              \e                    \e   _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&               \e                    \e |          |
\&                \e                    \e| stream 2 |
\&                 \e                    |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
\&                  \e
\&                   \e   _\|_\|_\|_\|_\|_\|_\|_\|_       _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&                    \e |         |     |          |
\&                     \e| feed 2  |\-\-\-\-\-| stream 3 |
\&                      |_\|_\|_\|_\|_\|_\|_\|_\|_|     |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
\&        
\&                       _\|_\|_\|_\|_\|_\|_\|_\|_       _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&                      |         |     |          |
\&        ffmpeg 2 \-\-\-\-\-| feed 3  |\-\-\-\-\-| stream 4 |
\&                      |_\|_\|_\|_\|_\|_\|_\|_\|_|     |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
\&        
\&                       _\|_\|_\|_\|_\|_\|_\|_\|_       _\|_\|_\|_\|_\|_\|_\|_\|_\|_
\&                      |         |     |          |
\&                      | file 1  |\-\-\-\-\-| stream 5 |
\&                      |_\|_\|_\|_\|_\|_\|_\|_\|_|     |_\|_\|_\|_\|_\|_\|_\|_\|_\|_|
.Ve
.SS "\s-1FFM, FFM2\s0 formats"
.IX Subsection "FFM, FFM2 formats"
\&\s-1FFM\s0 and \s-1FFM2\s0 are formats used by ffserver. They allow storing a wide variety of
video and audio streams and encoding options, and can store a moving time segment
of an infinite movie or a whole movie.
.PP
\&\s-1FFM\s0 is version specific, and there is limited compatibility of \s-1FFM\s0 files
generated by one version of ffmpeg/ffserver and another version of
ffmpeg/ffserver. It may work but it is not guaranteed to work.
.PP
\&\s-1FFM2\s0 is extensible while maintaining compatibility and should work between
differing versions of tools. \s-1FFM2\s0 is the default.
.SS "Status stream"
.IX Subsection "Status stream"
\&\fBffserver\fR supports an \s-1HTTP\s0 interface which exposes the
current status of the server.
.PP
Simply point your browser to the address of the special status stream
specified in the configuration file.
.PP
For example if you have:
.PP
.Vb 2
\&        <Stream status.html>
\&        Format status
\&        
\&        # Only allow local people to get the status
\&        ACL allow localhost
\&        ACL allow 192.168.0.0 192.168.255.255
\&        </Stream>
.Ve
.PP
then the server will post a page with the status information when
the special stream \fIstatus.html\fR is requested.
.SS "How do I make it work?"
.IX Subsection "How do I make it work?"
As a simple test, just run the following two command lines where \s-1INPUTFILE\s0
is some file which you can decode with ffmpeg:
.PP
.Vb 2
\&        ffserver \-f doc/ffserver.conf &
\&        ffmpeg \-i INPUTFILE http://localhost:8090/feed1.ffm
.Ve
.PP
At this point you should be able to go to your Windows machine and fire up
Windows Media Player (\s-1WMP\s0). Go to Open \s-1URL\s0 and enter
.PP
.Vb 1
\&            http://<linuxbox>:8090/test.asf
.Ve
.PP
You should (after a short delay) see video and hear audio.
.PP
\&\s-1WARNING:\s0 trying to stream test1.mpg doesn't work with \s-1WMP\s0 as it tries to
transfer the entire file before starting to play.
The same is true of \s-1AVI\s0 files.
.PP
You should edit the \fIffserver.conf\fR file to suit your needs (in
terms of frame rates etc). Then install \fBffserver\fR and
\&\fBffmpeg\fR, write a script to start them up, and off you go.
.SS "What else can it do?"
.IX Subsection "What else can it do?"
You can replay video from .ffm files that was recorded earlier.
However, there are a number of caveats, including the fact that the
ffserver parameters must match the original parameters used to record the
file. If they do not, then ffserver deletes the file before recording into it.
(Now that I write this, it seems broken).
.PP
You can fiddle with many of the codec choices and encoding parameters, and
there are a bunch more parameters that you cannot control. Post a message
to the mailing list if there are some 'must have' parameters. Look in
ffserver.conf for a list of the currently available controls.
.PP
It will automatically generate the \s-1ASX\s0 or \s-1RAM\s0 files that are often used
in browsers. These files are actually redirections to the underlying \s-1ASF\s0
or \s-1RM\s0 file. The reason for this is that the browser often fetches the
entire file before starting up the external viewer. The redirection files
are very small and can be transferred quickly. [The stream itself is
often 'infinite' and thus the browser tries to download it and never
finishes.]
.SS "Tips"
.IX Subsection "Tips"
* When you connect to a live stream, most players (\s-1WMP, RA,\s0 etc) want to
buffer a certain number of seconds of material so that they can display the
signal continuously. However, ffserver (by default) starts sending data
in realtime. This means that there is a pause of a few seconds while the
buffering is being done by the player. The good news is that this can be
cured by adding a '?buffer=5' to the end of the \s-1URL.\s0 This means that the
stream should start 5 seconds in the past \*(-- and so the first 5 seconds
of the stream are sent as fast as the network will allow. It will then
slow down to real time. This noticeably improves the startup experience.
.PP
You can also add a 'Preroll 15' statement into the ffserver.conf that will
add the 15 second prebuffering on all requests that do not otherwise
specify a time. In addition, ffserver will skip frames until a key_frame
is found. This further reduces the startup delay by not transferring data
that will be discarded.
.SS "Why does the ?buffer / Preroll stop working after a time?"
.IX Subsection "Why does the ?buffer / Preroll stop working after a time?"
It turns out that (on my machine at least) the number of frames successfully
grabbed is marginally less than the number that ought to be grabbed. This
means that the timestamp in the encoded data stream gets behind realtime.
This means that if you say 'Preroll 10', then when the stream gets 10
or more seconds behind, there is no Preroll left.
.PP
Fixing this requires a change in the internals of how timestamps are
handled.
.ie n .SS "Does the ""?date="" stuff work."
.el .SS "Does the \f(CW?date=\fP stuff work."
.IX Subsection "Does the ?date= stuff work."
Yes (subject to the limitation outlined above). Also note that whenever you
start ffserver, it deletes the ffm file (if any parameters have changed),
thus wiping out what you had recorded before.
.PP
The format of the \f(CW\*(C`?date=xxxxxx\*(C'\fR is fairly flexible. You should use one
of the following formats (the 'T' is literal):
.PP
.Vb 2
\&        * YYYY\-MM\-DDTHH:MM:SS     (localtime)
\&        * YYYY\-MM\-DDTHH:MM:SSZ    (UTC)
.Ve
.PP
You can omit the YYYY-MM-DD, and then it refers to the current day. However
note that \fB?date=16:00:00\fR refers to 16:00 on the current day \*(-- this
may be in the future and so is unlikely to be useful.
.PP
You use this by adding the ?date= to the end of the \s-1URL\s0 for the stream.
For example:   \fBhttp://localhost:8080/test.asf?date=2002\-07\-26T23:05:00\fR.
.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 multiples, 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' or 'V' for video, 'a' for audio, 's'
for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video
streams, 'V' only matches video streams which are not attached pictures, video
thumbnails or cover arts.  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 \fBor i:\fR\fIstream_id\fR" 4
.IX Item "#stream_id or i:stream_id"
Match the stream by stream id (e.g. \s-1PID\s0 in MPEG-TS container).
.IP "\fBm:\fR\fIkey\fR\fB[:\fR\fIvalue\fR\fB]\fR" 4
.IX Item "m:key[:value]"
Matches streams with the metadata tag \fIkey\fR having the specified value. If
\&\fIvalue\fR is not given, matches streams that contain the given tag with any
value.
.IP "\fBu\fR" 4
.IX Item "u"
Matches streams with usable configuration, the codec must be defined and the
essential information such as video dimension or audio sample rate must be present.
.Sp
Note that in \fBffmpeg\fR, matching by metadata will only work properly for
input files.
.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. If no argument is specified, only basic (non advanced) tool
options are shown.
.Sp
Possible values of \fIarg\fR are:
.RS 4
.IP "\fBlong\fR" 4
.IX Item "long"
Print advanced tool options in addition to the basic tool options.
.IP "\fBfull\fR" 4
.IX Item "full"
Print complete list of options, including shared and private options
for encoders, decoders, demuxers, muxers, filters, etc.
.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 (including devices).
.IP "\fB\-devices\fR" 4
.IX Item "-devices"
Show available devices.
.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\-colors\fR" 4
.IX Item "-colors"
Show recognized color names.
.IP "\fB\-sources\fR \fIdevice\fR\fB[,\fR\fIopt1\fR\fB=\fR\fIval1\fR\fB[,\fR\fIopt2\fR\fB=\fR\fIval2\fR\fB]...]\fR" 4
.IX Item "-sources device[,opt1=val1[,opt2=val2]...]"
Show autodetected sources of the intput device.
Some devices may provide system-dependent source names that cannot be autodetected.
The returned list cannot be assumed to be always complete.
.Sp
.Vb 1
\&        ffmpeg \-sources pulse,server=192.168.0.4
.Ve
.IP "\fB\-sinks\fR \fIdevice\fR\fB[,\fR\fIopt1\fR\fB=\fR\fIval1\fR\fB[,\fR\fIopt2\fR\fB=\fR\fIval2\fR\fB]...]\fR" 4
.IX Item "-sinks device[,opt1=val1[,opt2=val2]...]"
Show autodetected sinks of the output device.
Some devices may provide system-dependent sink names that cannot be autodetected.
The returned list cannot be assumed to be always complete.
.Sp
.Vb 1
\&        ffmpeg \-sinks pulse,server=192.168.0.4
.Ve
.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 string or a number containing one of the following values:
.RS 4
.IP "\fBquiet, \-8\fR" 4
.IX Item "quiet, -8"
Show nothing at all; be silent.
.IP "\fBpanic, 0\fR" 4
.IX Item "panic, 0"
Only show fatal errors which could lead the process to crash, such as
an assertion failure. This is not currently used for anything.
.IP "\fBfatal, 8\fR" 4
.IX Item "fatal, 8"
Only show fatal errors. These are errors after which the process absolutely
cannot continue.
.IP "\fBerror, 16\fR" 4
.IX Item "error, 16"
Show all errors, including ones which can be recovered from.
.IP "\fBwarning, 24\fR" 4
.IX Item "warning, 24"
Show all warnings and errors. Any message related to possibly
incorrect or unexpected events will be shown.
.IP "\fBinfo, 32\fR" 4
.IX Item "info, 32"
Show informative messages during processing. This is in addition to
warnings and errors. This is the default value.
.IP "\fBverbose, 40\fR" 4
.IX Item "verbose, 40"
Same as \f(CW\*(C`info\*(C'\fR, except more verbose.
.IP "\fBdebug, 48\fR" 4
.IX Item "debug, 48"
Show everything, including debugging information.
.IP "\fBtrace, 56\fR" 4
.IX Item "trace, 56"
.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 future 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 \fB\s-1FFREPORT\s0\fR to any value has the
same effect. If the value is a ':'\-separated key=value sequence, these
options will affect the report; option values must be escaped if they
contain special characters or the options delimiter ':' (see the
``Quoting and escaping'' section in the ffmpeg-utils manual).
.Sp
The following options are 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
.IP "\fBlevel\fR" 4
.IX Item "level"
set the log verbosity level using a numerical value (see \f(CW\*(C`\-loglevel\*(C'\fR).
.RE
.RS 4
.Sp
For example, to output a report to a file named \fIffreport.log\fR
using a log level of \f(CW32\fR (alias for log level \f(CW\*(C`info\*(C'\fR):
.Sp
.Vb 1
\&        FFREPORT=file=ffreport.log:level=32 ffmpeg \-i input output
.Ve
.Sp
Errors in parsing the environment variable are not fatal, and will not
appear in the report.
.RE
.IP "\fB\-hide_banner\fR" 4
.IX Item "-hide_banner"
Suppress printing banner.
.Sp
All FFmpeg tools will normally show a copyright notice, build options
and library versions. This option can be used to suppress printing
this information.
.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 "\fBavx2\fR" 4
.IX Item "avx2"
.IP "\fBxop\fR" 4
.IX Item "xop"
.IP "\fBfma3\fR" 4
.IX Item "fma3"
.IP "\fBfma4\fR" 4
.IX Item "fma4"
.IP "\fB3dnow\fR" 4
.IX Item "3dnow"
.IP "\fB3dnowext\fR" 4
.IX Item "3dnowext"
.IP "\fBbmi1\fR" 4
.IX Item "bmi1"
.IP "\fBbmi2\fR" 4
.IX Item "bmi2"
.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"
.IP "\fBsetend\fR" 4
.IX Item "setend"
.RE
.RS 4
.RE
.IP "\fBAArch64\fR" 4
.IX Item "AArch64"
.RS 4
.IP "\fBarmv8\fR" 4
.IX Item "armv8"
.IP "\fBvfp\fR" 4
.IX Item "vfp"
.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_bench\fR" 4
.IX Item "-opencl_bench"
.PD
This option is used to benchmark all available OpenCL devices and print the
results. This option is only available when FFmpeg has been compiled with
\&\f(CW\*(C`\-\-enable\-opencl\*(C'\fR.
.Sp
When FFmpeg is configured with \f(CW\*(C`\-\-enable\-opencl\*(C'\fR, the options for the
global OpenCL context are set via \fB\-opencl_options\fR. See the
\&\*(L"OpenCL Options\*(R" section in the ffmpeg-utils manual for the complete list of
supported options. Amongst others, these options include the ability to select
a specific platform and device to run the OpenCL code on. By default, FFmpeg
will run on the first device of the first platform. While the options for the
global OpenCL context provide flexibility to the user in selecting the OpenCL
device of their choice, most users would probably want to select the fastest
OpenCL device for their system.
.Sp
This option assists the selection of the most efficient configuration by
identifying the appropriate device for the user's system. The built-in
benchmark is run on all the OpenCL devices and the performance is measured for
each device. The devices in the results list are sorted based on their
performance with the fastest device listed first. The user can subsequently
invoke \fBffmpeg\fR using the device deemed most appropriate via
\&\fB\-opencl_options\fR to obtain the best performance for the OpenCL
accelerated code.
.Sp
Typical usage to use the fastest OpenCL device involve the following steps.
.Sp
Run the command:
.Sp
.Vb 1
\&        ffmpeg \-opencl_bench
.Ve
.Sp
Note down the platform \s-1ID \s0(\fIpidx\fR) and device \s-1ID \s0(\fIdidx\fR) of the first
i.e. fastest device in the list.
Select the platform and device using the command:
.Sp
.Vb 1
\&        ffmpeg \-opencl_options platform_idx=<pidx>:device_idx=<didx> ...
.Ve
.IP "\fB\-opencl_options options (\fR\fIglobal\fR\fB)\fR" 4
.IX Item "-opencl_options options (global)"
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 per-stream, and thus a stream specifier
should be attached to them.
.PP
Note: the \fB\-nooption\fR syntax cannot be used for boolean
AVOptions, use \fB\-option 0\fR/\fB\-option 1\fR.
.PP
Note: the 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 \fIconfigfile\fR" 4
.IX Item "-f configfile"
Read configuration file \fIconfigfile\fR. If not specified it will
read by default from \fI/etc/ffserver.conf\fR.
.IP "\fB\-n\fR" 4
.IX Item "-n"
Enable no-launch mode. This option disables all the \f(CW\*(C`Launch\*(C'\fR
directives within the various \f(CW\*(C`<Feed>\*(C'\fR sections. Since
\&\fBffserver\fR will not launch any \fBffmpeg\fR instances, you
will have to launch them manually.
.IP "\fB\-d\fR" 4
.IX Item "-d"
Enable debug mode. This option increases log verbosity, and directs
log messages to stdout. When specified, the \fBCustomLog\fR option
is ignored.
.SH "CONFIGURATION FILE SYNTAX"
.IX Header "CONFIGURATION FILE SYNTAX"
\&\fBffserver\fR reads a configuration file containing global
options and settings for each stream and feed.
.PP
The configuration file consists of global options and dedicated
sections, which must be introduced by "<\fI\s-1SECTION_NAME\s0\fR
\&\fI\s-1ARGS\s0\fR>\*(L" on a separate line and must be terminated by a line in
the form \*(R"</\fI\s-1SECTION_NAME\s0\fR>". \fI\s-1ARGS\s0\fR is optional.
.PP
Currently the following sections are recognized: \fBFeed\fR,
\&\fBStream\fR, \fBRedirect\fR.
.PP
A line starting with \f(CW\*(C`#\*(C'\fR is ignored and treated as a comment.
.PP
Name of options and sections are case-insensitive.
.SS "\s-1ACL\s0 syntax"
.IX Subsection "ACL syntax"
An \s-1ACL \s0(Access Control List) specifies the address which are allowed
to access a given stream, or to write a given feed.
.PP
It accepts the folling forms
.IP "\(bu" 4
Allow/deny access to \fIaddress\fR.
.Sp
.Vb 2
\&        ACL ALLOW <address>
\&        ACL DENY <address>
.Ve
.IP "\(bu" 4
Allow/deny access to ranges of addresses from \fIfirst_address\fR to
\&\fIlast_address\fR.
.Sp
.Vb 2
\&        ACL ALLOW <first_address> <last_address>
\&        ACL DENY <first_address> <last_address>
.Ve
.PP
You can repeat the \s-1ACL\s0 allow/deny as often as you like. It is on a per
stream basis. The first match defines the action. If there are no matches,
then the default is the inverse of the last \s-1ACL\s0 statement.
.PP
Thus '\s-1ACL\s0 allow localhost' only allows access from localhost.
\&'\s-1ACL\s0 deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
allow everybody else.
.SS "Global options"
.IX Subsection "Global options"
.IP "\fBHTTPPort\fR \fIport_number\fR" 4
.IX Item "HTTPPort port_number"
.PD 0
.IP "\fBPort\fR \fIport_number\fR" 4
.IX Item "Port port_number"
.IP "\fBRTSPPort\fR \fIport_number\fR" 4
.IX Item "RTSPPort port_number"
.PD
\&\fIHTTPPort\fR sets the \s-1HTTP\s0 server listening \s-1TCP\s0 port number,
\&\fIRTSPPort\fR sets the \s-1RTSP\s0 server listening \s-1TCP\s0 port number.
.Sp
\&\fIPort\fR is the equivalent of \fIHTTPPort\fR and is deprecated.
.Sp
You must select a different port from your standard \s-1HTTP\s0 web server if
it is running on the same computer.
.Sp
If not specified, no corresponding server will be created.
.IP "\fBHTTPBindAddress\fR \fIip_address\fR" 4
.IX Item "HTTPBindAddress ip_address"
.PD 0
.IP "\fBBindAddress\fR \fIip_address\fR" 4
.IX Item "BindAddress ip_address"
.IP "\fBRTSPBindAddress\fR \fIip_address\fR" 4
.IX Item "RTSPBindAddress ip_address"
.PD
Set address on which the \s-1HTTP/RTSP\s0 server is bound. Only useful if you
have several network interfaces.
.Sp
\&\fIBindAddress\fR is the equivalent of \fIHTTPBindAddress\fR and is
deprecated.
.IP "\fBMaxHTTPConnections\fR \fIn\fR" 4
.IX Item "MaxHTTPConnections n"
Set number of simultaneous \s-1HTTP\s0 connections that can be handled. It
has to be defined \fIbefore\fR the \fBMaxClients\fR parameter,
since it defines the \fBMaxClients\fR maximum limit.
.Sp
Default value is 2000.
.IP "\fBMaxClients\fR \fIn\fR" 4
.IX Item "MaxClients n"
Set number of simultaneous requests that can be handled. Since
\&\fBffserver\fR is very fast, it is more likely that you will want
to leave this high and use \fBMaxBandwidth\fR.
.Sp
Default value is 5.
.IP "\fBMaxBandwidth\fR \fIkbps\fR" 4
.IX Item "MaxBandwidth kbps"
Set the maximum amount of kbit/sec that you are prepared to consume
when streaming to clients.
.Sp
Default value is 1000.
.IP "\fBCustomLog\fR \fIfilename\fR" 4
.IX Item "CustomLog filename"
Set access log file (uses standard Apache log file format). '\-' is the
standard output.
.Sp
If not specified \fBffserver\fR will produce no log.
.Sp
In case the commandline option \fB\-d\fR is specified this option is
ignored, and the log is written to standard output.
.IP "\fBNoDaemon\fR" 4
.IX Item "NoDaemon"
Set no-daemon mode. This option is currently ignored since now
\&\fBffserver\fR will always work in no-daemon mode, and is
deprecated.
.IP "\fBUseDefaults\fR" 4
.IX Item "UseDefaults"
.PD 0
.IP "\fBNoDefaults\fR" 4
.IX Item "NoDefaults"
.PD
Control whether default codec options are used for the all streams or not.
Each stream may overwrite this setting for its own. Default is \fIUseDefaults\fR.
The lastest occurrence overrides previous if multiple definitions.
.SS "Feed section"
.IX Subsection "Feed section"
A Feed section defines a feed provided to \fBffserver\fR.
.PP
Each live feed contains one video and/or audio sequence coming from an
\&\fBffmpeg\fR encoder or another \fBffserver\fR. This sequence
may be encoded simultaneously with several codecs at several
resolutions.
.PP
A feed instance specification is introduced by a line in the form:
.PP
.Vb 1
\&        <Feed FEED_FILENAME>
.Ve
.PP
where \fI\s-1FEED_FILENAME\s0\fR specifies the unique name of the \s-1FFM\s0 stream.
.PP
The following options are recognized within a Feed section.
.IP "\fBFile\fR \fIfilename\fR" 4
.IX Item "File filename"
.PD 0
.IP "\fBReadOnlyFile\fR \fIfilename\fR" 4
.IX Item "ReadOnlyFile filename"
.PD
Set the path where the feed file is stored on disk.
.Sp
If not specified, the \fI/tmp/FEED.ffm\fR is assumed, where
\&\fI\s-1FEED\s0\fR is the feed name.
.Sp
If \fBReadOnlyFile\fR is used the file is marked as read-only and
it will not be deleted or updated.
.IP "\fBTruncate\fR" 4
.IX Item "Truncate"
Truncate the feed file, rather than appending to it. By default
\&\fBffserver\fR will append data to the file, until the maximum
file size value is reached (see \fBFileMaxSize\fR option).
.IP "\fBFileMaxSize\fR \fIsize\fR" 4
.IX Item "FileMaxSize size"
Set maximum size of the feed file in bytes. 0 means unlimited. The
postfixes \f(CW\*(C`K\*(C'\fR (2^10), \f(CW\*(C`M\*(C'\fR (2^20), and \f(CW\*(C`G\*(C'\fR (2^30) are
recognized.
.Sp
Default value is 5M.
.IP "\fBLaunch\fR \fIargs\fR" 4
.IX Item "Launch args"
Launch an \fBffmpeg\fR command when creating \fBffserver\fR.
.Sp
\&\fIargs\fR must be a sequence of arguments to be provided to an
\&\fBffmpeg\fR instance. The first provided argument is ignored, and
it is replaced by a path with the same dirname of the \fBffserver\fR
instance, followed by the remaining argument and terminated with a
path corresponding to the feed.
.Sp
When the launched process exits, \fBffserver\fR will launch
another program instance.
.Sp
In case you need a more complex \fBffmpeg\fR configuration,
e.g. if you need to generate multiple \s-1FFM\s0 feeds with a single
\&\fBffmpeg\fR instance, you should launch \fBffmpeg\fR by hand.
.Sp
This option is ignored in case the commandline option \fB\-n\fR is
specified.
.IP "\fB\s-1ACL\s0\fR \fIspec\fR" 4
.IX Item "ACL spec"
Specify the list of \s-1IP\s0 address which are allowed or denied to write
the feed. Multiple \s-1ACL\s0 options can be specified.
.SS "Stream section"
.IX Subsection "Stream section"
A Stream section defines a stream provided by \fBffserver\fR, and
identified by a single name.
.PP
The stream is sent when answering a request containing the stream
name.
.PP
A stream section must be introduced by the line:
.PP
.Vb 1
\&        <Stream STREAM_NAME>
.Ve
.PP
where \fI\s-1STREAM_NAME\s0\fR specifies the unique name of the stream.
.PP
The following options are recognized within a Stream section.
.PP
Encoding options are marked with the \fIencoding\fR tag, and they are
used to set the encoding parameters, and are mapped to libavcodec
encoding options. Not all encoding options are supported, in
particular it is not possible to set encoder private options. In order
to override the encoding options specified by \fBffserver\fR, you
can use the \fBffmpeg\fR \fBoverride_ffserver\fR commandline
option.
.PP
Only one of the \fBFeed\fR and \fBFile\fR options should be set.
.IP "\fBFeed\fR \fIfeed_name\fR" 4
.IX Item "Feed feed_name"
Set the input feed. \fIfeed_name\fR must correspond to an existing
feed defined in a \f(CW\*(C`Feed\*(C'\fR section.
.Sp
When this option is set, encoding options are used to setup the
encoding operated by the remote \fBffmpeg\fR process.
.IP "\fBFile\fR \fIfilename\fR" 4
.IX Item "File filename"
Set the filename of the pre-recorded input file to stream.
.Sp
When this option is set, encoding options are ignored and the input
file content is re-streamed as is.
.IP "\fBFormat\fR \fIformat_name\fR" 4
.IX Item "Format format_name"
Set the format of the output stream.
.Sp
Must be the name of a format recognized by FFmpeg. If set to
\&\fBstatus\fR, it is treated as a status stream.
.IP "\fBInputFormat\fR \fIformat_name\fR" 4
.IX Item "InputFormat format_name"
Set input format. If not specified, it is automatically guessed.
.IP "\fBPreroll\fR \fIn\fR" 4
.IX Item "Preroll n"
Set this to the number of seconds backwards in time to start. Note that
most players will buffer 5\-10 seconds of video, and also you need to allow
for a keyframe to appear in the data stream.
.Sp
Default value is 0.
.IP "\fBStartSendOnKey\fR" 4
.IX Item "StartSendOnKey"
Do not send stream until it gets the first key frame. By default
\&\fBffserver\fR will send data immediately.
.IP "\fBMaxTime\fR \fIn\fR" 4
.IX Item "MaxTime n"
Set the number of seconds to run. This value set the maximum duration
of the stream a client will be able to receive.
.Sp
A value of 0 means that no limit is set on the stream duration.
.IP "\fB\s-1ACL\s0\fR \fIspec\fR" 4
.IX Item "ACL spec"
Set \s-1ACL\s0 for the stream.
.IP "\fBDynamicACL\fR \fIspec\fR" 4
.IX Item "DynamicACL spec"
.PD 0
.IP "\fBRTSPOption\fR \fIoption\fR" 4
.IX Item "RTSPOption option"
.IP "\fBMulticastAddress\fR \fIaddress\fR" 4
.IX Item "MulticastAddress address"
.IP "\fBMulticastPort\fR \fIport\fR" 4
.IX Item "MulticastPort port"
.IP "\fBMulticastTTL\fR \fIinteger\fR" 4
.IX Item "MulticastTTL integer"
.IP "\fBNoLoop\fR" 4
.IX Item "NoLoop"
.IP "\fBFaviconURL\fR \fIurl\fR" 4
.IX Item "FaviconURL url"
.PD
Set favicon (favourite icon) for the server status page. It is ignored
for regular streams.
.IP "\fBAuthor\fR \fIvalue\fR" 4
.IX Item "Author value"
.PD 0
.IP "\fBComment\fR \fIvalue\fR" 4
.IX Item "Comment value"
.IP "\fBCopyright\fR \fIvalue\fR" 4
.IX Item "Copyright value"
.IP "\fBTitle\fR \fIvalue\fR" 4
.IX Item "Title value"
.PD
Set metadata corresponding to the option. All these options are
deprecated in favor of \fBMetadata\fR.
.IP "\fBMetadata\fR \fIkey\fR\fB \fR\fIvalue\fR" 4
.IX Item "Metadata key value"
Set metadata value on the output stream.
.IP "\fBUseDefaults\fR" 4
.IX Item "UseDefaults"
.PD 0
.IP "\fBNoDefaults\fR" 4
.IX Item "NoDefaults"
.PD
Control whether default codec options are used for the stream or not.
Default is \fIUseDefaults\fR unless disabled globally.
.IP "\fBNoAudio\fR" 4
.IX Item "NoAudio"
.PD 0
.IP "\fBNoVideo\fR" 4
.IX Item "NoVideo"
.PD
Suppress audio/video.
.IP "\fBAudioCodec\fR \fIcodec_name\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "AudioCodec codec_name (encoding,audio)"
Set audio codec.
.IP "\fBAudioBitRate\fR \fIrate\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "AudioBitRate rate (encoding,audio)"
Set bitrate for the audio stream in kbits per second.
.IP "\fBAudioChannels\fR \fIn\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "AudioChannels n (encoding,audio)"
Set number of audio channels.
.IP "\fBAudioSampleRate\fR \fIn\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "AudioSampleRate n (encoding,audio)"
Set sampling frequency for audio. When using low bitrates, you should
lower this frequency to 22050 or 11025. The supported frequencies
depend on the selected audio codec.
.IP "\fBAVOptionAudio [\fR\fIcodec\fR\fB:]\fR\fIoption\fR\fB \fR\fIvalue\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "AVOptionAudio [codec:]option value (encoding,audio)"
Set generic or private option for audio stream.
Private option must be prefixed with codec name or codec must be defined before.
.IP "\fBAVPresetAudio\fR \fIpreset\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "AVPresetAudio preset (encoding,audio)"
Set preset for audio stream.
.IP "\fBVideoCodec\fR \fIcodec_name\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoCodec codec_name (encoding,video)"
Set video codec.
.IP "\fBVideoBitRate\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoBitRate n (encoding,video)"
Set bitrate for the video stream in kbits per second.
.IP "\fBVideoBitRateRange\fR \fIrange\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoBitRateRange range (encoding,video)"
Set video bitrate range.
.Sp
A range must be specified in the form \fIminrate\fR\-\fImaxrate\fR, and
specifies the \fBminrate\fR and \fBmaxrate\fR encoding options
expressed in kbits per second.
.IP "\fBVideoBitRateRangeTolerance\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoBitRateRangeTolerance n (encoding,video)"
Set video bitrate tolerance in kbits per second.
.IP "\fBPixelFormat\fR \fIpixel_format\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "PixelFormat pixel_format (encoding,video)"
Set video pixel format.
.IP "\fBDebug\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "Debug integer (encoding,video)"
Set video \fBdebug\fR encoding option.
.IP "\fBStrict\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "Strict integer (encoding,video)"
Set video \fBstrict\fR encoding option.
.IP "\fBVideoBufferSize\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoBufferSize n (encoding,video)"
Set ratecontrol buffer size, expressed in \s-1KB.\s0
.IP "\fBVideoFrameRate\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoFrameRate n (encoding,video)"
Set number of video frames per second.
.IP "\fBVideoSize (\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoSize (encoding,video)"
Set size of the video frame, must be an abbreviation or in the form
\&\fIW\fRx\fIH\fR.  See \fBthe Video size section
in the \f(BIffmpeg\-utils\fB\|(1) manual\fR.
.Sp
Default value is \f(CW\*(C`160x128\*(C'\fR.
.IP "\fBVideoIntraOnly (\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoIntraOnly (encoding,video)"
Transmit only intra frames (useful for low bitrates, but kills frame rate).
.IP "\fBVideoGopSize\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoGopSize n (encoding,video)"
If non-intra only, an intra frame is transmitted every VideoGopSize
frames. Video synchronization can only begin at an intra frame.
.IP "\fBVideoTag\fR \fItag\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoTag tag (encoding,video)"
Set video tag.
.IP "\fBVideoHighQuality (\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoHighQuality (encoding,video)"
.PD 0
.IP "\fBVideo4MotionVector (\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "Video4MotionVector (encoding,video)"
.IP "\fBBitExact (\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "BitExact (encoding,video)"
.PD
Set bitexact encoding flag.
.IP "\fBIdctSimple (\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "IdctSimple (encoding,video)"
Set simple \s-1IDCT\s0 algorithm.
.IP "\fBQscale\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "Qscale n (encoding,video)"
Enable constant quality encoding, and set video qscale (quantization
scale) value, expressed in \fIn\fR \s-1QP\s0 units.
.IP "\fBVideoQMin\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoQMin n (encoding,video)"
.PD 0
.IP "\fBVideoQMax\fR \fIn\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoQMax n (encoding,video)"
.PD
Set video qmin/qmax.
.IP "\fBVideoQDiff\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "VideoQDiff integer (encoding,video)"
Set video \fBqdiff\fR encoding option.
.IP "\fBLumiMask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "LumiMask float (encoding,video)"
.PD 0
.IP "\fBDarkMask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "DarkMask float (encoding,video)"
.PD
Set \fBlumi_mask\fR/\fBdark_mask\fR encoding options.
.IP "\fBAVOptionVideo [\fR\fIcodec\fR\fB:]\fR\fIoption\fR\fB \fR\fIvalue\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "AVOptionVideo [codec:]option value (encoding,video)"
Set generic or private option for video stream.
Private option must be prefixed with codec name or codec must be defined before.
.IP "\fBAVPresetVideo\fR \fIpreset\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "AVPresetVideo preset (encoding,video)"
Set preset for video stream.
.Sp
\&\fIpreset\fR must be the path of a preset file.
.PP
\fIServer status stream\fR
.IX Subsection "Server status stream"
.PP
A server status stream is a special stream which is used to show
statistics about the \fBffserver\fR operations.
.PP
It must be specified setting the option \fBFormat\fR to
\&\fBstatus\fR.
.SS "Redirect section"
.IX Subsection "Redirect section"
A redirect section specifies where to redirect the requested \s-1URL\s0 to
another page.
.PP
A redirect section must be introduced by the line:
.PP
.Vb 1
\&        <Redirect NAME>
.Ve
.PP
where \fI\s-1NAME\s0\fR is the name of the page which should be redirected.
.PP
It only accepts the option \fB\s-1URL\s0\fR, which specify the redirection
\&\s-1URL.\s0
.SH "STREAM EXAMPLES"
.IX Header "STREAM EXAMPLES"
.IP "\(bu" 4
Multipart \s-1JPEG\s0
.Sp
.Vb 8
\&        <Stream test.mjpg>
\&        Feed feed1.ffm
\&        Format mpjpeg
\&        VideoFrameRate 2
\&        VideoIntraOnly
\&        NoAudio
\&        Strict \-1
\&        </Stream>
.Ve
.IP "\(bu" 4
Single \s-1JPEG\s0
.Sp
.Vb 9
\&        <Stream test.jpg>
\&        Feed feed1.ffm
\&        Format jpeg
\&        VideoFrameRate 2
\&        VideoIntraOnly
\&        VideoSize 352x240
\&        NoAudio
\&        Strict \-1
\&        </Stream>
.Ve
.IP "\(bu" 4
Flash
.Sp
.Vb 7
\&        <Stream test.swf>
\&        Feed feed1.ffm
\&        Format swf
\&        VideoFrameRate 2
\&        VideoIntraOnly
\&        NoAudio
\&        </Stream>
.Ve
.IP "\(bu" 4
\&\s-1ASF\s0 compatible
.Sp
.Vb 11
\&        <Stream test.asf>
\&        Feed feed1.ffm
\&        Format asf
\&        VideoFrameRate 15
\&        VideoSize 352x240
\&        VideoBitRate 256
\&        VideoBufferSize 40
\&        VideoGopSize 30
\&        AudioBitRate 64
\&        StartSendOnKey
\&        </Stream>
.Ve
.IP "\(bu" 4
\&\s-1MP3\s0 audio
.Sp
.Vb 9
\&        <Stream test.mp3>
\&        Feed feed1.ffm
\&        Format mp2
\&        AudioCodec mp3
\&        AudioBitRate 64
\&        AudioChannels 1
\&        AudioSampleRate 44100
\&        NoVideo
\&        </Stream>
.Ve
.IP "\(bu" 4
Ogg Vorbis audio
.Sp
.Vb 8
\&        <Stream test.ogg>
\&        Feed feed1.ffm
\&        Metadata title "Stream title"
\&        AudioBitRate 64
\&        AudioChannels 2
\&        AudioSampleRate 44100
\&        NoVideo
\&        </Stream>
.Ve
.IP "\(bu" 4
Real with audio only at 32 kbits
.Sp
.Vb 6
\&        <Stream test.ra>
\&        Feed feed1.ffm
\&        Format rm
\&        AudioBitRate 32
\&        NoVideo
\&        </Stream>
.Ve
.IP "\(bu" 4
Real with audio and video at 64 kbits
.Sp
.Vb 8
\&        <Stream test.rm>
\&        Feed feed1.ffm
\&        Format rm
\&        AudioBitRate 32
\&        VideoBitRate 128
\&        VideoFrameRate 25
\&        VideoGopSize 25
\&        </Stream>
.Ve
.IP "\(bu" 4
For stream coming from a file: you only need to set the input filename
and optionally a new format.
.Sp
.Vb 4
\&        <Stream file.rm>
\&        File "/usr/local/httpd/htdocs/tlive.rm"
\&        NoAudio
\&        </Stream>
\&
\&
\&        
\&        <Stream file.asf>
\&        File "/usr/local/httpd/htdocs/test.asf"
\&        NoAudio
\&        Metadata author "Me"
\&        Metadata copyright "Super MegaCorp"
\&        Metadata title "Test stream from disk"
\&        Metadata comment "Test comment"
\&        </Stream>
.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
\&\fB'\fR and \fB\e\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 \fB\e\fR.
.IP "\(bu" 4
All characters enclosed between \fB''\fR are included literally in the
parsed string. The quote character \fB'\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 \fB\e\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"
There are two accepted syntaxes for expressing time duration.
.PP
.Vb 1
\&        [\-][<HH>:]<MM>:<SS>[.<m>...]
.Ve
.PP
\&\fI\s-1HH\s0\fR expresses the number of hours, \fI\s-1MM\s0\fR the number of minutes
for a maximum of 2 digits, and \fI\s-1SS\s0\fR the number of seconds for a
maximum of 2 digits. The \fIm\fR at the end expresses decimal value for
\&\fI\s-1SS\s0\fR.
.PP
\&\fIor\fR
.PP
.Vb 1
\&        [\-]<S>+[.<m>...]
.Ve
.PP
\&\fIS\fR expresses the number of seconds, with the optional decimal part
\&\fIm\fR.
.PP
In both expressions, the optional \fB\-\fR indicates negative duration.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
The following examples are all valid time duration:
.IP "\fB55\fR" 4
.IX Item "55"
55 seconds
.IP "\fB12:03:45\fR" 4
.IX Item "12:03:45"
12 hours, 03 minutes and 45 seconds
.IP "\fB23.189\fR" 4
.IX Item "23.189"
23.189 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
.IP "\fBnhd\fR" 4
.IX Item "nhd"
640x360
.IP "\fBhqvga\fR" 4
.IX Item "hqvga"
240x160
.IP "\fBwqvga\fR" 4
.IX Item "wqvga"
400x240
.IP "\fBfwqvga\fR" 4
.IX Item "fwqvga"
432x240
.IP "\fBhvga\fR" 4
.IX Item "hvga"
480x320
.IP "\fBqhd\fR" 4
.IX Item "qhd"
960x540
.IP "\fB2kdci\fR" 4
.IX Item "2kdci"
2048x1080
.IP "\fB4kdci\fR" 4
.IX Item "4kdci"
4096x2160
.IP "\fBuhd2160\fR" 4
.IX Item "uhd2160"
3840x2160
.IP "\fBuhd4320\fR" 4
.IX Item "uhd4320"
7680x4320
.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 as defined below (case insensitive match) or a
\&\f(CW\*(C`[0x|#]RRGGBB[AA]\*(C'\fR sequence, possibly followed by @ 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 (\fB0x00\fR or \fB0.0\fR means completely
transparent, \fB0xff\fR or \fB1.0\fR completely opaque). If the alpha
component is not specified then \fB0xff\fR is assumed.
.PP
The string \fBrandom\fR will result in a random color.
.PP
The following names of colors are recognized:
.IP "\fBAliceBlue\fR" 4
.IX Item "AliceBlue"
0xF0F8FF
.IP "\fBAntiqueWhite\fR" 4
.IX Item "AntiqueWhite"
0xFAEBD7
.IP "\fBAqua\fR" 4
.IX Item "Aqua"
0x00FFFF
.IP "\fBAquamarine\fR" 4
.IX Item "Aquamarine"
0x7FFFD4
.IP "\fBAzure\fR" 4
.IX Item "Azure"
0xF0FFFF
.IP "\fBBeige\fR" 4
.IX Item "Beige"
0xF5F5DC
.IP "\fBBisque\fR" 4
.IX Item "Bisque"
0xFFE4C4
.IP "\fBBlack\fR" 4
.IX Item "Black"
0x000000
.IP "\fBBlanchedAlmond\fR" 4
.IX Item "BlanchedAlmond"
0xFFEBCD
.IP "\fBBlue\fR" 4
.IX Item "Blue"
0x0000FF
.IP "\fBBlueViolet\fR" 4
.IX Item "BlueViolet"
0x8A2BE2
.IP "\fBBrown\fR" 4
.IX Item "Brown"
0xA52A2A
.IP "\fBBurlyWood\fR" 4
.IX Item "BurlyWood"
0xDEB887
.IP "\fBCadetBlue\fR" 4
.IX Item "CadetBlue"
0x5F9EA0
.IP "\fBChartreuse\fR" 4
.IX Item "Chartreuse"
0x7FFF00
.IP "\fBChocolate\fR" 4
.IX Item "Chocolate"
0xD2691E
.IP "\fBCoral\fR" 4
.IX Item "Coral"
0xFF7F50
.IP "\fBCornflowerBlue\fR" 4
.IX Item "CornflowerBlue"
0x6495ED
.IP "\fBCornsilk\fR" 4
.IX Item "Cornsilk"
0xFFF8DC
.IP "\fBCrimson\fR" 4
.IX Item "Crimson"
0xDC143C
.IP "\fBCyan\fR" 4
.IX Item "Cyan"
0x00FFFF
.IP "\fBDarkBlue\fR" 4
.IX Item "DarkBlue"
0x00008B
.IP "\fBDarkCyan\fR" 4
.IX Item "DarkCyan"
0x008B8B
.IP "\fBDarkGoldenRod\fR" 4
.IX Item "DarkGoldenRod"
0xB8860B
.IP "\fBDarkGray\fR" 4
.IX Item "DarkGray"
0xA9A9A9
.IP "\fBDarkGreen\fR" 4
.IX Item "DarkGreen"
0x006400
.IP "\fBDarkKhaki\fR" 4
.IX Item "DarkKhaki"
0xBDB76B
.IP "\fBDarkMagenta\fR" 4
.IX Item "DarkMagenta"
0x8B008B
.IP "\fBDarkOliveGreen\fR" 4
.IX Item "DarkOliveGreen"
0x556B2F
.IP "\fBDarkorange\fR" 4
.IX Item "Darkorange"
0xFF8C00
.IP "\fBDarkOrchid\fR" 4
.IX Item "DarkOrchid"
0x9932CC
.IP "\fBDarkRed\fR" 4
.IX Item "DarkRed"
0x8B0000
.IP "\fBDarkSalmon\fR" 4
.IX Item "DarkSalmon"
0xE9967A
.IP "\fBDarkSeaGreen\fR" 4
.IX Item "DarkSeaGreen"
0x8FBC8F
.IP "\fBDarkSlateBlue\fR" 4
.IX Item "DarkSlateBlue"
0x483D8B
.IP "\fBDarkSlateGray\fR" 4
.IX Item "DarkSlateGray"
0x2F4F4F
.IP "\fBDarkTurquoise\fR" 4
.IX Item "DarkTurquoise"
0x00CED1
.IP "\fBDarkViolet\fR" 4
.IX Item "DarkViolet"
0x9400D3
.IP "\fBDeepPink\fR" 4
.IX Item "DeepPink"
0xFF1493
.IP "\fBDeepSkyBlue\fR" 4
.IX Item "DeepSkyBlue"
0x00BFFF
.IP "\fBDimGray\fR" 4
.IX Item "DimGray"
0x696969
.IP "\fBDodgerBlue\fR" 4
.IX Item "DodgerBlue"
0x1E90FF
.IP "\fBFireBrick\fR" 4
.IX Item "FireBrick"
0xB22222
.IP "\fBFloralWhite\fR" 4
.IX Item "FloralWhite"
0xFFFAF0
.IP "\fBForestGreen\fR" 4
.IX Item "ForestGreen"
0x228B22
.IP "\fBFuchsia\fR" 4
.IX Item "Fuchsia"
0xFF00FF
.IP "\fBGainsboro\fR" 4
.IX Item "Gainsboro"
0xDCDCDC
.IP "\fBGhostWhite\fR" 4
.IX Item "GhostWhite"
0xF8F8FF
.IP "\fBGold\fR" 4
.IX Item "Gold"
0xFFD700
.IP "\fBGoldenRod\fR" 4
.IX Item "GoldenRod"
0xDAA520
.IP "\fBGray\fR" 4
.IX Item "Gray"
0x808080
.IP "\fBGreen\fR" 4
.IX Item "Green"
0x008000
.IP "\fBGreenYellow\fR" 4
.IX Item "GreenYellow"
0xADFF2F
.IP "\fBHoneyDew\fR" 4
.IX Item "HoneyDew"
0xF0FFF0
.IP "\fBHotPink\fR" 4
.IX Item "HotPink"
0xFF69B4
.IP "\fBIndianRed\fR" 4
.IX Item "IndianRed"
0xCD5C5C
.IP "\fBIndigo\fR" 4
.IX Item "Indigo"
0x4B0082
.IP "\fBIvory\fR" 4
.IX Item "Ivory"
0xFFFFF0
.IP "\fBKhaki\fR" 4
.IX Item "Khaki"
0xF0E68C
.IP "\fBLavender\fR" 4
.IX Item "Lavender"
0xE6E6FA
.IP "\fBLavenderBlush\fR" 4
.IX Item "LavenderBlush"
0xFFF0F5
.IP "\fBLawnGreen\fR" 4
.IX Item "LawnGreen"
0x7CFC00
.IP "\fBLemonChiffon\fR" 4
.IX Item "LemonChiffon"
0xFFFACD
.IP "\fBLightBlue\fR" 4
.IX Item "LightBlue"
0xADD8E6
.IP "\fBLightCoral\fR" 4
.IX Item "LightCoral"
0xF08080
.IP "\fBLightCyan\fR" 4
.IX Item "LightCyan"
0xE0FFFF
.IP "\fBLightGoldenRodYellow\fR" 4
.IX Item "LightGoldenRodYellow"
0xFAFAD2
.IP "\fBLightGreen\fR" 4
.IX Item "LightGreen"
0x90EE90
.IP "\fBLightGrey\fR" 4
.IX Item "LightGrey"
0xD3D3D3
.IP "\fBLightPink\fR" 4
.IX Item "LightPink"
0xFFB6C1
.IP "\fBLightSalmon\fR" 4
.IX Item "LightSalmon"
0xFFA07A
.IP "\fBLightSeaGreen\fR" 4
.IX Item "LightSeaGreen"
0x20B2AA
.IP "\fBLightSkyBlue\fR" 4
.IX Item "LightSkyBlue"
0x87CEFA
.IP "\fBLightSlateGray\fR" 4
.IX Item "LightSlateGray"
0x778899
.IP "\fBLightSteelBlue\fR" 4
.IX Item "LightSteelBlue"
0xB0C4DE
.IP "\fBLightYellow\fR" 4
.IX Item "LightYellow"
0xFFFFE0
.IP "\fBLime\fR" 4
.IX Item "Lime"
0x00FF00
.IP "\fBLimeGreen\fR" 4
.IX Item "LimeGreen"
0x32CD32
.IP "\fBLinen\fR" 4
.IX Item "Linen"
0xFAF0E6
.IP "\fBMagenta\fR" 4
.IX Item "Magenta"
0xFF00FF
.IP "\fBMaroon\fR" 4
.IX Item "Maroon"
0x800000
.IP "\fBMediumAquaMarine\fR" 4
.IX Item "MediumAquaMarine"
0x66CDAA
.IP "\fBMediumBlue\fR" 4
.IX Item "MediumBlue"
0x0000CD
.IP "\fBMediumOrchid\fR" 4
.IX Item "MediumOrchid"
0xBA55D3
.IP "\fBMediumPurple\fR" 4
.IX Item "MediumPurple"
0x9370D8
.IP "\fBMediumSeaGreen\fR" 4
.IX Item "MediumSeaGreen"
0x3CB371
.IP "\fBMediumSlateBlue\fR" 4
.IX Item "MediumSlateBlue"
0x7B68EE
.IP "\fBMediumSpringGreen\fR" 4
.IX Item "MediumSpringGreen"
0x00FA9A
.IP "\fBMediumTurquoise\fR" 4
.IX Item "MediumTurquoise"
0x48D1CC
.IP "\fBMediumVioletRed\fR" 4
.IX Item "MediumVioletRed"
0xC71585
.IP "\fBMidnightBlue\fR" 4
.IX Item "MidnightBlue"
0x191970
.IP "\fBMintCream\fR" 4
.IX Item "MintCream"
0xF5FFFA
.IP "\fBMistyRose\fR" 4
.IX Item "MistyRose"
0xFFE4E1
.IP "\fBMoccasin\fR" 4
.IX Item "Moccasin"
0xFFE4B5
.IP "\fBNavajoWhite\fR" 4
.IX Item "NavajoWhite"
0xFFDEAD
.IP "\fBNavy\fR" 4
.IX Item "Navy"
0x000080
.IP "\fBOldLace\fR" 4
.IX Item "OldLace"
0xFDF5E6
.IP "\fBOlive\fR" 4
.IX Item "Olive"
0x808000
.IP "\fBOliveDrab\fR" 4
.IX Item "OliveDrab"
0x6B8E23
.IP "\fBOrange\fR" 4
.IX Item "Orange"
0xFFA500
.IP "\fBOrangeRed\fR" 4
.IX Item "OrangeRed"
0xFF4500
.IP "\fBOrchid\fR" 4
.IX Item "Orchid"
0xDA70D6
.IP "\fBPaleGoldenRod\fR" 4
.IX Item "PaleGoldenRod"
0xEEE8AA
.IP "\fBPaleGreen\fR" 4
.IX Item "PaleGreen"
0x98FB98
.IP "\fBPaleTurquoise\fR" 4
.IX Item "PaleTurquoise"
0xAFEEEE
.IP "\fBPaleVioletRed\fR" 4
.IX Item "PaleVioletRed"
0xD87093
.IP "\fBPapayaWhip\fR" 4
.IX Item "PapayaWhip"
0xFFEFD5
.IP "\fBPeachPuff\fR" 4
.IX Item "PeachPuff"
0xFFDAB9
.IP "\fBPeru\fR" 4
.IX Item "Peru"
0xCD853F
.IP "\fBPink\fR" 4
.IX Item "Pink"
0xFFC0CB
.IP "\fBPlum\fR" 4
.IX Item "Plum"
0xDDA0DD
.IP "\fBPowderBlue\fR" 4
.IX Item "PowderBlue"
0xB0E0E6
.IP "\fBPurple\fR" 4
.IX Item "Purple"
0x800080
.IP "\fBRed\fR" 4
.IX Item "Red"
0xFF0000
.IP "\fBRosyBrown\fR" 4
.IX Item "RosyBrown"
0xBC8F8F
.IP "\fBRoyalBlue\fR" 4
.IX Item "RoyalBlue"
0x4169E1
.IP "\fBSaddleBrown\fR" 4
.IX Item "SaddleBrown"
0x8B4513
.IP "\fBSalmon\fR" 4
.IX Item "Salmon"
0xFA8072
.IP "\fBSandyBrown\fR" 4
.IX Item "SandyBrown"
0xF4A460
.IP "\fBSeaGreen\fR" 4
.IX Item "SeaGreen"
0x2E8B57
.IP "\fBSeaShell\fR" 4
.IX Item "SeaShell"
0xFFF5EE
.IP "\fBSienna\fR" 4
.IX Item "Sienna"
0xA0522D
.IP "\fBSilver\fR" 4
.IX Item "Silver"
0xC0C0C0
.IP "\fBSkyBlue\fR" 4
.IX Item "SkyBlue"
0x87CEEB
.IP "\fBSlateBlue\fR" 4
.IX Item "SlateBlue"
0x6A5ACD
.IP "\fBSlateGray\fR" 4
.IX Item "SlateGray"
0x708090
.IP "\fBSnow\fR" 4
.IX Item "Snow"
0xFFFAFA
.IP "\fBSpringGreen\fR" 4
.IX Item "SpringGreen"
0x00FF7F
.IP "\fBSteelBlue\fR" 4
.IX Item "SteelBlue"
0x4682B4
.IP "\fBTan\fR" 4
.IX Item "Tan"
0xD2B48C
.IP "\fBTeal\fR" 4
.IX Item "Teal"
0x008080
.IP "\fBThistle\fR" 4
.IX Item "Thistle"
0xD8BFD8
.IP "\fBTomato\fR" 4
.IX Item "Tomato"
0xFF6347
.IP "\fBTurquoise\fR" 4
.IX Item "Turquoise"
0x40E0D0
.IP "\fBViolet\fR" 4
.IX Item "Violet"
0xEE82EE
.IP "\fBWheat\fR" 4
.IX Item "Wheat"
0xF5DEB3
.IP "\fBWhite\fR" 4
.IX Item "White"
0xFFFFFF
.IP "\fBWhiteSmoke\fR" 4
.IX Item "WhiteSmoke"
0xF5F5F5
.IP "\fBYellow\fR" 4
.IX Item "Yellow"
0xFFFF00
.IP "\fBYellowGreen\fR" 4
.IX Item "YellowGreen"
0x9ACD32
.SS "Channel Layout"
.IX Subsection "Channel Layout"
A channel layout specifies the spatial disposition of the channels in
a multi-channel audio stream. To specify a channel layout, FFmpeg
makes use of a special syntax.
.PP
Individual channels are identified by an id, as given by the table
below:
.IP "\fB\s-1FL\s0\fR" 4
.IX Item "FL"
front left
.IP "\fB\s-1FR\s0\fR" 4
.IX Item "FR"
front right
.IP "\fB\s-1FC\s0\fR" 4
.IX Item "FC"
front center
.IP "\fB\s-1LFE\s0\fR" 4
.IX Item "LFE"
low frequency
.IP "\fB\s-1BL\s0\fR" 4
.IX Item "BL"
back left
.IP "\fB\s-1BR\s0\fR" 4
.IX Item "BR"
back right
.IP "\fB\s-1FLC\s0\fR" 4
.IX Item "FLC"
front left-of-center
.IP "\fB\s-1FRC\s0\fR" 4
.IX Item "FRC"
front right-of-center
.IP "\fB\s-1BC\s0\fR" 4
.IX Item "BC"
back center
.IP "\fB\s-1SL\s0\fR" 4
.IX Item "SL"
side left
.IP "\fB\s-1SR\s0\fR" 4
.IX Item "SR"
side right
.IP "\fB\s-1TC\s0\fR" 4
.IX Item "TC"
top center
.IP "\fB\s-1TFL\s0\fR" 4
.IX Item "TFL"
top front left
.IP "\fB\s-1TFC\s0\fR" 4
.IX Item "TFC"
top front center
.IP "\fB\s-1TFR\s0\fR" 4
.IX Item "TFR"
top front right
.IP "\fB\s-1TBL\s0\fR" 4
.IX Item "TBL"
top back left
.IP "\fB\s-1TBC\s0\fR" 4
.IX Item "TBC"
top back center
.IP "\fB\s-1TBR\s0\fR" 4
.IX Item "TBR"
top back right
.IP "\fB\s-1DL\s0\fR" 4
.IX Item "DL"
downmix left
.IP "\fB\s-1DR\s0\fR" 4
.IX Item "DR"
downmix right
.IP "\fB\s-1WL\s0\fR" 4
.IX Item "WL"
wide left
.IP "\fB\s-1WR\s0\fR" 4
.IX Item "WR"
wide right
.IP "\fB\s-1SDL\s0\fR" 4
.IX Item "SDL"
surround direct left
.IP "\fB\s-1SDR\s0\fR" 4
.IX Item "SDR"
surround direct right
.IP "\fB\s-1LFE2\s0\fR" 4
.IX Item "LFE2"
low frequency 2
.PP
Standard channel layout compositions can be specified by using the
following identifiers:
.IP "\fBmono\fR" 4
.IX Item "mono"
\&\s-1FC\s0
.IP "\fBstereo\fR" 4
.IX Item "stereo"
\&\s-1FL+FR\s0
.IP "\fB2.1\fR" 4
.IX Item "2.1"
\&\s-1FL+FR+LFE\s0
.IP "\fB3.0\fR" 4
.IX Item "3.0"
\&\s-1FL+FR+FC\s0
.IP "\fB3.0(back)\fR" 4
.IX Item "3.0(back)"
\&\s-1FL+FR+BC\s0
.IP "\fB4.0\fR" 4
.IX Item "4.0"
\&\s-1FL+FR+FC+BC\s0
.IP "\fBquad\fR" 4
.IX Item "quad"
\&\s-1FL+FR+BL+BR\s0
.IP "\fBquad(side)\fR" 4
.IX Item "quad(side)"
\&\s-1FL+FR+SL+SR\s0
.IP "\fB3.1\fR" 4
.IX Item "3.1"
\&\s-1FL+FR+FC+LFE\s0
.IP "\fB5.0\fR" 4
.IX Item "5.0"
\&\s-1FL+FR+FC+BL+BR\s0
.IP "\fB5.0(side)\fR" 4
.IX Item "5.0(side)"
\&\s-1FL+FR+FC+SL+SR\s0
.IP "\fB4.1\fR" 4
.IX Item "4.1"
\&\s-1FL+FR+FC+LFE+BC\s0
.IP "\fB5.1\fR" 4
.IX Item "5.1"
\&\s-1FL+FR+FC+LFE+BL+BR\s0
.IP "\fB5.1(side)\fR" 4
.IX Item "5.1(side)"
\&\s-1FL+FR+FC+LFE+SL+SR\s0
.IP "\fB6.0\fR" 4
.IX Item "6.0"
\&\s-1FL+FR+FC+BC+SL+SR\s0
.IP "\fB6.0(front)\fR" 4
.IX Item "6.0(front)"
\&\s-1FL+FR+FLC+FRC+SL+SR\s0
.IP "\fBhexagonal\fR" 4
.IX Item "hexagonal"
\&\s-1FL+FR+FC+BL+BR+BC\s0
.IP "\fB6.1\fR" 4
.IX Item "6.1"
\&\s-1FL+FR+FC+LFE+BC+SL+SR\s0
.IP "\fB6.1\fR" 4
.IX Item "6.1"
\&\s-1FL+FR+FC+LFE+BL+BR+BC\s0
.IP "\fB6.1(front)\fR" 4
.IX Item "6.1(front)"
\&\s-1FL+FR+LFE+FLC+FRC+SL+SR\s0
.IP "\fB7.0\fR" 4
.IX Item "7.0"
\&\s-1FL+FR+FC+BL+BR+SL+SR\s0
.IP "\fB7.0(front)\fR" 4
.IX Item "7.0(front)"
\&\s-1FL+FR+FC+FLC+FRC+SL+SR\s0
.IP "\fB7.1\fR" 4
.IX Item "7.1"
\&\s-1FL+FR+FC+LFE+BL+BR+SL+SR\s0
.IP "\fB7.1(wide)\fR" 4
.IX Item "7.1(wide)"
\&\s-1FL+FR+FC+LFE+BL+BR+FLC+FRC\s0
.IP "\fB7.1(wide\-side)\fR" 4
.IX Item "7.1(wide-side)"
\&\s-1FL+FR+FC+LFE+FLC+FRC+SL+SR\s0
.IP "\fBoctagonal\fR" 4
.IX Item "octagonal"
\&\s-1FL+FR+FC+BL+BR+BC+SL+SR\s0
.IP "\fBdownmix\fR" 4
.IX Item "downmix"
\&\s-1DL+DR\s0
.PP
A custom channel layout can be specified as a sequence of terms, separated by
\&'+' or '|'. Each term can be:
.IP "\(bu" 4
the name of a standard channel layout (e.g. \fBmono\fR,
\&\fBstereo\fR, \fB4.0\fR, \fBquad\fR, \fB5.0\fR, etc.)
.IP "\(bu" 4
the name of a single channel (e.g. \fB\s-1FL\s0\fR, \fB\s-1FR\s0\fR, \fB\s-1FC\s0\fR, \fB\s-1LFE\s0\fR, etc.)
.IP "\(bu" 4
a number of channels, in decimal, optionally followed by 'c', yielding
the default channel layout for that number of channels (see the
function \f(CW\*(C`av_get_default_channel_layout\*(C'\fR)
.IP "\(bu" 4
a channel layout mask, in hexadecimal starting with \*(L"0x\*(R" (see the
\&\f(CW\*(C`AV_CH_*\*(C'\fR macros in \fIlibavutil/channel_layout.h\fR.
.PP
Starting from libavutil version 53 the trailing character \*(L"c\*(R" to
specify a number of channels will be required, while a channel layout
mask could also be specified as a decimal number (if and only if not
followed by \*(L"c\*(R").
.PP
See also the function \f(CW\*(C`av_get_channel_layout\*(C'\fR defined in
\&\fIlibavutil/channel_layout.h\fR.
.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 "\fBclip(x, min, max)\fR" 4
.IX Item "clip(x, min, max)"
Return the value of \fIx\fR clipped between \fImin\fR and \fImax\fR.
.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, 0.0\s0 otherwise.
.IP "\fBld(var)\fR" 4
.IX Item "ld(var)"
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 minimum 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)"
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`ffmpeg \-opencl_bench\*(C'\fR or \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 specified index must be one of the indexes in the device list which
can be obtained with \f(CW\*(C`ffmpeg \-opencl_bench\*(C'\fR or \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 nonsensical 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"
Only write platform\-, build\- and time-independent data. (except (I)DCT).
This ensures that file and data checksums are reproducible and match between
platforms. Its primary use is for regression testing.
.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 "\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 (\s-1GOP\s0) 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 between non-B-frames.
.Sp
Must be an integer between \-1 and 16. 0 means that B\-frames are
disabled. If a value of \-1 is used, it will choose an automatic value
depending on the encoder.
.Sp
Default value is 0.
.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 an 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, experimental
(unfinished/work in progress/not well tested) decoders and encoders.
Note: experimental decoders can pose a security risk, do not use this for
decoding untrusted input.
.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 "\fBignore_err\fR" 4
.IX Item "ignore_err"
ignore decoding errors, and continue decoding.
This is useful if you want to analyze the content of a video and thus want
everything to be decoded no matter what. This option will not result in a video
that is pleasing to watch in case of errors.
.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 DCT\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 "\fBsimpleauto\fR" 4
.IX Item "simpleauto"
.PD
Automatically pick a \s-1IDCT\s0 compatible with the simple one
.IP "\fBarm\fR" 4
.IX Item "arm"
.PD 0
.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 "\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 IDCT\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
.IP "\fBfavor_inter\fR" 4
.IX Item "favor_inter"
favor predicting from the previous frame instead of the current
.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 "\fBsar\fR \fIrational number\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4
.IX Item "sar rational number (encoding,video)"
Set sample aspect ratio. Alias to \fIaspect\fR.
.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 "\fBgreen_metadata\fR" 4
.IX Item "green_metadata"
.PD
display complexity metadata for the upcoming frame, GoP or for a given duration.
.IP "\fBskip\fR" 4
.IX Item "skip"
.PD 0
.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
.IP "\fBnomc\fR" 4
.IX Item "nomc"
skip motion compensation
.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
This option is deprecated, see the codecview filter instead.
.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 "\fBflags2\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video\fR\fB)\fR" 4
.IX Item "flags2 flags (decoding/encoding,audio,video)"
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 "\fBignorecrop\fR" 4
.IX Item "ignorecrop"
Ignore cropping information from sps.
.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.
.IP "\fBexport_mvs\fR" 4
.IX Item "export_mvs"
Export motion vectors into frame side-data (see \f(CW\*(C`AV_FRAME_DATA_MOTION_VECTORS\*(C'\fR)
for codecs that support it. See also \fIdoc/examples/export_mvs.c\fR.
.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)"
Set the number of threads to be used, in case the selected codec
implementation supports multi-threading.
.Sp
Possible values:
.RS 4
.IP "\fBauto, 0\fR" 4
.IX Item "auto, 0"
automatically select the number of threads to set
.RE
.RS 4
.Sp
Default value is \fBauto\fR.
.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 "\fBmpeg2_aac_low\fR" 4
.IX Item "mpeg2_aac_low"
.IP "\fBmpeg2_aac_he\fR" 4
.IX Item "mpeg2_aac_he"
.IP "\fBmpeg4_sp\fR" 4
.IX Item "mpeg4_sp"
.IP "\fBmpeg4_core\fR" 4
.IX Item "mpeg4_core"
.IP "\fBmpeg4_main\fR" 4
.IX Item "mpeg4_main"
.IP "\fBmpeg4_asp\fR" 4
.IX Item "mpeg4_asp"
.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.
Negative values behave identical to the corresponding positive ones, except
that the score is normalized.
Positive values exist primarily for compatibility reasons and are not so useful.
.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)"
.PD
Possible values:
.RS 4
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBbt470m\fR" 4
.IX Item "bt470m"
\&\s-1BT.470 M\s0
.IP "\fBbt470bg\fR" 4
.IX Item "bt470bg"
\&\s-1BT.470 BG\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE 170 M\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE 240 M\s0
.IP "\fBfilm\fR" 4
.IX Item "film"
Film
.IP "\fBbt2020\fR" 4
.IX Item "bt2020"
\&\s-1BT.2020\s0
.IP "\fBsmpte428_1\fR" 4
.IX Item "smpte428_1"
\&\s-1SMPTE ST 428\-1\s0
.IP "\fBsmpte431\fR" 4
.IX Item "smpte431"
\&\s-1SMPTE 431\-2\s0
.IP "\fBsmpte432\fR" 4
.IX Item "smpte432"
\&\s-1SMPTE 432\-1\s0
.RE
.RS 4
.RE
.IP "\fBcolor_trc\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "color_trc integer (decoding/encoding,video)"
Possible values:
.RS 4
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBgamma22\fR" 4
.IX Item "gamma22"
\&\s-1BT.470 M\s0
.IP "\fBgamma28\fR" 4
.IX Item "gamma28"
\&\s-1BT.470 BG\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE 170 M\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE 240 M\s0
.IP "\fBlinear\fR" 4
.IX Item "linear"
Linear
.IP "\fBlog\fR" 4
.IX Item "log"
Log
.IP "\fBlog_sqrt\fR" 4
.IX Item "log_sqrt"
Log square root
.IP "\fBiec61966_2_4\fR" 4
.IX Item "iec61966_2_4"
\&\s-1IEC 61966\-2\-4\s0
.IP "\fBbt1361\fR" 4
.IX Item "bt1361"
\&\s-1BT.1361\s0
.IP "\fBiec61966_2_1\fR" 4
.IX Item "iec61966_2_1"
\&\s-1IEC 61966\-2\-1\s0
.IP "\fBbt2020_10bit\fR" 4
.IX Item "bt2020_10bit"
\&\s-1BT.2020 \- 10\s0 bit
.IP "\fBbt2020_12bit\fR" 4
.IX Item "bt2020_12bit"
\&\s-1BT.2020 \- 12\s0 bit
.IP "\fBsmpte2084\fR" 4
.IX Item "smpte2084"
\&\s-1SMPTE ST 2084\s0
.IP "\fBsmpte428_1\fR" 4
.IX Item "smpte428_1"
\&\s-1SMPTE ST 428\-1\s0
.IP "\fBarib\-std\-b67\fR" 4
.IX Item "arib-std-b67"
\&\s-1ARIB STD\-B67\s0
.RE
.RS 4
.RE
.IP "\fBcolorspace\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "colorspace integer (decoding/encoding,video)"
Possible values:
.RS 4
.IP "\fBrgb\fR" 4
.IX Item "rgb"
\&\s-1RGB\s0
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBfcc\fR" 4
.IX Item "fcc"
\&\s-1FCC\s0
.IP "\fBbt470bg\fR" 4
.IX Item "bt470bg"
\&\s-1BT.470 BG\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE 170 M\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE 240 M\s0
.IP "\fBycocg\fR" 4
.IX Item "ycocg"
\&\s-1YCOCG\s0
.IP "\fBbt2020_ncl\fR" 4
.IX Item "bt2020_ncl"
\&\s-1BT.2020 NCL\s0
.IP "\fBbt2020_cl\fR" 4
.IX Item "bt2020_cl"
\&\s-1BT.2020 CL\s0
.IP "\fBsmpte2085\fR" 4
.IX Item "smpte2085"
\&\s-1SMPTE 2085\s0
.RE
.RS 4
.RE
.IP "\fBcolor_range\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4
.IX Item "color_range integer (decoding/encoding,video)"
If used as input parameter, it serves as a hint to the decoder, which
color_range the input has.
.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)"
.PD 0
.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 which multithreading methods to use.
.Sp
Use of \fBframe\fR will increase decoding delay by one frame per
thread, so clients which cannot provide future frames should not use
it.
.Sp
Possible values:
.RS 4
.IP "\fBslice\fR" 4
.IX Item "slice"
Decode more than one part of a single frame at once.
.Sp
Multithreading using slices works only when the video was encoded with
slices.
.IP "\fBframe\fR" 4
.IX Item "frame"
Decode more than one frame at once.
.RE
.RS 4
.Sp
Default value is \fBslice+frame\fR.
.RE
.IP "\fBaudio_service_type\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4
.IX Item "audio_service_type integer (encoding,audio)"
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.
.IP "\fBfield_order\fR  \fIfield_order\fR \fB(\fR\fIvideo\fR\fB)\fR" 4
.IX Item "field_order field_order (video)"
Set/override the field order of the video.
Possible values:
.RS 4
.IP "\fBprogressive\fR" 4
.IX Item "progressive"
Progressive video
.IP "\fBtt\fR" 4
.IX Item "tt"
Interlaced video, top field coded and displayed first
.IP "\fBbb\fR" 4
.IX Item "bb"
Interlaced video, bottom field coded and displayed first
.IP "\fBtb\fR" 4
.IX Item "tb"
Interlaced video, top coded first, bottom displayed first
.IP "\fBbt\fR" 4
.IX Item "bt"
Interlaced video, bottom coded first, top displayed first
.RE
.RS 4
.RE
.IP "\fBskip_alpha\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4
.IX Item "skip_alpha integer (decoding,video)"
Set to 1 to disable processing alpha (transparency). This works like the
\&\fBgray\fR flag in the \fBflags\fR option which skips chroma information
instead of alpha. Default is 0.
.IP "\fBcodec_whitelist\fR \fIlist\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "codec_whitelist list (input)"
\&\*(L",\*(R" separated list of allowed decoders. By default all are allowed.
.IP "\fBdump_separator\fR \fIstring\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "dump_separator string (input)"
Separator used to separate the fields printed on the command line about the
Stream parameters.
For example to separate the fields with newlines and indention:
.Sp
.Vb 2
\&        ffprobe \-dump_separator "
\&                                  "  \-i ~/videos/matrixbench_mpeg2.mpg
.Ve
.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`\-decoders\*(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 "hevc"
.IX Subsection "hevc"
\&\s-1HEVC / H.265\s0 decoder.
.PP
Note: the \fBskip_loop_filter\fR option has effect only at level
\&\f(CW\*(C`all\*(C'\fR.
.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"
A description of some of the currently available audio decoders
follows.
.SS "ac3"
.IX Subsection "ac3"
\&\s-1AC\-3\s0 audio decoder.
.PP
This decoder implements part of \s-1ATSC A/52:2010\s0 and \s-1ETSI TS 102 366,\s0 as well as
the undocumented RealAudio 3 (a.k.a. dnet).
.PP
\fI\s-1AC\-3\s0 Decoder Options\fR
.IX Subsection "AC-3 Decoder Options"
.IP "\fB\-drc_scale\fR \fIvalue\fR" 4
.IX Item "-drc_scale value"
Dynamic Range Scale Factor. The factor to apply to dynamic range values
from the \s-1AC\-3\s0 stream. This factor is applied exponentially.
There are 3 notable scale factor ranges:
.RS 4
.IP "\fBdrc_scale == 0\fR" 4
.IX Item "drc_scale == 0"
\&\s-1DRC\s0 disabled. Produces full range audio.
.IP "\fB0 < drc_scale <= 1\fR" 4
.IX Item "0 < drc_scale <= 1"
\&\s-1DRC\s0 enabled.  Applies a fraction of the stream \s-1DRC\s0 value.
Audio reproduction is between full range and full compression.
.IP "\fBdrc_scale > 1\fR" 4
.IX Item "drc_scale > 1"
\&\s-1DRC\s0 enabled. Applies drc_scale asymmetrically.
Loud sounds are fully compressed.  Soft sounds are enhanced.
.RE
.RS 4
.RE
.SS "flac"
.IX Subsection "flac"
\&\s-1FLAC\s0 audio decoder.
.PP
This decoder aims to implement the complete \s-1FLAC\s0 specification from Xiph.
.PP
\fI\s-1FLAC\s0 Decoder options\fR
.IX Subsection "FLAC Decoder options"
.IP "\fB\-use_buggy_lpc\fR" 4
.IX Item "-use_buggy_lpc"
The lavc \s-1FLAC\s0 encoder used to produce buggy streams with high lpc values
(like the default value). This option makes it possible to decode such streams
correctly by using lavc's old buggy lpc logic for decoding.
.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.
.SS "libcelt"
.IX Subsection "libcelt"
libcelt decoder wrapper.
.PP
libcelt allows libavcodec to decode the Xiph \s-1CELT\s0 ultra-low delay audio codec.
Requires the presence of the libcelt headers and library during configuration.
You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libcelt\*(C'\fR.
.SS "libgsm"
.IX Subsection "libgsm"
libgsm decoder wrapper.
.PP
libgsm allows libavcodec to decode the \s-1GSM\s0 full rate audio codec. Requires
the presence of the libgsm headers and library during configuration. You need
to explicitly configure the build with \f(CW\*(C`\-\-enable\-libgsm\*(C'\fR.
.PP
This decoder supports both the ordinary \s-1GSM\s0 and the Microsoft variant.
.SS "libilbc"
.IX Subsection "libilbc"
libilbc decoder wrapper.
.PP
libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
audio codec. Requires the presence of the libilbc headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libilbc\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following option is supported by the libilbc wrapper.
.IP "\fBenhance\fR" 4
.IX Item "enhance"
Enable the enhancement of the decoded audio when set to 1. The default
value is 0 (disabled).
.SS "libopencore-amrnb"
.IX Subsection "libopencore-amrnb"
libopencore-amrnb decoder wrapper.
.PP
libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
Narrowband audio codec. Using it requires the presence of the
libopencore-amrnb headers and library during configuration. You need to
explicitly configure the build with \f(CW\*(C`\-\-enable\-libopencore\-amrnb\*(C'\fR.
.PP
An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
without this library.
.SS "libopencore-amrwb"
.IX Subsection "libopencore-amrwb"
libopencore-amrwb decoder wrapper.
.PP
libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
Wideband audio codec. Using it requires the presence of the
libopencore-amrwb headers and library during configuration. You need to
explicitly configure the build with \f(CW\*(C`\-\-enable\-libopencore\-amrwb\*(C'\fR.
.PP
An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
without this library.
.SS "libopus"
.IX Subsection "libopus"
libopus decoder wrapper.
.PP
libopus allows libavcodec to decode the Opus Interactive Audio Codec.
Requires the presence of the libopus headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libopus\*(C'\fR.
.PP
An FFmpeg native decoder for Opus exists, so users can decode Opus
without this library.
.SH "SUBTITLES DECODERS"
.IX Header "SUBTITLES DECODERS"
.SS "dvbsub"
.IX Subsection "dvbsub"
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBcompute_clut\fR" 4
.IX Item "compute_clut"
.RS 4
.PD 0
.IP "\fB\-1\fR" 4
.IX Item "-1"
.PD
Compute clut if no matching \s-1CLUT\s0 is in the stream.
.IP "\fB0\fR" 4
.IX Item "0"
Never compute \s-1CLUT\s0
.IP "\fB1\fR" 4
.IX Item "1"
Always compute \s-1CLUT\s0 and override the one provided in the stream.
.RE
.RS 4
.RE
.IP "\fBdvb_substream\fR" 4
.IX Item "dvb_substream"
Selects the dvb substream, or all substreams if \-1 which is default.
.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.
.IP "\fBifo_palette\fR" 4
.IX Item "ifo_palette"
Specify the \s-1IFO\s0 file from which the global palette is obtained.
(experimental)
.IP "\fBforced_subs_only\fR" 4
.IX Item "forced_subs_only"
Only decode subtitle entries marked as forced. Some titles have forced
and non-forced subtitles in the same track. Setting this flag to \f(CW1\fR
will only keep the forced subtitles. Default value is \f(CW0\fR.
.SS "libzvbi-teletext"
.IX Subsection "libzvbi-teletext"
Libzvbi allows libavcodec to decode \s-1DVB\s0 teletext pages and \s-1DVB\s0 teletext
subtitles. Requires the presence of the libzvbi headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libzvbi\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBtxt_page\fR" 4
.IX Item "txt_page"
List of teletext page numbers to decode. You may use the special * string to
match all pages. Pages that do not match the specified list are dropped.
Default value is *.
.IP "\fBtxt_chop_top\fR" 4
.IX Item "txt_chop_top"
Discards the top teletext line. Default value is 1.
.IP "\fBtxt_format\fR" 4
.IX Item "txt_format"
Specifies the format of the decoded subtitles. The teletext decoder is capable
of decoding the teletext pages to bitmaps or to simple text, you should use
\&\*(L"bitmap\*(R" for teletext pages, because certain graphics and colors cannot be
expressed in simple text. You might use \*(L"text\*(R" for teletext based subtitles if
your application can handle simple text based subtitles. Default value is
bitmap.
.IP "\fBtxt_left\fR" 4
.IX Item "txt_left"
X offset of generated bitmaps, default is 0.
.IP "\fBtxt_top\fR" 4
.IX Item "txt_top"
Y offset of generated bitmaps, default is 0.
.IP "\fBtxt_chop_spaces\fR" 4
.IX Item "txt_chop_spaces"
Chops leading and trailing spaces and removes empty lines from the generated
text. This option is useful for teletext based subtitles where empty spaces may
be present at the start or at the end of the lines or empty lines may be
present between the subtitle lines because of double-sized teletext charactes.
Default value is 1.
.IP "\fBtxt_duration\fR" 4
.IX Item "txt_duration"
Sets the display duration of the decoded teletext pages or subtitles in
milliseconds. Default value is 30000 which is 30 seconds.
.IP "\fBtxt_transparent\fR" 4
.IX Item "txt_transparent"
Force transparent background of the generated teletext bitmaps. Default value
is 0 which means an opaque background.
.IP "\fBtxt_opacity\fR" 4
.IX Item "txt_opacity"
Sets the opacity (0\-255) of the teletext background. If
\&\fBtxt_transparent\fR is not set, it only affects characters between a start
box and an end box, typically subtitles. Default value is 0 if
\&\fBtxt_transparent\fR is set, 255 otherwise.
.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`\-encoders\*(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 "aac"
.IX Subsection "aac"
Advanced Audio Coding (\s-1AAC\s0) encoder.
.PP
This encoder is the default \s-1AAC\s0 encoder, natively implemented into FFmpeg. Its
quality is on par or better than libfdk_aac at the default bitrate of 128kbps.
This encoder also implements more options, profiles and samplerates than
other encoders (with only the AAC-HE profile pending to be implemented) so this
encoder has become the default and is the recommended choice.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBb\fR" 4
.IX Item "b"
Set bit rate in bits/s. Setting this automatically activates constant bit rate
(\s-1CBR\s0) mode. If this option is unspecified it is set to 128kbps.
.IP "\fBq\fR" 4
.IX Item "q"
Set quality for variable bit rate (\s-1VBR\s0) mode. This option is valid only using
the \fBffmpeg\fR command-line tool. For library interface users, use
\&\fBglobal_quality\fR.
.IP "\fBcutoff\fR" 4
.IX Item "cutoff"
Set cutoff frequency. If unspecified will allow the encoder to dynamically
adjust the cutoff to improve clarity on low bitrates.
.IP "\fBaac_coder\fR" 4
.IX Item "aac_coder"
Set \s-1AAC\s0 encoder coding method. Possible values:
.RS 4
.IP "\fBtwoloop\fR" 4
.IX Item "twoloop"
Two loop searching (\s-1TLS\s0) method.
.Sp
This method first sets quantizers depending on band thresholds and then tries
to find an optimal combination by adding or subtracting a specific value from
all quantizers and adjusting some individual quantizer a little.  Will tune
itself based on whether \fBaac_is\fR, \fBaac_ms\fR and \fBaac_pns\fR
are enabled.
This is the default choice for a coder.
.IP "\fBanmr\fR" 4
.IX Item "anmr"
Average noise to mask ratio (\s-1ANMR\s0) trellis-based solution.
.Sp
This is an experimental coder which currently produces a lower quality, is more
unstable and is slower than the default twoloop coder but has potential.
Currently has no support for the \fBaac_is\fR or \fBaac_pns\fR options.
Not currently recommended.
.IP "\fBfast\fR" 4
.IX Item "fast"
Constant quantizer method.
.Sp
This method sets a constant quantizer for all bands. This is the fastest of all
the methods and has no rate control or support for \fBaac_is\fR or
\&\fBaac_pns\fR.
Not recommended.
.RE
.RS 4
.RE
.IP "\fBaac_ms\fR" 4
.IX Item "aac_ms"
Sets mid/side coding mode. The default value of \*(L"auto\*(R" will automatically use
M/S with bands which will benefit from such coding. Can be forced for all bands
using the value \*(L"enable\*(R", which is mainly useful for debugging or disabled using
\&\*(L"disable\*(R".
.IP "\fBaac_is\fR" 4
.IX Item "aac_is"
Sets intensity stereo coding tool usage. By default, it's enabled and will
automatically toggle \s-1IS\s0 for similar pairs of stereo bands if it's benefitial.
Can be disabled for debugging by setting the value to \*(L"disable\*(R".
.IP "\fBaac_pns\fR" 4
.IX Item "aac_pns"
Uses perceptual noise substitution to replace low entropy high frequency bands
with imperceivable white noise during the decoding process. By default, it's
enabled, but can be disabled for debugging purposes by using \*(L"disable\*(R".
.IP "\fBaac_tns\fR" 4
.IX Item "aac_tns"
Enables the use of a multitap \s-1FIR\s0 filter which spans through the high frequency
bands to hide quantization noise during the encoding process and is reverted
by the decoder. As well as decreasing unpleasant artifacts in the high range
this also reduces the entropy in the high bands and allows for more bits to
be used by the mid-low bands. By default it's enabled but can be disabled for
debugging by setting the option to \*(L"disable\*(R".
.IP "\fBaac_ltp\fR" 4
.IX Item "aac_ltp"
Enables the use of the long term prediction extension which increases coding
efficiency in very low bandwidth situations such as encoding of voice or
solo piano music by extending constant harmonic peaks in bands throughout
frames. This option is implied by profile:a aac_low and is incompatible with
aac_pred. Use in conjunction with \fB\-ar\fR to decrease the samplerate.
.IP "\fBaac_pred\fR" 4
.IX Item "aac_pred"
Enables the use of a more traditional style of prediction where the spectral
coefficients transmitted are replaced by the difference of the current
coefficients minus the previous \*(L"predicted\*(R" coefficients. In theory and sometimes
in practice this can improve quality for low to mid bitrate audio.
This option implies the aac_main profile and is incompatible with aac_ltp.
.IP "\fBprofile\fR" 4
.IX Item "profile"
Sets the encoding profile, possible values:
.RS 4
.IP "\fBaac_low\fR" 4
.IX Item "aac_low"
The default, \s-1AAC \s0\*(L"Low-complexity\*(R" profile. Is the most compatible and produces
decent quality.
.IP "\fBmpeg2_aac_low\fR" 4
.IX Item "mpeg2_aac_low"
Equivalent to \f(CW\*(C`\-profile:a aac_low \-aac_pns 0\*(C'\fR. \s-1PNS\s0 was introduced with the
\&\s-1MPEG4\s0 specifications.
.IP "\fBaac_ltp\fR" 4
.IX Item "aac_ltp"
Long term prediction profile, is enabled by and will enable the \fBaac_ltp\fR
option. Introduced in \s-1MPEG4.\s0
.IP "\fBaac_main\fR" 4
.IX Item "aac_main"
Main-type prediction profile, is enabled by and will enable the \fBaac_pred\fR
option. Introduced in \s-1MPEG2.\s0
.RE
.RS 4
.Sp
If this option is unspecified it is set to \fBaac_low\fR.
.RE
.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 A/52:2010\s0 and \s-1ETSI TS 102 366,\s0 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 A/D\s0
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 A/D\s0 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
.SS "flac"
.IX Subsection "flac"
\&\s-1FLAC \s0(Free Lossless Audio Codec) Encoder
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by FFmpeg's flac encoder.
.IP "\fBcompression_level\fR" 4
.IX Item "compression_level"
Sets the compression level, which chooses defaults for many other options
if they are not set explicitly.
.IP "\fBframe_size\fR" 4
.IX Item "frame_size"
Sets the size of the frames in samples per channel.
.IP "\fBlpc_coeff_precision\fR" 4
.IX Item "lpc_coeff_precision"
Sets the \s-1LPC\s0 coefficient precision, valid values are from 1 to 15, 15 is the
default.
.IP "\fBlpc_type\fR" 4
.IX Item "lpc_type"
Sets the first stage \s-1LPC\s0 algorithm
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
\&\s-1LPC\s0 is not used
.IP "\fBfixed\fR" 4
.IX Item "fixed"
fixed \s-1LPC\s0 coefficients
.IP "\fBlevinson\fR" 4
.IX Item "levinson"
.PD 0
.IP "\fBcholesky\fR" 4
.IX Item "cholesky"
.RE
.RS 4
.RE
.IP "\fBlpc_passes\fR" 4
.IX Item "lpc_passes"
.PD
Number of passes to use for Cholesky factorization during \s-1LPC\s0 analysis
.IP "\fBmin_partition_order\fR" 4
.IX Item "min_partition_order"
The minimum partition order
.IP "\fBmax_partition_order\fR" 4
.IX Item "max_partition_order"
The maximum partition order
.IP "\fBprediction_order_method\fR" 4
.IX Item "prediction_order_method"
.RS 4
.PD 0
.IP "\fBestimation\fR" 4
.IX Item "estimation"
.IP "\fB2level\fR" 4
.IX Item "2level"
.IP "\fB4level\fR" 4
.IX Item "4level"
.IP "\fB8level\fR" 4
.IX Item "8level"
.IP "\fBsearch\fR" 4
.IX Item "search"
.PD
Bruteforce search
.IP "\fBlog\fR" 4
.IX Item "log"
.RE
.RS 4
.RE
.PD 0
.IP "\fBch_mode\fR" 4
.IX Item "ch_mode"
.PD
Channel mode
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
The mode is chosen automatically for each frame
.IP "\fBindep\fR" 4
.IX Item "indep"
Chanels are independently coded
.IP "\fBleft_side\fR" 4
.IX Item "left_side"
.PD 0
.IP "\fBright_side\fR" 4
.IX Item "right_side"
.IP "\fBmid_side\fR" 4
.IX Item "mid_side"
.RE
.RS 4
.RE
.IP "\fBexact_rice_parameters\fR" 4
.IX Item "exact_rice_parameters"
.PD
Chooses if rice parameters are calculated exactly or approximately.
if set to 1 then they are chosen exactly, which slows the code down slightly and
improves compression slightly.
.IP "\fBmulti_dim_quant\fR" 4
.IX Item "multi_dim_quant"
Multi Dimensional Quantization. If set to 1 then a 2nd stage \s-1LPC\s0 algorithm is
applied after the first stage to finetune the coefficients. This is quite slow
and slightly improves compression.
.SS "libfdk_aac"
.IX Subsection "libfdk_aac"
libfdk-aac \s-1AAC \s0(Advanced Audio Coding) encoder wrapper.
.PP
The libfdk-aac library is based on the Fraunhofer \s-1FDK AAC\s0 code from
the Android project.
.PP
Requires the presence of the libfdk-aac headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libfdk\-aac\*(C'\fR. The library is also incompatible with \s-1GPL,\s0
so if you allow the use of \s-1GPL,\s0 you should configure with
\&\f(CW\*(C`\-\-enable\-gpl \-\-enable\-nonfree \-\-enable\-libfdk\-aac\*(C'\fR.
.PP
This encoder is considered to produce output on par or worse at 128kbps to the
\&\fBthe native FFmpeg \s-1AAC\s0 encoder\fR but can often produce better
sounding audio at identical or lower bitrates and has support for the
AAC-HE profiles.
.PP
\&\s-1VBR\s0 encoding, enabled through the \fBvbr\fR or \fBflags
+qscale\fR options, is experimental and only works with some
combinations of parameters.
.PP
Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
higher.
.PP
For more information see the fdk-aac project at
<\fBhttp://sourceforge.net/p/opencore\-amr/fdk\-aac/\fR>.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are mapped on the shared FFmpeg codec options.
.IP "\fBb\fR" 4
.IX Item "b"
Set bit rate in bits/s. If the bitrate is not explicitly specified, it
is automatically set to a suitable value depending on the selected
profile.
.Sp
In case \s-1VBR\s0 mode is enabled the option is ignored.
.IP "\fBar\fR" 4
.IX Item "ar"
Set audio sampling rate (in Hz).
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of audio channels.
.IP "\fBflags +qscale\fR" 4
.IX Item "flags +qscale"
Enable fixed quality, \s-1VBR \s0(Variable Bit Rate) mode.
Note that \s-1VBR\s0 is implicitly enabled when the \fBvbr\fR value is
positive.
.IP "\fBcutoff\fR" 4
.IX Item "cutoff"
Set cutoff frequency. If not specified (or explicitly set to 0) it
will use a value automatically computed by the library. Default value
is 0.
.IP "\fBprofile\fR" 4
.IX Item "profile"
Set audio profile.
.Sp
The following profiles are recognized:
.RS 4
.IP "\fBaac_low\fR" 4
.IX Item "aac_low"
Low Complexity \s-1AAC \s0(\s-1LC\s0)
.IP "\fBaac_he\fR" 4
.IX Item "aac_he"
High Efficiency \s-1AAC \s0(HE-AAC)
.IP "\fBaac_he_v2\fR" 4
.IX Item "aac_he_v2"
High Efficiency \s-1AAC\s0 version 2 (HE\-AACv2)
.IP "\fBaac_ld\fR" 4
.IX Item "aac_ld"
Low Delay \s-1AAC \s0(\s-1LD\s0)
.IP "\fBaac_eld\fR" 4
.IX Item "aac_eld"
Enhanced Low Delay \s-1AAC \s0(\s-1ELD\s0)
.RE
.RS 4
.Sp
If not specified it is set to \fBaac_low\fR.
.RE
.PP
The following are private options of the libfdk_aac encoder.
.IP "\fBafterburner\fR" 4
.IX Item "afterburner"
Enable afterburner feature if set to 1, disabled if set to 0. This
improves the quality but also the required processing power.
.Sp
Default value is 1.
.IP "\fBeld_sbr\fR" 4
.IX Item "eld_sbr"
Enable \s-1SBR \s0(Spectral Band Replication) for \s-1ELD\s0 if set to 1, disabled
if set to 0.
.Sp
Default value is 0.
.IP "\fBsignaling\fR" 4
.IX Item "signaling"
Set \s-1SBR/PS\s0 signaling style.
.Sp
It can assume one of the following values:
.RS 4
.IP "\fBdefault\fR" 4
.IX Item "default"
choose signaling implicitly (explicit hierarchical by default,
implicit if global header is disabled)
.IP "\fBimplicit\fR" 4
.IX Item "implicit"
implicit backwards compatible signaling
.IP "\fBexplicit_sbr\fR" 4
.IX Item "explicit_sbr"
explicit \s-1SBR,\s0 implicit \s-1PS\s0 signaling
.IP "\fBexplicit_hierarchical\fR" 4
.IX Item "explicit_hierarchical"
explicit hierarchical signaling
.RE
.RS 4
.Sp
Default value is \fBdefault\fR.
.RE
.IP "\fBlatm\fR" 4
.IX Item "latm"
Output \s-1LATM/LOAS\s0 encapsulated data if set to 1, disabled if set to 0.
.Sp
Default value is 0.
.IP "\fBheader_period\fR" 4
.IX Item "header_period"
Set StreamMuxConfig and \s-1PCE\s0 repetition period (in frames) for sending
in-band configuration buffers within \s-1LATM/LOAS\s0 transport layer.
.Sp
Must be a 16\-bits non-negative integer.
.Sp
Default value is 0.
.IP "\fBvbr\fR" 4
.IX Item "vbr"
Set \s-1VBR\s0 mode, from 1 to 5. 1 is lowest quality (though still pretty
good) and 5 is highest quality. A value of 0 will disable \s-1VBR,\s0 and \s-1CBR
\&\s0(Constant Bit Rate) is enabled.
.Sp
Currently only the \fBaac_low\fR profile supports \s-1VBR\s0 encoding.
.Sp
\&\s-1VBR\s0 modes 1\-5 correspond to roughly the following average bit rates:
.RS 4
.IP "\fB1\fR" 4
.IX Item "1"
32 kbps/channel
.IP "\fB2\fR" 4
.IX Item "2"
40 kbps/channel
.IP "\fB3\fR" 4
.IX Item "3"
48\-56 kbps/channel
.IP "\fB4\fR" 4
.IX Item "4"
64 kbps/channel
.IP "\fB5\fR" 4
.IX Item "5"
about 80\-96 kbps/channel
.RE
.RS 4
.Sp
Default value is 0.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use \fBffmpeg\fR to convert an audio file to \s-1VBR AAC\s0 in an M4A (\s-1MP4\s0)
container:
.Sp
.Vb 1
\&        ffmpeg \-i input.wav \-codec:a libfdk_aac \-vbr 3 output.m4a
.Ve
.IP "\(bu" 4
Use \fBffmpeg\fR to convert an audio file to \s-1CBR\s0 64k kbps \s-1AAC,\s0 using the
High-Efficiency \s-1AAC\s0 profile:
.Sp
.Vb 1
\&        ffmpeg \-i input.wav \-c:a libfdk_aac \-profile:a aac_he \-b:a 64k output.m4a
.Ve
.SS "libmp3lame"
.IX Subsection "libmp3lame"
\&\s-1LAME \s0(Lame Ain't an \s-1MP3\s0 Encoder) \s-1MP3\s0 encoder wrapper.
.PP
Requires the presence of the libmp3lame headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libmp3lame\*(C'\fR.
.PP
See \fBlibshine\fR for a fixed-point \s-1MP3\s0 encoder, although with a
lower quality.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by the libmp3lame wrapper. The
\&\fBlame\fR\-equivalent of the options are listed in parentheses.
.IP "\fBb (\fR\fI\-b\fR\fB)\fR" 4
.IX Item "b (-b)"
Set bitrate expressed in bits/s for \s-1CBR\s0 or \s-1ABR. LAME \s0\f(CW\*(C`bitrate\*(C'\fR is
expressed in kilobits/s.
.IP "\fBq (\fR\fI\-V\fR\fB)\fR" 4
.IX Item "q (-V)"
Set constant quality setting for \s-1VBR.\s0 This option is valid only
using the \fBffmpeg\fR command-line tool. For library interface
users, use \fBglobal_quality\fR.
.IP "\fBcompression_level (\fR\fI\-q\fR\fB)\fR" 4
.IX Item "compression_level (-q)"
Set algorithm quality. Valid arguments are integers in the 0\-9 range,
with 0 meaning highest quality but slowest, and 9 meaning fastest
while producing the worst quality.
.IP "\fBreservoir\fR" 4
.IX Item "reservoir"
Enable use of bit reservoir when set to 1. Default value is 1. \s-1LAME\s0
has this enabled by default, but can be overridden by use
\&\fB\-\-nores\fR option.
.IP "\fBjoint_stereo (\fR\fI\-m j\fR\fB)\fR" 4
.IX Item "joint_stereo (-m j)"
Enable the encoder to use (on a frame by frame basis) either L/R
stereo or mid/side stereo. Default value is 1.
.IP "\fBabr (\fR\fI\-\-abr\fR\fB)\fR" 4
.IX Item "abr (--abr)"
Enable the encoder to use \s-1ABR\s0 when set to 1. The \fBlame\fR
\&\fB\-\-abr\fR sets the target bitrate, while this options only
tells FFmpeg to use \s-1ABR\s0 still relies on \fBb\fR to set bitrate.
.SS "libopencore-amrnb"
.IX Subsection "libopencore-amrnb"
OpenCORE Adaptive Multi-Rate Narrowband encoder.
.PP
Requires the presence of the libopencore-amrnb headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libopencore\-amrnb \-\-enable\-version3\*(C'\fR.
.PP
This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
but you can override it by setting \fBstrict\fR to \fBunofficial\fR or
lower.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBb\fR" 4
.IX Item "b"
Set bitrate in bits per second. Only the following bitrates are supported,
otherwise libavcodec will round to the nearest valid bitrate.
.RS 4
.IP "\fB4750\fR" 4
.IX Item "4750"
.PD 0
.IP "\fB5150\fR" 4
.IX Item "5150"
.IP "\fB5900\fR" 4
.IX Item "5900"
.IP "\fB6700\fR" 4
.IX Item "6700"
.IP "\fB7400\fR" 4
.IX Item "7400"
.IP "\fB7950\fR" 4
.IX Item "7950"
.IP "\fB10200\fR" 4
.IX Item "10200"
.IP "\fB12200\fR" 4
.IX Item "12200"
.RE
.RS 4
.RE
.IP "\fBdtx\fR" 4
.IX Item "dtx"
.PD
Allow discontinuous transmission (generate comfort noise) when set to 1. The
default value is 0 (disabled).
.SS "libshine"
.IX Subsection "libshine"
Shine Fixed-Point \s-1MP3\s0 encoder wrapper.
.PP
Shine is a fixed-point \s-1MP3\s0 encoder. It has a far better performance on
platforms without an \s-1FPU,\s0 e.g. armel CPUs, and some phones and tablets.
However, as it is more targeted on performance than quality, it is not on par
with \s-1LAME\s0 and other production-grade encoders quality-wise. Also, according to
the project's homepage, this encoder may not be free of bugs as the code was
written a long time ago and the project was dead for at least 5 years.
.PP
This encoder only supports stereo and mono input. This is also CBR-only.
.PP
The original project (last updated in early 2007) is at
<\fBhttp://sourceforge.net/projects/libshine\-fxp/\fR>. We only support the
updated fork by the Savonet/Liquidsoap project at <\fBhttps://github.com/savonet/shine\fR>.
.PP
Requires the presence of the libshine headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libshine\*(C'\fR.
.PP
See also \fBlibmp3lame\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by the libshine wrapper. The
\&\fBshineenc\fR\-equivalent of the options are listed in parentheses.
.IP "\fBb (\fR\fI\-b\fR\fB)\fR" 4
.IX Item "b (-b)"
Set bitrate expressed in bits/s for \s-1CBR. \s0\fBshineenc\fR \fB\-b\fR option
is expressed in kilobits/s.
.SS "libtwolame"
.IX Subsection "libtwolame"
TwoLAME \s-1MP2\s0 encoder wrapper.
.PP
Requires the presence of the libtwolame headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libtwolame\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by the libtwolame wrapper. The
\&\fBtwolame\fR\-equivalent options follow the FFmpeg ones and are in
parentheses.
.IP "\fBb (\fR\fI\-b\fR\fB)\fR" 4
.IX Item "b (-b)"
Set bitrate expressed in bits/s for \s-1CBR. \s0\fBtwolame\fR \fBb\fR
option is expressed in kilobits/s. Default value is 128k.
.IP "\fBq (\fR\fI\-V\fR\fB)\fR" 4
.IX Item "q (-V)"
Set quality for experimental \s-1VBR\s0 support. Maximum value range is
from \-50 to 50, useful range is from \-10 to 10. The higher the
value, the better the quality. This option is valid only using the
\&\fBffmpeg\fR command-line tool. For library interface users,
use \fBglobal_quality\fR.
.IP "\fBmode (\fR\fI\-\-mode\fR\fB)\fR" 4
.IX Item "mode (--mode)"
Set the mode of the resulting audio. Possible values:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
Choose mode automatically based on the input. This is the default.
.IP "\fBstereo\fR" 4
.IX Item "stereo"
Stereo
.IP "\fBjoint_stereo\fR" 4
.IX Item "joint_stereo"
Joint stereo
.IP "\fBdual_channel\fR" 4
.IX Item "dual_channel"
Dual channel
.IP "\fBmono\fR" 4
.IX Item "mono"
Mono
.RE
.RS 4
.RE
.IP "\fBpsymodel (\fR\fI\-\-psyc\-mode\fR\fB)\fR" 4
.IX Item "psymodel (--psyc-mode)"
Set psychoacoustic model to use in encoding. The argument must be
an integer between \-1 and 4, inclusive. The higher the value, the
better the quality. The default value is 3.
.IP "\fBenergy_levels (\fR\fI\-\-energy\fR\fB)\fR" 4
.IX Item "energy_levels (--energy)"
Enable energy levels extensions when set to 1. The default value is
0 (disabled).
.IP "\fBerror_protection (\fR\fI\-\-protect\fR\fB)\fR" 4
.IX Item "error_protection (--protect)"
Enable \s-1CRC\s0 error protection when set to 1. The default value is 0
(disabled).
.IP "\fBcopyright (\fR\fI\-\-copyright\fR\fB)\fR" 4
.IX Item "copyright (--copyright)"
Set \s-1MPEG\s0 audio copyright flag when set to 1. The default value is 0
(disabled).
.IP "\fBoriginal (\fR\fI\-\-original\fR\fB)\fR" 4
.IX Item "original (--original)"
Set \s-1MPEG\s0 audio original flag when set to 1. The default value is 0
(disabled).
.SS "libvo-amrwbenc"
.IX Subsection "libvo-amrwbenc"
VisualOn Adaptive Multi-Rate Wideband encoder.
.PP
Requires the presence of the libvo-amrwbenc headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libvo\-amrwbenc \-\-enable\-version3\*(C'\fR.
.PP
This is a mono-only encoder. Officially it only supports 16000Hz sample
rate, but you can override it by setting \fBstrict\fR to
\&\fBunofficial\fR or lower.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBb\fR" 4
.IX Item "b"
Set bitrate in bits/s. Only the following bitrates are supported, otherwise
libavcodec will round to the nearest valid bitrate.
.RS 4
.IP "\fB6600\fR" 4
.IX Item "6600"
.PD 0
.IP "\fB8850\fR" 4
.IX Item "8850"
.IP "\fB12650\fR" 4
.IX Item "12650"
.IP "\fB14250\fR" 4
.IX Item "14250"
.IP "\fB15850\fR" 4
.IX Item "15850"
.IP "\fB18250\fR" 4
.IX Item "18250"
.IP "\fB19850\fR" 4
.IX Item "19850"
.IP "\fB23050\fR" 4
.IX Item "23050"
.IP "\fB23850\fR" 4
.IX Item "23850"
.RE
.RS 4
.RE
.IP "\fBdtx\fR" 4
.IX Item "dtx"
.PD
Allow discontinuous transmission (generate comfort noise) when set to 1. The
default value is 0 (disabled).
.SS "libopus"
.IX Subsection "libopus"
libopus Opus Interactive Audio Codec encoder wrapper.
.PP
Requires the presence of the libopus headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libopus\*(C'\fR.
.PP
\fIOption Mapping\fR
.IX Subsection "Option Mapping"
.PP
Most libopus options are modelled after the \fBopusenc\fR utility from
opus-tools. The following is an option mapping chart describing options
supported by the libopus wrapper, and their \fBopusenc\fR\-equivalent
in parentheses.
.IP "\fBb (\fR\fIbitrate\fR\fB)\fR" 4
.IX Item "b (bitrate)"
Set the bit rate in bits/s.  FFmpeg's \fBb\fR option is
expressed in bits/s, while \fBopusenc\fR's \fBbitrate\fR in
kilobits/s.
.IP "\fBvbr (\fR\fIvbr\fR\fB,\fR \fIhard-cbr\fR\fB, and\fR \fIcvbr\fR\fB)\fR" 4
.IX Item "vbr (vbr, hard-cbr, and cvbr)"
Set \s-1VBR\s0 mode. The FFmpeg \fBvbr\fR option has the following
valid arguments, with the \fBopusenc\fR equivalent options
in parentheses:
.RS 4
.IP "\fBoff (\fR\fIhard-cbr\fR\fB)\fR" 4
.IX Item "off (hard-cbr)"
Use constant bit rate encoding.
.IP "\fBon (\fR\fIvbr\fR\fB)\fR" 4
.IX Item "on (vbr)"
Use variable bit rate encoding (the default).
.IP "\fBconstrained (\fR\fIcvbr\fR\fB)\fR" 4
.IX Item "constrained (cvbr)"
Use constrained variable bit rate encoding.
.RE
.RS 4
.RE
.IP "\fBcompression_level (\fR\fIcomp\fR\fB)\fR" 4
.IX Item "compression_level (comp)"
Set encoding algorithm complexity. Valid options are integers in
the 0\-10 range. 0 gives the fastest encodes but lower quality, while 10
gives the highest quality but slowest encoding. The default is 10.
.IP "\fBframe_duration (\fR\fIframesize\fR\fB)\fR" 4
.IX Item "frame_duration (framesize)"
Set maximum frame size, or duration of a frame in milliseconds. The
argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
frame sizes achieve lower latency but less quality at a given bitrate.
Sizes greater than 20ms are only interesting at fairly low bitrates.
The default is 20ms.
.IP "\fBpacket_loss (\fR\fIexpect-loss\fR\fB)\fR" 4
.IX Item "packet_loss (expect-loss)"
Set expected packet loss percentage. The default is 0.
.IP "\fBapplication (N.A.)\fR" 4
.IX Item "application (N.A.)"
Set intended application type. Valid options are listed below:
.RS 4
.IP "\fBvoip\fR" 4
.IX Item "voip"
Favor improved speech intelligibility.
.IP "\fBaudio\fR" 4
.IX Item "audio"
Favor faithfulness to the input (the default).
.IP "\fBlowdelay\fR" 4
.IX Item "lowdelay"
Restrict to only the lowest delay modes.
.RE
.RS 4
.RE
.IP "\fBcutoff (N.A.)\fR" 4
.IX Item "cutoff (N.A.)"
Set cutoff bandwidth in Hz. The argument must be exactly one of the
following: 4000, 6000, 8000, 12000, or 20000, corresponding to
narrowband, mediumband, wideband, super wideband, and fullband
respectively. The default is 0 (cutoff disabled).
.IP "\fBmapping_family (\fR\fImapping_family\fR\fB)\fR" 4
.IX Item "mapping_family (mapping_family)"
Set channel mapping family to be used by the encoder. The default value of \-1
uses mapping family 0 for mono and stereo inputs, and mapping family 1
otherwise. The default also disables the surround masking and \s-1LFE\s0 bandwidth
optimzations in libopus, and requires that the input contains 8 channels or
fewer.
.Sp
Other values include 0 for mono and stereo, 1 for surround sound with masking
and \s-1LFE\s0 bandwidth optimizations, and 255 for independent streams with an
unspecified channel layout.
.SS "libvorbis"
.IX Subsection "libvorbis"
libvorbis encoder wrapper.
.PP
Requires the presence of the libvorbisenc headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libvorbis\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by the libvorbis wrapper. The
\&\fBoggenc\fR\-equivalent of the options are listed in parentheses.
.PP
To get a more accurate and extensive documentation of the libvorbis
options, consult the libvorbisenc's and \fBoggenc\fR's documentations.
See <\fBhttp://xiph.org/vorbis/\fR>,
<\fBhttp://wiki.xiph.org/Vorbis\-tools\fR>, and \fIoggenc\fR\|(1).
.IP "\fBb (\fR\fI\-b\fR\fB)\fR" 4
.IX Item "b (-b)"
Set bitrate expressed in bits/s for \s-1ABR. \s0\fBoggenc\fR \fB\-b\fR is
expressed in kilobits/s.
.IP "\fBq (\fR\fI\-q\fR\fB)\fR" 4
.IX Item "q (-q)"
Set constant quality setting for \s-1VBR.\s0 The value should be a float
number in the range of \-1.0 to 10.0. The higher the value, the better
the quality. The default value is \fB3.0\fR.
.Sp
This option is valid only using the \fBffmpeg\fR command-line tool.
For library interface users, use \fBglobal_quality\fR.
.IP "\fBcutoff (\fR\fI\-\-advanced\-encode\-option lowpass_frequency=N\fR\fB)\fR" 4
.IX Item "cutoff (--advanced-encode-option lowpass_frequency=N)"
Set cutoff bandwidth in Hz, a value of 0 disables cutoff. \fBoggenc\fR's
related option is expressed in kHz. The default value is \fB0\fR (cutoff
disabled).
.IP "\fBminrate (\fR\fI\-m\fR\fB)\fR" 4
.IX Item "minrate (-m)"
Set minimum bitrate expressed in bits/s. \fBoggenc\fR \fB\-m\fR is
expressed in kilobits/s.
.IP "\fBmaxrate (\fR\fI\-M\fR\fB)\fR" 4
.IX Item "maxrate (-M)"
Set maximum bitrate expressed in bits/s. \fBoggenc\fR \fB\-M\fR is
expressed in kilobits/s. This only has effect on \s-1ABR\s0 mode.
.IP "\fBiblock (\fR\fI\-\-advanced\-encode\-option impulse_noisetune=N\fR\fB)\fR" 4
.IX Item "iblock (--advanced-encode-option impulse_noisetune=N)"
Set noise floor bias for impulse blocks. The value is a float number from
\&\-15.0 to 0.0. A negative bias instructs the encoder to pay special attention
to the crispness of transients in the encoded audio. The tradeoff for better
transient response is a higher bitrate.
.SS "libwavpack"
.IX Subsection "libwavpack"
A wrapper providing WavPack encoding through libwavpack.
.PP
Only lossless mode using 32\-bit integer samples is supported currently.
.PP
Requires the presence of the libwavpack headers and library during
configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libwavpack\*(C'\fR.
.PP
Note that a libavcodec-native encoder for the WavPack codec exists so users can
encode audios with this codec without using this encoder. See \fBwavpackenc\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
\&\fBwavpack\fR command line utility's corresponding options are listed in
parentheses, if any.
.IP "\fBframe_size (\fR\fI\-\-blocksize\fR\fB)\fR" 4
.IX Item "frame_size (--blocksize)"
Default is 32768.
.IP "\fBcompression_level\fR" 4
.IX Item "compression_level"
Set speed vs. compression tradeoff. Acceptable arguments are listed below:
.RS 4
.IP "\fB0 (\fR\fI\-f\fR\fB)\fR" 4
.IX Item "0 (-f)"
Fast mode.
.IP "\fB1\fR" 4
.IX Item "1"
Normal (default) settings.
.IP "\fB2 (\fR\fI\-h\fR\fB)\fR" 4
.IX Item "2 (-h)"
High quality.
.IP "\fB3 (\fR\fI\-hh\fR\fB)\fR" 4
.IX Item "3 (-hh)"
Very high quality.
.IP "\fB4\-8 (\fR\fI\-hh \-x\fR\fI\s-1EXTRAPROC\s0\fR\fB)\fR" 4
.IX Item "4-8 (-hh -xEXTRAPROC)"
Same as \fB3\fR, but with extra processing enabled.
.Sp
\&\fB4\fR is the same as \fB\-x2\fR and \fB8\fR is the same as \fB\-x6\fR.
.RE
.RS 4
.RE
.SS "wavpack"
.IX Subsection "wavpack"
WavPack lossless audio encoder.
.PP
This is a libavcodec-native WavPack encoder. There is also an encoder based on
libwavpack, but there is virtually no reason to use that encoder.
.PP
See also \fBlibwavpack\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The equivalent options for \fBwavpack\fR command line utility are listed in
parentheses.
.PP
Shared options
.IX Subsection "Shared options"
.PP
The following shared options are effective for this encoder. Only special notes
about this particular encoder will be documented here. For the general meaning
of the options, see \fBthe Codec Options chapter\fR.
.IP "\fBframe_size (\fR\fI\-\-blocksize\fR\fB)\fR" 4
.IX Item "frame_size (--blocksize)"
For this encoder, the range for this option is between 128 and 131072. Default
is automatically decided based on sample rate and number of channel.
.Sp
For the complete formula of calculating default, see
\&\fIlibavcodec/wavpackenc.c\fR.
.IP "\fBcompression_level (\fR\fI\-f\fR\fB,\fR \fI\-h\fR\fB,\fR \fI\-hh\fR\fB, and\fR \fI\-x\fR\fB)\fR" 4
.IX Item "compression_level (-f, -h, -hh, and -x)"
This option's syntax is consistent with \fBlibwavpack\fR's.
.PP
Private options
.IX Subsection "Private options"
.IP "\fBjoint_stereo (\fR\fI\-j\fR\fB)\fR" 4
.IX Item "joint_stereo (-j)"
Set whether to enable joint stereo. Valid values are:
.RS 4
.IP "\fBon (\fR\fI1\fR\fB)\fR" 4
.IX Item "on (1)"
Force mid/side audio encoding.
.IP "\fBoff (\fR\fI0\fR\fB)\fR" 4
.IX Item "off (0)"
Force left/right audio encoding.
.IP "\fBauto\fR" 4
.IX Item "auto"
Let the encoder decide automatically.
.RE
.RS 4
.RE
.IP "\fBoptimize_mono\fR" 4
.IX Item "optimize_mono"
Set whether to enable optimization for mono. This option is only effective for
non-mono streams. Available values:
.RS 4
.IP "\fBon\fR" 4
.IX Item "on"
enabled
.IP "\fBoff\fR" 4
.IX Item "off"
disabled
.RE
.RS 4
.RE
.SH "VIDEO ENCODERS"
.IX Header "VIDEO ENCODERS"
A description of some of the currently available video encoders
follows.
.SS "libopenh264"
.IX Subsection "libopenh264"
Cisco libopenh264 H.264/MPEG\-4 \s-1AVC\s0 encoder wrapper.
.PP
This encoder requires the presence of the libopenh264 headers and
library during configuration. You need to explicitly configure the
build with \f(CW\*(C`\-\-enable\-libopenh264\*(C'\fR. The library is detected using
\&\fBpkg-config\fR.
.PP
For more information about the library see
<\fBhttp://www.openh264.org\fR>.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following FFmpeg global options affect the configurations of the
libopenh264 encoder.
.IP "\fBb\fR" 4
.IX Item "b"
Set the bitrate (as a number of bits per second).
.IP "\fBg\fR" 4
.IX Item "g"
Set the \s-1GOP\s0 size.
.IP "\fBmaxrate\fR" 4
.IX Item "maxrate"
Set the max bitrate (as a number of bits per second).
.IP "\fBflags +global_header\fR" 4
.IX Item "flags +global_header"
Set global header in the bitstream.
.IP "\fBslices\fR" 4
.IX Item "slices"
Set the number of slices, used in parallelized encoding. Default value
is 0. This is only used when \fBslice_mode\fR is set to
\&\fBfixed\fR.
.IP "\fBslice_mode\fR" 4
.IX Item "slice_mode"
Set slice mode. Can assume one of the following possible values:
.RS 4
.IP "\fBfixed\fR" 4
.IX Item "fixed"
a fixed number of slices
.IP "\fBrowmb\fR" 4
.IX Item "rowmb"
one slice per row of macroblocks
.IP "\fBauto\fR" 4
.IX Item "auto"
automatic number of slices according to number of threads
.IP "\fBdyn\fR" 4
.IX Item "dyn"
dynamic slicing
.RE
.RS 4
.Sp
Default value is \fBauto\fR.
.RE
.IP "\fBloopfilter\fR" 4
.IX Item "loopfilter"
Enable loop filter, if set to 1 (automatically enabled). To disable
set a value of 0.
.IP "\fBprofile\fR" 4
.IX Item "profile"
Set profile restrictions. If set to the value of \fBmain\fR enable
\&\s-1CABAC \s0(set the \f(CW\*(C`SEncParamExt.iEntropyCodingModeFlag\*(C'\fR flag to 1).
.IP "\fBmax_nal_size\fR" 4
.IX Item "max_nal_size"
Set maximum \s-1NAL\s0 size in bytes.
.IP "\fBallow_skip_frames\fR" 4
.IX Item "allow_skip_frames"
Allow skipping frames to hit the target bitrate if set to 1.
.SS "jpeg2000"
.IX Subsection "jpeg2000"
The native jpeg 2000 encoder is lossy by default, the \f(CW\*(C`\-q:v\*(C'\fR
option can be used to set the encoding quality. Lossless encoding
can be selected with \f(CW\*(C`\-pred 1\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBformat\fR" 4
.IX Item "format"
Can be set to either \f(CW\*(C`j2k\*(C'\fR or \f(CW\*(C`jp2\*(C'\fR (the default) that
makes it possible to store non-rgb pix_fmts.
.SS "snow"
.IX Subsection "snow"
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBiterative_dia_size\fR" 4
.IX Item "iterative_dia_size"
dia size for the iterative motion estimation
.SS "libtheora"
.IX Subsection "libtheora"
libtheora Theora encoder wrapper.
.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
For more information about the libtheora project see
<\fBhttp://www.theora.org/\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 in bit/s for \s-1CBR \s0(Constant Bit Rate) mode.  In
case \s-1VBR \s0(Variable Bit Rate) mode is enabled this option is ignored.
.IP "\fBflags\fR" 4
.IX Item "flags"
Used to enable constant quality mode (\s-1VBR\s0) 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 as an integer in lambda units.
.Sp
Only relevant when \s-1VBR\s0 mode is enabled with \f(CW\*(C`flags +qscale\*(C'\fR. The
value is converted to \s-1QP\s0 units by dividing it by \f(CW\*(C`FF_QP2LAMBDA\*(C'\fR,
clipped in the [0 \- 10] range, and then multiplied by 6.3 to get a
value in the native libtheora range [0\-63]. A higher value corresponds
to a higher quality.
.IP "\fBq\fR" 4
.IX Item "q"
Enable \s-1VBR\s0 mode when set to a non-negative value, and set constant
quality value as a double floating point value in \s-1QP\s0 units.
.Sp
The value is clipped in the [0\-10] range, and then multiplied by 6.3
to get a value in the native libtheora range [0\-63].
.Sp
This option is valid only using the \fBffmpeg\fR command-line
tool. For library interface users, use \fBglobal_quality\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Set maximum constant quality (\s-1VBR\s0) encoding with \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-codec:v libtheora \-q:v 10 OUTPUT.ogg
.Ve
.IP "\(bu" 4
Use \fBffmpeg\fR to convert a \s-1CBR 1000\s0 kbps Theora video stream:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-codec:v libtheora \-b:v 1000k OUTPUT.ogg
.Ve
.SS "libvpx"
.IX Subsection "libvpx"
\&\s-1VP8/VP9\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
The following options are supported by the libvpx wrapper. The
\&\fBvpxenc\fR\-equivalent options or values are listed in parentheses
for easy migration.
.PP
To reduce the duplication of documentation, only the private options
and some others requiring special attention are documented here. For
the documentation of the undocumented generic options, see
\&\fBthe Codec Options chapter\fR.
.PP
To get more documentation of the libvpx options, invoke the command
\&\fBffmpeg \-h encoder=libvpx\fR, \fBffmpeg \-h encoder=libvpx\-vp9\fR or
\&\fBvpxenc \-\-help\fR. Further information is available in the libvpx \s-1API\s0
documentation.
.IP "\fBb (\fR\fItarget-bitrate\fR\fB)\fR" 4
.IX Item "b (target-bitrate)"
Set bitrate in bits/s. Note that FFmpeg's \fBb\fR option is
expressed in bits/s, while \fBvpxenc\fR's \fBtarget-bitrate\fR is in
kilobits/s.
.IP "\fBg (\fR\fIkf-max-dist\fR\fB)\fR" 4
.IX Item "g (kf-max-dist)"
.PD 0
.IP "\fBkeyint_min (\fR\fIkf-min-dist\fR\fB)\fR" 4
.IX Item "keyint_min (kf-min-dist)"
.IP "\fBqmin (\fR\fImin-q\fR\fB)\fR" 4
.IX Item "qmin (min-q)"
.IP "\fBqmax (\fR\fImax-q\fR\fB)\fR" 4
.IX Item "qmax (max-q)"
.IP "\fBbufsize (\fR\fIbuf-sz\fR\fB,\fR \fIbuf-optimal-sz\fR\fB)\fR" 4
.IX Item "bufsize (buf-sz, buf-optimal-sz)"
.PD
Set ratecontrol buffer size (in bits). Note \fBvpxenc\fR's options are
specified in milliseconds, the libvpx wrapper converts this value as follows:
\&\f(CW\*(C`buf\-sz = bufsize * 1000 / bitrate\*(C'\fR,
\&\f(CW\*(C`buf\-optimal\-sz = bufsize * 1000 / bitrate * 5 / 6\*(C'\fR.
.IP "\fBrc_init_occupancy (\fR\fIbuf-initial-sz\fR\fB)\fR" 4
.IX Item "rc_init_occupancy (buf-initial-sz)"
Set number of bits which should be loaded into the rc buffer before decoding
starts. Note \fBvpxenc\fR's option is specified in milliseconds, the libvpx
wrapper converts this value as follows:
\&\f(CW\*(C`rc_init_occupancy * 1000 / bitrate\*(C'\fR.
.IP "\fBundershoot-pct\fR" 4
.IX Item "undershoot-pct"
Set datarate undershoot (min) percentage of the target bitrate.
.IP "\fBovershoot-pct\fR" 4
.IX Item "overshoot-pct"
Set datarate overshoot (max) percentage of the target bitrate.
.IP "\fBskip_threshold (\fR\fIdrop-frame\fR\fB)\fR" 4
.IX Item "skip_threshold (drop-frame)"
.PD 0
.IP "\fBqcomp (\fR\fIbias-pct\fR\fB)\fR" 4
.IX Item "qcomp (bias-pct)"
.IP "\fBmaxrate (\fR\fImaxsection-pct\fR\fB)\fR" 4
.IX Item "maxrate (maxsection-pct)"
.PD
Set \s-1GOP\s0 max bitrate in bits/s. Note \fBvpxenc\fR's option is specified as a
percentage of the target bitrate, the libvpx wrapper converts this value as
follows: \f(CW\*(C`(maxrate * 100 / bitrate)\*(C'\fR.
.IP "\fBminrate (\fR\fIminsection-pct\fR\fB)\fR" 4
.IX Item "minrate (minsection-pct)"
Set \s-1GOP\s0 min bitrate in bits/s. Note \fBvpxenc\fR's option is specified as a
percentage of the target bitrate, the libvpx wrapper converts this value as
follows: \f(CW\*(C`(minrate * 100 / bitrate)\*(C'\fR.
.IP "\fBminrate, maxrate, b\fR \fIend\-usage=cbr\fR" 4
.IX Item "minrate, maxrate, b end-usage=cbr"
\&\f(CW\*(C`(minrate == maxrate == bitrate)\*(C'\fR.
.IP "\fBcrf (\fR\fIend\-usage=cq\fR\fB,\fR \fIcq-level\fR\fB)\fR" 4
.IX Item "crf (end-usage=cq, cq-level)"
.PD 0
.IP "\fBtune (\fR\fItune\fR\fB)\fR" 4
.IX Item "tune (tune)"
.RS 4
.IP "\fBpsnr (\fR\fIpsnr\fR\fB)\fR" 4
.IX Item "psnr (psnr)"
.IP "\fBssim (\fR\fIssim\fR\fB)\fR" 4
.IX Item "ssim (ssim)"
.RE
.RS 4
.RE
.IP "\fBquality, deadline (\fR\fIdeadline\fR\fB)\fR" 4
.IX Item "quality, deadline (deadline)"
.RS 4
.IP "\fBbest\fR" 4
.IX Item "best"
.PD
Use best quality deadline. Poorly named and quite slow, this option should be
avoided as it may give worse quality output than good.
.IP "\fBgood\fR" 4
.IX Item "good"
Use good quality deadline. This is a good trade-off between speed and quality
when used with the \fBcpu-used\fR option.
.IP "\fBrealtime\fR" 4
.IX Item "realtime"
Use realtime quality deadline.
.RE
.RS 4
.RE
.IP "\fBspeed, cpu-used (\fR\fIcpu-used\fR\fB)\fR" 4
.IX Item "speed, cpu-used (cpu-used)"
Set quality/speed ratio modifier. Higher values speed up the encode at the cost
of quality.
.IP "\fBnr (\fR\fInoise-sensitivity\fR\fB)\fR" 4
.IX Item "nr (noise-sensitivity)"
.PD 0
.IP "\fBstatic-thresh\fR" 4
.IX Item "static-thresh"
.PD
Set a change threshold on blocks below which they will be skipped by the
encoder.
.IP "\fBslices (\fR\fItoken-parts\fR\fB)\fR" 4
.IX Item "slices (token-parts)"
Note that FFmpeg's \fBslices\fR option gives the total number of partitions,
while \fBvpxenc\fR's \fBtoken-parts\fR is given as
\&\f(CW\*(C`log2(partitions)\*(C'\fR.
.IP "\fBmax-intra-rate\fR" 4
.IX Item "max-intra-rate"
Set maximum I\-frame bitrate as a percentage of the target bitrate. A value of 0
means unlimited.
.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 "\fBauto-alt-ref\fR" 4
.IX Item "auto-alt-ref"
.PD
Enable use of alternate reference frames (2\-pass only).
.IP "\fBarnr-max-frames\fR" 4
.IX Item "arnr-max-frames"
Set altref noise reduction max frame count.
.IP "\fBarnr-type\fR" 4
.IX Item "arnr-type"
Set altref noise reduction filter type: backward, forward, centered.
.IP "\fBarnr-strength\fR" 4
.IX Item "arnr-strength"
Set altref noise reduction filter strength.
.IP "\fBrc-lookahead, lag-in-frames (\fR\fIlag-in-frames\fR\fB)\fR" 4
.IX Item "rc-lookahead, lag-in-frames (lag-in-frames)"
Set number of frames to look ahead for frametype and ratecontrol.
.RE
.RS 4
.RE
.IP "\fBerror-resilient\fR" 4
.IX Item "error-resilient"
Enable error resiliency features.
.IP "\fBVP9\-specific options\fR" 4
.IX Item "VP9-specific options"
.RS 4
.PD 0
.IP "\fBlossless\fR" 4
.IX Item "lossless"
.PD
Enable lossless mode.
.IP "\fBtile-columns\fR" 4
.IX Item "tile-columns"
Set number of tile columns to use. Note this is given as
\&\f(CW\*(C`log2(tile_columns)\*(C'\fR. For example, 8 tile columns would be requested by
setting the \fBtile-columns\fR option to 3.
.IP "\fBtile-rows\fR" 4
.IX Item "tile-rows"
Set number of tile rows to use. Note this is given as \f(CW\*(C`log2(tile_rows)\*(C'\fR.
For example, 4 tile rows would be requested by setting the \fBtile-rows\fR
option to 2.
.IP "\fBframe-parallel\fR" 4
.IX Item "frame-parallel"
Enable frame parallel decodability features.
.IP "\fBaq-mode\fR" 4
.IX Item "aq-mode"
Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
cyclic refresh).
.IP "\fBcolorspace\fR \fIcolor-space\fR" 4
.IX Item "colorspace color-space"
Set input color space. The \s-1VP9\s0 bitstream supports signaling the following
colorspaces:
.RS 4
.IP "\fB\fBrgb\fB \f(BIsRGB\fB\fR" 4
.IX Item "rgb sRGB"
.PD 0
.IP "\fB\fBbt709\fB \f(BIbt709\fB\fR" 4
.IX Item "bt709 bt709"
.IP "\fB\fBunspecified\fB \f(BIunknown\fB\fR" 4
.IX Item "unspecified unknown"
.IP "\fB\fBbt470bg\fB \f(BIbt601\fB\fR" 4
.IX Item "bt470bg bt601"
.IP "\fB\fBsmpte170m\fB \f(BIsmpte170\fB\fR" 4
.IX Item "smpte170m smpte170"
.IP "\fB\fBsmpte240m\fB \f(BIsmpte240\fB\fR" 4
.IX Item "smpte240m smpte240"
.IP "\fB\fBbt2020_ncl\fB \f(BIbt2020\fB\fR" 4
.IX Item "bt2020_ncl bt2020"
.RE
.RS 4
.RE
.RE
.RS 4
.RE
.PD
.PP
For more information about libvpx see:
<\fBhttp://www.webmproject.org/\fR>
.SS "libwebp"
.IX Subsection "libwebp"
libwebp WebP Image encoder wrapper
.PP
libwebp is Google's official encoder for WebP images. It can encode in either
lossy or lossless mode. Lossy images are essentially a wrapper around a \s-1VP8\s0
frame. Lossless images are a separate codec developed by Google.
.PP
\fIPixel Format\fR
.IX Subsection "Pixel Format"
.PP
Currently, libwebp only supports \s-1YUV420\s0 for lossy and \s-1RGB\s0 for lossless due
to limitations of the format and libwebp. Alpha is supported for either mode.
Because of \s-1API\s0 limitations, if \s-1RGB\s0 is passed in when encoding lossy or \s-1YUV\s0 is
passed in for encoding lossless, the pixel format will automatically be
converted using functions from libwebp. This is not ideal and is done only for
convenience.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fB\-lossless\fR \fIboolean\fR" 4
.IX Item "-lossless boolean"
Enables/Disables use of lossless mode. Default is 0.
.IP "\fB\-compression_level\fR \fIinteger\fR" 4
.IX Item "-compression_level integer"
For lossy, this is a quality/speed tradeoff. Higher values give better quality
for a given size at the cost of increased encoding time. For lossless, this is
a size/speed tradeoff. Higher values give smaller size at the cost of increased
encoding time. More specifically, it controls the number of extra algorithms
and compression tools used, and varies the combination of these tools. This
maps to the \fImethod\fR option in libwebp. The valid range is 0 to 6.
Default is 4.
.IP "\fB\-qscale\fR \fIfloat\fR" 4
.IX Item "-qscale float"
For lossy encoding, this controls image quality, 0 to 100. For lossless
encoding, this controls the effort and time spent at compressing more. The
default value is 75. Note that for usage via libavcodec, this option is called
\&\fIglobal_quality\fR and must be multiplied by \fI\s-1FF_QP2LAMBDA\s0\fR.
.IP "\fB\-preset\fR \fItype\fR" 4
.IX Item "-preset type"
Configuration preset. This does some automatic settings based on the general
type of the image.
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Do not use a preset.
.IP "\fBdefault\fR" 4
.IX Item "default"
Use the encoder default.
.IP "\fBpicture\fR" 4
.IX Item "picture"
Digital picture, like portrait, inner shot
.IP "\fBphoto\fR" 4
.IX Item "photo"
Outdoor photograph, with natural lighting
.IP "\fBdrawing\fR" 4
.IX Item "drawing"
Hand or line drawing, with high-contrast details
.IP "\fBicon\fR" 4
.IX Item "icon"
Small-sized colorful images
.IP "\fBtext\fR" 4
.IX Item "text"
Text-like
.RE
.RS 4
.RE
.SS "libx264, libx264rgb"
.IX Subsection "libx264, libx264rgb"
x264 H.264/MPEG\-4 \s-1AVC\s0 encoder wrapper.
.PP
This encoder 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
libx264 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
Many libx264 encoder options are mapped to FFmpeg global codec
options, while unique encoder options are provided through private
options. Additionally the \fBx264opts\fR and \fBx264\-params\fR
private options allows one to pass a list of key=value tuples as accepted
by the libx264 \f(CW\*(C`x264_param_parse\*(C'\fR function.
.PP
The x264 project website is at
<\fBhttp://www.videolan.org/developers/x264.html\fR>.
.PP
The libx264rgb encoder is the same as libx264, except it accepts packed \s-1RGB\s0
pixel formats as input instead of \s-1YUV.\s0
.PP
\fISupported Pixel Formats\fR
.IX Subsection "Supported Pixel Formats"
.PP
x264 supports 8\- to 10\-bit color spaces. The exact bit depth is controlled at
x264's configure time. FFmpeg only supports one bit depth in one particular
build. In other words, it is not possible to build one FFmpeg with multiple
versions of x264 with different bit depths.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by the libx264 wrapper. The
\&\fBx264\fR\-equivalent options or values are listed in parentheses
for easy migration.
.PP
To reduce the duplication of documentation, only the private options
and some others requiring special attention are documented here. For
the documentation of the undocumented generic options, see
\&\fBthe Codec Options chapter\fR.
.PP
To get a more accurate and extensive documentation of the libx264
options, invoke the command \fBx264 \-\-full\-help\fR or consult
the libx264 documentation.
.IP "\fBb (\fR\fIbitrate\fR\fB)\fR" 4
.IX Item "b (bitrate)"
Set bitrate in bits/s. Note that FFmpeg's \fBb\fR option is
expressed in bits/s, while \fBx264\fR's \fBbitrate\fR is in
kilobits/s.
.IP "\fBbf (\fR\fIbframes\fR\fB)\fR" 4
.IX Item "bf (bframes)"
.PD 0
.IP "\fBg (\fR\fIkeyint\fR\fB)\fR" 4
.IX Item "g (keyint)"
.IP "\fBqmin (\fR\fIqpmin\fR\fB)\fR" 4
.IX Item "qmin (qpmin)"
.PD
Minimum quantizer scale.
.IP "\fBqmax (\fR\fIqpmax\fR\fB)\fR" 4
.IX Item "qmax (qpmax)"
Maximum quantizer scale.
.IP "\fBqdiff (\fR\fIqpstep\fR\fB)\fR" 4
.IX Item "qdiff (qpstep)"
Maximum difference between quantizer scales.
.IP "\fBqblur (\fR\fIqblur\fR\fB)\fR" 4
.IX Item "qblur (qblur)"
Quantizer curve blur
.IP "\fBqcomp (\fR\fIqcomp\fR\fB)\fR" 4
.IX Item "qcomp (qcomp)"
Quantizer curve compression factor
.IP "\fBrefs (\fR\fIref\fR\fB)\fR" 4
.IX Item "refs (ref)"
Number of reference frames each P\-frame can use. The range is from \fI0\-16\fR.
.IP "\fBsc_threshold (\fR\fIscenecut\fR\fB)\fR" 4
.IX Item "sc_threshold (scenecut)"
Sets the threshold for the scene change detection.
.IP "\fBtrellis (\fR\fItrellis\fR\fB)\fR" 4
.IX Item "trellis (trellis)"
Performs Trellis quantization to increase efficiency. Enabled by default.
.IP "\fBnr  (\fR\fInr\fR\fB)\fR" 4
.IX Item "nr (nr)"
.PD 0
.IP "\fBme_range (\fR\fImerange\fR\fB)\fR" 4
.IX Item "me_range (merange)"
.PD
Maximum range of the motion search in pixels.
.IP "\fBme_method (\fR\fIme\fR\fB)\fR" 4
.IX Item "me_method (me)"
Set motion estimation method. Possible values in the decreasing order
of speed:
.RS 4
.IP "\fBdia (\fR\fIdia\fR\fB)\fR" 4
.IX Item "dia (dia)"
.PD 0
.IP "\fBepzs (\fR\fIdia\fR\fB)\fR" 4
.IX Item "epzs (dia)"
.PD
Diamond search with radius 1 (fastest). \fBepzs\fR is an alias for
\&\fBdia\fR.
.IP "\fBhex (\fR\fIhex\fR\fB)\fR" 4
.IX Item "hex (hex)"
Hexagonal search with radius 2.
.IP "\fBumh (\fR\fIumh\fR\fB)\fR" 4
.IX Item "umh (umh)"
Uneven multi-hexagon search.
.IP "\fBesa (\fR\fIesa\fR\fB)\fR" 4
.IX Item "esa (esa)"
Exhaustive search.
.IP "\fBtesa (\fR\fItesa\fR\fB)\fR" 4
.IX Item "tesa (tesa)"
Hadamard exhaustive search (slowest).
.RE
.RS 4
.RE
.IP "\fBsubq (\fR\fIsubme\fR\fB)\fR" 4
.IX Item "subq (subme)"
Sub-pixel motion estimation method.
.IP "\fBb_strategy (\fR\fIb\-adapt\fR\fB)\fR" 4
.IX Item "b_strategy (b-adapt)"
Adaptive B\-frame placement decision algorithm. Use only on first-pass.
.IP "\fBkeyint_min (\fR\fImin-keyint\fR\fB)\fR" 4
.IX Item "keyint_min (min-keyint)"
Minimum \s-1GOP\s0 size.
.IP "\fBcoder\fR" 4
.IX Item "coder"
Set entropy encoder. Possible values:
.RS 4
.IP "\fBac\fR" 4
.IX Item "ac"
Enable \s-1CABAC.\s0
.IP "\fBvlc\fR" 4
.IX Item "vlc"
Enable \s-1CAVLC\s0 and disable \s-1CABAC.\s0 It generates the same effect as
\&\fBx264\fR's \fB\-\-no\-cabac\fR option.
.RE
.RS 4
.RE
.IP "\fBcmp\fR" 4
.IX Item "cmp"
Set full pixel motion estimation comparison algorithm. Possible values:
.RS 4
.IP "\fBchroma\fR" 4
.IX Item "chroma"
Enable chroma in motion estimation.
.IP "\fBsad\fR" 4
.IX Item "sad"
Ignore chroma in motion estimation. It generates the same effect as
\&\fBx264\fR's \fB\-\-no\-chroma\-me\fR option.
.RE
.RS 4
.RE
.IP "\fBthreads (\fR\fIthreads\fR\fB)\fR" 4
.IX Item "threads (threads)"
Number of encoding threads.
.IP "\fBthread_type\fR" 4
.IX Item "thread_type"
Set multithreading technique. Possible values:
.RS 4
.IP "\fBslice\fR" 4
.IX Item "slice"
Slice-based multithreading. It generates the same effect as
\&\fBx264\fR's \fB\-\-sliced\-threads\fR option.
.IP "\fBframe\fR" 4
.IX Item "frame"
Frame-based multithreading.
.RE
.RS 4
.RE
.IP "\fBflags\fR" 4
.IX Item "flags"
Set encoding flags. It can be used to disable closed \s-1GOP\s0 and enable
open \s-1GOP\s0 by setting it to \f(CW\*(C`\-cgop\*(C'\fR. The result is similar to
the behavior of \fBx264\fR's \fB\-\-open\-gop\fR option.
.IP "\fBrc_init_occupancy (\fR\fIvbv-init\fR\fB)\fR" 4
.IX Item "rc_init_occupancy (vbv-init)"
.PD 0
.IP "\fBpreset (\fR\fIpreset\fR\fB)\fR" 4
.IX Item "preset (preset)"
.PD
Set the encoding preset.
.IP "\fBtune (\fR\fItune\fR\fB)\fR" 4
.IX Item "tune (tune)"
Set tuning of the encoding params.
.IP "\fBprofile (\fR\fIprofile\fR\fB)\fR" 4
.IX Item "profile (profile)"
Set profile restrictions.
.IP "\fBfastfirstpass\fR" 4
.IX Item "fastfirstpass"
Enable fast settings when encoding first pass, when set to 1. When set
to 0, it has the same effect of \fBx264\fR's
\&\fB\-\-slow\-firstpass\fR option.
.IP "\fBcrf (\fR\fIcrf\fR\fB)\fR" 4
.IX Item "crf (crf)"
Set the quality for constant quality mode.
.IP "\fBcrf_max (\fR\fIcrf-max\fR\fB)\fR" 4
.IX Item "crf_max (crf-max)"
In \s-1CRF\s0 mode, prevents \s-1VBV\s0 from lowering quality beyond this point.
.IP "\fBqp (\fR\fIqp\fR\fB)\fR" 4
.IX Item "qp (qp)"
Set constant quantization rate control method parameter.
.IP "\fBaq-mode (\fR\fIaq-mode\fR\fB)\fR" 4
.IX Item "aq-mode (aq-mode)"
Set \s-1AQ\s0 method. Possible values:
.RS 4
.IP "\fBnone (\fR\fI0\fR\fB)\fR" 4
.IX Item "none (0)"
Disabled.
.IP "\fBvariance (\fR\fI1\fR\fB)\fR" 4
.IX Item "variance (1)"
Variance \s-1AQ \s0(complexity mask).
.IP "\fBautovariance (\fR\fI2\fR\fB)\fR" 4
.IX Item "autovariance (2)"
Auto-variance \s-1AQ \s0(experimental).
.RE
.RS 4
.RE
.IP "\fBaq-strength (\fR\fIaq-strength\fR\fB)\fR" 4
.IX Item "aq-strength (aq-strength)"
Set \s-1AQ\s0 strength, reduce blocking and blurring in flat and textured areas.
.IP "\fBpsy\fR" 4
.IX Item "psy"
Use psychovisual optimizations when set to 1. When set to 0, it has the
same effect as \fBx264\fR's \fB\-\-no\-psy\fR option.
.IP "\fBpsy-rd  (\fR\fIpsy-rd\fR\fB)\fR" 4
.IX Item "psy-rd (psy-rd)"
Set strength of psychovisual optimization, in
\&\fIpsy-rd\fR:\fIpsy-trellis\fR format.
.IP "\fBrc-lookahead (\fR\fIrc-lookahead\fR\fB)\fR" 4
.IX Item "rc-lookahead (rc-lookahead)"
Set number of frames to look ahead for frametype and ratecontrol.
.IP "\fBweightb\fR" 4
.IX Item "weightb"
Enable weighted prediction for B\-frames when set to 1. When set to 0,
it has the same effect as \fBx264\fR's \fB\-\-no\-weightb\fR option.
.IP "\fBweightp (\fR\fIweightp\fR\fB)\fR" 4
.IX Item "weightp (weightp)"
Set weighted prediction method for P\-frames. Possible values:
.RS 4
.IP "\fBnone (\fR\fI0\fR\fB)\fR" 4
.IX Item "none (0)"
Disabled
.IP "\fBsimple (\fR\fI1\fR\fB)\fR" 4
.IX Item "simple (1)"
Enable only weighted refs
.IP "\fBsmart (\fR\fI2\fR\fB)\fR" 4
.IX Item "smart (2)"
Enable both weighted refs and duplicates
.RE
.RS 4
.RE
.IP "\fBssim (\fR\fIssim\fR\fB)\fR" 4
.IX Item "ssim (ssim)"
Enable calculation and printing \s-1SSIM\s0 stats after the encoding.
.IP "\fBintra-refresh (\fR\fIintra-refresh\fR\fB)\fR" 4
.IX Item "intra-refresh (intra-refresh)"
Enable the use of Periodic Intra Refresh instead of \s-1IDR\s0 frames when set
to 1.
.IP "\fBavcintra-class (\fR\fIclass\fR\fB)\fR" 4
.IX Item "avcintra-class (class)"
Configure the encoder to generate AVC-Intra.
Valid values are 50,100 and 200
.IP "\fBbluray-compat (\fR\fIbluray-compat\fR\fB)\fR" 4
.IX Item "bluray-compat (bluray-compat)"
Configure the encoder to be compatible with the bluray standard.
It is a shorthand for setting \*(L"bluray\-compat=1 force\-cfr=1\*(R".
.IP "\fBb\-bias (\fR\fIb\-bias\fR\fB)\fR" 4
.IX Item "b-bias (b-bias)"
Set the influence on how often B\-frames are used.
.IP "\fBb\-pyramid (\fR\fIb\-pyramid\fR\fB)\fR" 4
.IX Item "b-pyramid (b-pyramid)"
Set method for keeping of some B\-frames as references. Possible values:
.RS 4
.IP "\fBnone (\fR\fInone\fR\fB)\fR" 4
.IX Item "none (none)"
Disabled.
.IP "\fBstrict (\fR\fIstrict\fR\fB)\fR" 4
.IX Item "strict (strict)"
Strictly hierarchical pyramid.
.IP "\fBnormal (\fR\fInormal\fR\fB)\fR" 4
.IX Item "normal (normal)"
Non-strict (not Blu-ray compatible).
.RE
.RS 4
.RE
.IP "\fBmixed-refs\fR" 4
.IX Item "mixed-refs"
Enable the use of one reference per partition, as opposed to one
reference per macroblock when set to 1. When set to 0, it has the
same effect as \fBx264\fR's \fB\-\-no\-mixed\-refs\fR option.
.IP "\fB8x8dct\fR" 4
.IX Item "8x8dct"
Enable adaptive spatial transform (high profile 8x8 transform)
when set to 1. When set to 0, it has the same effect as
\&\fBx264\fR's \fB\-\-no\-8x8dct\fR option.
.IP "\fBfast-pskip\fR" 4
.IX Item "fast-pskip"
Enable early \s-1SKIP\s0 detection on P\-frames when set to 1. When set
to 0, it has the same effect as \fBx264\fR's
\&\fB\-\-no\-fast\-pskip\fR option.
.IP "\fBaud (\fR\fIaud\fR\fB)\fR" 4
.IX Item "aud (aud)"
Enable use of access unit delimiters when set to 1.
.IP "\fBmbtree\fR" 4
.IX Item "mbtree"
Enable use macroblock tree ratecontrol when set to 1. When set
to 0, it has the same effect as \fBx264\fR's
\&\fB\-\-no\-mbtree\fR option.
.IP "\fBdeblock (\fR\fIdeblock\fR\fB)\fR" 4
.IX Item "deblock (deblock)"
Set loop filter parameters, in \fIalpha\fR:\fIbeta\fR form.
.IP "\fBcplxblur (\fR\fIcplxblur\fR\fB)\fR" 4
.IX Item "cplxblur (cplxblur)"
Set fluctuations reduction in \s-1QP \s0(before curve compression).
.IP "\fBpartitions (\fR\fIpartitions\fR\fB)\fR" 4
.IX Item "partitions (partitions)"
Set partitions to consider as a comma-separated list of. Possible
values in the list:
.RS 4
.IP "\fBp8x8\fR" 4
.IX Item "p8x8"
8x8 P\-frame partition.
.IP "\fBp4x4\fR" 4
.IX Item "p4x4"
4x4 P\-frame partition.
.IP "\fBb8x8\fR" 4
.IX Item "b8x8"
4x4 B\-frame partition.
.IP "\fBi8x8\fR" 4
.IX Item "i8x8"
8x8 I\-frame partition.
.IP "\fBi4x4\fR" 4
.IX Item "i4x4"
4x4 I\-frame partition.
(Enabling \fBp4x4\fR requires \fBp8x8\fR to be enabled. Enabling
\&\fBi8x8\fR requires adaptive spatial transform (\fB8x8dct\fR
option) to be enabled.)
.IP "\fBnone (\fR\fInone\fR\fB)\fR" 4
.IX Item "none (none)"
Do not consider any partitions.
.IP "\fBall (\fR\fIall\fR\fB)\fR" 4
.IX Item "all (all)"
Consider every partition.
.RE
.RS 4
.RE
.IP "\fBdirect-pred (\fR\fIdirect\fR\fB)\fR" 4
.IX Item "direct-pred (direct)"
Set direct \s-1MV\s0 prediction mode. Possible values:
.RS 4
.IP "\fBnone (\fR\fInone\fR\fB)\fR" 4
.IX Item "none (none)"
Disable \s-1MV\s0 prediction.
.IP "\fBspatial (\fR\fIspatial\fR\fB)\fR" 4
.IX Item "spatial (spatial)"
Enable spatial predicting.
.IP "\fBtemporal (\fR\fItemporal\fR\fB)\fR" 4
.IX Item "temporal (temporal)"
Enable temporal predicting.
.IP "\fBauto (\fR\fIauto\fR\fB)\fR" 4
.IX Item "auto (auto)"
Automatically decided.
.RE
.RS 4
.RE
.IP "\fBslice-max-size (\fR\fIslice-max-size\fR\fB)\fR" 4
.IX Item "slice-max-size (slice-max-size)"
Set the limit of the size of each slice in bytes. If not specified
but \s-1RTP\s0 payload size (\fBps\fR) is specified, that is used.
.IP "\fBstats (\fR\fIstats\fR\fB)\fR" 4
.IX Item "stats (stats)"
Set the file name for multi-pass stats.
.IP "\fBnal-hrd (\fR\fInal-hrd\fR\fB)\fR" 4
.IX Item "nal-hrd (nal-hrd)"
Set signal \s-1HRD\s0 information (requires \fBvbv-bufsize\fR to be set).
Possible values:
.RS 4
.IP "\fBnone (\fR\fInone\fR\fB)\fR" 4
.IX Item "none (none)"
Disable \s-1HRD\s0 information signaling.
.IP "\fBvbr (\fR\fIvbr\fR\fB)\fR" 4
.IX Item "vbr (vbr)"
Variable bit rate.
.IP "\fBcbr (\fR\fIcbr\fR\fB)\fR" 4
.IX Item "cbr (cbr)"
Constant bit rate (not allowed in \s-1MP4\s0 container).
.RE
.RS 4
.RE
.IP "\fBx264opts (N.A.)\fR" 4
.IX Item "x264opts (N.A.)"
Set any x264 option, see \fBx264 \-\-fullhelp\fR for a list.
.Sp
Argument 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
.IP "\fBa53cc\fR \fIboolean\fR" 4
.IX Item "a53cc boolean"
Import closed captions (which must be \s-1ATSC\s0 compatible format) into output.
Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
.IP "\fBx264\-params (N.A.)\fR" 4
.IX Item "x264-params (N.A.)"
Override the x264 configuration using a :\-separated list of key=value
parameters.
.Sp
This option is functionally the same as the \fBx264opts\fR, but is
duplicated for compatibility with the Libav fork.
.Sp
For example to specify libx264 encoding options with \fBffmpeg\fR:
.Sp
.Vb 3
\&        ffmpeg \-i INPUT \-c:v libx264 \-x264\-params level=30:bframes=0:weightp=0:\e
\&        cabac=0:ref=1:vbv\-maxrate=768:vbv\-bufsize=2000:analyse=all:me=umh:\e
\&        no\-fast\-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
.Ve
.PP
Encoding ffpresets for common usages are provided so they can be used with the
general presets system (e.g. passing the \fBpre\fR option).
.SS "libx265"
.IX Subsection "libx265"
x265 H.265/HEVC encoder wrapper.
.PP
This encoder requires the presence of the libx265 headers and library
during configuration. You need to explicitly configure the build with
\&\fB\-\-enable\-libx265\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBpreset\fR" 4
.IX Item "preset"
Set the x265 preset.
.IP "\fBtune\fR" 4
.IX Item "tune"
Set the x265 tune parameter.
.IP "\fBx265\-params\fR" 4
.IX Item "x265-params"
Set x265 options using a list of \fIkey\fR=\fIvalue\fR couples separated
by \*(L":\*(R". See \fBx265 \-\-help\fR for a list of options.
.Sp
For example to specify libx265 encoding options with \fB\-x265\-params\fR:
.Sp
.Vb 1
\&        ffmpeg \-i input \-c:v libx265 \-x265\-params crf=26:psy\-rd=1 output.mp4
.Ve
.SS "libxvid"
.IX Subsection "libxvid"
Xvid \s-1MPEG\-4\s0 Part 2 encoder wrapper.
.PP
This encoder requires the presence of the libxvidcore headers and library
during configuration. You need to explicitly configure the build with
\&\f(CW\*(C`\-\-enable\-libxvid \-\-enable\-gpl\*(C'\fR.
.PP
The native \f(CW\*(C`mpeg4\*(C'\fR encoder supports the \s-1MPEG\-4\s0 Part 2 format, so
users can encode to this format without this library.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The following options are supported by the libxvid wrapper. Some of
the following options are listed but are not documented, and
correspond to shared codec options. See \fBthe Codec
Options chapter\fR for their documentation. The other shared options
which are not listed have no effect for the libxvid encoder.
.IP "\fBb\fR" 4
.IX Item "b"
.PD 0
.IP "\fBg\fR" 4
.IX Item "g"
.IP "\fBqmin\fR" 4
.IX Item "qmin"
.IP "\fBqmax\fR" 4
.IX Item "qmax"
.IP "\fBmpeg_quant\fR" 4
.IX Item "mpeg_quant"
.IP "\fBthreads\fR" 4
.IX Item "threads"
.IP "\fBbf\fR" 4
.IX Item "bf"
.IP "\fBb_qfactor\fR" 4
.IX Item "b_qfactor"
.IP "\fBb_qoffset\fR" 4
.IX Item "b_qoffset"
.IP "\fBflags\fR" 4
.IX Item "flags"
.PD
Set specific encoding flags. Possible values:
.RS 4
.IP "\fBmv4\fR" 4
.IX Item "mv4"
Use four motion vector by macroblock.
.IP "\fBaic\fR" 4
.IX Item "aic"
Enable high quality \s-1AC\s0 prediction.
.IP "\fBgray\fR" 4
.IX Item "gray"
Only encode grayscale.
.IP "\fBgmc\fR" 4
.IX Item "gmc"
Enable the use of global motion compensation (\s-1GMC\s0).
.IP "\fBqpel\fR" 4
.IX Item "qpel"
Enable quarter-pixel motion compensation.
.IP "\fBcgop\fR" 4
.IX Item "cgop"
Enable closed \s-1GOP.\s0
.IP "\fBglobal_header\fR" 4
.IX Item "global_header"
Place global headers in extradata instead of every keyframe.
.RE
.RS 4
.RE
.IP "\fBtrellis\fR" 4
.IX Item "trellis"
.PD 0
.IP "\fBme_method\fR" 4
.IX Item "me_method"
.PD
Set motion estimation method. Possible values in decreasing order of
speed and increasing order of quality:
.RS 4
.IP "\fBzero\fR" 4
.IX Item "zero"
Use no motion estimation (default).
.IP "\fBphods\fR" 4
.IX Item "phods"
.PD 0
.IP "\fBx1\fR" 4
.IX Item "x1"
.IP "\fBlog\fR" 4
.IX Item "log"
.PD
Enable advanced diamond zonal search for 16x16 blocks and half-pixel
refinement for 16x16 blocks. \fBx1\fR and \fBlog\fR are aliases for
\&\fBphods\fR.
.IP "\fBepzs\fR" 4
.IX Item "epzs"
Enable all of the things described above, plus advanced diamond zonal
search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
estimation on chroma planes.
.IP "\fBfull\fR" 4
.IX Item "full"
Enable all of the things described above, plus extended 16x16 and 8x8
blocks search.
.RE
.RS 4
.RE
.IP "\fBmbd\fR" 4
.IX Item "mbd"
Set macroblock decision algorithm. Possible values in the increasing
order of quality:
.RS 4
.IP "\fBsimple\fR" 4
.IX Item "simple"
Use macroblock comparing function algorithm (default).
.IP "\fBbits\fR" 4
.IX Item "bits"
Enable rate distortion-based half pixel and quarter pixel refinement for
16x16 blocks.
.IP "\fBrd\fR" 4
.IX Item "rd"
Enable all of the things described above, plus rate distortion-based
half pixel and quarter pixel refinement for 8x8 blocks, and rate
distortion-based search using square pattern.
.RE
.RS 4
.RE
.IP "\fBlumi_aq\fR" 4
.IX Item "lumi_aq"
Enable lumi masking adaptive quantization when set to 1. Default is 0
(disabled).
.IP "\fBvariance_aq\fR" 4
.IX Item "variance_aq"
Enable variance adaptive quantization when set to 1. Default is 0
(disabled).
.Sp
When combined with \fBlumi_aq\fR, the resulting quality will not
be better than any of the two specified individually. In other
words, the resulting quality will be the worse one of the two
effects.
.IP "\fBssim\fR" 4
.IX Item "ssim"
Set structural similarity (\s-1SSIM\s0) displaying method. Possible values:
.RS 4
.IP "\fBoff\fR" 4
.IX Item "off"
Disable displaying of \s-1SSIM\s0 information.
.IP "\fBavg\fR" 4
.IX Item "avg"
Output average \s-1SSIM\s0 at the end of encoding to stdout. The format of
showing the average \s-1SSIM\s0 is:
.Sp
.Vb 1
\&        Average SSIM: %f
.Ve
.Sp
For users who are not familiar with C, \f(CW%f\fR means a float number, or
a decimal (e.g. 0.939232).
.IP "\fBframe\fR" 4
.IX Item "frame"
Output both per-frame \s-1SSIM\s0 data during encoding and average \s-1SSIM\s0 at
the end of encoding to stdout. The format of per-frame information
is:
.Sp
.Vb 1
\&               SSIM: avg: %1.3f min: %1.3f max: %1.3f
.Ve
.Sp
For users who are not familiar with C, \f(CW%1\fR.3f means a float number
rounded to 3 digits after the dot (e.g. 0.932).
.RE
.RS 4
.RE
.IP "\fBssim_acc\fR" 4
.IX Item "ssim_acc"
Set \s-1SSIM\s0 accuracy. Valid options are integers within the range of
0\-4, while 0 gives the most accurate result and 4 computes the
fastest.
.SS "mpeg2"
.IX Subsection "mpeg2"
\&\s-1MPEG\-2\s0 video encoder.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBseq_disp_ext\fR \fIinteger\fR" 4
.IX Item "seq_disp_ext integer"
Specifies if the encoder should write a sequence_display_extension to the
output.
.RS 4
.IP "\fB\-1\fR" 4
.IX Item "-1"
.PD 0
.IP "\fBauto\fR" 4
.IX Item "auto"
.PD
Decide automatically to write it or not (this is the default) by checking if
the data to be written is different from the default or unspecified values.
.IP "\fB0\fR" 4
.IX Item "0"
.PD 0
.IP "\fBnever\fR" 4
.IX Item "never"
.PD
Never write it.
.IP "\fB1\fR" 4
.IX Item "1"
.PD 0
.IP "\fBalways\fR" 4
.IX Item "always"
.PD
Always write it.
.RE
.RS 4
.RE
.SS "png"
.IX Subsection "png"
\&\s-1PNG\s0 image encoder.
.PP
\fIPrivate options\fR
.IX Subsection "Private options"
.IP "\fBdpi\fR \fIinteger\fR" 4
.IX Item "dpi integer"
Set physical density of pixels, in dots per inch, unset by default
.IP "\fBdpm\fR \fIinteger\fR" 4
.IX Item "dpm integer"
Set physical density of pixels, in dots per meter, unset by default
.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 chosen 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"
.IP "\fB4444\fR" 4
.IX Item "4444"
.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.
A\s0 custom vendor \s-1ID\s0 like \fIapl0\fR would claim the stream was produced by
the Apple encoder.
.IP "\fBalpha_bits\fR \fIinteger\fR" 4
.IX Item "alpha_bits integer"
Specify number of bits for alpha component.
Possible values are \fI0\fR, \fI8\fR and \fI16\fR.
Use \fI0\fR to disable alpha plane coding.
.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 produce 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.
.SS "libkvazaar"
.IX Subsection "libkvazaar"
Kvazaar H.265/HEVC encoder.
.PP
Requires the presence of the libkvazaar headers and library during
configuration. You need to explicitly configure the build with
\&\fB\-\-enable\-libkvazaar\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBb\fR" 4
.IX Item "b"
Set target video bitrate in bit/s and enable rate control.
.IP "\fBkvazaar-params\fR" 4
.IX Item "kvazaar-params"
Set kvazaar parameters as a list of \fIname\fR=\fIvalue\fR pairs separated
by commas (,). See kvazaar documentation for a list of options.
.SS "\s-1QSV\s0 encoders"
.IX Subsection "QSV encoders"
The family of Intel QuickSync Video encoders (\s-1MPEG\-2, H.264\s0 and \s-1HEVC\s0)
.PP
The ratecontrol method is selected as follows:
.IP "\(bu" 4
When \fBglobal_quality\fR is specified, a quality-based mode is used.
Specifically this means either
.RS 4
.IP "\-" 4
\&\fI\s-1CQP\s0\fR \- constant quantizer scale, when the \fBqscale\fR codec flag is
also set (the \fB\-qscale\fR ffmpeg option).
.IP "\-" 4
\&\fI\s-1LA_ICQ\s0\fR \- intelligent constant quality with lookahead, when the
\&\fBlook_ahead\fR option is also set.
.IP "\-" 4
\&\fI\s-1ICQ\s0\fR \*(-- intelligent constant quality otherwise.
.RE
.RS 4
.RE
.IP "\(bu" 4
Otherwise, a bitrate-based mode is used. For all of those, you should specify at
least the desired average bitrate with the \fBb\fR option.
.RS 4
.IP "\-" 4
\&\fI\s-1LA\s0\fR \- \s-1VBR\s0 with lookahead, when the \fBlook_ahead\fR option is specified.
.IP "\-" 4
\&\fI\s-1VCM\s0\fR \- video conferencing mode, when the \fBvcm\fR option is set.
.IP "\-" 4
\&\fI\s-1CBR\s0\fR \- constant bitrate, when \fBmaxrate\fR is specified and equal to
the average bitrate.
.IP "\-" 4
\&\fI\s-1VBR\s0\fR \- variable bitrate, when \fBmaxrate\fR is specified, but is higher
than the average bitrate.
.IP "\-" 4
\&\fI\s-1AVBR\s0\fR \- average \s-1VBR\s0 mode, when \fBmaxrate\fR is not specified. This mode
is further configured by the \fBavbr_accuracy\fR and
\&\fBavbr_convergence\fR options.
.RE
.RS 4
.RE
.PP
Note that depending on your system, a different mode than the one you specified
may be selected by the encoder. Set the verbosity level to \fIverbose\fR or
higher to see the actual settings used by the \s-1QSV\s0 runtime.
.PP
Additional libavcodec global options are mapped to \s-1MSDK\s0 options as follows:
.IP "\(bu" 4
\&\fBg/gop_size\fR \-> \fBGopPicSize\fR
.IP "\(bu" 4
\&\fBbf/max_b_frames\fR+1 \-> \fBGopRefDist\fR
.IP "\(bu" 4
\&\fBrc_init_occupancy/rc_initial_buffer_occupancy\fR \->
\&\fBInitialDelayInKB\fR
.IP "\(bu" 4
\&\fBslices\fR \-> \fBNumSlice\fR
.IP "\(bu" 4
\&\fBrefs\fR \-> \fBNumRefFrame\fR
.IP "\(bu" 4
\&\fBb_strategy/b_frame_strategy\fR \-> \fBBRefType\fR
.IP "\(bu" 4
\&\fBcgop/CLOSED_GOP\fR codec flag \-> \fBGopOptFlag\fR
.IP "\(bu" 4
For the \fI\s-1CQP\s0\fR mode, the \fBi_qfactor/i_qoffset\fR and
\&\fBb_qfactor/b_qoffset\fR set the difference between \fI\s-1QPP\s0\fR and \fI\s-1QPI\s0\fR,
and \fI\s-1QPP\s0\fR and \fI\s-1QPB\s0\fR respectively.
.IP "\(bu" 4
Setting the \fBcoder\fR option to the value \fIvlc\fR will make the H.264
encoder use \s-1CAVLC\s0 instead of \s-1CABAC.\s0
.SS "vc2"
.IX Subsection "vc2"
\&\s-1SMPTE VC\-2 \s0(previously \s-1BBC\s0 Dirac Pro). This codec was primarily aimed at
professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
8 (limited range or full range), 10 or 12 bits, this makes it suitable for
other tasks which require low overhead and low compression (like screen
recording).
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBb\fR" 4
.IX Item "b"
Sets target video bitrate. Usually that's around 1:6 of the uncompressed
video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
values (close to the uncompressed bitrate) turn on lossless compression mode.
.IP "\fBfield_order\fR" 4
.IX Item "field_order"
Enables field coding when set (e.g. to tt \- top field first) for interlaced
inputs. Should increase compression with interlaced content as it splits the
fields and encodes each separately.
.IP "\fBwavelet_depth\fR" 4
.IX Item "wavelet_depth"
Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
Lower values reduce compression and quality. Less capable decoders may not be
able to handle values of \fBwavelet_depth\fR over 3.
.IP "\fBwavelet_type\fR" 4
.IX Item "wavelet_type"
Sets the transform type. Currently only \fI5_3\fR (LeGall) and \fI9_7\fR
(Deslauriers-Dubuc)
are implemented, with 9_7 being the one with better compression and thus
is the default.
.IP "\fBslice_width\fR" 4
.IX Item "slice_width"
.PD 0
.IP "\fBslice_height\fR" 4
.IX Item "slice_height"
.PD
Sets the slice size for each slice. Larger values result in better compression.
For compatibility with other more limited decoders use \fBslice_width\fR of
32 and \fBslice_height\fR of 8.
.IP "\fBtolerance\fR" 4
.IX Item "tolerance"
Sets the undershoot tolerance of the rate control system in percent. This is
to prevent an expensive search from being run.
.IP "\fBqm\fR" 4
.IX Item "qm"
Sets the quantization matrix preset to use by default or when \fBwavelet_depth\fR
is set to 5
.RS 4
.IP "\-" 4
\&\fIdefault\fR
Uses the default quantization matrix from the specifications, extended with
values for the fifth level. This provides a good balance between keeping detail
and omitting artifacts.
.IP "\-" 4
\&\fIflat\fR
Use a completely zeroed out quantization matrix. This increases \s-1PSNR\s0 but might
reduce perception. Use in bogus benchmarks.
.IP "\-" 4
\&\fIcolor\fR
Reduces detail but attempts to preserve color at extremely low bitrates.
.RE
.RS 4
.RE
.SH "SUBTITLES ENCODERS"
.IX Header "SUBTITLES ENCODERS"
.SS "dvdsub"
.IX Subsection "dvdsub"
This codec encodes the bitmap subtitle format that is used in DVDs.
Typically they are stored in \s-1VOBSUB\s0 file pairs (*.idx + *.sub),
and they can also be used in Matroska files.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBeven_rows_fix\fR" 4
.IX Item "even_rows_fix"
When set to 1, enable a work-around that makes the number of pixel rows
even in all subtitles.  This fixes a problem with some players that
cut off the bottom row if the number is odd.  The work-around just adds
a fully transparent row if needed.  The overhead is low, typically
one byte per subtitle on average.
.Sp
By default, this work-around is disabled.
.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
The ff* tools have a \-bsf option applied per stream, taking a
comma-separated list of filters, whose parameters follow the filter
name after a '='.
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-c:v copy \-bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
.Ve
.PP
Below is a description of the currently available bitstream filters,
with their parameters, if any.
.SS "aac_adtstoasc"
.IX Subsection "aac_adtstoasc"
Convert \s-1MPEG\-2/4 AAC ADTS\s0 to \s-1MPEG\-4\s0 Audio Specific Configuration
bitstream filter.
.PP
This filter creates an \s-1MPEG\-4\s0 AudioSpecificConfig from an \s-1MPEG\-2/4
ADTS\s0 header and removes the \s-1ADTS\s0 header.
.PP
This is required for example when copying an \s-1AAC\s0 stream from a raw
\&\s-1ADTS AAC\s0 container to a \s-1FLV\s0 or a \s-1MOV/MP4\s0 file.
.SS "chomp"
.IX Subsection "chomp"
Remove zero padding at the end of a packet.
.SS "dump_extra"
.IX Subsection "dump_extra"
Add extradata to the beginning of the filtered packets.
.PP
The additional argument specifies which packets should be filtered.
It accepts the values:
.IP "\fBa\fR" 4
.IX Item "a"
add extradata to all key packets, but only if \fIlocal_header\fR is
set in the \fBflags2\fR codec context field
.IP "\fBk\fR" 4
.IX Item "k"
add extradata to all key packets
.IP "\fBe\fR" 4
.IX Item "e"
add extradata to all packets
.PP
If not specified it is assumed \fBk\fR.
.PP
For example the following \fBffmpeg\fR command forces a global
header (thus disabling individual packet headers) in the H.264 packets
generated by the \f(CW\*(C`libx264\*(C'\fR encoder, but corrects them by adding
the header stored in extradata to the key packets:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-map 0 \-flags:v +global_header \-c:v libx264 \-bsf:v dump_extra out.ts
.Ve
.SS "dca_core"
.IX Subsection "dca_core"
Extract \s-1DCA\s0 core from DTS-HD streams.
.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 "imxdump"
.IX Subsection "imxdump"
Modifies the bitstream to fit in \s-1MOV\s0 and to be usable by the Final Cut
Pro decoder. This filter only applies to the mpeg2video codec, and is
likely not needed for Final Cut Pro 7 and newer with the appropriate
\&\fB\-tag:v\fR.
.PP
For example, to remux 30 MB/sec \s-1NTSC IMX\s0 to \s-1MOV:\s0
.PP
.Vb 1
\&        ffmpeg \-i input.mxf \-c copy \-bsf:v imxdump \-tag:v mx3n output.mov
.Ve
.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_decompress"
.IX Subsection "mp3_header_decompress"
.SS "mpeg4_unpack_bframes"
.IX Subsection "mpeg4_unpack_bframes"
Unpack DivX-style packed B\-frames.
.PP
DivX-style packed B\-frames are not valid \s-1MPEG\-4\s0 and were only a
workaround for the broken Video for Windows subsystem.
They use more space, can cause minor \s-1AV\s0 sync issues, require more
\&\s-1CPU\s0 power to decode (unless the player has some decoded picture queue
to compensate the 2,0,2,0 frame per packet style) and cause
trouble if copied into a standard container like mp4 or mpeg\-ps/ts,
because \s-1MPEG\-4\s0 decoders may not be able to decode them, since they are
not valid \s-1MPEG\-4.\s0
.PP
For example to fix an \s-1AVI\s0 file containing an \s-1MPEG\-4\s0 stream with
DivX-style packed B\-frames using \fBffmpeg\fR, you can use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT.avi \-codec copy \-bsf:v mpeg4_unpack_bframes OUTPUT.avi
.Ve
.SS "noise"
.IX Subsection "noise"
Damages the contents of packets without damaging the container. Can be
used for fuzzing or testing error resilience/concealment.
.PP
Parameters:
A numeral string, whose value is related to how often output bytes will
be modified. Therefore, values below or equal to 0 are forbidden, and
the lower the more frequent bytes will be modified, with 1 meaning
every byte is modified.
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-c copy \-bsf noise[=1] output.mkv
.Ve
.PP
applies the modification to every byte.
.SS "remove_extra"
.IX Subsection "remove_extra"
.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 enable detecting 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 "\fBfastseek\fR" 4
.IX Item "fastseek"
Enable fast, but inaccurate seeks for some formats.
.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 MP4A\-LATM\s0 payload.
.IP "\fBnobuffer\fR" 4
.IX Item "nobuffer"
Reduce the latency introduced by optional buffering
.IP "\fBbitexact\fR" 4
.IX Item "bitexact"
Only write platform\-, build\- and time-independent data.
This ensures that file and data checksums are reproducible and match between
platforms. Its primary use is for regression testing.
.IP "\fBshortest\fR" 4
.IX Item "shortest"
Stop muxing at the end of the shortest stream.
It may be needed to increase max_interleave_delta to avoid flushing the longer
streams before \s-1EOF.\s0
.RE
.RS 4
.RE
.IP "\fBseek2any\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "seek2any integer (input)"
Allow seeking to non-keyframes on demuxer level when supported if set to 1.
Default is 0.
.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 enable detecting 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 "\fBmax_interleave_delta\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "max_interleave_delta integer (output)"
Set maximum buffering duration for interleaving. The duration is
expressed in microseconds, and defaults to 1000000 (1 second).
.Sp
To ensure all the streams are interleaved correctly, libavformat will
wait until it has at least one packet for each stream before actually
writing any packets to the output file. When some streams are
\&\*(L"sparse\*(R" (i.e. there are large gaps between successive packets), this
can result in excessive buffering.
.Sp
This field specifies the maximum difference between the timestamps of the
first and the last packet in the muxing queue, above which libavformat
will output a packet regardless of whether it has queued a packet for all
the streams.
.Sp
If set to 0, libavformat will continue buffering packets until it has
a packet for each stream, regardless of the maximum timestamp
difference between the buffered packets.
.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 if set to 1. Default is 0.
.IP "\fBavoid_negative_ts\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "avoid_negative_ts integer (output)"
Possible values:
.RS 4
.IP "\fBmake_non_negative\fR" 4
.IX Item "make_non_negative"
Shift timestamps to make them non-negative.
Also note that this affects only leading negative timestamps, and not
non-monotonic negative timestamps.
.IP "\fBmake_zero\fR" 4
.IX Item "make_zero"
Shift timestamps so that the first timestamp is 0.
.IP "\fBauto (default)\fR" 4
.IX Item "auto (default)"
Enables shifting when required by the target format.
.IP "\fBdisabled\fR" 4
.IX Item "disabled"
Disables shifting of timestamp.
.RE
.RS 4
.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.
.RE
.IP "\fBskip_initial_bytes\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "skip_initial_bytes integer (input)"
Set number of bytes to skip before reading header and frames if set to 1.
Default is 0.
.IP "\fBcorrect_ts_overflow\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "correct_ts_overflow integer (input)"
Correct single timestamp overflows if set to 1. Default is 1.
.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.
.IP "\fBoutput_ts_offset\fR \fIoffset\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
.IX Item "output_ts_offset offset (output)"
Set the output time offset.
.Sp
\&\fIoffset\fR must be a time duration specification,
see \fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR.
.Sp
The offset is added by the muxer to the output timestamps.
.Sp
Specifying a positive offset means that the corresponding streams are
delayed bt the time duration specified in \fIoffset\fR. Default value
is \f(CW0\fR (meaning that no offset is applied).
.IP "\fBformat_whitelist\fR \fIlist\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "format_whitelist list (input)"
\&\*(L",\*(R" separated list of allowed demuxers. By default all are allowed.
.IP "\fBdump_separator\fR \fIstring\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "dump_separator string (input)"
Separator used to separate the fields printed on the command line about the
Stream parameters.
For example to separate the fields with newlines and indention:
.Sp
.Vb 2
\&        ffprobe \-dump_separator "
\&                                  "  \-i ~/videos/matrixbench_mpeg2.mpg
.Ve
.IP "\fBmax_streams\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "max_streams integer (input)"
Specifies the maximum number of streams. This can be used to reject files that
would require too many resources due to a large number of streams.
.SS "Format stream specifiers"
.IX Subsection "Format stream specifiers"
Format stream specifiers allow selection of one or more streams that
match specific properties.
.PP
Possible forms of stream specifiers are:
.IP "\fIstream_index\fR" 4
.IX Item "stream_index"
Matches the stream with this index.
.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 the 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
.PP
The exact semantics of stream specifiers is defined by the
\&\f(CW\*(C`avformat_match_stream_specifier()\*(C'\fR function declared in the
\&\fIlibavformat/avformat.h\fR header.
.SH "DEMUXERS"
.IX Header "DEMUXERS"
Demuxers are configured elements in FFmpeg that can 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 "aa"
.IX Subsection "aa"
Audible Format 2, 3, and 4 demuxer.
.PP
This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
.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 "apng"
.IX Subsection "apng"
Animated Portable Network Graphics demuxer.
.PP
This demuxer is used to demux \s-1APNG\s0 files.
All headers, but the \s-1PNG\s0 signature, up to (but not including) the first
fcTL chunk are transmitted as extradata.
Frames are then split as being all the chunks between two fcTL ones, or
between the last fcTL and \s-1IEND\s0 chunks.
.IP "\fB\-ignore_loop\fR \fIbool\fR" 4
.IX Item "-ignore_loop bool"
Ignore the loop variable in the file if set.
.IP "\fB\-max_fps\fR \fIint\fR" 4
.IX Item "-max_fps int"
Maximum framerate in frames per second (0 for no limit).
.IP "\fB\-default_fps\fR \fIint\fR" 4
.IX Item "-default_fps int"
Default framerate in frames per second when none is specified in the file
(0 meaning as fast as possible).
.SS "asf"
.IX Subsection "asf"
Advanced Systems Format demuxer.
.PP
This demuxer is used to demux \s-1ASF\s0 files and \s-1MMS\s0 network streams.
.IP "\fB\-no_resync_search\fR \fIbool\fR" 4
.IX Item "-no_resync_search bool"
Do not try to resynchronize by looking for a certain optional start code.
.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 packets 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 file-related 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 \-1.
.Sp
To make FFmpeg recognize the format automatically, this directive must
appear 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.
.ie n .IP "\fB\fB""inpoint \f(BItimestamp\f(CB""\fB\fR" 4
.el .IP "\fB\f(CBinpoint \f(CBtimestamp\f(CB\fB\fR" 4
.IX Item "inpoint timestamp"
In point of the file. When the demuxer opens the file it instantly seeks to the
specified timestamp. Seeking is done so that all streams can be presented
successfully at In point.
.Sp
This directive works best with intra frame codecs, because for non-intra frame
ones you will usually get extra packets before the actual In point and the
decoded content will most likely contain frames before In point too.
.Sp
For each file, packets before the file In point will have timestamps less than
the calculated start timestamp of the file (negative in case of the first
file), and the duration of the files (if not specified by the \f(CW\*(C`duration\*(C'\fR
directive) will be reduced based on their specified In point.
.Sp
Because of potential packets before the specified In point, packet timestamps
may overlap between two concatenated files.
.ie n .IP "\fB\fB""outpoint \f(BItimestamp\f(CB""\fB\fR" 4
.el .IP "\fB\f(CBoutpoint \f(CBtimestamp\f(CB\fB\fR" 4
.IX Item "outpoint timestamp"
Out point of the file. When the demuxer reaches the specified decoding
timestamp in any of the streams, it handles it as an end of file condition and
skips the current and all the remaining packets from all streams.
.Sp
Out point is exclusive, which means that the demuxer will not output packets
with a decoding timestamp greater or equal to Out point.
.Sp
This directive works best with intra frame codecs and formats where all streams
are tightly interleaved. For non-intra frame codecs you will usually get
additional packets with presentation timestamp after Out point therefore the
decoded content will most likely contain frames after Out point too. If your
streams are not tightly interleaved you may not get all the packets from all
streams before Out point and you may only will be able to decode the earliest
stream until Out point.
.Sp
The duration of the files (if not specified by the \f(CW\*(C`duration\*(C'\fR
directive) will be reduced based on their specified Out point.
.ie n .IP "\fB\fB""file_packet_metadata \f(BIkey=value\f(CB""\fB\fR" 4
.el .IP "\fB\f(CBfile_packet_metadata \f(CBkey=value\f(CB\fB\fR" 4
.IX Item "file_packet_metadata key=value"
Metadata of the packets of the file. The specified metadata will be set for
each file packet. You can specify this directive multiple times to add multiple
metadata entries.
.ie n .IP "\fB\fB""stream""\fB\fR" 4
.el .IP "\fB\f(CBstream\fB\fR" 4
.IX Item "stream"
Introduce a stream in the virtual file.
All subsequent stream-related directives apply to the last introduced
stream.
Some streams properties must be set in order to allow identifying the
matching streams in the subfiles.
If no streams are defined in the script, the streams from the first file are
copied.
.ie n .IP "\fB\fB""exact_stream_id \f(BIid\f(CB""\fB\fR" 4
.el .IP "\fB\f(CBexact_stream_id \f(CBid\f(CB\fB\fR" 4
.IX Item "exact_stream_id id"
Set the id of the stream.
If this directive is given, the string with the corresponding id in the
subfiles will be used.
This is especially useful for MPEG-PS (\s-1VOB\s0) files, where the order of the
streams is not reliable.
.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.
.Sp
\&\-1 is equivalent to 1 if the format was automatically
probed and 0 otherwise.
.IP "\fBauto_convert\fR" 4
.IX Item "auto_convert"
If set to 1, try to perform automatic conversions on packet data to make the
streams concatenable.
The default is 1.
.Sp
Currently, the only conversion is adding the h264_mp4toannexb bitstream
filter to H.264 streams in \s-1MP4\s0 format. This is necessary in particular if
there are resolution changes.
.IP "\fBsegment_time_metadata\fR" 4
.IX Item "segment_time_metadata"
If set to 1, every packet will contain the \fIlavf.concat.start_time\fR and the
\&\fIlavf.concat.duration\fR packet metadata values which are the start_time and
the duration of the respective file segments in the concatenated output
expressed in microseconds. The duration metadata is only set if it is known
based on the concat file.
The default is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use absolute filenames and include some comments:
.Sp
.Vb 6
\&        # my first filename
\&        file /mnt/share/file\-1.wav
\&        # my second filename including whitespace
\&        file \*(Aq/mnt/share/file 2.wav\*(Aq
\&        # my third filename including whitespace plus single quote
\&        file \*(Aq/mnt/share/file 3\*(Aq\e\*(Aq\*(Aq.wav\*(Aq
.Ve
.IP "\(bu" 4
Allow for input format auto-probing, use safe filenames and set the duration of
the first file:
.Sp
.Vb 1
\&        ffconcat version 1.0
\&        
\&        file file\-1.wav
\&        duration 20.0
\&        
\&        file subdir/file\-2.wav
.Ve
.SS "flv"
.IX Subsection "flv"
Adobe Flash Video Format demuxer.
.PP
This demuxer is used to demux \s-1FLV\s0 files and \s-1RTMP\s0 network streams.
.IP "\fB\-flv_metadata\fR \fIbool\fR" 4
.IX Item "-flv_metadata bool"
Allocate the streams according to the onMetaData array content.
.SS "gif"
.IX Subsection "gif"
Animated \s-1GIF\s0 demuxer.
.PP
It accepts the following options:
.IP "\fBmin_delay\fR" 4
.IX Item "min_delay"
Set the minimum valid delay between frames in hundredths of seconds.
Range is 0 to 6000. Default value is 2.
.IP "\fBmax_gif_delay\fR" 4
.IX Item "max_gif_delay"
Set the maximum valid delay between frames in hundredth of seconds.
Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
the maximum value allowed by the specification.
.IP "\fBdefault_delay\fR" 4
.IX Item "default_delay"
Set the default delay between frames in hundredths of seconds.
Range is 0 to 6000. Default value is 10.
.IP "\fBignore_loop\fR" 4
.IX Item "ignore_loop"
\&\s-1GIF\s0 files can contain information to loop a certain number of times (or
infinitely). If \fBignore_loop\fR is set to 1, then the loop setting
from the input will be ignored and looping will not occur. If set to 0,
then looping will occur and will cycle the number of times according to
the \s-1GIF.\s0 Default value is 1.
.PP
For example, with the overlay filter, place an infinitely looping \s-1GIF\s0
over another video:
.PP
.Vb 1
\&        ffmpeg \-i input.mp4 \-ignore_loop 0 \-i input.gif \-filter_complex overlay=shortest=1 out.mkv
.Ve
.PP
Note that in the above example the shortest option for overlay filter is
used to end the output video at the length of the shortest input file,
which in this case is \fIinput.mp4\fR as the \s-1GIF\s0 in this example loops
infinitely.
.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 "\fBnone\fR" 4
.IX Item "none"
Disable pattern matching, therefore the video will only contain the specified
image. You should use this option if you do not want to create sequences from
multiple images and your filenames may contain special pattern characters.
.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 "\fBts_from_file\fR" 4
.IX Item "ts_from_file"
If set to 1, will set frame timestamp to modification time of image file. Note
that monotonity of timestamps is not provided: images go in the same order as
without this option. Default value is 0.
If set to 2, will set frame timestamp to the modification time of the image file in
nanosecond precision.
.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 \-framerate 10 \-i \*(Aqimg\-%03d.jpeg\*(Aq 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 \-framerate 10 \-start_number 100 \-i \*(Aqimg\-%03d.jpeg\*(Aq 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 \-framerate 10 \-pattern_type glob \-i "*.png" out.mkv
.Ve
.SS "libgme"
.IX Subsection "libgme"
The Game Music Emu library is a collection of video game music file emulators.
.PP
See <\fBhttp://code.google.com/p/game\-music\-emu/\fR> for more information.
.PP
Some files have multiple tracks. The demuxer will pick the first track by
default. The \fBtrack_index\fR option can be used to select a different
track. Track indexes start at 0. The demuxer exports the number of tracks as
\&\fItracks\fR meta data entry.
.PP
For very large files, the \fBmax_size\fR option may have to be adjusted.
.SS "libopenmpt"
.IX Subsection "libopenmpt"
libopenmpt based module demuxer
.PP
See <\fBhttps://lib.openmpt.org/libopenmpt/\fR> for more information.
.PP
Some files have multiple subsongs (tracks) this can be set with the \fBsubsong\fR
option.
.PP
It accepts the following options:
.IP "\fBsubsong\fR" 4
.IX Item "subsong"
Set the subsong index. This can be either  'all', 'auto', or the index of the
subsong. Subsong indexes start at 0. The default is 'auto'.
.Sp
The default value is to let libopenmpt choose.
.IP "\fBlayout\fR" 4
.IX Item "layout"
Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
The default value is \s-1STEREO.\s0
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Set the sample rate for libopenmpt to output.
Range is from 1000 to \s-1INT_MAX.\s0 The value default is 48000.
.SS "mov/mp4/3gp/QuickTime"
.IX Subsection "mov/mp4/3gp/QuickTime"
QuickTime / \s-1MP4\s0 demuxer.
.PP
This demuxer accepts the following options:
.IP "\fBenable_drefs\fR" 4
.IX Item "enable_drefs"
Enable loading of external tracks, disabled by default.
Enabling this can theoretically leak information in some use cases.
.IP "\fBuse_absolute_path\fR" 4
.IX Item "use_absolute_path"
Allows loading of external tracks via absolute paths, disabled by default.
Enabling this poses a security risk. It should only be enabled if the source
is known to be non malicious.
.SS "mpegts"
.IX Subsection "mpegts"
\&\s-1MPEG\-2\s0 transport stream demuxer.
.PP
This demuxer accepts the following options:
.IP "\fBresync_size\fR" 4
.IX Item "resync_size"
Set size limit for looking up a new synchronization. Default value is
65536.
.IP "\fBfix_teletext_pts\fR" 4
.IX Item "fix_teletext_pts"
Override teletext packet \s-1PTS\s0 and \s-1DTS\s0 values with the timestamps calculated
from the \s-1PCR\s0 of the first program which the teletext stream is part of and is
not discarded. Default value is 1, set this option to 0 if you want your
teletext packet \s-1PTS\s0 and \s-1DTS\s0 values untouched.
.IP "\fBts_packetsize\fR" 4
.IX Item "ts_packetsize"
Output option carrying the raw packet size in bytes.
Show the detected raw packet size, cannot be set by the user.
.IP "\fBscan_all_pmts\fR" 4
.IX Item "scan_all_pmts"
Scan and combine all PMTs. The value is an integer with value from \-1
to 1 (\-1 means automatic setting, 1 means enabled, 0 means
disabled). Default value is \-1.
.SS "mpjpeg"
.IX Subsection "mpjpeg"
\&\s-1MJPEG\s0 encapsulated in multi-part \s-1MIME\s0 demuxer.
.PP
This demuxer allows reading of \s-1MJPEG,\s0 where each frame is represented as a part of
multipart/x\-mixed\-replace stream.
.IP "\fBstrict_mime_boundary\fR" 4
.IX Item "strict_mime_boundary"
Default implementation applies a relaxed standard to multi-part \s-1MIME\s0 boundary detection,
to prevent regression with numerous existing endpoints not generating a proper \s-1MIME
MJPEG\s0 stream. Turning this option on by setting it to 1 will result in a stricter check
of the boundary value.
.SS "rawvideo"
.IX Subsection "rawvideo"
Raw video demuxer.
.PP
This demuxer allows one 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 "aiff"
.IX Subsection "aiff"
Audio Interchange File Format muxer.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
It accepts the following options:
.IP "\fBwrite_id3v2\fR" 4
.IX Item "write_id3v2"
Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
.IP "\fBid3v2_version\fR" 4
.IX Item "id3v2_version"
Select ID3v2 version to write. Currently only version 3 and 4 (aka.
ID3v2.3 and ID3v2.4) are supported. The default is version 4.
.SS "asf"
.IX Subsection "asf"
Advanced Systems Format muxer.
.PP
Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
muxer too.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
It accepts the following options:
.IP "\fBpacket_size\fR" 4
.IX Item "packet_size"
Set the muxer packet size. By tuning this setting you may reduce data
fragmentation or muxer overhead depending on your source. Default value is
3200, minimum is 100, maximum is 64k.
.SS "chromaprint"
.IX Subsection "chromaprint"
Chromaprint fingerprinter
.PP
This muxer feeds audio data to the Chromaprint library, which generates
a fingerprint for the provided audio data. It takes a single signed
native-endian 16\-bit raw audio stream.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBsilence_threshold\fR" 4
.IX Item "silence_threshold"
Threshold for detecting silence, ranges from 0 to 32767. \-1 for default
(required for use with the AcoustID service).
.IP "\fBalgorithm\fR" 4
.IX Item "algorithm"
Algorithm index to fingerprint with.
.IP "\fBfp_format\fR" 4
.IX Item "fp_format"
Format to output the fingerprint as. Accepts the following options:
.RS 4
.IP "\fBraw\fR" 4
.IX Item "raw"
Binary raw fingerprint
.IP "\fBcompressed\fR" 4
.IX Item "compressed"
Binary compressed fingerprint
.IP "\fBbase64\fR" 4
.IX Item "base64"
Base64 compressed fingerprint
.RE
.RS 4
.RE
.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
See also the \fBframecrc\fR muxer.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.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
.SS "flv"
.IX Subsection "flv"
Adobe Flash Video Format muxer.
.PP
This muxer accepts the following options:
.IP "\fBflvflags\fR \fIflags\fR" 4
.IX Item "flvflags flags"
Possible values:
.RS 4
.IP "\fBaac_seq_header_detect\fR" 4
.IX Item "aac_seq_header_detect"
Place \s-1AAC\s0 sequence header based on audio stream data.
.IP "\fBno_sequence_end\fR" 4
.IX Item "no_sequence_end"
Disable sequence end tag.
.RE
.RS 4
.RE
.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
\fIExamples\fR
.IX Subsection "Examples"
.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 \fBcrc\fR muxer.
.SS "framehash"
.IX Subsection "framehash"
Per-packet hash testing format.
.PP
This muxer computes and prints a cryptographic hash for each audio
and video packet. This can be used for packet-by-packet equality
checks without having to individually do a binary comparison on each.
.PP
By default audio frames are converted to signed 16\-bit raw audio and
video frames to raw video before computing the hash, but the output
of explicit conversions to other codecs can also be used. It uses the
\&\s-1SHA\-256\s0 cryptographic hash function by default, but supports several
other algorithms.
.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>, <hash>
.Ve
.PP
\&\fIhash\fR is a hexadecimal number representing the computed hash
for the packet.
.IP "\fBhash\fR \fIalgorithm\fR" 4
.IX Item "hash algorithm"
Use the cryptographic hash function specified by the string \fIalgorithm\fR.
Supported values include \f(CW\*(C`MD5\*(C'\fR, \f(CW\*(C`murmur3\*(C'\fR, \f(CW\*(C`RIPEMD128\*(C'\fR,
\&\f(CW\*(C`RIPEMD160\*(C'\fR, \f(CW\*(C`RIPEMD256\*(C'\fR, \f(CW\*(C`RIPEMD320\*(C'\fR, \f(CW\*(C`SHA160\*(C'\fR,
\&\f(CW\*(C`SHA224\*(C'\fR, \f(CW\*(C`SHA256\*(C'\fR (default), \f(CW\*(C`SHA512/224\*(C'\fR, \f(CW\*(C`SHA512/256\*(C'\fR,
\&\f(CW\*(C`SHA384\*(C'\fR, \f(CW\*(C`SHA512\*(C'\fR, \f(CW\*(C`CRC32\*(C'\fR and \f(CW\*(C`adler32\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
To compute the \s-1SHA\-256\s0 hash 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.sha256\fR:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f framehash out.sha256
.Ve
.PP
To print the information to stdout, using the \s-1MD5\s0 hash function, use
the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f framehash \-hash md5 \-
.Ve
.PP
See also the \fBhash\fR muxer.
.SS "framemd5"
.IX Subsection "framemd5"
Per-packet \s-1MD5\s0 testing format.
.PP
This is a variant of the \fBframehash\fR muxer. Unlike that muxer,
it defaults to using the \s-1MD5\s0 hash function.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
To compute the \s-1MD5\s0 hash 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 \fBframehash\fR and \fBmd5\fR muxers.
.SS "gif"
.IX Subsection "gif"
Animated \s-1GIF\s0 muxer.
.PP
It accepts the following options:
.IP "\fBloop\fR" 4
.IX Item "loop"
Set the number of times to loop the output. Use \f(CW\*(C`\-1\*(C'\fR for no loop, \f(CW0\fR
for looping indefinitely (default).
.IP "\fBfinal_delay\fR" 4
.IX Item "final_delay"
Force the delay (expressed in centiseconds) after the last frame. Each frame
ends with a delay until the next frame. The default is \f(CW\*(C`\-1\*(C'\fR, which is a
special value to tell the muxer to re-use the previous delay. In case of a
loop, you might want to customize this value to mark a pause for instance.
.PP
For example, to encode a gif looping 10 times, with a 5 seconds delay between
the loops:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-loop 10 \-final_delay 500 out.gif
.Ve
.PP
Note 1: if you wish to extract the frames into separate \s-1GIF\s0 files, you need to
force the \fBimage2\fR muxer:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-c:v gif \-f image2 "out%d.gif"
.Ve
.PP
Note 2: the \s-1GIF\s0 format has a very large time base: the delay between two frames
can therefore not be smaller than one centi second.
.SS "hash"
.IX Subsection "hash"
Hash testing format.
.PP
This muxer computes and prints a cryptographic hash of all the input
audio and video frames. This can be used for equality checks without
having to do a complete binary comparison.
.PP
By default audio frames are converted to signed 16\-bit raw audio and
video frames to raw video before computing the hash, but the output
of explicit conversions to other codecs can also be used. Timestamps
are ignored. It uses the \s-1SHA\-256\s0 cryptographic hash function by default,
but supports several other algorithms.
.PP
The output of the muxer consists of a single line of the form:
\&\fIalgo\fR=\fIhash\fR, where \fIalgo\fR is a short string representing
the hash function used, and \fIhash\fR is a hexadecimal number
representing the computed hash.
.IP "\fBhash\fR \fIalgorithm\fR" 4
.IX Item "hash algorithm"
Use the cryptographic hash function specified by the string \fIalgorithm\fR.
Supported values include \f(CW\*(C`MD5\*(C'\fR, \f(CW\*(C`murmur3\*(C'\fR, \f(CW\*(C`RIPEMD128\*(C'\fR,
\&\f(CW\*(C`RIPEMD160\*(C'\fR, \f(CW\*(C`RIPEMD256\*(C'\fR, \f(CW\*(C`RIPEMD320\*(C'\fR, \f(CW\*(C`SHA160\*(C'\fR,
\&\f(CW\*(C`SHA224\*(C'\fR, \f(CW\*(C`SHA256\*(C'\fR (default), \f(CW\*(C`SHA512/224\*(C'\fR, \f(CW\*(C`SHA512/256\*(C'\fR,
\&\f(CW\*(C`SHA384\*(C'\fR, \f(CW\*(C`SHA512\*(C'\fR, \f(CW\*(C`CRC32\*(C'\fR and \f(CW\*(C`adler32\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
To compute the \s-1SHA\-256\s0 hash of the input converted to raw audio and
video, and store it in the file \fIout.sha256\fR:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f hash out.sha256
.Ve
.PP
To print an \s-1MD5\s0 hash to stdout use the command:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f hash \-hash md5 \-
.Ve
.PP
See also the \fBframehash\fR 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 (\s-1HLS\s0) specification.
.PP
It creates a playlist file, and one or more segment files. The output filename
specifies the playlist filename.
.PP
By default, the muxer creates a file for each segment produced. These files
have the same name as the playlist, followed by a sequential number and a
\&.ts extension.
.PP
For example, to convert an input file with \fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-i in.nut out.m3u8
.Ve
.PP
This example will produce the playlist, \fIout.m3u8\fR, and segment files:
\&\fIout0.ts\fR, \fIout1.ts\fR, \fIout2.ts\fR, etc.
.PP
See also the \fBsegment\fR muxer, which provides a more generic and
flexible implementation of a segmenter, and can be used to perform \s-1HLS\s0
segmentation.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
This muxer supports the following options:
.IP "\fBhls_init_time\fR \fIseconds\fR" 4
.IX Item "hls_init_time seconds"
Set the initial target segment length in seconds. Default value is \fI0\fR.
Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
After the initial playlist is filled \fBffmpeg\fR will cut segments
at duration equal to \f(CW\*(C`hls_time\*(C'\fR
.IP "\fBhls_time\fR \fIseconds\fR" 4
.IX Item "hls_time seconds"
Set the target segment length in seconds. Default value is 2.
Segment will be cut on the next key frame after this time has passed.
.IP "\fBhls_list_size\fR \fIsize\fR" 4
.IX Item "hls_list_size size"
Set the maximum number of playlist entries. If set to 0 the list file
will contain all the segments. Default value is 5.
.IP "\fBhls_ts_options\fR \fIoptions_list\fR" 4
.IX Item "hls_ts_options options_list"
Set output format options using a :\-separated list of key=value
parameters. Values containing \f(CW\*(C`:\*(C'\fR special characters must be
escaped.
.IP "\fBhls_wrap\fR \fIwrap\fR" 4
.IX Item "hls_wrap wrap"
Set the number after which the segment filename number (the number
specified in each segment file) wraps. If set to 0 the number will be
never wrapped. Default value is 0.
.Sp
This option is useful to avoid to fill the disk with many segment
files, and limits the maximum number of segment files written to disk
to \fIwrap\fR.
.IP "\fBstart_number\fR \fInumber\fR" 4
.IX Item "start_number number"
Start the playlist sequence number from \fInumber\fR. Default value is
0.
.IP "\fBhls_allow_cache\fR \fIallowcache\fR" 4
.IX Item "hls_allow_cache allowcache"
Explicitly set whether the client \s-1MAY \\fIs0\fR\|(1) or \s-1MUST NOT \\fIs0\fR\|(0) cache media segments.
.IP "\fBhls_base_url\fR \fIbaseurl\fR" 4
.IX Item "hls_base_url baseurl"
Append \fIbaseurl\fR to every entry in the playlist.
Useful to generate playlists with absolute paths.
.Sp
Note that the playlist sequence number must be unique for each segment
and it is not to be confused with the segment filename sequence number
which can be cyclic, for example if the \fBwrap\fR option is
specified.
.IP "\fBhls_segment_filename\fR \fIfilename\fR" 4
.IX Item "hls_segment_filename filename"
Set the segment filename. Unless \f(CW\*(C`hls_flags single_file\*(C'\fR is set,
\&\fIfilename\fR is used as a string format with the segment number:
.Sp
.Vb 1
\&        ffmpeg \-i in.nut \-hls_segment_filename \*(Aqfile%03d.ts\*(Aq out.m3u8
.Ve
.Sp
This example will produce the playlist, \fIout.m3u8\fR, and segment files:
\&\fIfile000.ts\fR, \fIfile001.ts\fR, \fIfile002.ts\fR, etc.
.IP "\fBuse_localtime\fR" 4
.IX Item "use_localtime"
Use strftime on \fIfilename\fR to expand the segment filename with localtime.
The segment number (%d) is not available in this mode.
.Sp
.Vb 1
\&        ffmpeg \-i in.nut \-use_localtime 1 \-hls_segment_filename \*(Aqfile\-%Y%m%d\-%s.ts\*(Aq out.m3u8
.Ve
.Sp
This example will produce the playlist, \fIout.m3u8\fR, and segment files:
\&\fIfile\-20160215\-1455569023.ts\fR, \fIfile\-20160215\-1455569024.ts\fR, etc.
.IP "\fBuse_localtime_mkdir\fR" 4
.IX Item "use_localtime_mkdir"
Used together with \-use_localtime, it will create up to one subdirectory which
is expanded in \fIfilename\fR.
.Sp
.Vb 1
\&        ffmpeg \-i in.nut \-use_localtime 1 \-use_localtime_mkdir 1 \-hls_segment_filename \*(Aq%Y%m%d/file\-%Y%m%d\-%s.ts\*(Aq out.m3u8
.Ve
.Sp
This example will create a directory 201560215 (if it does not exist), and then
produce the playlist, \fIout.m3u8\fR, and segment files:
\&\fI201560215/file\-20160215\-1455569023.ts\fR, \fI201560215/file\-20160215\-1455569024.ts\fR, etc.
.IP "\fBhls_key_info_file\fR \fIkey_info_file\fR" 4
.IX Item "hls_key_info_file key_info_file"
Use the information in \fIkey_info_file\fR for segment encryption. The first
line of \fIkey_info_file\fR specifies the key \s-1URI\s0 written to the playlist. The
key \s-1URL\s0 is used to access the encryption key during playback. The second line
specifies the path to the key file used to obtain the key during the encryption
process. The key file is read as a single packed array of 16 octets in binary
format. The optional third line specifies the initialization vector (\s-1IV\s0) as a
hexadecimal string to be used instead of the segment sequence number (default)
for encryption. Changes to \fIkey_info_file\fR will result in segment
encryption with the new key/IV and an entry in the playlist for the new key
\&\s-1URI/IV.\s0
.Sp
Key info file format:
.Sp
.Vb 3
\&        <key URI>
\&        <key file path>
\&        <IV> (optional)
.Ve
.Sp
Example key URIs:
.Sp
.Vb 3
\&        http://server/file.key
\&        /path/to/file.key
\&        file.key
.Ve
.Sp
Example key file paths:
.Sp
.Vb 2
\&        file.key
\&        /path/to/file.key
.Ve
.Sp
Example \s-1IV:\s0
.Sp
.Vb 1
\&        0123456789ABCDEF0123456789ABCDEF
.Ve
.Sp
Key info file example:
.Sp
.Vb 3
\&        http://server/file.key
\&        /path/to/file.key
\&        0123456789ABCDEF0123456789ABCDEF
.Ve
.Sp
Example shell script:
.Sp
.Vb 8
\&        #!/bin/sh
\&        BASE_URL=${1:\-\*(Aq.\*(Aq}
\&        openssl rand 16 > file.key
\&        echo $BASE_URL/file.key > file.keyinfo
\&        echo file.key >> file.keyinfo
\&        echo $(openssl rand \-hex 16) >> file.keyinfo
\&        ffmpeg \-f lavfi \-re \-i testsrc \-c:v h264 \-hls_flags delete_segments \e
\&          \-hls_key_info_file file.keyinfo out.m3u8
.Ve
.IP "\fBhls_flags single_file\fR" 4
.IX Item "hls_flags single_file"
If this flag is set, the muxer will store all segments in a single MPEG-TS
file, and will use byte ranges in the playlist. \s-1HLS\s0 playlists generated with
this way will have the version number 4.
For example:
.Sp
.Vb 1
\&        ffmpeg \-i in.nut \-hls_flags single_file out.m3u8
.Ve
.Sp
Will produce the playlist, \fIout.m3u8\fR, and a single segment file,
\&\fIout.ts\fR.
.IP "\fBhls_flags delete_segments\fR" 4
.IX Item "hls_flags delete_segments"
Segment files removed from the playlist are deleted after a period of time
equal to the duration of the segment plus the duration of the playlist.
.IP "\fBhls_flags append_list\fR" 4
.IX Item "hls_flags append_list"
Append new segments into the end of old segment list,
and remove the \f(CW\*(C`#EXT\-X\-ENDLIST\*(C'\fR from the old segment list.
.IP "\fBhls_flags round_durations\fR" 4
.IX Item "hls_flags round_durations"
Round the duration info in the playlist file segment info to integer
values, instead of using floating point.
.IP "\fBhls_flags discont_starts\fR" 4
.IX Item "hls_flags discont_starts"
Add the \f(CW\*(C`#EXT\-X\-DISCONTINUITY\*(C'\fR tag to the playlist, before the
first segment's information.
.IP "\fBhls_flags omit_endlist\fR" 4
.IX Item "hls_flags omit_endlist"
Do not append the \f(CW\*(C`EXT\-X\-ENDLIST\*(C'\fR tag at the end of the playlist.
.IP "\fBhls_flags split_by_time\fR" 4
.IX Item "hls_flags split_by_time"
Allow segments to start on frames other than keyframes. This improves
behavior on some players when the time between keyframes is inconsistent,
but may make things worse on others, and can cause some oddities during
seeking. This flag should be used with the \f(CW\*(C`hls_time\*(C'\fR option.
.IP "\fBhls_flags program_date_time\fR" 4
.IX Item "hls_flags program_date_time"
Generate \f(CW\*(C`EXT\-X\-PROGRAM\-DATE\-TIME\*(C'\fR tags.
.IP "\fBhls_playlist_type event\fR" 4
.IX Item "hls_playlist_type event"
Emit \f(CW\*(C`#EXT\-X\-PLAYLIST\-TYPE:EVENT\*(C'\fR in the m3u8 header. Forces
\&\fBhls_list_size\fR to 0; the playlist can only be appended to.
.IP "\fBhls_playlist_type vod\fR" 4
.IX Item "hls_playlist_type vod"
Emit \f(CW\*(C`#EXT\-X\-PLAYLIST\-TYPE:VOD\*(C'\fR in the m3u8 header. Forces
\&\fBhls_list_size\fR to 0; the playlist must not change.
.IP "\fBmethod\fR" 4
.IX Item "method"
Use the given \s-1HTTP\s0 method to create the hls files.
.Sp
.Vb 1
\&        ffmpeg \-re \-i in.ts \-f hls \-method PUT http://example.com/live/out.m3u8
.Ve
.Sp
This example will upload all the mpegts segment files to the \s-1HTTP\s0
server using the \s-1HTTP PUT\s0 method, and update the m3u8 files every
\&\f(CW\*(C`refresh\*(C'\fR times using the same method.
Note that the \s-1HTTP\s0 server must support the given method for uploading
files.
.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 DIB\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
\fIExamples\fR
.IX Subsection "Examples"
.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
.PP
The \fBstrftime\fR option allows you to expand the filename with
date and time information. Check the documentation of
the \f(CW\*(C`strftime()\*(C'\fR function for the syntax.
.PP
For example to generate image files from the \f(CW\*(C`strftime()\*(C'\fR
\&\*(L"%Y\-%m\-%d_%H\-%M\-%S\*(R" pattern, the following \fBffmpeg\fR command
can be used:
.PP
.Vb 1
\&        ffmpeg \-f v4l2 \-r 1 \-i /dev/video0 \-f image2 \-strftime 1 "%Y\-%m\-%d_%H\-%M\-%S.jpg"
.Ve
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBstart_number\fR" 4
.IX Item "start_number"
Start the sequence from the specified number. Default value is 0.
.IP "\fBupdate\fR" 4
.IX Item "update"
If set to 1, the filename will always be interpreted as just a
filename, not a pattern, and the corresponding file will be continuously
overwritten with new images. Default value is 0.
.IP "\fBstrftime\fR" 4
.IX Item "strftime"
If set to 1, expand the filename with date and time information from
\&\f(CW\*(C`strftime()\*(C'\fR. Default value is 0.
.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 "matroska"
.IX Subsection "matroska"
Matroska container muxer.
.PP
This muxer implements the matroska and webm container specs.
.PP
\fIMetadata\fR
.IX Subsection "Metadata"
.PP
The recognized metadata settings in this muxer are:
.IP "\fBtitle\fR" 4
.IX Item "title"
Set title name provided to a single track.
.IP "\fBlanguage\fR" 4
.IX Item "language"
Specify the language of the track in the Matroska languages form.
.Sp
The language can be either the 3 letters bibliographic \s-1ISO\-639\-2 \s0(\s-1ISO
639\-2/B\s0) form (like \*(L"fre\*(R" for French), or a language code mixed with a
country code for specialities in languages (like \*(L"fre-ca\*(R" for Canadian
French).
.IP "\fBstereo_mode\fR" 4
.IX Item "stereo_mode"
Set stereo 3D video layout of two views in a single video track.
.Sp
The following values are recognized:
.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
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
This muxer supports the following options:
.IP "\fBreserve_index_space\fR" 4
.IX Item "reserve_index_space"
By default, this muxer writes the index for seeking (called cues in Matroska
terms) at the end of the file, because it cannot know in advance how much space
to leave for the index at the beginning of the file. However for some use cases
\&\*(-- e.g.  streaming where seeking is possible but slow \*(-- it is useful to put the
index at the beginning of the file.
.Sp
If this option is set to a non-zero value, the muxer will reserve a given amount
of space in the file header and then try to write the cues there when the muxing
finishes. If the available space does not suffice, muxing will fail. A safe size
for most use cases should be about 50kB per hour of video.
.Sp
Note that cues are only written if the output is seekable and this option will
have no effect if it is not.
.SS "md5"
.IX Subsection "md5"
\&\s-1MD5\s0 testing format.
.PP
This is a variant of the \fBhash\fR muxer. Unlike that muxer, it
defaults to using the \s-1MD5\s0 hash function.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
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 \fBhash\fR and \fBframemd5\fR muxers.
.SS "mov, mp4, ismv"
.IX Subsection "mov, mp4, ismv"
\&\s-1MOV/MP4/ISMV \s0(Smooth Streaming) muxer.
.PP
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
\fIOptions\fR
.IX Subsection "Options"
.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
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 index (moov atom) to the beginning 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.
.IP "\fB\-movflags disable_chpl\fR" 4
.IX Item "-movflags disable_chpl"
Disable Nero chapter markers (chpl atom).  Normally, both Nero chapters
and a QuickTime chapter track are written to the file. With this option
set, only the QuickTime chapter track will be written. Nero chapters can
cause failures when the file is reprocessed with certain tagging programs, like
mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
.IP "\fB\-movflags omit_tfhd_offset\fR" 4
.IX Item "-movflags omit_tfhd_offset"
Do not write any absolute base_data_offset in tfhd atoms. This avoids
tying fragments to absolute byte positions in the file/streams.
.IP "\fB\-movflags default_base_moof\fR" 4
.IX Item "-movflags default_base_moof"
Similarly to the omit_tfhd_offset, this flag avoids writing the
absolute base_data_offset field in tfhd atoms, but does so by using
the new default-base-is-moof flag instead. This flag is new from
14496\-12:2012. This may make the fragments easier to parse in certain
circumstances (avoiding basing track fragment location calculations
on the implicit end of the previous track fragment).
.IP "\fB\-write_tmcd\fR" 4
.IX Item "-write_tmcd"
Specify \f(CW\*(C`on\*(C'\fR to force writing a timecode track, \f(CW\*(C`off\*(C'\fR to disable it
and \f(CW\*(C`auto\*(C'\fR to write a timecode track only for mov and mp4 output (default).
.PP
\fIExample\fR
.IX Subsection "Example"
.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
.PP
\fIAudible \s-1AAX\s0\fR
.IX Subsection "Audible AAX"
.PP
Audible \s-1AAX\s0 files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
.PP
.Vb 1
\&        ffmpeg \-activation_bytes 1CEB00DA \-i test.aax \-vn \-c:a copy output.mp4
.Ve
.SS "mp3"
.IX Subsection "mp3"
The \s-1MP3\s0 muxer writes a raw \s-1MP3\s0 stream with the following optional features:
.IP "\(bu" 4
An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
2.4 are supported, the \f(CW\*(C`id3v2_version\*(C'\fR private option controls which one is
used (3 or 4). Setting \f(CW\*(C`id3v2_version\*(C'\fR to 0 disables the ID3v2 header
completely.
.Sp
The muxer supports writing attached pictures (\s-1APIC\s0 frames) to the ID3v2 header.
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.
.Sp
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.
.IP "\(bu" 4
A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
default, but will be written only if the output is seekable. The
\&\f(CW\*(C`write_xing\*(C'\fR private option can be used to disable it.  The frame contains
various information that may be useful to the decoder, like the audio duration
or encoder delay.
.IP "\(bu" 4
A legacy ID3v1 tag at the end of the file (disabled by default). It may be
enabled with the \f(CW\*(C`write_id3v1\*(C'\fR private option, but as its capabilities are
very limited, its usage is not recommended.
.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
.PP
Write a \*(L"clean\*(R" \s-1MP3\s0 without any extra features:
.PP
.Vb 1
\&        ffmpeg \-i input.wav \-write_xing 0 \-id3v2_version 0 out.mp3
.Ve
.SS "mpegts"
.IX Subsection "mpegts"
\&\s-1MPEG\s0 transport stream muxer.
.PP
This muxer implements \s-1ISO 13818\-1\s0 and part of \s-1ETSI EN 300 468.\s0
.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
\fIOptions\fR
.IX Subsection "Options"
.PP
The muxer options are:
.IP "\fBmpegts_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 "\fBmpegts_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 "\fBmpegts_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 "\fBmpegts_service_type\fR \fInumber\fR" 4
.IX Item "mpegts_service_type number"
Set the program service_type (default \fIdigital_tv\fR), see below
a list of pre defined values.
.IP "\fBmpegts_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 "\fBmpegts_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).
.IP "\fBmpegts_m2ts_mode\fR \fInumber\fR" 4
.IX Item "mpegts_m2ts_mode number"
Enable m2ts mode if set to 1. Default value is \-1 which disables m2ts mode.
.IP "\fBmuxrate\fR \fInumber\fR" 4
.IX Item "muxrate number"
Set a constant muxrate (default \s-1VBR\s0).
.IP "\fBpcr_period\fR \fInumer\fR" 4
.IX Item "pcr_period numer"
Override the default \s-1PCR\s0 retransmission time (default 20ms), ignored
if variable muxrate is selected.
.IP "\fBpat_period\fR \fInumber\fR" 4
.IX Item "pat_period number"
Maximal time in seconds between \s-1PAT/PMT\s0 tables.
.IP "\fBsdt_period\fR \fInumber\fR" 4
.IX Item "sdt_period number"
Maximal time in seconds between \s-1SDT\s0 tables.
.IP "\fBpes_payload_size\fR \fInumber\fR" 4
.IX Item "pes_payload_size number"
Set minimum \s-1PES\s0 packet payload in bytes.
.IP "\fBmpegts_flags\fR \fIflags\fR" 4
.IX Item "mpegts_flags flags"
Set flags (see below).
.IP "\fBmpegts_copyts\fR \fInumber\fR" 4
.IX Item "mpegts_copyts number"
Preserve original timestamps, if value is set to 1. Default value is \-1, which
results in shifting timestamps so that they start from 0.
.IP "\fBtables_version\fR \fInumber\fR" 4
.IX Item "tables_version number"
Set \s-1PAT, PMT\s0 and \s-1SDT\s0 version (default 0, valid values are from 0 to 31, inclusively).
This option allows updating stream structure so that standard consumer may
detect the change. To do so, reopen output AVFormatContext (in case of \s-1API\s0
usage) or restart ffmpeg instance, cyclically changing tables_version value:
.Sp
.Vb 7
\&        ffmpeg \-i source1.ts \-codec copy \-f mpegts \-tables_version 0 udp://1.1.1.1:1111
\&        ffmpeg \-i source2.ts \-codec copy \-f mpegts \-tables_version 1 udp://1.1.1.1:1111
\&        ...
\&        ffmpeg \-i source3.ts \-codec copy \-f mpegts \-tables_version 31 udp://1.1.1.1:1111
\&        ffmpeg \-i source1.ts \-codec copy \-f mpegts \-tables_version 0 udp://1.1.1.1:1111
\&        ffmpeg \-i source2.ts \-codec copy \-f mpegts \-tables_version 1 udp://1.1.1.1:1111
\&        ...
.Ve
.PP
Option \fBmpegts_service_type\fR accepts the following values:
.IP "\fBhex_value\fR" 4
.IX Item "hex_value"
Any hexdecimal value between 0x01 to 0xff as defined in \s-1ETSI 300 468.\s0
.IP "\fBdigital_tv\fR" 4
.IX Item "digital_tv"
Digital \s-1TV\s0 service.
.IP "\fBdigital_radio\fR" 4
.IX Item "digital_radio"
Digital Radio service.
.IP "\fBteletext\fR" 4
.IX Item "teletext"
Teletext service.
.IP "\fBadvanced_codec_digital_radio\fR" 4
.IX Item "advanced_codec_digital_radio"
Advanced Codec Digital Radio service.
.IP "\fBmpeg2_digital_hdtv\fR" 4
.IX Item "mpeg2_digital_hdtv"
\&\s-1MPEG2\s0 Digital \s-1HDTV\s0 service.
.IP "\fBadvanced_codec_digital_sdtv\fR" 4
.IX Item "advanced_codec_digital_sdtv"
Advanced Codec Digital \s-1SDTV\s0 service.
.IP "\fBadvanced_codec_digital_hdtv\fR" 4
.IX Item "advanced_codec_digital_hdtv"
Advanced Codec Digital \s-1HDTV\s0 service.
.PP
Option \fBmpegts_flags\fR may take a set of such flags:
.IP "\fBresend_headers\fR" 4
.IX Item "resend_headers"
Reemit \s-1PAT/PMT\s0 before writing the next packet.
.IP "\fBlatm\fR" 4
.IX Item "latm"
Use \s-1LATM\s0 packetization for \s-1AAC.\s0
.IP "\fBpat_pmt_at_frames\fR" 4
.IX Item "pat_pmt_at_frames"
Reemit \s-1PAT\s0 and \s-1PMT\s0 at each video frame.
.IP "\fBsystem_b\fR" 4
.IX Item "system_b"
Conform to System B (\s-1DVB\s0) instead of System A (\s-1ATSC\s0).
.PP
\fIExample\fR
.IX Subsection "Example"
.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 "mxf, mxf_d10"
.IX Subsection "mxf, mxf_d10"
\&\s-1MXF\s0 muxer.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The muxer options are:
.IP "\fBstore_user_comments\fR \fIbool\fR" 4
.IX Item "store_user_comments bool"
Set if user comments should be stored if available or never.
\&\s-1IRT D\-10\s0 does not allow user comments. The default is thus to write them for
mxf but not for mxf_d10
.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 "nut"
.IX Subsection "nut"
.IP "\fB\-syncpoints\fR \fIflags\fR" 4
.IX Item "-syncpoints flags"
Change the syncpoint usage in nut:
.RS 4
.IP "\fIdefault\fR \fBuse the normal low-overhead seeking aids.\fR" 4
.IX Item "default use the normal low-overhead seeking aids."
.PD 0
.IP "\fInone\fR \fBdo not use the syncpoints at all, reducing the overhead but making the stream non-seekable;\fR" 4
.IX Item "none do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;"
.PD
.Vb 5
\&    Use of this option is not recommended, as the resulting files are very damage
\&    sensitive and seeking is not possible. Also in general the overhead from
\&    syncpoints is negligible. Note, \-C<write_index> 0 can be used to disable
\&    all growing data tables, allowing to mux endless streams with limited memory
\&    and without these disadvantages.
.Ve
.IP "\fItimestamped\fR \fBextend the syncpoint with a wallclock field.\fR" 4
.IX Item "timestamped extend the syncpoint with a wallclock field."
.RE
.RS 4
.Sp
The \fInone\fR and \fItimestamped\fR flags are experimental.
.RE
.IP "\fB\-write_index\fR \fIbool\fR" 4
.IX Item "-write_index bool"
Write index at the end, the default is to write an index.
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f_strict experimental \-syncpoints none \- | processor
.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.
.IP "\fB\-serial_offset\fR \fIvalue\fR" 4
.IX Item "-serial_offset value"
Serial value from which to set the streams serial number.
Setting it to different and sufficiently large values ensures that the produced
ogg files can be safely chained.
.SS "segment, stream_segment, ssegment"
.IX Subsection "segment, stream_segment, ssegment"
Basic stream segmenter.
.PP
This muxer outputs streams to a number of separate files of nearly
fixed duration. Output filename pattern can be set in a fashion
similar to \fBimage2\fR, or by using a \f(CW\*(C`strftime\*(C'\fR template if
the \fBstrftime\fR option is enabled.
.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. The entry filenames in the segment
list are set by default to the basename of the corresponding segment
files.
.PP
See also the \fBhls\fR muxer, which provides a more specific
implementation for \s-1HLS\s0 segmentation.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The segment muxer supports the following options:
.IP "\fBincrement_tc\fR \fI1|0\fR" 4
.IX Item "increment_tc 1|0"
if set to \f(CW1\fR, increment timecode between each segment
If this is selected, the input need to have
a timecode in the first video stream. Default value is
\&\f(CW0\fR.
.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 chosen
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 \f(CW\*(C`auto\*(C'\fR.
.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_format_options\fR \fIoptions_list\fR" 4
.IX Item "segment_format_options options_list"
Set output format options using a :\-separated list of key=value
parameters. Values containing the \f(CW\*(C`:\*(C'\fR special character must be
escaped.
.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 "\fBcache\fR" 4
.IX Item "cache"
Allow caching (only affects M3U8 list files).
.IP "\fBlive\fR" 4
.IX Item "live"
Allow live-friendly file generation.
.RE
.RS 4
.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 \fIsize\fR
segments. If 0 the list file will contain all the segments. Default
value is 0.
.IP "\fBsegment_list_entry_prefix\fR \fIprefix\fR" 4
.IX Item "segment_list_entry_prefix prefix"
Prepend \fIprefix\fR to each entry. Useful to generate absolute paths.
By default no prefix is applied.
.IP "\fBsegment_list_type\fR \fItype\fR" 4
.IX Item "segment_list_type type"
Select the listing format.
.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
\&\fBext\fR is deprecated in favor or \fBcsv\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 \fBconcat\fR 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_atclocktime\fR \fI1|0\fR" 4
.IX Item "segment_atclocktime 1|0"
If set to \*(L"1\*(R" split at regular clock time intervals starting from 00:00
o'clock. The \fItime\fR value specified in \fBsegment_time\fR is
used for setting the length of the splitting interval.
.Sp
For example with \fBsegment_time\fR set to \*(L"900\*(R" this makes it possible
to create files at 12:00 o'clock, 12:15, 12:30, etc.
.Sp
Default value is \*(L"0\*(R".
.IP "\fBsegment_clocktime_offset\fR \fIduration\fR" 4
.IX Item "segment_clocktime_offset duration"
Delay the segment splitting times with the specified duration when using
\&\fBsegment_atclocktime\fR.
.Sp
For example with \fBsegment_time\fR set to \*(L"900\*(R" and
\&\fBsegment_clocktime_offset\fR set to \*(L"300\*(R" this makes it possible to
create files at 12:05, 12:20, 12:35, etc.
.Sp
Default value is \*(L"0\*(R".
.IP "\fBsegment_clocktime_wrap_duration\fR \fIduration\fR" 4
.IX Item "segment_clocktime_wrap_duration duration"
Force the segmenter to only start a new segment if a packet reaches the muxer
within the specified duration after the segmenting clock time. This way you
can make the segmenter more resilient to backward local time jumps, such as
leap seconds or transition to standard time from daylight savings time.
.Sp
Assuming that the delay between the packets of your source is less than 0.5
second you can detect a leap second by specifying 0.5 as the duration.
.Sp
Default is the maximum possible duration which means starting a new segment
regardless of the elapsed time since the last clock time.
.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 "\fBstrftime\fR \fI1|0\fR" 4
.IX Item "strftime 1|0"
Use the \f(CW\*(C`strftime\*(C'\fR function to define the name of the new
segments to write. If this is selected, the output segment name must
contain a \f(CW\*(C`strftime\*(C'\fR function template. Default value is
\&\f(CW0\fR.
.IP "\fBbreak_non_keyframes\fR \fI1|0\fR" 4
.IX Item "break_non_keyframes 1|0"
If enabled, allow segments to start on frames other than keyframes. This
improves behavior on some players when the time between keyframes is
inconsistent, but may make things worse on others, and can cause some oddities
during seeking. 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.
.IP "\fBinitial_offset\fR \fIoffset\fR" 4
.IX Item "initial_offset offset"
Specify timestamp offset to apply to the output packet timestamps. The
argument must be a time duration specification, and defaults to 0.
.IP "\fBwrite_empty_segments\fR \fI1|0\fR" 4
.IX Item "write_empty_segments 1|0"
If enabled, write an empty segment if there are no packets during the period a
segment would usually span. Otherwise, the segment will be filled with the next
packet written. Defaults to \f(CW0\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
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
Segment input and set output format options for the output segments:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-f segment \-segment_time 10 \-segment_format_options movflags=+faststart out%03d.mp4
.Ve
.IP "\(bu" 4
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
Use the \fBffmpeg\fR \fBforce_key_frames\fR
option to force key frames in the input at the specified location, together
with the segment option \fBsegment_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 \fBsegment_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
Convert the \fIin.mkv\fR to \s-1TS\s0 segments using the \f(CW\*(C`libx264\*(C'\fR
and \f(CW\*(C`aac\*(C'\fR encoders:
.Sp
.Vb 1
\&        ffmpeg \-i in.mkv \-map 0 \-codec:v libx264 \-codec:a aac \-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 "smoothstreaming"
.IX Subsection "smoothstreaming"
Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
.IP "\fBwindow_size\fR" 4
.IX Item "window_size"
Specify the number of fragments kept in the manifest. Default 0 (keep all).
.IP "\fBextra_window_size\fR" 4
.IX Item "extra_window_size"
Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
.IP "\fBlookahead_count\fR" 4
.IX Item "lookahead_count"
Specify the number of lookahead fragments. Default 2.
.IP "\fBmin_frag_duration\fR" 4
.IX Item "min_frag_duration"
Specify the minimum fragment duration (in microseconds). Default 5000000.
.IP "\fBremove_at_exit\fR" 4
.IX Item "remove_at_exit"
Specify whether to remove all fragments when finished. Default 0 (do not remove).
.SS "fifo"
.IX Subsection "fifo"
The fifo pseudo-muxer allows the separation of encoding and muxing by using
first-in-first-out queue and running the actual muxer in a separate thread. This
is especially useful in combination with the \fBtee\fR muxer and can be used to
send data to several destinations with different reliability/writing speed/latency.
.PP
\&\s-1API\s0 users should be aware that callback functions (interrupt_callback,
io_open and io_close) used within its AVFormatContext must be thread-safe.
.PP
The behavior of the fifo muxer if the queue fills up or if the output fails is
selectable,
.IP "\(bu" 4
output can be transparently restarted with configurable delay between retries
based on real time or time of the processed stream.
.IP "\(bu" 4
encoding can be blocked during temporary failure, or continue transparently
dropping packets in case fifo queue fills up.
.IP "\fBfifo_format\fR" 4
.IX Item "fifo_format"
Specify the format name. Useful if it cannot be guessed from the
output name suffix.
.IP "\fBqueue_size\fR" 4
.IX Item "queue_size"
Specify size of the queue (number of packets). Default value is 60.
.IP "\fBformat_opts\fR" 4
.IX Item "format_opts"
Specify format options for the underlying muxer. Muxer options can be specified
as a list of \fIkey\fR=\fIvalue\fR pairs separated by ':'.
.IP "\fBdrop_pkts_on_overflow\fR \fIbool\fR" 4
.IX Item "drop_pkts_on_overflow bool"
If set to 1 (true), in case the fifo queue fills up, packets will be dropped
rather than blocking the encoder. This makes it possible to continue streaming without
delaying the input, at the cost of omitting part of the stream. By default
this option is set to 0 (false), so in such cases the encoder will be blocked
until the muxer processes some of the packets and none of them is lost.
.IP "\fBattempt_recovery\fR \fIbool\fR" 4
.IX Item "attempt_recovery bool"
If failure occurs, attempt to recover the output. This is especially useful
when used with network output, since it makes it possible to restart streaming transparently.
By default this option is set to 0 (false).
.IP "\fBmax_recovery_attempts\fR" 4
.IX Item "max_recovery_attempts"
Sets maximum number of successive unsuccessful recovery attempts after which
the output fails permanently. By default this option is set to 0 (unlimited).
.IP "\fBrecovery_wait_time\fR \fIduration\fR" 4
.IX Item "recovery_wait_time duration"
Waiting time before the next recovery attempt after previous unsuccessful
recovery attempt. Default value is 5 seconds.
.IP "\fBrecovery_wait_streamtime\fR \fIbool\fR" 4
.IX Item "recovery_wait_streamtime bool"
If set to 0 (false), the real time is used when waiting for the recovery
attempt (i.e. the recovery will be attempted after at least
recovery_wait_time seconds).
If set to 1 (true), the time of the processed stream is taken into account
instead (i.e. the recovery will be attempted after at least \fIrecovery_wait_time\fR
seconds of the stream is omitted).
By default, this option is set to 0 (false).
.IP "\fBrecover_any_error\fR \fIbool\fR" 4
.IX Item "recover_any_error bool"
If set to 1 (true), recovery will be attempted regardless of type of the error
causing the failure. By default this option is set to 0 (false) and in case of
certain (usually permanent) errors the recovery is not attempted even when
\&\fIattempt_recovery\fR is set to 1.
.IP "\fBrestart_with_keyframe\fR \fIbool\fR" 4
.IX Item "restart_with_keyframe bool"
Specify whether to wait for the keyframe after recovering from
queue overflow or failure. This option is set to 0 (false) by default.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Stream something to rtmp server, continue processing the stream at real-time
rate even in case of temporary failure (network outage) and attempt to recover
streaming every second indefinitely.
.Sp
.Vb 2
\&        ffmpeg \-re \-i ... \-c:v libx264 \-c:a aac \-f fifo \-fifo_format flv \-map 0:v \-map 0:a
\&          \-drop_pkts_on_overflow 1 \-attempt_recovery 1 \-recovery_wait_time 1 rtmp://example.com/live/stream_name
.Ve
.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 \fBthe \*(L"Quoting and escaping\*(R"
section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR).
.PP
Muxer 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
The following special options are also recognized:
.IP "\fBf\fR" 4
.IX Item "f"
Specify the format name. Useful if it cannot be guessed from the
output name suffix.
.IP "\fBbsfs[/\fR\fIspec\fR\fB]\fR" 4
.IX Item "bsfs[/spec]"
Specify a list of bitstream filters to apply to the specified
output.
.Sp
It is possible to specify to which streams a given bitstream filter
applies, by appending a stream specifier to the option separated by
\&\f(CW\*(C`/\*(C'\fR. \fIspec\fR must be a stream specifier (see \fBFormat
stream specifiers\fR).  If the stream specifier is not specified, the
bitstream filters will be applied to all streams in the output.
.Sp
Several bitstream filters can be specified, separated by \*(L",\*(R".
.IP "\fBselect\fR" 4
.IX Item "select"
Select the streams that should be mapped to the slave output,
specified by a stream specifier. If not specified, this defaults to
all the input streams. You may use multiple stream specifiers
separated by commas (\f(CW\*(C`,\*(C'\fR) e.g.: \f(CW\*(C`a:0,v\*(C'\fR
.IP "\fBonfail\fR" 4
.IX Item "onfail"
Specify behaviour on output failure. This can be set to either \f(CW\*(C`abort\*(C'\fR (which is
default) or \f(CW\*(C`ignore\*(C'\fR. \f(CW\*(C`abort\*(C'\fR will cause whole process to fail in case of failure
on this slave output. \f(CW\*(C`ignore\*(C'\fR will ignore failure on this output, so other outputs
will continue without being affected.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
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):
.Sp
.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
.IP "\(bu" 4
As above, but continue streaming even if output to local file fails
(for example local drive fills up):
.Sp
.Vb 2
\&        ffmpeg \-i ... \-c:v libx264 \-c:a mp2 \-f tee \-map 0:v \-map 0:a
\&          "[onfail=ignore]archive\-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
.Ve
.IP "\(bu" 4
Use \fBffmpeg\fR to encode the input, and send the output
to three different destinations. The \f(CW\*(C`dump_extra\*(C'\fR bitstream
filter is used to add extradata information to all the output video
keyframes packets, as requested by the MPEG-TS format. The select
option is applied to \fIout.aac\fR in order to make it contain only
audio packets.
.Sp
.Vb 2
\&        ffmpeg \-i ... \-map 0 \-flags +global_header \-c:v libx264 \-c:a aac \-strict experimental
\&               \-f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
.Ve
.IP "\(bu" 4
As below, but select only stream \f(CW\*(C`a:1\*(C'\fR for the audio output. Note
that a second level escaping must be performed, as \*(L":\*(R" is a special
character used to separate options.
.Sp
.Vb 2
\&        ffmpeg \-i ... \-map 0 \-flags +global_header \-c:v libx264 \-c:a aac \-strict experimental
\&               \-f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=\e\*(Aqa:1\e\*(Aq]out.aac"
.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.
.SS "webm_dash_manifest"
.IX Subsection "webm_dash_manifest"
WebM \s-1DASH\s0 Manifest muxer.
.PP
This muxer implements the WebM \s-1DASH\s0 Manifest specification to generate the \s-1DASH\s0
manifest \s-1XML.\s0 It also supports manifest generation for \s-1DASH\s0 live streams.
.PP
For more information see:
.IP "\(bu" 4
WebM \s-1DASH\s0 Specification: <\fBhttps://sites.google.com/a/webmproject.org/wiki/adaptive\-streaming/webm\-dash\-specification\fR>
.IP "\(bu" 4
\&\s-1ISO DASH\s0 Specification: <\fBhttp://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009\-1_2014.zip\fR>
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
This muxer supports the following options:
.IP "\fBadaptation_sets\fR" 4
.IX Item "adaptation_sets"
This option has the following syntax: \*(L"id=x,streams=a,b,c id=y,streams=d,e\*(R" where x and y are the
unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
audio and video streams. Any number of adaptation sets can be added using this option.
.IP "\fBlive\fR" 4
.IX Item "live"
Set this to 1 to create a live stream \s-1DASH\s0 Manifest. Default: 0.
.IP "\fBchunk_start_index\fR" 4
.IX Item "chunk_start_index"
Start index of the first chunk. This will go in the \fBstartNumber\fR attribute
of the \fBSegmentTemplate\fR element in the manifest. Default: 0.
.IP "\fBchunk_duration_ms\fR" 4
.IX Item "chunk_duration_ms"
Duration of each chunk in milliseconds. This will go in the \fBduration\fR
attribute of the \fBSegmentTemplate\fR element in the manifest. Default: 1000.
.IP "\fButc_timing_url\fR" 4
.IX Item "utc_timing_url"
\&\s-1URL\s0 of the page that will return the \s-1UTC\s0 timestamp in \s-1ISO\s0 format. This will go
in the \fBvalue\fR attribute of the \fBUTCTiming\fR element in the manifest.
Default: None.
.IP "\fBtime_shift_buffer_depth\fR" 4
.IX Item "time_shift_buffer_depth"
Smallest time (in seconds) shifting buffer for which any Representation is
guaranteed to be available. This will go in the \fBtimeShiftBufferDepth\fR
attribute of the \fB\s-1MPD\s0\fR element. Default: 60.
.IP "\fBminimum_update_period\fR" 4
.IX Item "minimum_update_period"
Minimum update period (in seconds) of the manifest. This will go in the
\&\fBminimumUpdatePeriod\fR attribute of the \fB\s-1MPD\s0\fR element. Default: 0.
.PP
\fIExample\fR
.IX Subsection "Example"
.PP
.Vb 9
\&        ffmpeg \-f webm_dash_manifest \-i video1.webm \e
\&               \-f webm_dash_manifest \-i video2.webm \e
\&               \-f webm_dash_manifest \-i audio1.webm \e
\&               \-f webm_dash_manifest \-i audio2.webm \e
\&               \-map 0 \-map 1 \-map 2 \-map 3 \e
\&               \-c copy \e
\&               \-f webm_dash_manifest \e
\&               \-adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \e
\&               manifest.xml
.Ve
.SS "webm_chunk"
.IX Subsection "webm_chunk"
WebM Live Chunk Muxer.
.PP
This muxer writes out WebM headers and chunks as separate files which can be
consumed by clients that support WebM Live streams via \s-1DASH.\s0
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
This muxer supports the following options:
.IP "\fBchunk_start_index\fR" 4
.IX Item "chunk_start_index"
Index of the first chunk (defaults to 0).
.IP "\fBheader\fR" 4
.IX Item "header"
Filename of the header where the initialization data will be written.
.IP "\fBaudio_chunk_duration\fR" 4
.IX Item "audio_chunk_duration"
Duration of each audio chunk in milliseconds (defaults to 5000).
.PP
\fIExample\fR
.IX Subsection "Example"
.PP
.Vb 10
\&        ffmpeg \-f v4l2 \-i /dev/video0 \e
\&               \-f alsa \-i hw:0 \e
\&               \-map 0:0 \e
\&               \-c:v libvpx\-vp9 \e
\&               \-s 640x360 \-keyint_min 30 \-g 30 \e
\&               \-f webm_chunk \e
\&               \-header webm_live_video_360.hdr \e
\&               \-chunk_start_index 1 \e
\&               webm_live_video_360_%d.chk \e
\&               \-map 1:0 \e
\&               \-c:a libvorbis \e
\&               \-b:a 128k \e
\&               \-f webm_chunk \e
\&               \-header webm_live_audio_128.hdr \e
\&               \-chunk_start_index 1 \e
\&               \-audio_chunk_duration 1000 \e
\&               webm_live_audio_128_%d.chk
.Ve
.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 \fB;FFMETADATA\fR string, followed by a version number (now 1).
.IP "3." 4
Metadata tags are of the form \fBkey=value\fR
.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 (\fB[\fR, \fB]\fR) 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
\&\fBTIMEBASE=\fR\fInum\fR\fB/\fR\fIden\fR, where \fInum\fR and \fIden\fR are
integers. If the timebase is missing then start/end times are assumed to
be in milliseconds.
.Sp
Next a chapter section must contain chapter start and end times in form
\&\fBSTART=\fR\fInum\fR, \fBEND=\fR\fInum\fR, where \fInum\fR is a positive
integer.
.IP "8." 4
Empty lines and lines starting with \fB;\fR or \fB#\fR are ignored.
.IP "9." 4
Metadata keys or values containing special characters (\fB=\fR, \fB;\fR,
\&\fB#\fR, \fB\e\fR and a newline) must be escaped with a backslash \fB\e\fR.
.IP "10." 4
Note that whitespace in metadata (e.g. \fBfoo = bar\fR) is considered to be
a part of the tag (in the example above key is \fBfoo\fR , value is
 \fBbar\fR).
.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
.PP
By using the ffmetadata muxer and demuxer it is possible to extract
metadata from an input file to an ffmetadata file, and then transcode
the file into an output file with the edited ffmetadata file.
.PP
Extracting an ffmetadata file with \fIffmpeg\fR goes as follows:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-f ffmetadata FFMETADATAFILE
.Ve
.PP
Reinserting edited metadata information from the \s-1FFMETADATAFILE\s0 file can
be done as:
.PP
.Vb 1
\&        ffmpeg \-i INPUT \-i FFMETADATAFILE \-map_metadata 1 \-codec copy OUTPUT
.Ve
.SH "PROTOCOL OPTIONS"
.IX Header "PROTOCOL OPTIONS"
The libavformat library provides some generic global options, which
can be set on all the protocols. In addition each protocol may support
so-called private options, which are specific for that component.
.PP
The list of supported options follows:
.IP "\fBprotocol_whitelist\fR \fIlist\fR \fB(\fR\fIinput\fR\fB)\fR" 4
.IX Item "protocol_whitelist list (input)"
Set a \*(L",\*(R"\-separated list of allowed protocols. \*(L"\s-1ALL\*(R"\s0 matches all protocols. Protocols
prefixed by \*(L"\-\*(R" are disabled.
All protocols are allowed by default but protocols used by an another
protocol (nested protocols) are restricted to a per protocol subset.
.SH "PROTOCOLS"
.IX Header "PROTOCOLS"
Protocols are configured elements in FFmpeg that enable access to
resources that require specific protocols.
.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
All protocols accept the following options:
.IP "\fBrw_timeout\fR" 4
.IX Item "rw_timeout"
Maximum time to wait for (network) read/write operations to complete,
in microseconds.
.PP
A description of the currently available protocols follows.
.SS "async"
.IX Subsection "async"
Asynchronous data filling wrapper for input stream.
.PP
Fill data in a background thread, to decouple I/O operation from demux thread.
.PP
.Vb 3
\&        async:<URL>
\&        async:http://host/resource
\&        async:cache:http://host/resource
.Ve
.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 "cache"
.IX Subsection "cache"
Caching wrapper for input stream.
.PP
Cache the input stream to temporary file. It brings seeking capability to live streams.
.PP
.Vb 1
\&        cache:<URL>
.Ve
.SS "concat"
.IX Subsection "concat"
Physical concatenation protocol.
.PP
Read and seek from many resources 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 "crypto"
.IX Subsection "crypto"
AES-encrypted stream reading protocol.
.PP
The accepted options are:
.IP "\fBkey\fR" 4
.IX Item "key"
Set the \s-1AES\s0 decryption key binary block from given hexadecimal representation.
.IP "\fBiv\fR" 4
.IX Item "iv"
Set the \s-1AES\s0 decryption initialization vector binary block from given hexadecimal representation.
.PP
Accepted \s-1URL\s0 formats:
.PP
.Vb 2
\&        crypto:<URL>
\&        crypto+<URL>
.Ve
.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
Read from or write to a file.
.PP
A file \s-1URL\s0 can have the form:
.PP
.Vb 1
\&        file:<filename>
.Ve
.PP
where \fIfilename\fR is the path of the file to read.
.PP
An \s-1URL\s0 that does not have a protocol prefix will be assumed to be a
file \s-1URL.\s0 Depending on the build, an \s-1URL\s0 that looks like a Windows
path with the drive letter at the beginning will also be assumed to be
a file \s-1URL \s0(usually not the case in builds for unix-like systems).
.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
This protocol accepts the following options:
.IP "\fBtruncate\fR" 4
.IX Item "truncate"
Truncate existing files on write, if set to 1. A value of 0 prevents
truncating. Default value is 1.
.IP "\fBblocksize\fR" 4
.IX Item "blocksize"
Set I/O operation maximum block size, in bytes. Default value is
\&\f(CW\*(C`INT_MAX\*(C'\fR, which results in not limiting the requested block size.
Setting this value reasonably low improves user termination request reaction
time, which is valuable for files on slow medium.
.SS "ftp"
.IX Subsection "ftp"
\&\s-1FTP \s0(File Transfer Protocol).
.PP
Read from or write to remote resources using \s-1FTP\s0 protocol.
.PP
Following syntax is required.
.PP
.Vb 1
\&        ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
.Ve
.PP
This protocol accepts the following options.
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Set timeout in microseconds 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 "\fBftp-anonymous-password\fR" 4
.IX Item "ftp-anonymous-password"
Password used when login as anonymous user. Typically an e\-mail address
should be used.
.IP "\fBftp-write-seekable\fR" 4
.IX Item "ftp-write-seekable"
Control seekability of connection during encoding. If set to 1 the
resource is supposed to be seekable, if set to 0 it is assumed not
to be seekable. Default value is 0.
.PP
\&\s-1NOTE:\s0 Protocol can be used as output, but it is recommended to not do
it, unless special care is taken (tests, customized server configuration
etc.). Different \s-1FTP\s0 servers behave in different way during seek
operation. ff* tools may produce incomplete content due to server limitations.
.PP
This protocol accepts the following options:
.IP "\fBfollow\fR" 4
.IX Item "follow"
If set to 1, the protocol will retry reading at the end of the file, allowing
reading files that still are being written. In order for this to terminate,
you either need to use the rw_timeout option, or use the interrupt callback
(for \s-1API\s0 users).
.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 "\fBcontent_type\fR" 4
.IX Item "content_type"
Set a specific content type for the \s-1POST\s0 messages or for listen mode.
.IP "\fBhttp_proxy\fR" 4
.IX Item "http_proxy"
set \s-1HTTP\s0 proxy to tunnel through e.g. http://example.com:1234
.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 "\fBmultiple_requests\fR" 4
.IX Item "multiple_requests"
Use persistent connections if set to 1, default is 0.
.IP "\fBpost_data\fR" 4
.IX Item "post_data"
Set custom \s-1HTTP\s0 post data.
.IP "\fBuser_agent\fR" 4
.IX Item "user_agent"
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. (\*(L"Lavf/<version>\*(R")
.IP "\fBuser-agent\fR" 4
.IX Item "user-agent"
This is a deprecated option, you can use user_agent instead it.
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Set timeout in microseconds 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 "\fBreconnect_at_eof\fR" 4
.IX Item "reconnect_at_eof"
If set then eof is treated like an error and causes reconnection, this is useful
for live / endless streams.
.IP "\fBreconnect_streamed\fR" 4
.IX Item "reconnect_streamed"
If set then even streamed/non seekable streams will be reconnected on errors.
.IP "\fBreconnect_delay_max\fR" 4
.IX Item "reconnect_delay_max"
Sets the maximum delay in seconds after which to give up reconnecting
.IP "\fBmime_type\fR" 4
.IX Item "mime_type"
Export the \s-1MIME\s0 type.
.IP "\fBicy\fR" 4
.IX Item "icy"
If set to 1 request \s-1ICY \s0(SHOUTcast) metadata from the server. If the server
supports this, the metadata has to be retrieved by the application by reading
the \fBicy_metadata_headers\fR and \fBicy_metadata_packet\fR options.
The default is 1.
.IP "\fBicy_metadata_headers\fR" 4
.IX Item "icy_metadata_headers"
If the server supports \s-1ICY\s0 metadata, this contains the ICY-specific \s-1HTTP\s0 reply
headers, separated by newline characters.
.IP "\fBicy_metadata_packet\fR" 4
.IX Item "icy_metadata_packet"
If the server supports \s-1ICY\s0 metadata, and \fBicy\fR was set to 1, this
contains the last non-empty metadata packet sent by the server. It should be
polled in regular intervals by applications interested in mid-stream metadata
updates.
.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.
.IP "\fBoffset\fR" 4
.IX Item "offset"
Set initial byte offset.
.IP "\fBend_offset\fR" 4
.IX Item "end_offset"
Try to limit the request to bytes preceding this offset.
.IP "\fBmethod\fR" 4
.IX Item "method"
When used as a client option it sets the \s-1HTTP\s0 method for the request.
.Sp
When used as a server option it sets the \s-1HTTP\s0 method that is going to be
expected from the client(s).
If the expected and the received \s-1HTTP\s0 method do not match the client will
be given a Bad Request response.
When unset the \s-1HTTP\s0 method is not checked for now. This will be replaced by
autodetection in the future.
.IP "\fBlisten\fR" 4
.IX Item "listen"
If set to 1 enables experimental \s-1HTTP\s0 server. This can be used to send data when
used as an output option, or read data from a client with \s-1HTTP POST\s0 when used as
an input option.
If set to 2 enables experimental multi-client \s-1HTTP\s0 server. This is not yet implemented
in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
.Sp
.Vb 2
\&        # Server side (sending):
\&        ffmpeg \-i somefile.ogg \-c copy \-listen 1 \-f ogg http://<server>:<port>
\&        
\&        # Client side (receiving):
\&        ffmpeg \-i http://<server>:<port> \-c copy somefile.ogg
\&        
\&        # Client can also be done with wget:
\&        wget http://<server>:<port> \-O somefile.ogg
\&        
\&        # Server side (receiving):
\&        ffmpeg \-listen 1 \-i http://<server>:<port> \-c copy somefile.ogg
\&        
\&        # Client side (sending):
\&        ffmpeg \-i somefile.ogg \-chunked_post 0 \-c copy \-f ogg http://<server>:<port>
\&        
\&        # Client can also be done with wget:
\&        wget \-\-post\-file=somefile.ogg http://<server>:<port>
.Ve
.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 "Icecast"
.IX Subsection "Icecast"
Icecast protocol (stream to Icecast servers)
.PP
This protocol accepts the following options:
.IP "\fBice_genre\fR" 4
.IX Item "ice_genre"
Set the stream genre.
.IP "\fBice_name\fR" 4
.IX Item "ice_name"
Set the stream name.
.IP "\fBice_description\fR" 4
.IX Item "ice_description"
Set the stream description.
.IP "\fBice_url\fR" 4
.IX Item "ice_url"
Set the stream website \s-1URL.\s0
.IP "\fBice_public\fR" 4
.IX Item "ice_public"
Set if the stream should be public.
The default is 0 (not public).
.IP "\fBuser_agent\fR" 4
.IX Item "user_agent"
Override the User-Agent header. If not specified a string of the form
\&\*(L"Lavf/<version>\*(R" will be used.
.IP "\fBpassword\fR" 4
.IX Item "password"
Set the Icecast mountpoint password.
.IP "\fBcontent_type\fR" 4
.IX Item "content_type"
Set the stream content type. This must be set if it is different from
audio/mpeg.
.IP "\fBlegacy_icecast\fR" 4
.IX Item "legacy_icecast"
This enables support for Icecast versions < 2.4.0, that do not support the
\&\s-1HTTP PUT\s0 method but the \s-1SOURCE\s0 method.
.PP
.Vb 1
\&        icecast://[<username>[:<password>]@]<server>:<port>/<mountpoint>
.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
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
This protocol accepts the following options:
.IP "\fBblocksize\fR" 4
.IX Item "blocksize"
Set I/O operation maximum block size, in bytes. Default value is
\&\f(CW\*(C`INT_MAX\*(C'\fR, which results in not limiting the requested block size.
Setting this value reasonably low improves user termination request reaction
time, which is valuable if data transmission is slow.
.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://[<username>:<password>@]<server>[:<port>][/<app>][/<instance>][/<playpath>]
.Ve
.PP
The accepted parameters are:
.IP "\fBusername\fR" 4
.IX Item "username"
An optional username (mostly for publishing).
.IP "\fBpassword\fR" 4
.IX Item "password"
An optional password (mostly for publishing).
.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 9,0,124,2. \s0(When publishing, the default is \s-1FMLE/3.0 \s0(compatible;
<libavformat version>).)
.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
.PP
To publish to a password protected server, passing the playpath and
app names separately:
.PP
.Vb 1
\&        ffmpeg \-re \-i <input> \-f flv \-rtmp_playpath some/long/path \-rtmp_app long/app/name rtmp://username:password@myserver/
.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 "libsmbclient"
.IX Subsection "libsmbclient"
libsmbclient permits one to manipulate \s-1CIFS/SMB\s0 network resources.
.PP
Following syntax is required.
.PP
.Vb 1
\&        smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
.Ve
.PP
This protocol accepts the following options.
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Set timeout in milliseconds 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 "\fBtruncate\fR" 4
.IX Item "truncate"
Truncate existing files on write, if set to 1. A value of 0 prevents
truncating. Default value is 1.
.IP "\fBworkgroup\fR" 4
.IX Item "workgroup"
Set the workgroup used for making connections. By default workgroup is not specified.
.PP
For more information see: <\fBhttp://www.samba.org/\fR>.
.SS "libssh"
.IX Subsection "libssh"
Secure File Transfer Protocol via libssh
.PP
Read from or write to remote resources using \s-1SFTP\s0 protocol.
.PP
Following syntax is required.
.PP
.Vb 1
\&        sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
.Ve
.PP
This protocol accepts the following options.
.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 "\fBtruncate\fR" 4
.IX Item "truncate"
Truncate existing files on write, if set to 1. A value of 0 prevents
truncating. Default value is 1.
.IP "\fBprivate_key\fR" 4
.IX Item "private_key"
Specify the path of the file containing private key to use during authorization.
By default libssh searches for keys in the \fI~/.ssh/\fR directory.
.PP
Example: Play a file stored on remote server.
.PP
.Vb 1
\&        ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
.Ve
.SS "librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte"
.IX Subsection "librtmp 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, RTMP\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, RTMPTS\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 Transport Protocol.
.PP
The required syntax for an \s-1RTP URL\s0 is:
rtp://\fIhostname\fR[:\fIport\fR][?\fIoption\fR=\fIval\fR...]
.PP
\&\fIport\fR specifies the \s-1RTP\s0 port to use.
.PP
The following \s-1URL\s0 options are supported:
.IP "\fBttl=\fR\fIn\fR" 4
.IX Item "ttl=n"
Set the \s-1TTL \s0(Time-To-Live) value (for multicast only).
.IP "\fBrtcpport=\fR\fIn\fR" 4
.IX Item "rtcpport=n"
Set the remote \s-1RTCP\s0 port to \fIn\fR.
.IP "\fBlocalrtpport=\fR\fIn\fR" 4
.IX Item "localrtpport=n"
Set the local \s-1RTP\s0 port to \fIn\fR.
.IP "\fBlocalrtcpport=\fR\fIn\fR\fB'\fR" 4
.IX Item "localrtcpport=n'"
Set the local \s-1RTCP\s0 port to \fIn\fR.
.IP "\fBpkt_size=\fR\fIn\fR" 4
.IX Item "pkt_size=n"
Set max packet size (in bytes) to \fIn\fR.
.IP "\fBconnect=0|1\fR" 4
.IX Item "connect=0|1"
Do a \f(CW\*(C`connect()\*(C'\fR on the \s-1UDP\s0 socket (if set to 1) or not (if set
to 0).
.IP "\fBsources=\fR\fIip\fR\fB[,\fR\fIip\fR\fB]\fR" 4
.IX Item "sources=ip[,ip]"
List allowed source \s-1IP\s0 addresses.
.IP "\fBblock=\fR\fIip\fR\fB[,\fR\fIip\fR\fB]\fR" 4
.IX Item "block=ip[,ip]"
List disallowed (blocked) source \s-1IP\s0 addresses.
.IP "\fBwrite_to_source=0|1\fR" 4
.IX Item "write_to_source=0|1"
Send packets to the source address of the latest received packet (if
set to 1) or to a default remote address (if set to 0).
.IP "\fBlocalport=\fR\fIn\fR" 4
.IX Item "localport=n"
Set the local \s-1RTP\s0 port to \fIn\fR.
.Sp
This is a deprecated option. Instead, \fBlocalrtpport\fR should be
used.
.PP
Important notes:
.IP "1." 4
If \fBrtcpport\fR is not set the \s-1RTCP\s0 port will be set to the \s-1RTP\s0
port value plus 1.
.IP "2." 4
If \fBlocalrtpport\fR (the local \s-1RTP\s0 port) is not set any available
port will be used for the local \s-1RTP\s0 and \s-1RTCP\s0 ports.
.IP "3." 4
If \fBlocalrtcpport\fR (the local \s-1RTCP\s0 port) is not set it will be
set to the local \s-1RTP\s0 port value plus 1.
.SS "rtsp"
.IX Subsection "rtsp"
Real-Time Streaming Protocol.
.PP
\&\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 ANNOUNCE\s0 to a server
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
<\fBhttps://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
Options can be 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.
.PP
The following options are supported.
.IP "\fBinitial_pause\fR" 4
.IX Item "initial_pause"
Do not start playing the stream immediately if set to 1. Default value
is 0.
.IP "\fBrtsp_transport\fR" 4
.IX Item "rtsp_transport"
Set \s-1RTSP\s0 transport protocols.
.Sp
It accepts the following values:
.RS 4
.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.
.RE
.RS 4
.Sp
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 \fBtcp\fR and \fBudp\fR options are supported.
.RE
.IP "\fBrtsp_flags\fR" 4
.IX Item "rtsp_flags"
Set \s-1RTSP\s0 flags.
.Sp
The following values are accepted:
.RS 4
.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.
.IP "\fBprefer_tcp\fR" 4
.IX Item "prefer_tcp"
Try \s-1TCP\s0 for \s-1RTP\s0 transport first, if \s-1TCP\s0 is available as \s-1RTSP RTP\s0 transport.
.RE
.RS 4
.Sp
Default value is \fBnone\fR.
.RE
.IP "\fBallowed_media_types\fR" 4
.IX Item "allowed_media_types"
Set media types to accept from the server.
.Sp
The following flags are accepted:
.RS 4
.IP "\fBvideo\fR" 4
.IX Item "video"
.PD 0
.IP "\fBaudio\fR" 4
.IX Item "audio"
.IP "\fBdata\fR" 4
.IX Item "data"
.RE
.RS 4
.PD
.Sp
By default it accepts all media types.
.RE
.IP "\fBmin_port\fR" 4
.IX Item "min_port"
Set minimum local \s-1UDP\s0 port. Default value is 5000.
.IP "\fBmax_port\fR" 4
.IX Item "max_port"
Set maximum local \s-1UDP\s0 port. Default value is 65000.
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Set maximum timeout (in seconds) to wait for incoming connections.
.Sp
A value of \-1 means infinite (default). This option implies the
\&\fBrtsp_flags\fR set to \fBlisten\fR.
.IP "\fBreorder_queue_size\fR" 4
.IX Item "reorder_queue_size"
Set number of packets to buffer for handling of reordered packets.
.IP "\fBstimeout\fR" 4
.IX Item "stimeout"
Set socket \s-1TCP I/O\s0 timeout in microseconds.
.IP "\fBuser-agent\fR" 4
.IX Item "user-agent"
Override User-Agent header. If not specified, it defaults to the
libavformat identifier string.
.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
\fIExamples\fR
.IX Subsection "Examples"
.PP
The following examples all make use of the \fBffplay\fR and
\&\fBffmpeg\fR tools.
.IP "\(bu" 4
Watch a stream over \s-1UDP,\s0 with a max reordering delay of 0.5 seconds:
.Sp
.Vb 1
\&        ffplay \-max_delay 500000 \-rtsp_transport udp rtsp://server/video.mp4
.Ve
.IP "\(bu" 4
Watch a stream tunneled over \s-1HTTP:\s0
.Sp
.Vb 1
\&        ffplay \-rtsp_transport http rtsp://server/video.mp4
.Ve
.IP "\(bu" 4
Send a stream in realtime to a \s-1RTSP\s0 server, for others to watch:
.Sp
.Vb 1
\&        ffmpeg \-re \-i <input> \-f rtsp \-muxdelay 0.1 rtsp://server/live.sdp
.Ve
.IP "\(bu" 4
Receive a stream in realtime:
.Sp
.Vb 1
\&        ffmpeg \-rtsp_flags listen \-i rtsp://ownaddress/live.sdp <output>
.Ve
.SS "sap"
.IX Subsection "sap"
Session Announcement Protocol (\s-1RFC 2974\s0). 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 "sctp"
.IX Subsection "sctp"
Stream Control Transmission Protocol.
.PP
The accepted \s-1URL\s0 syntax is:
.PP
.Vb 1
\&        sctp://<host>:<port>[?<options>]
.Ve
.PP
The protocol accepts the following options:
.IP "\fBlisten\fR" 4
.IX Item "listen"
If set to any value, listen for an incoming connection. Outgoing connection is done by default.
.IP "\fBmax_streams\fR" 4
.IX Item "max_streams"
Set the maximum number of streams. By default no limit is set.
.SS "srtp"
.IX Subsection "srtp"
Secure Real-time Transport Protocol.
.PP
The accepted options are:
.IP "\fBsrtp_in_suite\fR" 4
.IX Item "srtp_in_suite"
.PD 0
.IP "\fBsrtp_out_suite\fR" 4
.IX Item "srtp_out_suite"
.PD
Select input and output encoding suites.
.Sp
Supported values:
.RS 4
.IP "\fB\s-1AES_CM_128_HMAC_SHA1_80\s0\fR" 4
.IX Item "AES_CM_128_HMAC_SHA1_80"
.PD 0
.IP "\fB\s-1SRTP_AES128_CM_HMAC_SHA1_80\s0\fR" 4
.IX Item "SRTP_AES128_CM_HMAC_SHA1_80"
.IP "\fB\s-1AES_CM_128_HMAC_SHA1_32\s0\fR" 4
.IX Item "AES_CM_128_HMAC_SHA1_32"
.IP "\fB\s-1SRTP_AES128_CM_HMAC_SHA1_32\s0\fR" 4
.IX Item "SRTP_AES128_CM_HMAC_SHA1_32"
.RE
.RS 4
.RE
.IP "\fBsrtp_in_params\fR" 4
.IX Item "srtp_in_params"
.IP "\fBsrtp_out_params\fR" 4
.IX Item "srtp_out_params"
.PD
Set input and output encoding parameters, which are expressed by a
base64\-encoded representation of a binary block. The first 16 bytes of
this binary block are used as master key, the following 14 bytes are
used as master salt.
.SS "subfile"
.IX Subsection "subfile"
Virtually extract a segment of a file or another stream.
The underlying stream must be seekable.
.PP
Accepted options:
.IP "\fBstart\fR" 4
.IX Item "start"
Start offset of the extracted segment, in bytes.
.IP "\fBend\fR" 4
.IX Item "end"
End offset of the extracted segment, in bytes.
.PP
Examples:
.PP
Extract a chapter from a \s-1DVD VOB\s0 file (start and end sectors obtained
externally and multiplied by 2048):
.PP
.Vb 1
\&        subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
.Ve
.PP
Play an \s-1AVI\s0 file directly from a \s-1TAR\s0 archive:
.PP
.Vb 1
\&        subfile,,start,183241728,end,366490624,,:archive.tar
.Ve
.SS "tee"
.IX Subsection "tee"
Writes the output to multiple protocols. The individual outputs are separated
by |
.PP
.Vb 1
\&        tee:file://path/to/local/this.avi|file://path/to/local/that.avi
.Ve
.SS "tcp"
.IX Subsection "tcp"
Transmission Control Protocol.
.PP
The required syntax for a \s-1TCP\s0 url is:
.PP
.Vb 1
\&        tcp://<hostname>:<port>[?<options>]
.Ve
.PP
\&\fIoptions\fR contains a list of &\-separated options of the form
\&\fIkey\fR=\fIval\fR.
.PP
The list of supported options follows.
.IP "\fBlisten=\fR\fI1|0\fR" 4
.IX Item "listen=1|0"
Listen for an incoming connection. Default value is 0.
.IP "\fBtimeout=\fR\fImicroseconds\fR" 4
.IX Item "timeout=microseconds"
Set raise error timeout, expressed in microseconds.
.Sp
This option is only relevant in read mode: if no data arrived in more
than this time interval, raise error.
.IP "\fBlisten_timeout=\fR\fImilliseconds\fR" 4
.IX Item "listen_timeout=milliseconds"
Set listen timeout, expressed in milliseconds.
.IP "\fBrecv_buffer_size=\fR\fIbytes\fR" 4
.IX Item "recv_buffer_size=bytes"
Set receive buffer size, expressed bytes.
.IP "\fBsend_buffer_size=\fR\fIbytes\fR" 4
.IX Item "send_buffer_size=bytes"
Set send buffer size, expressed bytes.
.PP
The following example shows how to setup a listening \s-1TCP\s0 connection
with \fBffmpeg\fR, which is then accessed with \fBffplay\fR:
.PP
.Vb 2
\&        ffmpeg \-i <input> \-f <format> tcp://<hostname>:<port>?listen
\&        ffplay tcp://<hostname>:<port>
.Ve
.SS "tls"
.IX Subsection "tls"
Transport Layer Security (\s-1TLS\s0) / Secure Sockets Layer (\s-1SSL\s0)
.PP
The required syntax for a \s-1TLS/SSL\s0 url is:
.PP
.Vb 1
\&        tls://<hostname>:<port>[?<options>]
.Ve
.PP
The following parameters can be set via command line options
(or in code via \f(CW\*(C`AVOption\*(C'\fRs):
.IP "\fBca_file, cafile=\fR\fIfilename\fR" 4
.IX Item "ca_file, cafile=filename"
A file containing certificate authority (\s-1CA\s0) root certificates to treat
as trusted. If the linked \s-1TLS\s0 library contains a default this might not
need to be specified for verification to work, but not all libraries and
setups have defaults built in.
The file must be in OpenSSL \s-1PEM\s0 format.
.IP "\fBtls_verify=\fR\fI1|0\fR" 4
.IX Item "tls_verify=1|0"
If enabled, try to verify the peer that we are communicating with.
Note, if using OpenSSL, this currently only makes sure that the
peer certificate is signed by one of the root certificates in the \s-1CA\s0
database, but it does not validate that the certificate actually
matches the host name we are trying to connect to. (With GnuTLS,
the host name is validated as well.)
.Sp
This is disabled by default since it requires a \s-1CA\s0 database to be
provided by the caller in many cases.
.IP "\fBcert_file, cert=\fR\fIfilename\fR" 4
.IX Item "cert_file, cert=filename"
A file containing a certificate to use in the handshake with the peer.
(When operating as server, in listen mode, this is more often required
by the peer, while client certificates only are mandated in certain
setups.)
.IP "\fBkey_file, key=\fR\fIfilename\fR" 4
.IX Item "key_file, key=filename"
A file containing the private key for the certificate.
.IP "\fBlisten=\fR\fI1|0\fR" 4
.IX Item "listen=1|0"
If enabled, listen for connections on the provided port, and assume
the server role in the handshake instead of the client role.
.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 an \s-1UDP URL\s0 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 one 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 maximum socket buffer size in bytes. This is used to set either
the receive or send buffer size, depending on what the socket is used for.
Default is 64KB.  See also \fIfifo_size\fR.
.IP "\fBbitrate=\fR\fIbitrate\fR" 4
.IX Item "bitrate=bitrate"
If set to nonzero, the output will have the specified constant bitrate if the
input has enough packets to sustain it.
.IP "\fBburst_bits=\fR\fIbits\fR" 4
.IX Item "burst_bits=bits"
When using \fIbitrate\fR this specifies the maximum number of bits in
packet bursts.
.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"
Set raise error timeout, expressed in microseconds.
.Sp
This option is only relevant in read mode: if no data arrived in more
than this time interval, raise error.
.IP "\fBbroadcast=\fR\fI1|0\fR" 4
.IX Item "broadcast=1|0"
Explicitly allow or disallow \s-1UDP\s0 broadcasting.
.Sp
Note that broadcasting may not work properly on networks having
a broadcast storm protection.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use \fBffmpeg\fR to stream over \s-1UDP\s0 to a remote endpoint:
.Sp
.Vb 1
\&        ffmpeg \-i <input> \-f <format> udp://<hostname>:<port>
.Ve
.IP "\(bu" 4
Use \fBffmpeg\fR to stream in mpegts format over \s-1UDP\s0 using 188
sized \s-1UDP\s0 packets, using a large input buffer:
.Sp
.Vb 1
\&        ffmpeg \-i <input> \-f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
.Ve
.IP "\(bu" 4
Use \fBffmpeg\fR to receive over \s-1UDP\s0 from a remote endpoint:
.Sp
.Vb 1
\&        ffmpeg \-i udp://[<multicast\-address>]:<port> ...
.Ve
.SS "unix"
.IX Subsection "unix"
Unix local socket
.PP
The required syntax for a Unix socket \s-1URL\s0 is:
.PP
.Vb 1
\&        unix://<filepath>
.Ve
.PP
The following parameters can be set via command line options
(or in code via \f(CW\*(C`AVOption\*(C'\fRs):
.IP "\fBtimeout\fR" 4
.IX Item "timeout"
Timeout in ms.
.IP "\fBlisten\fR" 4
.IX Item "listen"
Create the Unix socket in listening mode.
.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 enable accessing
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"\-devices\*(R" of the ff* tools will display the list of
supported input devices.
.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>
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Set the sample rate in Hz. Default is 48000.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of channels. Default is 2.
.SS "avfoundation"
.IX Subsection "avfoundation"
AVFoundation input device.
.PP
AVFoundation is the currently recommended framework by Apple for streamgrabbing on \s-1OSX \s0>= 10.7 as well as on iOS.
The older QTKit framework has been marked deprecated since \s-1OSX\s0 version 10.7.
.PP
The input filename has to be given in the following syntax:
.PP
.Vb 1
\&        \-i "[[VIDEO]:[AUDIO]]"
.Ve
.PP
The first entry selects the video input while the latter selects the audio input.
The stream has to be specified by the device name or the device index as shown by the device list.
Alternatively, the video and/or audio input device can be chosen by index using the
.PP
.Vb 1
\&    B<\-video_device_index E<lt>INDEXE<gt>>
.Ve
.PP
and/or
.PP
.Vb 1
\&    B<\-audio_device_index E<lt>INDEXE<gt>>
.Ve
.PP
, overriding any
device name or index given in the input filename.
.PP
All available devices can be enumerated by using \fB\-list_devices true\fR, listing
all device names and corresponding indices.
.PP
There are two device name aliases:
.ie n .IP """default""" 4
.el .IP "\f(CWdefault\fR" 4
.IX Item "default"
Select the AVFoundation default device of the corresponding type.
.ie n .IP """none""" 4
.el .IP "\f(CWnone\fR" 4
.IX Item "none"
Do not record the corresponding media type.
This is equivalent to specifying an empty device name or index.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
AVFoundation supports the following options:
.IP "\fB\-list_devices <TRUE|FALSE>\fR" 4
.IX Item "-list_devices <TRUE|FALSE>"
If set to true, a list of all available input devices is given showing all
device names and indices.
.IP "\fB\-video_device_index <\s-1INDEX\s0>\fR" 4
.IX Item "-video_device_index <INDEX>"
Specify the video device by its index. Overrides anything given in the input filename.
.IP "\fB\-audio_device_index <\s-1INDEX\s0>\fR" 4
.IX Item "-audio_device_index <INDEX>"
Specify the audio device by its index. Overrides anything given in the input filename.
.IP "\fB\-pixel_format <\s-1FORMAT\s0>\fR" 4
.IX Item "-pixel_format <FORMAT>"
Request the video device to use a specific pixel format.
If the specified format is not supported, a list of available formats is given
and the first one in this list is used instead. Available pixel formats are:
\&\f(CW\*(C`monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
 bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
 yuv420p, nv12, yuyv422, gray\*(C'\fR
.IP "\fB\-framerate\fR" 4
.IX Item "-framerate"
Set the grabbing frame rate. Default is \f(CW\*(C`ntsc\*(C'\fR, corresponding to a
frame rate of \f(CW\*(C`30000/1001\*(C'\fR.
.IP "\fB\-video_size\fR" 4
.IX Item "-video_size"
Set the video frame size.
.IP "\fB\-capture_cursor\fR" 4
.IX Item "-capture_cursor"
Capture the mouse pointer. Default is 0.
.IP "\fB\-capture_mouse_clicks\fR" 4
.IX Item "-capture_mouse_clicks"
Capture the screen mouse clicks. Default is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Print the list of AVFoundation supported devices and exit:
.Sp
.Vb 1
\&        $ ffmpeg \-f avfoundation \-list_devices true \-i ""
.Ve
.IP "\(bu" 4
Record video from video device 0 and audio from audio device 0 into out.avi:
.Sp
.Vb 1
\&        $ ffmpeg \-f avfoundation \-i "0:0" out.avi
.Ve
.IP "\(bu" 4
Record video from video device 2 and audio from audio device 1 into out.avi:
.Sp
.Vb 1
\&        $ ffmpeg \-f avfoundation \-video_device_index 2 \-i ":1" out.avi
.Ve
.IP "\(bu" 4
Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
.Sp
.Vb 1
\&        $ ffmpeg \-f avfoundation \-pixel_format bgr0 \-i "default:none" out.avi
.Ve
.SS "bktr"
.IX Subsection "bktr"
\&\s-1BSD\s0 video input device.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the frame rate.
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video frame size. Default is \f(CW\*(C`vga\*(C'\fR.
.IP "\fBstandard\fR" 4
.IX Item "standard"
Available values are:
.RS 4
.IP "\fBpal\fR" 4
.IX Item "pal"
.PD 0
.IP "\fBntsc\fR" 4
.IX Item "ntsc"
.IP "\fBsecam\fR" 4
.IX Item "secam"
.IP "\fBpaln\fR" 4
.IX Item "paln"
.IP "\fBpalm\fR" 4
.IX Item "palm"
.IP "\fBntscj\fR" 4
.IX Item "ntscj"
.RE
.RS 4
.RE
.PD
.SS "decklink"
.IX Subsection "decklink"
The decklink input device provides capture capabilities for Blackmagic
DeckLink devices.
.PP
To enable this input device, you need the Blackmagic DeckLink \s-1SDK\s0 and you
need to configure with the appropriate \f(CW\*(C`\-\-extra\-cflags\*(C'\fR
and \f(CW\*(C`\-\-extra\-ldflags\*(C'\fR.
On Windows, you need to run the \s-1IDL\s0 files through \fBwidl\fR.
.PP
DeckLink is very picky about the formats it supports. Pixel format is
uyvy422 or v210, framerate and video size must be determined for your device with
\&\fB\-list_formats 1\fR. Audio sample rate is always 48 kHz and the number
of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
audio track.
.PP
\fIOptions\fR
.IX Subsection "Options"
.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.
.IP "\fBlist_formats\fR" 4
.IX Item "list_formats"
If set to \fBtrue\fR, print a list of supported formats and exit.
Defaults to \fBfalse\fR.
.IP "\fBbm_v210\fR" 4
.IX Item "bm_v210"
If set to \fB1\fR, video is captured in 10 bit v210 instead
of uyvy422. Not all Blackmagic devices support this option.
.IP "\fBteletext_lines\fR" 4
.IX Item "teletext_lines"
If set to nonzero, an additional teletext stream will be captured from the
vertical ancillary data. This option is a bitmask of the \s-1VBI\s0 lines checked,
specifically lines 6 to 22, and lines 318 to 335. Line 6 is the \s-1LSB\s0 in the mask.
Selected lines which do not contain teletext information will be ignored. You
can use the special \fBall\fR constant to select all possible lines, or
\&\fBstandard\fR to skip lines 6, 318 and 319, which are not compatible with all
receivers. Capturing teletext only works for \s-1SD PAL\s0 sources in 8 bit mode.
To use this option, ffmpeg needs to be compiled with \f(CW\*(C`\-\-enable\-libzvbi\*(C'\fR.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Defines number of audio channels to capture. Must be \fB2\fR, \fB8\fR or \fB16\fR.
Defaults to \fB2\fR.
.IP "\fBduplex_mode\fR" 4
.IX Item "duplex_mode"
Sets the decklink device duplex mode. Must be \fBunset\fR, \fBhalf\fR or \fBfull\fR.
Defaults to \fBunset\fR.
.IP "\fBvideo_input\fR" 4
.IX Item "video_input"
Sets the video input source. Must be \fBunset\fR, \fBsdi\fR, \fBhdmi\fR,
\&\fBoptical_sdi\fR, \fBcomponent\fR, \fBcomposite\fR or \fBs_video\fR.
Defaults to \fBunset\fR.
.IP "\fBaudio_input\fR" 4
.IX Item "audio_input"
Sets the audio input source. Must be \fBunset\fR, \fBembedded\fR,
\&\fBaes_ebu\fR, \fBanalog\fR, \fBanalog_xlr\fR, \fBanalog_rca\fR or
\&\fBmicrophone\fR. Defaults to \fBunset\fR.
.IP "\fBvideo_pts\fR" 4
.IX Item "video_pts"
Sets the video packet timestamp source. Must be \fBvideo\fR, \fBaudio\fR,
\&\fBreference\fR or \fBwallclock\fR. Defaults to \fBvideo\fR.
.IP "\fBaudio_pts\fR" 4
.IX Item "audio_pts"
Sets the audio packet timestamp source. Must be \fBvideo\fR, \fBaudio\fR,
\&\fBreference\fR or \fBwallclock\fR. Defaults to \fBaudio\fR.
.IP "\fBdraw_bars\fR" 4
.IX Item "draw_bars"
If set to \fBtrue\fR, color bars are drawn in the event of a signal loss.
Defaults to \fBtrue\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
List input devices:
.Sp
.Vb 1
\&        ffmpeg \-f decklink \-list_devices 1 \-i dummy
.Ve
.IP "\(bu" 4
List supported formats:
.Sp
.Vb 1
\&        ffmpeg \-f decklink \-list_formats 1 \-i \*(AqIntensity Pro\*(Aq
.Ve
.IP "\(bu" 4
Capture video clip at 1080i50 (format 11):
.Sp
.Vb 1
\&        ffmpeg \-f decklink \-i \*(AqIntensity Pro@11\*(Aq \-acodec copy \-vcodec copy output.avi
.Ve
.IP "\(bu" 4
Capture video clip at 1080i50 10 bit:
.Sp
.Vb 1
\&        ffmpeg \-bm_v210 1 \-f decklink \-i \*(AqUltraStudio Mini Recorder@11\*(Aq \-acodec copy \-vcodec copy output.avi
.Ve
.IP "\(bu" 4
Capture video clip at 1080i50 with 16 audio channels:
.Sp
.Vb 1
\&        ffmpeg \-channels 16 \-f decklink \-i \*(AqUltraStudio Mini Recorder@11\*(Aq \-acodec copy \-vcodec copy output.avi
.Ve
.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 or alternative 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 the 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 the 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>
.IP "\fBvideo_pin_name\fR" 4
.IX Item "video_pin_name"
Select video capture pin to use by name or alternative name.
.IP "\fBaudio_pin_name\fR" 4
.IX Item "audio_pin_name"
Select audio capture pin to use by name or alternative name.
.IP "\fBcrossbar_video_input_pin_number\fR" 4
.IX Item "crossbar_video_input_pin_number"
Select video input pin number for crossbar device. This will be
routed to the crossbar device's Video Decoder output pin.
Note that changing this value can affect future invocations
(sets a new default) until system reboot occurs.
.IP "\fBcrossbar_audio_input_pin_number\fR" 4
.IX Item "crossbar_audio_input_pin_number"
Select audio input pin number for crossbar device. This will be
routed to the crossbar device's Audio Decoder output pin.
Note that changing this value can affect future invocations
(sets a new default) until system reboot occurs.
.IP "\fBshow_video_device_dialog\fR" 4
.IX Item "show_video_device_dialog"
If set to \fBtrue\fR, before capture starts, popup a display dialog
to the end user, allowing them to change video filter properties
and configurations manually.
Note that for crossbar devices, adjusting values in this dialog
may be needed at times to toggle between \s-1PAL \s0(25 fps) and \s-1NTSC \s0(29.97)
input frame rates, sizes, interlacing, etc.  Changing these values can
enable different scan rates/frame rates and avoiding green bars at
the bottom, flickering scan lines, etc.
Note that with some devices, changing these properties can also affect future
invocations (sets new defaults) until system reboot occurs.
.IP "\fBshow_audio_device_dialog\fR" 4
.IX Item "show_audio_device_dialog"
If set to \fBtrue\fR, before capture starts, popup a display dialog
to the end user, allowing them to change audio filter properties
and configurations manually.
.IP "\fBshow_video_crossbar_connection_dialog\fR" 4
.IX Item "show_video_crossbar_connection_dialog"
If set to \fBtrue\fR, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify crossbar pin routings, when it opens a video device.
.IP "\fBshow_audio_crossbar_connection_dialog\fR" 4
.IX Item "show_audio_crossbar_connection_dialog"
If set to \fBtrue\fR, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify crossbar pin routings, when it opens an audio device.
.IP "\fBshow_analog_tv_tuner_dialog\fR" 4
.IX Item "show_analog_tv_tuner_dialog"
If set to \fBtrue\fR, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify \s-1TV\s0 channels and frequencies.
.IP "\fBshow_analog_tv_tuner_audio_dialog\fR" 4
.IX Item "show_analog_tv_tuner_audio_dialog"
If set to \fBtrue\fR, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify \s-1TV\s0 audio (like mono vs. stereo, Language A,B or C).
.IP "\fBaudio_device_load\fR" 4
.IX Item "audio_device_load"
Load an audio capture filter device from file instead of searching
it by name. It may load additional parameters too, if the filter
supports the serialization of its properties to.
To use this an audio capture source has to be specified, but it can
be anything even fake one.
.IP "\fBaudio_device_save\fR" 4
.IX Item "audio_device_save"
Save the currently used audio capture filter device and its
parameters (if the filter supports it) to a file.
If a file with the same name exists it will be overwritten.
.IP "\fBvideo_device_load\fR" 4
.IX Item "video_device_load"
Load a video capture filter device from file instead of searching
it by name. It may load additional parameters too, if the filter
supports the serialization of its properties to.
To use this a video capture source has to be specified, but it can
be anything even fake one.
.IP "\fBvideo_device_save\fR" 4
.IX Item "video_device_save"
Save the currently used video capture filter device and its
parameters (if the filter supports it) to a file.
If a file with the same name exists it will be overwritten.
.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
.IP "\(bu" 4
Specify pin names to capture by name or alternative name, specify alternative device name:
.Sp
.Vb 1
\&        $ ffmpeg \-f dshow \-audio_pin_name "Audio Out" \-video_pin_name 2 \-i video=video="@device_pnp_\e\e?\epci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d\-8f56\-11d0\-a3b9\-00a0c9223196}\e{ca465100\-deb0\-4d59\-818f\-8c477184adf6}":audio="Microphone"
.Ve
.IP "\(bu" 4
Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
.Sp
.Vb 2
\&        $ ffmpeg \-f dshow \-show_video_device_dialog true \-crossbar_video_input_pin_number 0
\&             \-crossbar_audio_input_pin_number 3 \-i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
.Ve
.SS "dv1394"
.IX Subsection "dv1394"
Linux \s-1DV 1394\s0 input device.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the frame rate. Default is 25.
.IP "\fBstandard\fR" 4
.IX Item "standard"
Available values are:
.RS 4
.IP "\fBpal\fR" 4
.IX Item "pal"
.PD 0
.IP "\fBntsc\fR" 4
.IX Item "ntsc"
.RE
.RS 4
.PD
.Sp
Default value is \f(CW\*(C`ntsc\*(C'\fR.
.RE
.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
See also <\fBhttp://linux\-fbdev.sourceforge.net/\fR>, and \fIfbset\fR\|(1).
.PP
To record from the framebuffer device \fI/dev/fb0\fR with
\&\fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-f fbdev \-framerate 10 \-i /dev/fb0 out.avi
.Ve
.PP
You can take a single screenshot image with the command:
.PP
.Vb 1
\&        ffmpeg \-f fbdev \-framerate 1 \-i /dev/fb0 \-frames:v 1 screenshot.jpeg
.Ve
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBframerate\fR" 4
.IX Item "framerate"
Set the frame rate. Default is 25.
.SS "gdigrab"
.IX Subsection "gdigrab"
Win32 GDI-based screen capture device.
.PP
This device allows you to capture a region of the display on Windows.
.PP
There are two options for the input filename:
.PP
.Vb 1
\&        desktop
.Ve
.PP
or
.PP
.Vb 1
\&        title=<window_title>
.Ve
.PP
The first option will capture the entire desktop, or a fixed region of the
desktop. The second option will instead capture the contents of a single
window, regardless of its position on the screen.
.PP
For example, to grab the entire desktop using \fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-f gdigrab \-framerate 6 \-i desktop out.mpg
.Ve
.PP
Grab a 640x480 region at position \f(CW\*(C`10,20\*(C'\fR:
.PP
.Vb 1
\&        ffmpeg \-f gdigrab \-framerate 6 \-offset_x 10 \-offset_y 20 \-video_size vga \-i desktop out.mpg
.Ve
.PP
Grab the contents of the window named \*(L"Calculator\*(R"
.PP
.Vb 1
\&        ffmpeg \-f gdigrab \-framerate 6 \-i title=Calculator 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. Use the value \f(CW0\fR to
not draw the pointer. Default value is \f(CW1\fR.
.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
Note that \fIshow_region\fR is incompatible with grabbing the contents
of a single window.
.Sp
For example:
.Sp
.Vb 1
\&        ffmpeg \-f gdigrab \-show_region 1 \-framerate 6 \-video_size cif \-offset_x 10 \-offset_y 20 \-i desktop out.mpg
.Ve
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video frame size. The default is to capture the full screen if \fIdesktop\fR is selected, or the full window size if \fItitle=\fIwindow_title\fI\fR is selected.
.IP "\fBoffset_x\fR" 4
.IX Item "offset_x"
When capturing a region with \fIvideo_size\fR, set the distance from the left edge of the screen or desktop.
.Sp
Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative \fIoffset_x\fR value to move the region to that monitor.
.IP "\fBoffset_y\fR" 4
.IX Item "offset_y"
When capturing a region with \fIvideo_size\fR, set the distance from the top edge of the screen or desktop.
.Sp
Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative \fIoffset_y\fR value to move the region to that monitor.
.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 maximum 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 its \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>
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of channels. Default is 2.
.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
The suffix \*(L"+subcc\*(R" can be appended to the output label to create an extra
stream with the closed captions packets attached to that output
(experimental; only for \s-1EIA\-608 / CEA\-708\s0 for now).
The subcc streams are created after all the normal streams, in the order of
the corresponding stream.
For example, if there is \*(L"out19+subcc\*(R", \*(L"out7+subcc\*(R" and up to \*(L"out42\*(R", the
stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
.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.
.IP "\fBdumpgraph\fR" 4
.IX Item "dumpgraph"
Dump graph to stderr.
.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
.IP "\(bu" 4
Dump decoded frames to images and closed captions to a file (experimental):
.Sp
.Vb 1
\&        ffmpeg \-f lavfi \-i "movie=test.ts[out0+subcc]" \-map v frame%08d.png \-map s \-c copy \-f rawvideo subcc.bin
.Ve
.SS "libcdio"
.IX Subsection "libcdio"
Audio-CD input device based on libcdio.
.PP
To enable this input device during configuration you need libcdio
installed on your system. It requires the configure option
\&\f(CW\*(C`\-\-enable\-libcdio\*(C'\fR.
.PP
This device allows playing and grabbing from an Audio-CD.
.PP
For example to copy with \fBffmpeg\fR the entire Audio-CD in \fI/dev/sr0\fR,
you may run the command:
.PP
.Vb 1
\&        ffmpeg \-f libcdio \-i /dev/sr0 cd.wav
.Ve
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBspeed\fR" 4
.IX Item "speed"
Set drive reading speed. Default value is 0.
.Sp
The speed is specified CD-ROM speed units. The speed is set through
the libcdio \f(CW\*(C`cdio_cddap_speed_set\*(C'\fR function. On many CD-ROM
drives, specifying a value too large will result in using the fastest
speed.
.IP "\fBparanoia_mode\fR" 4
.IX Item "paranoia_mode"
Set paranoia recovery mode flags. It accepts one of the following values:
.RS 4
.IP "\fBdisable\fR" 4
.IX Item "disable"
.PD 0
.IP "\fBverify\fR" 4
.IX Item "verify"
.IP "\fBoverlap\fR" 4
.IX Item "overlap"
.IP "\fBneverskip\fR" 4
.IX Item "neverskip"
.IP "\fBfull\fR" 4
.IX Item "full"
.RE
.RS 4
.PD
.Sp
Default value is \fBdisable\fR.
.Sp
For more information about the available recovery modes, consult the
paranoia project documentation.
.RE
.SS "libdc1394"
.IX Subsection "libdc1394"
\&\s-1IIDC1394\s0 input device, based on libdc1394 and libraw1394.
.PP
Requires the configure option \f(CW\*(C`\-\-enable\-libdc1394\*(C'\fR.
.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 X\s0 Audio interface.
See <\fBhttp://developer.apple.com/technologies/mac/audio\-and\-video.html\fR>
.PP
This device allows one 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>
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Set the sample rate in Hz. Default is 48000.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of channels. Default is 2.
.SS "pulse"
.IX Subsection "pulse"
PulseAudio input device.
.PP
To enable this output device you need to configure FFmpeg with \f(CW\*(C`\-\-enable\-libpulse\*(C'\fR.
.PP
The filename to provide to the input device is a source device or the
string \*(L"default\*(R"
.PP
To list the PulseAudio source devices and their properties you can invoke
the command \fBpactl list sources\fR.
.PP
More information about PulseAudio can be found on <\fBhttp://www.pulseaudio.org\fR>.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBserver\fR" 4
.IX Item "server"
Connect to a specific PulseAudio server, specified by an \s-1IP\s0 address.
Default server is used when not provided.
.IP "\fBname\fR" 4
.IX Item "name"
Specify the application name PulseAudio will use when showing active clients,
by default it is the \f(CW\*(C`LIBAVFORMAT_IDENT\*(C'\fR string.
.IP "\fBstream_name\fR" 4
.IX Item "stream_name"
Specify the stream name PulseAudio will use when showing active streams,
by default it is \*(L"record\*(R".
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Specify the samplerate in Hz, by default 48kHz is used.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Specify the channels in use, by default 2 (stereo) is set.
.IP "\fBframe_size\fR" 4
.IX Item "frame_size"
Specify the number of bytes per frame, by default it is set to 1024.
.IP "\fBfragment_size\fR" 4
.IX Item "fragment_size"
Specify the minimal buffering fragment in PulseAudio, it will affect the
audio latency. By default it is unset.
.IP "\fBwallclock\fR" 4
.IX Item "wallclock"
Set the initial \s-1PTS\s0 using the current time. Default is 1.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Record a stream from default device:
.PP
.Vb 1
\&        ffmpeg \-f pulse \-i default /tmp/pulse.wav
.Ve
.SS "qtkit"
.IX Subsection "qtkit"
QTKit input device.
.PP
The filename passed as input is parsed to contain either a device name or index.
The device index can also be given by using \-video_device_index.
A given device index will override any given device name.
If the desired device consists of numbers only, use \-video_device_index to identify it.
The default device will be chosen if an empty string  or the device name \*(L"default\*(R" is given.
The available devices can be enumerated by using \-list_devices.
.PP
.Vb 1
\&        ffmpeg \-f qtkit \-i "0" out.mpg
\&
\&
\&        
\&        ffmpeg \-f qtkit \-video_device_index 0 \-i "" out.mpg
\&
\&
\&        
\&        ffmpeg \-f qtkit \-i "default" out.mpg
\&
\&
\&        
\&        ffmpeg \-f qtkit \-list_devices true \-i ""
.Ve
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBframe_rate\fR" 4
.IX Item "frame_rate"
Set frame rate. Default is 30.
.IP "\fBlist_devices\fR" 4
.IX Item "list_devices"
If set to \f(CW\*(C`true\*(C'\fR, print a list of devices and exit. Default is
\&\f(CW\*(C`false\*(C'\fR.
.IP "\fBvideo_device_index\fR" 4
.IX Item "video_device_index"
Select the video device by index for devices with the same name (starts at 0).
.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
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Set the sample rate in Hz. Default is 48000.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set the number of channels. Default is 2.
.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), it is possible to use it with the
\&\f(CW\*(C`\-use_libv4l2\*(C'\fR input device option.
.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
List supported formats for a video4linux2 device:
.Sp
.Vb 1
\&        ffplay \-f video4linux2 \-list_formats all /dev/video0
.Ve
.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 one 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
.IP "\fBuse_libv4l2\fR" 4
.IX Item "use_libv4l2"
Use libv4l2 (v4l\-utils) conversion functions. Default is 0.
.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.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Set the video frame size.
.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.
.SS "x11grab"
.IX Subsection "x11grab"
X11 video input device.
.PP
To enable this input device during configuration you need libxcb
installed on your system. It will be automatically detected during
configuration.
.PP
Alternatively, the configure option \fB\-\-enable\-x11grab\fR exists
for legacy Xlib users.
.PP
This device allows one 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. \fBman X\fR) for more detailed
information.
.PP
Use the \fBxdpyinfo\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 \-framerate 25 \-video_size cif \-i :0.0 out.mpg
.Ve
.PP
Grab at position \f(CW\*(C`10,20\*(C'\fR:
.PP
.Vb 1
\&        ffmpeg \-f x11grab \-framerate 25 \-video_size 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 specifies
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 \-framerate 25 \-video_size 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 \-framerate 25 \-video_size 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.
.IP "\fBregion_border\fR" 4
.IX Item "region_border"
Set the region border thickness if \fB\-show_region 1\fR is used.
Range is 1 to 128 and default is 3 (XCB-based x11grab only).
.Sp
For example:
.Sp
.Vb 1
\&        ffmpeg \-f x11grab \-show_region 1 \-framerate 25 \-video_size 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 \-framerate 25 \-video_size 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.
.IP "\fBuse_shm\fR" 4
.IX Item "use_shm"
Use the MIT-SHM extension for shared memory. Default value is \f(CW1\fR.
It may be necessary to disable it for remote displays (legacy x11grab
only).
.IP "\fBgrab_x\fR" 4
.IX Item "grab_x"
.PD 0
.IP "\fBgrab_y\fR" 4
.IX Item "grab_y"
.PD
Set the grabbing region coordinates. They are expressed as offset from
the top left corner of the X11 window and correspond to the
\&\fIx_offset\fR and \fIy_offset\fR parameters in the device name. The
default value for both options is 0.
.SH "OUTPUT DEVICES"
.IX Header "OUTPUT DEVICES"
Output devices are configured elements in FFmpeg that can 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"\-devices\*(R" of the ff* tools will display the list of
enabled output devices.
.PP
A description of the currently available output devices follows.
.SS "alsa"
.IX Subsection "alsa"
\&\s-1ALSA \s0(Advanced Linux Sound Architecture) output device.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Play a file on default \s-1ALSA\s0 device:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-f alsa default
.Ve
.IP "\(bu" 4
Play a file on soundcard 1, audio device 7:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-f alsa hw:1,7
.Ve
.SS "caca"
.IX Subsection "caca"
\&\s-1CACA\s0 output device.
.PP
This output device allows one 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 "decklink"
.IX Subsection "decklink"
The decklink output device provides playback capabilities for Blackmagic
DeckLink devices.
.PP
To enable this output device, you need the Blackmagic DeckLink \s-1SDK\s0 and you
need to configure with the appropriate \f(CW\*(C`\-\-extra\-cflags\*(C'\fR
and \f(CW\*(C`\-\-extra\-ldflags\*(C'\fR.
On Windows, you need to run the \s-1IDL\s0 files through \fBwidl\fR.
.PP
DeckLink is very picky about the formats it supports. Pixel format is always
uyvy422, framerate and video size must be determined for your device with
\&\fB\-list_formats 1\fR. Audio sample rate is always 48 kHz.
.PP
\fIOptions\fR
.IX Subsection "Options"
.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.
.IP "\fBlist_formats\fR" 4
.IX Item "list_formats"
If set to \fBtrue\fR, print a list of supported formats and exit.
Defaults to \fBfalse\fR.
.IP "\fBpreroll\fR" 4
.IX Item "preroll"
Amount of time to preroll video in seconds.
Defaults to \fB0.5\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
List output devices:
.Sp
.Vb 1
\&        ffmpeg \-i test.avi \-f decklink \-list_devices 1 dummy
.Ve
.IP "\(bu" 4
List supported formats:
.Sp
.Vb 1
\&        ffmpeg \-i test.avi \-f decklink \-list_formats 1 \*(AqDeckLink Mini Monitor\*(Aq
.Ve
.IP "\(bu" 4
Play video clip:
.Sp
.Vb 1
\&        ffmpeg \-i test.avi \-f decklink \-pix_fmt uyvy422 \*(AqDeckLink Mini Monitor\*(Aq
.Ve
.IP "\(bu" 4
Play video clip with non-standard framerate or video size:
.Sp
.Vb 1
\&        ffmpeg \-i test.avi \-f decklink \-pix_fmt uyvy422 \-s 720x486 \-r 24000/1001 \*(AqDeckLink Mini Monitor\*(Aq
.Ve
.SS "fbdev"
.IX Subsection "fbdev"
Linux framebuffer output 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
\&\fIDocumentation/fb/framebuffer.txt\fR included in the Linux source tree.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBxoffset\fR" 4
.IX Item "xoffset"
.PD 0
.IP "\fByoffset\fR" 4
.IX Item "yoffset"
.PD
Set x/y coordinate of top left corner. Default is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Play a file on framebuffer device \fI/dev/fb0\fR.
Required pixel format depends on current framebuffer settings.
.PP
.Vb 1
\&        ffmpeg \-re \-i INPUT \-vcodec rawvideo \-pix_fmt bgra \-f fbdev /dev/fb0
.Ve
.PP
See also <\fBhttp://linux\-fbdev.sourceforge.net/\fR>, and \fIfbset\fR\|(1).
.SS "opengl"
.IX Subsection "opengl"
OpenGL output device.
.PP
To enable this output device you need to configure FFmpeg with \f(CW\*(C`\-\-enable\-opengl\*(C'\fR.
.PP
This output device allows one to render to OpenGL context.
Context may be provided by application or default \s-1SDL\s0 window is created.
.PP
When device renders to external context, application must implement handlers for following messages:
\&\f(CW\*(C`AV_DEV_TO_APP_CREATE_WINDOW_BUFFER\*(C'\fR \- create OpenGL context on current thread.
\&\f(CW\*(C`AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER\*(C'\fR \- make OpenGL context current.
\&\f(CW\*(C`AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER\*(C'\fR \- swap buffers.
\&\f(CW\*(C`AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER\*(C'\fR \- destroy OpenGL context.
Application is also required to inform a device about current resolution by sending \f(CW\*(C`AV_APP_TO_DEV_WINDOW_SIZE\*(C'\fR message.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBbackground\fR" 4
.IX Item "background"
Set background color. Black is a default.
.IP "\fBno_window\fR" 4
.IX Item "no_window"
Disables default \s-1SDL\s0 window when set to non-zero value.
Application must provide OpenGL context and both \f(CW\*(C`window_size_cb\*(C'\fR and \f(CW\*(C`window_swap_buffers_cb\*(C'\fR callbacks when set.
.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.
Ignored when \fBno_window\fR is set.
.IP "\fBwindow_size\fR" 4
.IX Item "window_size"
Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
Mostly usable when \fBno_window\fR is not set.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Play a file on \s-1SDL\s0 window using OpenGL rendering:
.PP
.Vb 1
\&        ffmpeg  \-i INPUT \-f opengl "window title"
.Ve
.SS "oss"
.IX Subsection "oss"
\&\s-1OSS \s0(Open Sound System) output device.
.SS "pulse"
.IX Subsection "pulse"
PulseAudio output device.
.PP
To enable this output device you need to configure FFmpeg with \f(CW\*(C`\-\-enable\-libpulse\*(C'\fR.
.PP
More information about PulseAudio can be found on <\fBhttp://www.pulseaudio.org\fR>
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBserver\fR" 4
.IX Item "server"
Connect to a specific PulseAudio server, specified by an \s-1IP\s0 address.
Default server is used when not provided.
.IP "\fBname\fR" 4
.IX Item "name"
Specify the application name PulseAudio will use when showing active clients,
by default it is the \f(CW\*(C`LIBAVFORMAT_IDENT\*(C'\fR string.
.IP "\fBstream_name\fR" 4
.IX Item "stream_name"
Specify the stream name PulseAudio will use when showing active streams,
by default it is set to the specified output name.
.IP "\fBdevice\fR" 4
.IX Item "device"
Specify the device to use. Default device is used when not provided.
List of output devices can be obtained with command \fBpactl list sinks\fR.
.IP "\fBbuffer_size\fR" 4
.IX Item "buffer_size"
.PD 0
.IP "\fBbuffer_duration\fR" 4
.IX Item "buffer_duration"
.PD
Control the size and duration of the PulseAudio buffer. A small buffer
gives more control, but requires more frequent updates.
.Sp
\&\fBbuffer_size\fR specifies size in bytes while
\&\fBbuffer_duration\fR specifies duration in milliseconds.
.Sp
When both options are provided then the highest value is used
(duration is recalculated to bytes using stream parameters). If they
are set to 0 (which is default), the device will use the default
PulseAudio duration value. By default PulseAudio set buffer duration
to around 2 seconds.
.IP "\fBprebuf\fR" 4
.IX Item "prebuf"
Specify pre-buffering size in bytes. The server does not start with
playback before at least \fBprebuf\fR bytes are available in the
buffer. By default this option is initialized to the same value as
\&\fBbuffer_size\fR or \fBbuffer_duration\fR (whichever is bigger).
.IP "\fBminreq\fR" 4
.IX Item "minreq"
Specify minimum request size in bytes. The server does not request less
than \fBminreq\fR bytes from the client, instead waits until the buffer
is free enough to request more bytes at once. It is recommended to not set
this option, which will initialize this to a value that is deemed sensible
by the server.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Play a file on default device on default server:
.PP
.Vb 1
\&        ffmpeg  \-i INPUT \-f pulse "stream name"
.Ve
.SS "sdl"
.IX Subsection "sdl"
\&\s-1SDL \s0(Simple DirectMedia Layer) output device.
.PP
This output device allows one 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.
.IP "\fBwindow_fullscreen\fR" 4
.IX Item "window_fullscreen"
Set fullscreen mode when non-zero value is provided.
Default value is zero.
.PP
\fIInteractive commands\fR
.IX Subsection "Interactive commands"
.PP
The window created by the device can be controlled through the
following interactive commands.
.IP "\fBq, \s-1ESC\s0\fR" 4
.IX Item "q, ESC"
Quit the device immediately.
.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.
.SS "xv"
.IX Subsection "xv"
\&\s-1XV \s0(XVideo) output device.
.PP
This output device allows one to show a video stream in a X Window System
window.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBdisplay_name\fR" 4
.IX Item "display_name"
Specify the hardware display name, which determines the display and
communications domain to be used.
.Sp
The display name or \s-1DISPLAY\s0 environment variable can be a string in
the format \fIhostname\fR[:\fInumber\fR[.\fIscreen_number\fR]].
.Sp
\&\fIhostname\fR specifies the name of the host machine on which the
display is physically attached. \fInumber\fR specifies the number of
the display server on that host machine. \fIscreen_number\fR specifies
the screen to be used on that server.
.Sp
If unspecified, it defaults to the value of the \s-1DISPLAY\s0 environment
variable.
.Sp
For example, \f(CW\*(C`dual\-headed:0.1\*(C'\fR would specify screen 1 of display
0 on the machine named ``dual\-headed''.
.Sp
Check the X11 specification for more detailed information about the
display name format.
.IP "\fBwindow_id\fR" 4
.IX Item "window_id"
When set to non-zero value then device doesn't create new window,
but uses existing one with provided \fIwindow_id\fR. By default
this options is set to zero and device creates its own window.
.IP "\fBwindow_size\fR" 4
.IX Item "window_size"
Set the created 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.
Ignored when \fIwindow_id\fR is set.
.IP "\fBwindow_x\fR" 4
.IX Item "window_x"
.PD 0
.IP "\fBwindow_y\fR" 4
.IX Item "window_y"
.PD
Set the X and Y window offsets for the created window. They are both
set to 0 by default. The values may be ignored by the window manager.
Ignored when \fIwindow_id\fR is set.
.IP "\fBwindow_title\fR" 4
.IX Item "window_title"
Set the window title, if not specified default to the filename
specified for the output device. Ignored when \fIwindow_id\fR is set.
.PP
For more information about XVideo see <\fBhttp://www.x.org/\fR>.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Decode, display and encode video input with \fBffmpeg\fR at the
same time:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT OUTPUT \-f xv display
.Ve
.IP "\(bu" 4
Decode and display the input video to multiple X11 windows:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-f xv normal \-vf negate \-f xv negated
.Ve
.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"
.PD 0
.IP "\fBocl, out_channel_layout\fR" 4
.IX Item "ocl, out_channel_layout"
.PD
Set the input/output channel layout.
.Sp
See \fBthe Channel Layout section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the required syntax.
.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 "\fBrematrix_maxval\fR" 4
.IX Item "rematrix_maxval"
Set maximum output value for rematrixing.
This can be used to prevent clipping vs. preventing volume reduction.
A value of 1.0 prevents clipping.
.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, exact_rational, 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 "\fBexact_rational\fR" 4
.IX Item "exact_rational"
For swr only, when enabled, try to use exact phase_count based on input and
output sample rate. However, if it is larger than \f(CW\*(C`1 << phase_shift\*(C'\fR,
the phase_count will be \f(CW\*(C`1 << phase_shift\*(C'\fR as fallback. Default is disabled.
.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 a double float value in the
interval [2,16], default value is 9.
.IP "\fBoutput_sample_bits\fR" 4
.IX Item "output_sample_bits"
For swr only, set number of used output sample bits for dithering. Must be an integer in the
interval [0,64], default value is 0, which means it's not used.
.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 "\fBbicublin\fR" 4
.IX Item "bicublin"
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.
.IP "\fBsws_dither\fR" 4
.IX Item "sws_dither"
Set the dithering algorithm. Accepts one of the following
values. Default value is \fBauto\fR.
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
automatic choice
.IP "\fBnone\fR" 4
.IX Item "none"
no dithering
.IP "\fBbayer\fR" 4
.IX Item "bayer"
bayer dither
.IP "\fBed\fR" 4
.IX Item "ed"
error diffusion dither
.IP "\fBa_dither\fR" 4
.IX Item "a_dither"
arithmetic dither, based using addition
.IP "\fBx_dither\fR" 4
.IX Item "x_dither"
arithmetic dither, based using xor (more random/less apparent patterning that
a_dither).
.RE
.RS 4
.RE
.IP "\fBalphablend\fR" 4
.IX Item "alphablend"
Set the alpha blending to use when the input has alpha but the output does not.
Default value is \fBnone\fR.
.RS 4
.IP "\fBuniform_color\fR" 4
.IX Item "uniform_color"
Blend onto a uniform background color
.IP "\fBcheckerboard\fR" 4
.IX Item "checkerboard"
Blend onto a checkerboard
.IP "\fBnone\fR" 4
.IX Item "none"
No blending
.RE
.RS 4
.RE
.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 5
\&                        [main]
\&        input \-\-> split \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> overlay \-\-> output
\&                    |                             ^
\&                    |[tmp]                  [flip]|
\&                    +\-\-\-\-\-> crop \-\-> vflip \-\-\-\-\-\-\-+
.Ve
.PP
This filtergraph splits the input stream in two streams, then 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 the top half of the video is mirrored
onto the bottom half of the output video.
.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 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", and a filter with no
output pads is called a \*(L"sink\*(R".
.SS "Filtergraph syntax"
.IX Subsection "Filtergraph syntax"
A filtergraph has a textual representation, which is recognized by the
\&\fB\-filter\fR/\fB\-vf\fR/\fB\-af\fR and
\&\fB\-filter_complex\fR options in \fBffmpeg\fR and
\&\fB\-vf\fR/\fB\-af\fR in \fBffplay\fR, and by the
\&\f(CW\*(C`avfilter_graph_parse_ptr()\*(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 two 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
\&\fB|\fR.
.PP
The list of arguments can be quoted using the character \fB'\fR as initial
and ending mark, and the character \fB\e\fR for escaping the characters
within the quoted text; otherwise the argument string is considered
terminated when the next special character (belonging to the set
\&\fB[]=;,\fR) 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 one 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 filter description, if the input label of the first filter is not
specified, \*(L"in\*(R" is assumed; if the output label of the last filter is not
specified, \*(L"out\*(R" is assumed.
.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 \fBscale\fR 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
Here is a \s-1BNF\s0 description of the filtergraph syntax:
.PP
.Vb 7
\&        <NAME>             ::= sequence of alphanumeric characters and \*(Aq_\*(Aq
\&        <LINKLABEL>        ::= "[" <NAME> "]"
\&        <LINKLABELS>       ::= <LINKLABEL> [<LINKLABELS>]
\&        <FILTER_ARGUMENTS> ::= sequence of chars (possibly 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"
Filtergraph description composition entails several levels of
escaping. See \fBthe \*(L"Quoting and escaping\*(R"
section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR for more
information about the employed escaping procedure.
.PP
A first level escaping affects the content of each filter option
value, which may contain the special character \f(CW\*(C`:\*(C'\fR used to
separate values, or one of the escaping characters \f(CW\*(C`\e\*(Aq\*(C'\fR.
.PP
A second level escaping affects the whole filter description, which
may contain the escaping characters \f(CW\*(C`\e\*(Aq\*(C'\fR or the special
characters \f(CW\*(C`[],;\*(C'\fR used by the filtergraph description.
.PP
Finally, when you specify a filtergraph on a shell commandline, you
need to perform a third level escaping for the shell special
characters contained within it.
.PP
For example, consider the following string to be embedded in
the \fBdrawtext\fR filter description \fBtext\fR value:
.PP
.Vb 1
\&        this is a \*(Aqstring\*(Aq: may contain one, or more, special characters
.Ve
.PP
This string contains the \f(CW\*(C`\*(Aq\*(C'\fR special escaping character, and the
\&\f(CW\*(C`:\*(C'\fR special character, so it needs to be escaped in this way:
.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
description 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
(note that in addition to the \f(CW\*(C`\e\*(Aq\*(C'\fR escaping special characters,
also \f(CW\*(C`,\*(C'\fR needs to be escaped).
.PP
Finally an additional level of escaping is 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
.SH "TIMELINE EDITING"
.IX Header "TIMELINE EDITING"
Some filters support a generic \fBenable\fR option. For the filters
supporting timeline editing, this option can be set to an expression which is
evaluated before sending a frame to the filter. If the evaluation is non-zero,
the filter will be enabled, otherwise the frame will be sent unchanged to the
next filter in the filtergraph.
.PP
The expression accepts the following values:
.IP "\fBt\fR" 4
.IX Item "t"
timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
.IP "\fBn\fR" 4
.IX Item "n"
sequential number of the 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 "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
width and height of the input frame if video
.PP
Additionally, these filters support an \fBenable\fR command that can be used
to re-define the expression.
.PP
Like any other filtering option, the \fBenable\fR option follows the same
rules.
.PP
For example, to enable a blur filter (\fBsmartblur\fR) from 10 seconds to 3
minutes, and a \fBcurves\fR filter starting at 3 seconds:
.PP
.Vb 2
\&        smartblur = enable=\*(Aqbetween(t,10,3*60)\*(Aq,
\&        curves    = enable=\*(Aqgte(t,3)\*(Aq : preset=cross_process
.Ve
.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 "acompressor"
.IX Subsection "acompressor"
A compressor is mainly used to reduce the dynamic range of a signal.
Especially modern music is mostly compressed at a high ratio to
improve the overall loudness. It's done to get the highest attention
of a listener, \*(L"fatten\*(R" the sound and bring more \*(L"power\*(R" to the track.
If a signal is compressed too much it may sound dull or \*(L"dead\*(R"
afterwards or it may start to \*(L"pump\*(R" (which could be a powerful effect
but can also destroy a track completely).
The right compression is the key to reach a professional sound and is
the high art of mixing and mastering. Because of its complex settings
it may take a long time to get the right feeling for this kind of effect.
.PP
Compression is done by detecting the volume above a chosen level
\&\f(CW\*(C`threshold\*(C'\fR and dividing it by the factor set with \f(CW\*(C`ratio\*(C'\fR.
So if you set the threshold to \-12dB and your signal reaches \-6dB a ratio
of 2:1 will result in a signal at \-9dB. Because an exact manipulation of
the signal would cause distortion of the waveform the reduction can be
levelled over the time. This is done by setting \*(L"Attack\*(R" and \*(L"Release\*(R".
\&\f(CW\*(C`attack\*(C'\fR determines how long the signal has to rise above the threshold
before any reduction will occur and \f(CW\*(C`release\*(C'\fR sets the time the signal
has to fall below the threshold to reduce the reduction again. Shorter signals
than the chosen attack time will be left untouched.
The overall reduction of the signal can be made up afterwards with the
\&\f(CW\*(C`makeup\*(C'\fR setting. So compressing the peaks of a signal about 6dB and
raising the makeup to this level results in a signal twice as loud than the
source. To gain a softer entry in the compression the \f(CW\*(C`knee\*(C'\fR flattens the
hard edge at the threshold in the range of the chosen decibels.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input gain. Default is 1. Range is between 0.015625 and 64.
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
If a signal of second stream rises above this level it will affect the gain
reduction of the first stream.
By default it is 0.125. Range is between 0.00097563 and 1.
.IP "\fBratio\fR" 4
.IX Item "ratio"
Set a ratio by which the signal is reduced. 1:2 means that if the level
rose 4dB above the threshold, it will be only 2dB above after the reduction.
Default is 2. Range is between 1 and 20.
.IP "\fBattack\fR" 4
.IX Item "attack"
Amount of milliseconds the signal has to rise above the threshold before gain
reduction starts. Default is 20. Range is between 0.01 and 2000.
.IP "\fBrelease\fR" 4
.IX Item "release"
Amount of milliseconds the signal has to fall below the threshold before
reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
.IP "\fBmakeup\fR" 4
.IX Item "makeup"
Set the amount by how much signal will be amplified after processing.
Default is 2. Range is from 1 and 64.
.IP "\fBknee\fR" 4
.IX Item "knee"
Curve the sharp knee around the threshold to enter gain reduction more softly.
Default is 2.82843. Range is between 1 and 8.
.IP "\fBlink\fR" 4
.IX Item "link"
Choose if the \f(CW\*(C`average\*(C'\fR level between all channels of input stream
or the louder(\f(CW\*(C`maximum\*(C'\fR) channel of input stream affects the
reduction. Default is \f(CW\*(C`average\*(C'\fR.
.IP "\fBdetection\fR" 4
.IX Item "detection"
Should the exact signal be taken in case of \f(CW\*(C`peak\*(C'\fR or an \s-1RMS\s0 one in case
of \f(CW\*(C`rms\*(C'\fR. Default is \f(CW\*(C`rms\*(C'\fR which is mostly smoother.
.IP "\fBmix\fR" 4
.IX Item "mix"
How much to use compressed signal in output. Default is 1.
Range is between 0 and 1.
.SS "acrossfade"
.IX Subsection "acrossfade"
Apply cross fade from one input audio stream to another input audio stream.
The cross fade is applied for specified duration near the end of first stream.
.PP
The filter accepts the following options:
.IP "\fBnb_samples, ns\fR" 4
.IX Item "nb_samples, ns"
Specify the number of samples for which the cross fade effect has to last.
At the end of the cross fade effect the first input audio will be completely
silent. Default is 44100.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Specify the duration of the cross fade effect. See
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
By default the duration is determined by \fInb_samples\fR.
If set this option is used instead of \fInb_samples\fR.
.IP "\fBoverlap, o\fR" 4
.IX Item "overlap, o"
Should first stream end overlap with second stream start. Default is enabled.
.IP "\fBcurve1\fR" 4
.IX Item "curve1"
Set curve for cross fade transition for first stream.
.IP "\fBcurve2\fR" 4
.IX Item "curve2"
Set curve for cross fade transition for second stream.
.Sp
For description of available curve types see \fBafade\fR filter description.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Cross fade from one input to another:
.Sp
.Vb 1
\&        ffmpeg \-i first.flac \-i second.flac \-filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
.Ve
.IP "\(bu" 4
Cross fade from one input to another but without overlapping:
.Sp
.Vb 1
\&        ffmpeg \-i first.flac \-i second.flac \-filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
.Ve
.SS "acrusher"
.IX Subsection "acrusher"
Reduce audio bit resolution.
.PP
This filter is bit crusher with enhanced functionality. A bit crusher
is used to audibly reduce number of bits an audio signal is sampled
with. This doesn't change the bit depth at all, it just produces the
effect. Material reduced in bit depth sounds more harsh and \*(L"digital\*(R".
This filter is able to even round to continuous values instead of discrete
bit depths.
Additionally it has a D/C offset which results in different crushing of
the lower and the upper half of the signal.
An Anti-Aliasing setting is able to produce \*(L"softer\*(R" crushing sounds.
.PP
Another feature of this filter is the logarithmic mode.
This setting switches from linear distances between bits to logarithmic ones.
The result is a much more \*(L"natural\*(R" sounding crusher which doesn't gate low
signals for example. The human ear has a logarithmic perception, too
so this kind of crushing is much more pleasant.
Logarithmic crushing is also able to get anti-aliased.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set level in.
.IP "\fBlevel_out\fR" 4
.IX Item "level_out"
Set level out.
.IP "\fBbits\fR" 4
.IX Item "bits"
Set bit reduction.
.IP "\fBmix\fR" 4
.IX Item "mix"
Set mixing amount.
.IP "\fBmode\fR" 4
.IX Item "mode"
Can be linear: \f(CW\*(C`lin\*(C'\fR or logarithmic: \f(CW\*(C`log\*(C'\fR.
.IP "\fBdc\fR" 4
.IX Item "dc"
Set \s-1DC.\s0
.IP "\fBaa\fR" 4
.IX Item "aa"
Set anti-aliasing.
.IP "\fBsamples\fR" 4
.IX Item "samples"
Set sample reduction.
.IP "\fBlfo\fR" 4
.IX Item "lfo"
Enable \s-1LFO.\s0 By default disabled.
.IP "\fBlforange\fR" 4
.IX Item "lforange"
Set \s-1LFO\s0 range.
.IP "\fBlforate\fR" 4
.IX Item "lforate"
Set \s-1LFO\s0 rate.
.SS "adelay"
.IX Subsection "adelay"
Delay one or more audio channels.
.PP
Samples in delayed channel are filled with silence.
.PP
The filter accepts the following option:
.IP "\fBdelays\fR" 4
.IX Item "delays"
Set list of delays in milliseconds for each channel separated by '|'.
At least one delay greater than 0 should be provided.
Unused delays will be silently ignored. If number of given delays is
smaller than number of channels all remaining channels will not be delayed.
If you want to delay exact number of samples, append 'S' to number.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
the second channel (and any other channels that may be present) unchanged.
.Sp
.Vb 1
\&        adelay=1500|0|500
.Ve
.IP "\(bu" 4
Delay second channel by 500 samples, the third channel by 700 samples and leave
the first channel (and any other channels that may be present) unchanged.
.Sp
.Vb 1
\&        adelay=0|500S|700S
.Ve
.SS "aecho"
.IX Subsection "aecho"
Apply echoing to the input audio.
.PP
Echoes are reflected sound and can occur naturally amongst mountains
(and sometimes large buildings) when talking or shouting; digital echo
effects emulate this behaviour and are often used to help fill out the
sound of a single instrument or vocal. The time difference between the
original signal and the reflection is the \f(CW\*(C`delay\*(C'\fR, and the
loudness of the reflected signal is the \f(CW\*(C`decay\*(C'\fR.
Multiple echoes can have different delays and decays.
.PP
A description of the accepted parameters follows.
.IP "\fBin_gain\fR" 4
.IX Item "in_gain"
Set input gain of reflected signal. Default is \f(CW0.6\fR.
.IP "\fBout_gain\fR" 4
.IX Item "out_gain"
Set output gain of reflected signal. Default is \f(CW0.3\fR.
.IP "\fBdelays\fR" 4
.IX Item "delays"
Set list of time intervals in milliseconds between original signal and reflections
separated by '|'. Allowed range for each \f(CW\*(C`delay\*(C'\fR is \f(CW\*(C`(0 \- 90000.0]\*(C'\fR.
Default is \f(CW1000\fR.
.IP "\fBdecays\fR" 4
.IX Item "decays"
Set list of loudnesses of reflected signals separated by '|'.
Allowed range for each \f(CW\*(C`decay\*(C'\fR is \f(CW\*(C`(0 \- 1.0]\*(C'\fR.
Default is \f(CW0.5\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Make it sound as if there are twice as many instruments as are actually playing:
.Sp
.Vb 1
\&        aecho=0.8:0.88:60:0.4
.Ve
.IP "\(bu" 4
If delay is very short, then it sound like a (metallic) robot playing music:
.Sp
.Vb 1
\&        aecho=0.8:0.88:6:0.4
.Ve
.IP "\(bu" 4
A longer delay will sound like an open air concert in the mountains:
.Sp
.Vb 1
\&        aecho=0.8:0.9:1000:0.3
.Ve
.IP "\(bu" 4
Same as above but with one more mountain:
.Sp
.Vb 1
\&        aecho=0.8:0.9:1000|1800:0.3|0.25
.Ve
.SS "aemphasis"
.IX Subsection "aemphasis"
Audio emphasis filter creates or restores material directly taken from LPs or
emphased CDs with different filter curves. E.g. to store music on vinyl the
signal has to be altered by a filter first to even out the disadvantages of
this recording medium.
Once the material is played back the inverse filter has to be applied to
restore the distortion of the frequency response.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input gain.
.IP "\fBlevel_out\fR" 4
.IX Item "level_out"
Set output gain.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set filter mode. For restoring material use \f(CW\*(C`reproduction\*(C'\fR mode, otherwise
use \f(CW\*(C`production\*(C'\fR mode. Default is \f(CW\*(C`reproduction\*(C'\fR mode.
.IP "\fBtype\fR" 4
.IX Item "type"
Set filter type. Selects medium. Can be one of the following:
.RS 4
.IP "\fBcol\fR" 4
.IX Item "col"
select Columbia.
.IP "\fBemi\fR" 4
.IX Item "emi"
select \s-1EMI.\s0
.IP "\fBbsi\fR" 4
.IX Item "bsi"
select \s-1BSI \s0(78RPM).
.IP "\fBriaa\fR" 4
.IX Item "riaa"
select \s-1RIAA.\s0
.IP "\fBcd\fR" 4
.IX Item "cd"
select Compact Disc (\s-1CD\s0).
.IP "\fB50fm\fR" 4
.IX Item "50fm"
select 50Xs (\s-1FM\s0).
.IP "\fB75fm\fR" 4
.IX Item "75fm"
select 75Xs (\s-1FM\s0).
.IP "\fB50kf\fR" 4
.IX Item "50kf"
select 50Xs (FM-KF).
.IP "\fB75kf\fR" 4
.IX Item "75kf"
select 75Xs (FM-KF).
.RE
.RS 4
.RE
.SS "aeval"
.IX Subsection "aeval"
Modify an audio signal according to the specified expressions.
.PP
This filter accepts one or more expressions (one for each channel),
which are evaluated and used to modify a corresponding audio signal.
.PP
It accepts the following parameters:
.IP "\fBexprs\fR" 4
.IX Item "exprs"
Set the '|'\-separated expressions list for each separate channel. If
the number of input channels is greater than the number of
expressions, the last specified expression is used for the remaining
output channels.
.IP "\fBchannel_layout, c\fR" 4
.IX Item "channel_layout, c"
Set output channel layout. If not specified, the channel layout is
specified by the number of expressions. If set to \fBsame\fR, it will
use by default the same input channel layout.
.PP
Each expression in \fIexprs\fR can contain the following constants and functions:
.IP "\fBch\fR" 4
.IX Item "ch"
channel number of the current expression
.IP "\fBn\fR" 4
.IX Item "n"
number of the evaluated sample, starting from 0
.IP "\fBs\fR" 4
.IX Item "s"
sample rate
.IP "\fBt\fR" 4
.IX Item "t"
time of the evaluated sample expressed in seconds
.IP "\fBnb_in_channels\fR" 4
.IX Item "nb_in_channels"
.PD 0
.IP "\fBnb_out_channels\fR" 4
.IX Item "nb_out_channels"
.PD
input and output number of channels
.IP "\fBval(\s-1CH\s0)\fR" 4
.IX Item "val(CH)"
the value of input channel with number \fI\s-1CH\s0\fR
.PP
Note: this filter is slow. For faster processing you should use a
dedicated filter.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Half volume:
.Sp
.Vb 1
\&        aeval=val(ch)/2:c=same
.Ve
.IP "\(bu" 4
Invert phase of the second channel:
.Sp
.Vb 1
\&        aeval=val(0)|\-val(1)
.Ve
.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 the start time of the fade effect. Default is 0.
The value must be specified as a time duration; see
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
If set this option is used instead of \fIstart_sample\fR.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Specify the duration of the fade effect. See
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
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.
By default the duration is determined by \fInb_samples\fR.
If set this option is used instead of \fInb_samples\fR.
.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 "\fBipar\fR" 4
.IX Item "ipar"
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
.IP "\fBpar\fR" 4
.IX Item "par"
select parabola
.IP "\fBexp\fR" 4
.IX Item "exp"
select exponential
.IP "\fBiqsin\fR" 4
.IX Item "iqsin"
select inverted quarter of sine wave
.IP "\fBihsin\fR" 4
.IX Item "ihsin"
select inverted half of sine wave
.IP "\fBdese\fR" 4
.IX Item "dese"
select double-exponential seat
.IP "\fBdesi\fR" 4
.IX Item "desi"
select double-exponential sigmoid
.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:st=875:d=25
.Ve
.SS "afftfilt"
.IX Subsection "afftfilt"
Apply arbitrary expressions to samples in frequency domain.
.IP "\fBreal\fR" 4
.IX Item "real"
Set frequency domain real expression for each separate channel separated
by '|'. Default is \*(L"1\*(R".
If the number of input channels is greater than the number of
expressions, the last specified expression is used for the remaining
output channels.
.IP "\fBimag\fR" 4
.IX Item "imag"
Set frequency domain imaginary expression for each separate channel
separated by '|'. If not set, \fIreal\fR option is used.
.Sp
Each expression in \fIreal\fR and \fIimag\fR can contain the following
constants:
.RS 4
.IP "\fBsr\fR" 4
.IX Item "sr"
sample rate
.IP "\fBb\fR" 4
.IX Item "b"
current frequency bin number
.IP "\fBnb\fR" 4
.IX Item "nb"
number of available bins
.IP "\fBch\fR" 4
.IX Item "ch"
channel number of the current expression
.IP "\fBchs\fR" 4
.IX Item "chs"
number of channels
.IP "\fBpts\fR" 4
.IX Item "pts"
current frame pts
.RE
.RS 4
.RE
.IP "\fBwin_size\fR" 4
.IX Item "win_size"
Set window size.
.Sp
It accepts the following values:
.RS 4
.IP "\fBw16\fR" 4
.IX Item "w16"
.PD 0
.IP "\fBw32\fR" 4
.IX Item "w32"
.IP "\fBw64\fR" 4
.IX Item "w64"
.IP "\fBw128\fR" 4
.IX Item "w128"
.IP "\fBw256\fR" 4
.IX Item "w256"
.IP "\fBw512\fR" 4
.IX Item "w512"
.IP "\fBw1024\fR" 4
.IX Item "w1024"
.IP "\fBw2048\fR" 4
.IX Item "w2048"
.IP "\fBw4096\fR" 4
.IX Item "w4096"
.IP "\fBw8192\fR" 4
.IX Item "w8192"
.IP "\fBw16384\fR" 4
.IX Item "w16384"
.IP "\fBw32768\fR" 4
.IX Item "w32768"
.IP "\fBw65536\fR" 4
.IX Item "w65536"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`w4096\*(C'\fR
.RE
.IP "\fBwin_func\fR" 4
.IX Item "win_func"
Set window function. Default is \f(CW\*(C`hann\*(C'\fR.
.IP "\fBoverlap\fR" 4
.IX Item "overlap"
Set window overlap. If set to 1, the recommended overlap for selected
window function will be picked. Default is \f(CW0.75\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Leave almost only low frequencies in audio:
.Sp
.Vb 1
\&        afftfilt="1\-clip((b/nb)*b,0,1)"
.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
It accepts the following 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.
.Sp
See \fBthe Channel Layout section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the required syntax.
.PP
If a parameter is omitted, all values are allowed.
.PP
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 "agate"
.IX Subsection "agate"
A gate is mainly used to reduce lower parts of a signal. This kind of signal
processing reduces disturbing noise between useful signals.
.PP
Gating is done by detecting the volume below a chosen level \fIthreshold\fR
and dividing it by the factor set with \fIratio\fR. The bottom of the noise
floor is set via \fIrange\fR. Because an exact manipulation of the signal
would cause distortion of the waveform the reduction can be levelled over
time. This is done by setting \fIattack\fR and \fIrelease\fR.
.PP
\&\fIattack\fR determines how long the signal has to fall below the threshold
before any reduction will occur and \fIrelease\fR sets the time the signal
has to rise above the threshold to reduce the reduction again.
Shorter signals than the chosen attack time will be left untouched.
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input level before filtering.
Default is 1. Allowed range is from 0.015625 to 64.
.IP "\fBrange\fR" 4
.IX Item "range"
Set the level of gain reduction when the signal is below the threshold.
Default is 0.06125. Allowed range is from 0 to 1.
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
If a signal rises above this level the gain reduction is released.
Default is 0.125. Allowed range is from 0 to 1.
.IP "\fBratio\fR" 4
.IX Item "ratio"
Set a ratio by which the signal is reduced.
Default is 2. Allowed range is from 1 to 9000.
.IP "\fBattack\fR" 4
.IX Item "attack"
Amount of milliseconds the signal has to rise above the threshold before gain
reduction stops.
Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
.IP "\fBrelease\fR" 4
.IX Item "release"
Amount of milliseconds the signal has to fall below the threshold before the
reduction is increased again. Default is 250 milliseconds.
Allowed range is from 0.01 to 9000.
.IP "\fBmakeup\fR" 4
.IX Item "makeup"
Set amount of amplification of signal after processing.
Default is 1. Allowed range is from 1 to 64.
.IP "\fBknee\fR" 4
.IX Item "knee"
Curve the sharp knee around the threshold to enter gain reduction more softly.
Default is 2.828427125. Allowed range is from 1 to 8.
.IP "\fBdetection\fR" 4
.IX Item "detection"
Choose if exact signal should be taken for detection or an \s-1RMS\s0 like one.
Default is \f(CW\*(C`rms\*(C'\fR. Can be \f(CW\*(C`peak\*(C'\fR or \f(CW\*(C`rms\*(C'\fR.
.IP "\fBlink\fR" 4
.IX Item "link"
Choose if the average level between all channels or the louder channel affects
the reduction.
Default is \f(CW\*(C`average\*(C'\fR. Can be \f(CW\*(C`average\*(C'\fR or \f(CW\*(C`maximum\*(C'\fR.
.SS "alimiter"
.IX Subsection "alimiter"
The limiter prevents an input signal from rising over a desired threshold.
This limiter uses lookahead technology to prevent your signal from distorting.
It means that there is a small delay after the signal is processed. Keep in mind
that the delay it produces is the attack time you set.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input gain. Default is 1.
.IP "\fBlevel_out\fR" 4
.IX Item "level_out"
Set output gain. Default is 1.
.IP "\fBlimit\fR" 4
.IX Item "limit"
Don't let signals above this level pass the limiter. Default is 1.
.IP "\fBattack\fR" 4
.IX Item "attack"
The limiter will reach its attenuation level in this amount of time in
milliseconds. Default is 5 milliseconds.
.IP "\fBrelease\fR" 4
.IX Item "release"
Come back from limiting to attenuation 1.0 in this amount of milliseconds.
Default is 50 milliseconds.
.IP "\fBasc\fR" 4
.IX Item "asc"
When gain reduction is always needed \s-1ASC\s0 takes care of releasing to an
average reduction level rather than reaching a reduction of 0 in the release
time.
.IP "\fBasc_level\fR" 4
.IX Item "asc_level"
Select how much the release time is affected by \s-1ASC, 0\s0 means nearly no changes
in release time while 1 produces higher release times.
.IP "\fBlevel\fR" 4
.IX Item "level"
Auto level output signal. Default is enabled.
This normalizes audio back to 0dB if enabled.
.PP
Depending on picked setting it is recommended to upsample input 2x or 4x times
with \fBaresample\fR before applying this filter.
.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 "aloop"
.IX Subsection "aloop"
Loop audio samples.
.PP
The filter accepts the following options:
.IP "\fBloop\fR" 4
.IX Item "loop"
Set the number of loops.
.IP "\fBsize\fR" 4
.IX Item "size"
Set maximal number of samples.
.IP "\fBstart\fR" 4
.IX Item "start"
Set first sample of loop.
.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
Note that this filter only supports float samples (the \fIamerge\fR
and \fIpan\fR audio filters support many formats). If the \fIamix\fR
input has integer samples then \fBaresample\fR will be automatically
inserted to perform the conversion to float samples.
.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
It accepts the following parameters:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
The 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"
The duration of the longest input. (default)
.IP "\fBshortest\fR" 4
.IX Item "shortest"
The duration of the shortest input.
.IP "\fBfirst\fR" 4
.IX Item "first"
The duration of the first input.
.RE
.RS 4
.RE
.IP "\fBdropout_transition\fR" 4
.IX Item "dropout_transition"
The transition time, in seconds, for volume renormalization when an input
stream ends. The default value is 2 seconds.
.SS "anequalizer"
.IX Subsection "anequalizer"
High-order parametric multiband equalizer for each channel.
.PP
It accepts the following parameters:
.IP "\fBparams\fR" 4
.IX Item "params"
This option string is in format:
"c\fIchn\fR f=\fIcf\fR w=\fIw\fR g=\fIg\fR t=\fIf\fR | ..."
Each equalizer band is separated by '|'.
.RS 4
.IP "\fBchn\fR" 4
.IX Item "chn"
Set channel number to which equalization will be applied.
If input doesn't have that channel the entry is ignored.
.IP "\fBf\fR" 4
.IX Item "f"
Set central frequency for band.
If input doesn't have that frequency the entry is ignored.
.IP "\fBw\fR" 4
.IX Item "w"
Set band width in hertz.
.IP "\fBg\fR" 4
.IX Item "g"
Set band gain in dB.
.IP "\fBt\fR" 4
.IX Item "t"
Set filter type for band, optional, can be:
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
Butterworth, this is default.
.IP "\fB1\fR" 4
.IX Item "1"
Chebyshev type 1.
.IP "\fB2\fR" 4
.IX Item "2"
Chebyshev type 2.
.RE
.RS 4
.RE
.RE
.RS 4
.RE
.IP "\fBcurves\fR" 4
.IX Item "curves"
With this option activated frequency response of anequalizer is displayed
in video stream.
.IP "\fBsize\fR" 4
.IX Item "size"
Set video stream size. Only useful if curves option is activated.
.IP "\fBmgain\fR" 4
.IX Item "mgain"
Set max gain that will be displayed. Only useful if curves option is activated.
Setting this to a reasonable value makes it possible to display gain which is derived from
neighbour bands which are too close to each other and thus produce higher gain
when both are activated.
.IP "\fBfscale\fR" 4
.IX Item "fscale"
Set frequency scale used to draw frequency response in video output.
Can be linear or logarithmic. Default is logarithmic.
.IP "\fBcolors\fR" 4
.IX Item "colors"
Set color for each channel curve which is going to be displayed in video stream.
This is list of color names separated by space or by '|'.
Unrecognised or missing colors will be replaced by white color.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Lower gain by 10 of central frequency 200Hz and width 100 Hz
for first 2 channels using Chebyshev type 1 filter:
.Sp
.Vb 1
\&        anequalizer=c0 f=200 w=100 g=\-10 t=1|c1 f=200 w=100 g=\-10 t=1
.Ve
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBchange\fR" 4
.IX Item "change"
Alter existing filter parameters.
Syntax for the commands is : "\fIfN\fR|f=\fIfreq\fR|w=\fIwidth\fR|g=\fIgain\fR"
.Sp
\&\fIfN\fR is existing filter number, starting from 0, if no such filter is available
error is returned.
\&\fIfreq\fR set new frequency parameter.
\&\fIwidth\fR set new width parameter in herz.
\&\fIgain\fR set new gain parameter in dB.
.Sp
Full filter invocation with asendcmd may look like this:
asendcmd=c='4.0 anequalizer change 0|f=200|w=50|g=1',anequalizer=...
.SS "anull"
.IX Subsection "anull"
Pass the audio source unchanged to the output.
.SS "apad"
.IX Subsection "apad"
Pad the end of an audio stream with silence.
.PP
This can be used together with \fBffmpeg\fR \fB\-shortest\fR to
extend audio streams to the same length as the video stream.
.PP
A description of the accepted options follows.
.IP "\fBpacket_size\fR" 4
.IX Item "packet_size"
Set silence packet size. Default value is 4096.
.IP "\fBpad_len\fR" 4
.IX Item "pad_len"
Set the number of samples of silence to add to the end. After the
value is reached, the stream is terminated. This option is mutually
exclusive with \fBwhole_len\fR.
.IP "\fBwhole_len\fR" 4
.IX Item "whole_len"
Set the minimum total number of samples in the output audio stream. If
the value is longer than the input audio length, silence is added to
the end, until the value is reached. This option is mutually exclusive
with \fBpad_len\fR.
.PP
If neither the \fBpad_len\fR nor the \fBwhole_len\fR option is
set, the filter will add silence to the end of the input stream
indefinitely.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Add 1024 samples of silence to the end of the input:
.Sp
.Vb 1
\&        apad=pad_len=1024
.Ve
.IP "\(bu" 4
Make sure the audio output will contain at least 10000 samples, pad
the input with silence if required:
.Sp
.Vb 1
\&        apad=whole_len=10000
.Ve
.IP "\(bu" 4
Use \fBffmpeg\fR to pad the audio input with silence, so that the
video stream will always result the shortest and will be converted
until the end in the output file when using the \fBshortest\fR
option:
.Sp
.Vb 1
\&        ffmpeg \-i VIDEO \-i AUDIO \-filter_complex "[1:0]apad" \-shortest OUTPUT
.Ve
.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 "apulsator"
.IX Subsection "apulsator"
Audio pulsator is something between an autopanner and a tremolo.
But it can produce funny stereo effects as well. Pulsator changes the volume
of the left and right channel based on a \s-1LFO \s0(low frequency oscillator) with
different waveforms and shifted phases.
This filter have the ability to define an offset between left and right
channel. An offset of 0 means that both \s-1LFO\s0 shapes match each other.
The left and right channel are altered equally \- a conventional tremolo.
An offset of 50% means that the shape of the right channel is exactly shifted
in phase (or moved backwards about half of the frequency) \- pulsator acts as
an autopanner. At 1 both curves match again. Every setting in between moves the
phase shift gapless between all stages and produces some \*(L"bypassing\*(R" sounds with
sine and triangle waveforms. The more you set the offset near 1 (starting from
the 0.5) the faster the signal passes from the left to the right speaker.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input gain. By default it is 1. Range is [0.015625 \- 64].
.IP "\fBlevel_out\fR" 4
.IX Item "level_out"
Set output gain. By default it is 1. Range is [0.015625 \- 64].
.IP "\fBmode\fR" 4
.IX Item "mode"
Set waveform shape the \s-1LFO\s0 will use. Can be one of: sine, triangle, square,
sawup or sawdown. Default is sine.
.IP "\fBamount\fR" 4
.IX Item "amount"
Set modulation. Define how much of original signal is affected by the \s-1LFO.\s0
.IP "\fBoffset_l\fR" 4
.IX Item "offset_l"
Set left channel offset. Default is 0. Allowed range is [0 \- 1].
.IP "\fBoffset_r\fR" 4
.IX Item "offset_r"
Set right channel offset. Default is 0.5. Allowed range is [0 \- 1].
.IP "\fBwidth\fR" 4
.IX Item "width"
Set pulse width. Default is 1. Allowed range is [0 \- 2].
.IP "\fBtiming\fR" 4
.IX Item "timing"
Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
.IP "\fBbpm\fR" 4
.IX Item "bpm"
Set bpm. Default is 120. Allowed range is [30 \- 300]. Only used if timing
is set to bpm.
.IP "\fBms\fR" 4
.IX Item "ms"
Set ms. Default is 500. Allowed range is [10 \- 2000]. Only used if timing
is set to ms.
.IP "\fBhz\fR" 4
.IX Item "hz"
Set frequency in Hz. Default is 2. Allowed range is [0.01 \- 100]. Only used
if timing is set to hz.
.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 "areverse"
.IX Subsection "areverse"
Reverse an audio clip.
.PP
Warning: This filter requires memory to buffer the entire clip, so trimming
is suggested.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Take the first 5 seconds of a clip, and reverse it.
.Sp
.Vb 1
\&        atrim=end=5,areverse
.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
signals 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 "asetrate"
.IX Subsection "asetrate"
Set the sample rate without altering the \s-1PCM\s0 data.
This will result in a change of speed and pitch.
.PP
The filter accepts the following options:
.IP "\fBsample_rate, r\fR" 4
.IX Item "sample_rate, r"
Set the output sample rate. Default is 44100 Hz.
.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
The following values are shown in the output:
.IP "\fBn\fR" 4
.IX Item "n"
The (sequential) number of the input frame, starting from 0.
.IP "\fBpts\fR" 4
.IX Item "pts"
The 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"
The 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"
The sample format.
.IP "\fBchlayout\fR" 4
.IX Item "chlayout"
The channel layout.
.IP "\fBrate\fR" 4
.IX Item "rate"
The sample rate for the audio frame.
.IP "\fBnb_samples\fR" 4
.IX Item "nb_samples"
The number of samples (per channel) in the frame.
.IP "\fBchecksum\fR" 4
.IX Item "checksum"
The 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 "astats"
.IX Subsection "astats"
Display time domain statistical information about the audio channels.
Statistics are calculated and displayed for each audio channel and,
where applicable, an overall figure is also given.
.PP
It accepts the following option:
.IP "\fBlength\fR" 4
.IX Item "length"
Short window length in seconds, used for peak and trough \s-1RMS\s0 measurement.
Default is \f(CW0.05\fR (50 milliseconds). Allowed range is \f(CW\*(C`[0.1 \- 10]\*(C'\fR.
.IP "\fBmetadata\fR" 4
.IX Item "metadata"
Set metadata injection. All the metadata keys are prefixed with \f(CW\*(C`lavfi.astats.X\*(C'\fR,
where \f(CW\*(C`X\*(C'\fR is channel number starting from 1 or string \f(CW\*(C`Overall\*(C'\fR. Default is
disabled.
.Sp
Available keys for each channel are:
DC_offset
Min_level
Max_level
Min_difference
Max_difference
Mean_difference
Peak_level
RMS_peak
RMS_trough
Crest_factor
Flat_factor
Peak_count
Bit_depth
.Sp
and for Overall:
DC_offset
Min_level
Max_level
Min_difference
Max_difference
Mean_difference
Peak_level
RMS_level
RMS_peak
RMS_trough
Flat_factor
Peak_count
Bit_depth
Number_of_samples
.Sp
For example full key look like this \f(CW\*(C`lavfi.astats.1.DC_offset\*(C'\fR or
this \f(CW\*(C`lavfi.astats.Overall.Peak_count\*(C'\fR.
.Sp
For description what each key means read below.
.IP "\fBreset\fR" 4
.IX Item "reset"
Set number of frame after which stats are going to be recalculated.
Default is disabled.
.PP
A description of each shown parameter follows:
.IP "\fB\s-1DC\s0 offset\fR" 4
.IX Item "DC offset"
Mean amplitude displacement from zero.
.IP "\fBMin level\fR" 4
.IX Item "Min level"
Minimal sample level.
.IP "\fBMax level\fR" 4
.IX Item "Max level"
Maximal sample level.
.IP "\fBMin difference\fR" 4
.IX Item "Min difference"
Minimal difference between two consecutive samples.
.IP "\fBMax difference\fR" 4
.IX Item "Max difference"
Maximal difference between two consecutive samples.
.IP "\fBMean difference\fR" 4
.IX Item "Mean difference"
Mean difference between two consecutive samples.
The average of each difference between two consecutive samples.
.IP "\fBPeak level dB\fR" 4
.IX Item "Peak level dB"
.PD 0
.IP "\fB\s-1RMS\s0 level dB\fR" 4
.IX Item "RMS level dB"
.PD
Standard peak and \s-1RMS\s0 level measured in dBFS.
.IP "\fB\s-1RMS\s0 peak dB\fR" 4
.IX Item "RMS peak dB"
.PD 0
.IP "\fB\s-1RMS\s0 trough dB\fR" 4
.IX Item "RMS trough dB"
.PD
Peak and trough values for \s-1RMS\s0 level measured over a short window.
.IP "\fBCrest factor\fR" 4
.IX Item "Crest factor"
Standard ratio of peak to \s-1RMS\s0 level (note: not in dB).
.IP "\fBFlat factor\fR" 4
.IX Item "Flat factor"
Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
(i.e. either \fIMin level\fR or \fIMax level\fR).
.IP "\fBPeak count\fR" 4
.IX Item "Peak count"
Number of occasions (not the number of samples) that the signal attained either
\&\fIMin level\fR or \fIMax level\fR.
.IP "\fBBit depth\fR" 4
.IX Item "Bit depth"
Overall bit depth of audio. Number of bits used for each sample.
.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 \fBaresample\fR to do squeezing/stretching.
.PP
It accepts the following 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"
The minimum difference between timestamps and audio data (in seconds) to trigger
adding/dropping samples. The default value is 0.1. If you get an imperfect
sync with this filter, try setting this parameter to 0.
.IP "\fBmax_comp\fR" 4
.IX Item "max_comp"
The maximum compensation in samples per second. Only relevant with compensate=1.
The default value is 500.
.IP "\fBfirst_pts\fR" 4
.IX Item "first_pts"
Assume that the first \s-1PTS\s0 should be this value. The time base is 1 / sample
rate. This allows for padding/trimming at the start of the stream. By default,
no assumption is made about the first frame's expected \s-1PTS,\s0 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 \s-1PTS\s0 due to encoder delay.
.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 "atrim"
.IX Subsection "atrim"
Trim the input so that the output contains one continuous subpart of the input.
.PP
It accepts the following parameters:
.IP "\fBstart\fR" 4
.IX Item "start"
Timestamp (in seconds) of the start of the section to keep. I.e. the audio
sample with the timestamp \fIstart\fR will be the first sample in the output.
.IP "\fBend\fR" 4
.IX Item "end"
Specify time of the first audio sample that will be dropped, i.e. the
audio sample immediately preceding the one with the timestamp \fIend\fR will be
the last sample in the output.
.IP "\fBstart_pts\fR" 4
.IX Item "start_pts"
Same as \fIstart\fR, except this option sets the start timestamp in samples
instead of seconds.
.IP "\fBend_pts\fR" 4
.IX Item "end_pts"
Same as \fIend\fR, except this option sets the end timestamp in samples instead
of seconds.
.IP "\fBduration\fR" 4
.IX Item "duration"
The maximum duration of the output in seconds.
.IP "\fBstart_sample\fR" 4
.IX Item "start_sample"
The number of the first sample that should be output.
.IP "\fBend_sample\fR" 4
.IX Item "end_sample"
The number of the first sample that should be dropped.
.PP
\&\fBstart\fR, \fBend\fR, and \fBduration\fR are expressed as time
duration specifications; see
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR.
.PP
Note that the first two sets of the start/end options and the \fBduration\fR
option look at the frame timestamp, while the _sample options simply count the
samples that pass through the filter. So start/end_pts and start/end_sample will
give different results when the timestamps are wrong, inexact or do not start at
zero. Also note that this filter does not modify the timestamps. If you wish
to have the output timestamps start at zero, insert the asetpts filter after the
atrim filter.
.PP
If multiple start or end options are set, this filter tries to be greedy and
keep all samples that match at least one of the specified constraints. To keep
only the part that matches all the constraints at once, chain multiple atrim
filters.
.PP
The defaults are such that all the input is kept. So it is possible to set e.g.
just the end values to keep everything before the specified time.
.PP
Examples:
.IP "\(bu" 4
Drop everything except the second minute of input:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-af atrim=60:120
.Ve
.IP "\(bu" 4
Keep only the first 1000 samples:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-af atrim=end_sample=1000
.Ve
.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 "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 "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 "bs2b"
.IX Subsection "bs2b"
Bauer stereo to binaural transformation, which improves headphone listening of
stereo audio records.
.PP
It accepts the following parameters:
.IP "\fBprofile\fR" 4
.IX Item "profile"
Pre-defined crossfeed level.
.RS 4
.IP "\fBdefault\fR" 4
.IX Item "default"
Default level (fcut=700, feed=50).
.IP "\fBcmoy\fR" 4
.IX Item "cmoy"
Chu Moy circuit (fcut=700, feed=60).
.IP "\fBjmeier\fR" 4
.IX Item "jmeier"
Jan Meier circuit (fcut=650, feed=95).
.RE
.RS 4
.RE
.IP "\fBfcut\fR" 4
.IX Item "fcut"
Cut frequency (in Hz).
.IP "\fBfeed\fR" 4
.IX Item "feed"
Feed level (in Hz).
.SS "channelmap"
.IX Subsection "channelmap"
Remap input channels to new locations.
.PP
It accepts the following parameters:
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
The 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 indices.
.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:5.1\*(Aq out.wav
.Ve
.SS "channelsplit"
.IX Subsection "channelsplit"
Split each channel from an input audio stream into a separate output stream.
.PP
It accepts the following parameters:
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
The channel layout of the input stream. The 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
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 "chorus"
.IX Subsection "chorus"
Add a chorus effect to the audio.
.PP
Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
.PP
Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
constant, with chorus, it is varied using using sinusoidal or triangular modulation.
The modulation depth defines the range the modulated delay is played before or after
the delay. Hence the delayed sound will sound slower or faster, that is the delayed
sound tuned around the original one, like in a chorus where some vocals are slightly
off key.
.PP
It accepts the following parameters:
.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.4.
.IP "\fBdelays\fR" 4
.IX Item "delays"
Set delays. A typical delay is around 40ms to 60ms.
.IP "\fBdecays\fR" 4
.IX Item "decays"
Set decays.
.IP "\fBspeeds\fR" 4
.IX Item "speeds"
Set speeds.
.IP "\fBdepths\fR" 4
.IX Item "depths"
Set depths.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
A single delay:
.Sp
.Vb 1
\&        chorus=0.7:0.9:55:0.4:0.25:2
.Ve
.IP "\(bu" 4
Two delays:
.Sp
.Vb 1
\&        chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
.Ve
.IP "\(bu" 4
Fuller sounding chorus with three delays:
.Sp
.Vb 1
\&        chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
.Ve
.SS "compand"
.IX Subsection "compand"
Compress or expand the audio's dynamic range.
.PP
It accepts the following parameters:
.IP "\fBattacks\fR" 4
.IX Item "attacks"
.PD 0
.IP "\fBdecays\fR" 4
.IX Item "decays"
.PD
A list of times in seconds for each channel over which the instantaneous level
of the input signal is averaged to determine its volume. \fIattacks\fR refers to
increase of volume and \fIdecays\fR refers to decrease of volume. For most
situations, the attack time (response to the audio getting louder) should be
shorter than the decay time, because the human ear is more sensitive to sudden
loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
a typical value for decay is 0.8 seconds.
If specified number of attacks & decays is lower than number of channels, the last
set attack/decay will be used for all remaining channels.
.IP "\fBpoints\fR" 4
.IX Item "points"
A list of points for the transfer function, specified in dB relative to the
maximum possible signal amplitude. Each key points list must be defined using
the following syntax: \f(CW\*(C`x0/y0|x1/y1|x2/y2|....\*(C'\fR or
\&\f(CW\*(C`x0/y0 x1/y1 x2/y2 ....\*(C'\fR
.Sp
The input values must be in strictly increasing order but the transfer function
does not have to be monotonically rising. The point \f(CW\*(C`0/0\*(C'\fR is assumed but
may be overridden (by \f(CW\*(C`0/out\-dBn\*(C'\fR). Typical values for the transfer
function are \f(CW\*(C`\-70/\-70|\-60/\-20\*(C'\fR.
.IP "\fBsoft-knee\fR" 4
.IX Item "soft-knee"
Set the curve radius in dB for all joints. It defaults to 0.01.
.IP "\fBgain\fR" 4
.IX Item "gain"
Set the additional gain in dB to be applied at all points on the transfer
function. This allows for easy adjustment of the overall gain.
It defaults to 0.
.IP "\fBvolume\fR" 4
.IX Item "volume"
Set an initial volume, in dB, to be assumed for each channel when filtering
starts. This permits the user to supply a nominal level initially, so that, for
example, a very large gain is not applied to initial signal levels before the
companding has begun to operate. A typical value for audio which is initially
quiet is \-90 dB. It defaults to 0.
.IP "\fBdelay\fR" 4
.IX Item "delay"
Set a delay, in seconds. The input audio is analyzed immediately, but audio is
delayed before being fed to the volume adjuster. Specifying a delay
approximately equal to the attack/decay times allows the filter to effectively
operate in predictive rather than reactive mode. It defaults to 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Make music with both quiet and loud passages suitable for listening to in a
noisy environment:
.Sp
.Vb 1
\&        compand=.3|.3:1|1:\-90/\-60|\-60/\-40|\-40/\-30|\-20/\-20:6:0:\-90:0.2
.Ve
.Sp
Another example for audio with whisper and explosion parts:
.Sp
.Vb 1
\&        compand=0|0:1|1:\-90/\-900|\-70/\-70|\-30/\-9|0/\-3:6:0:0:0
.Ve
.IP "\(bu" 4
A noise gate for when the noise is at a lower level than the signal:
.Sp
.Vb 1
\&        compand=.1|.1:.2|.2:\-900/\-900|\-50.1/\-900|\-50/\-50:.01:0:\-90:.1
.Ve
.IP "\(bu" 4
Here is another noise gate, this time for when the noise is at a higher level
than the signal (making it, in some ways, similar to squelch):
.Sp
.Vb 1
\&        compand=.1|.1:.1|.1:\-45.1/\-45.1|\-45/\-900|0/\-900:.01:45:\-90:.1
.Ve
.IP "\(bu" 4
2:1 compression starting at \-6dB:
.Sp
.Vb 1
\&        compand=points=\-80/\-80|\-6/\-6|0/\-3.8|20/3.5
.Ve
.IP "\(bu" 4
2:1 compression starting at \-9dB:
.Sp
.Vb 1
\&        compand=points=\-80/\-80|\-9/\-9|0/\-5.3|20/2.9
.Ve
.IP "\(bu" 4
2:1 compression starting at \-12dB:
.Sp
.Vb 1
\&        compand=points=\-80/\-80|\-12/\-12|0/\-6.8|20/1.9
.Ve
.IP "\(bu" 4
2:1 compression starting at \-18dB:
.Sp
.Vb 1
\&        compand=points=\-80/\-80|\-18/\-18|0/\-9.8|20/0.7
.Ve
.IP "\(bu" 4
3:1 compression starting at \-15dB:
.Sp
.Vb 1
\&        compand=points=\-80/\-80|\-15/\-15|0/\-10.8|20/\-5.2
.Ve
.IP "\(bu" 4
Compressor/Gate:
.Sp
.Vb 1
\&        compand=points=\-80/\-105|\-62/\-80|\-15.4/\-15.4|0/\-12|20/\-7.6
.Ve
.IP "\(bu" 4
Expander:
.Sp
.Vb 1
\&        compand=attacks=0:points=\-80/\-169|\-54/\-80|\-49.5/\-64.6|\-41.1/\-41.1|\-25.8/\-15|\-10.8/\-4.5|0/0|20/8.3
.Ve
.IP "\(bu" 4
Hard limiter at \-6dB:
.Sp
.Vb 1
\&        compand=attacks=0:points=\-80/\-80|\-6/\-6|20/\-6
.Ve
.IP "\(bu" 4
Hard limiter at \-12dB:
.Sp
.Vb 1
\&        compand=attacks=0:points=\-80/\-80|\-12/\-12|20/\-12
.Ve
.IP "\(bu" 4
Hard noise gate at \-35 dB:
.Sp
.Vb 1
\&        compand=attacks=0:points=\-80/\-115|\-35.1/\-80|\-35/\-35|20/20
.Ve
.IP "\(bu" 4
Soft limiter:
.Sp
.Vb 1
\&        compand=attacks=0:points=\-80/\-80|\-12.4/\-12.4|\-6/\-8|0/\-6.8|20/\-2.8
.Ve
.SS "compensationdelay"
.IX Subsection "compensationdelay"
Compensation Delay Line is a metric based delay to compensate differing
positions of microphones or speakers.
.PP
For example, you have recorded guitar with two microphones placed in
different location. Because the front of sound wave has fixed speed in
normal conditions, the phasing of microphones can vary and depends on
their location and interposition. The best sound mix can be achieved when
these microphones are in phase (synchronized). Note that distance of
~30 cm between microphones makes one microphone to capture signal in
antiphase to another microphone. That makes the final mix sounding moody.
This filter helps to solve phasing problems by adding different delays
to each microphone track and make them synchronized.
.PP
The best result can be reached when you take one track as base and
synchronize other tracks one by one with it.
Remember that synchronization/delay tolerance depends on sample rate, too.
Higher sample rates will give more tolerance.
.PP
It accepts the following parameters:
.IP "\fBmm\fR" 4
.IX Item "mm"
Set millimeters distance. This is compensation distance for fine tuning.
Default is 0.
.IP "\fBcm\fR" 4
.IX Item "cm"
Set cm distance. This is compensation distance for tightening distance setup.
Default is 0.
.IP "\fBm\fR" 4
.IX Item "m"
Set meters distance. This is compensation distance for hard distance setup.
Default is 0.
.IP "\fBdry\fR" 4
.IX Item "dry"
Set dry amount. Amount of unprocessed (dry) signal.
Default is 0.
.IP "\fBwet\fR" 4
.IX Item "wet"
Set wet amount. Amount of processed (wet) signal.
Default is 1.
.IP "\fBtemp\fR" 4
.IX Item "temp"
Set temperature degree in Celsius. This is the temperature of the environment.
Default is 20.
.SS "crystalizer"
.IX Subsection "crystalizer"
Simple algorithm to expand audio dynamic range.
.PP
The filter accepts the following options:
.IP "\fBi\fR" 4
.IX Item "i"
Sets the intensity of effect (default: 2.0). Must be in range between 0.0
(unchanged sound) to 10.0 (maximum effect).
.IP "\fBc\fR" 4
.IX Item "c"
Enable clipping. By default is enabled.
.SS "dcshift"
.IX Subsection "dcshift"
Apply a \s-1DC\s0 shift to the audio.
.PP
This can be useful to remove a \s-1DC\s0 offset (caused perhaps by a hardware problem
in the recording chain) from the audio. The effect of a \s-1DC\s0 offset is reduced
headroom and hence volume. The \fBastats\fR filter can be used to determine if
a signal has a \s-1DC\s0 offset.
.IP "\fBshift\fR" 4
.IX Item "shift"
Set the \s-1DC\s0 shift, allowed range is [\-1, 1]. It indicates the amount to shift
the audio.
.IP "\fBlimitergain\fR" 4
.IX Item "limitergain"
Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
used to prevent clipping.
.SS "dynaudnorm"
.IX Subsection "dynaudnorm"
Dynamic Audio Normalizer.
.PP
This filter applies a certain amount of gain to the input audio in order
to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
contrast to more \*(L"simple\*(R" normalization algorithms, the Dynamic Audio
Normalizer *dynamically* re-adjusts the gain factor to the input audio.
This allows for applying extra gain to the \*(L"quiet\*(R" sections of the audio
while avoiding distortions or clipping the \*(L"loud\*(R" sections. In other words:
The Dynamic Audio Normalizer will \*(L"even out\*(R" the volume of quiet and loud
sections, in the sense that the volume of each section is brought to the
same target level. Note, however, that the Dynamic Audio Normalizer achieves
this goal *without* applying \*(L"dynamic range compressing\*(R". It will retain 100%
of the dynamic range *within* each section of the audio file.
.IP "\fBf\fR" 4
.IX Item "f"
Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
Default is 500 milliseconds.
The Dynamic Audio Normalizer processes the input audio in small chunks,
referred to as frames. This is required, because a peak magnitude has no
meaning for just a single sample value. Instead, we need to determine the
peak magnitude for a contiguous sequence of sample values. While a \*(L"standard\*(R"
normalizer would simply use the peak magnitude of the complete file, the
Dynamic Audio Normalizer determines the peak magnitude individually for each
frame. The length of a frame is specified in milliseconds. By default, the
Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
been found to give good results with most files.
Note that the exact frame length, in number of samples, will be determined
automatically, based on the sampling rate of the individual input audio file.
.IP "\fBg\fR" 4
.IX Item "g"
Set the Gaussian filter window size. In range from 3 to 301, must be odd
number. Default is 31.
Probably the most important parameter of the Dynamic Audio Normalizer is the
\&\f(CW\*(C`window size\*(C'\fR of the Gaussian smoothing filter. The filter's window size
is specified in frames, centered around the current frame. For the sake of
simplicity, this must be an odd number. Consequently, the default value of 31
takes into account the current frame, as well as the 15 preceding frames and
the 15 subsequent frames. Using a larger window results in a stronger
smoothing effect and thus in less gain variation, i.e. slower gain
adaptation. Conversely, using a smaller window results in a weaker smoothing
effect and thus in more gain variation, i.e. faster gain adaptation.
In other words, the more you increase this value, the more the Dynamic Audio
Normalizer will behave like a \*(L"traditional\*(R" normalization filter. On the
contrary, the more you decrease this value, the more the Dynamic Audio
Normalizer will behave like a dynamic range compressor.
.IP "\fBp\fR" 4
.IX Item "p"
Set the target peak value. This specifies the highest permissible magnitude
level for the normalized audio input. This filter will try to approach the
target peak magnitude as closely as possible, but at the same time it also
makes sure that the normalized signal will never exceed the peak magnitude.
A frame's maximum local gain factor is imposed directly by the target peak
magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
It is not recommended to go above this value.
.IP "\fBm\fR" 4
.IX Item "m"
Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
The Dynamic Audio Normalizer determines the maximum possible (local) gain
factor for each input frame, i.e. the maximum gain factor that does not
result in clipping or distortion. The maximum gain factor is determined by
the frame's highest magnitude sample. However, the Dynamic Audio Normalizer
additionally bounds the frame's maximum gain factor by a predetermined
(global) maximum gain factor. This is done in order to avoid excessive gain
factors in \*(L"silent\*(R" or almost silent frames. By default, the maximum gain
factor is 10.0, For most inputs the default value should be sufficient and
it usually is not recommended to increase this value. Though, for input
with an extremely low overall volume level, it may be necessary to allow even
higher gain factors. Note, however, that the Dynamic Audio Normalizer does
not simply apply a \*(L"hard\*(R" threshold (i.e. cut off values above the threshold).
Instead, a \*(L"sigmoid\*(R" threshold function will be applied. This way, the
gain factors will smoothly approach the threshold value, but never exceed that
value.
.IP "\fBr\fR" 4
.IX Item "r"
Set the target \s-1RMS.\s0 In range from 0.0 to 1.0. Default is 0.0 \- disabled.
By default, the Dynamic Audio Normalizer performs \*(L"peak\*(R" normalization.
This means that the maximum local gain factor for each frame is defined
(only) by the frame's highest magnitude sample. This way, the samples can
be amplified as much as possible without exceeding the maximum signal
level, i.e. without clipping. Optionally, however, the Dynamic Audio
Normalizer can also take into account the frame's root mean square,
abbreviated \s-1RMS.\s0 In electrical engineering, the \s-1RMS\s0 is commonly used to
determine the power of a time-varying signal. It is therefore considered
that the \s-1RMS\s0 is a better approximation of the \*(L"perceived loudness\*(R" than
just looking at the signal's peak magnitude. Consequently, by adjusting all
frames to a constant \s-1RMS\s0 value, a uniform \*(L"perceived loudness\*(R" can be
established. If a target \s-1RMS\s0 value has been specified, a frame's local gain
factor is defined as the factor that would result in exactly that \s-1RMS\s0 value.
Note, however, that the maximum local gain factor is still restricted by the
frame's highest magnitude sample, in order to prevent clipping.
.IP "\fBn\fR" 4
.IX Item "n"
Enable channels coupling. By default is enabled.
By default, the Dynamic Audio Normalizer will amplify all channels by the same
amount. This means the same gain factor will be applied to all channels, i.e.
the maximum possible gain factor is determined by the \*(L"loudest\*(R" channel.
However, in some recordings, it may happen that the volume of the different
channels is uneven, e.g. one channel may be \*(L"quieter\*(R" than the other one(s).
In this case, this option can be used to disable the channel coupling. This way,
the gain factor will be determined independently for each channel, depending
only on the individual channel's highest magnitude sample. This allows for
harmonizing the volume of the different channels.
.IP "\fBc\fR" 4
.IX Item "c"
Enable \s-1DC\s0 bias correction. By default is disabled.
An audio signal (in the time domain) is a sequence of sample values.
In the Dynamic Audio Normalizer these sample values are represented in the
\&\-1.0 to 1.0 range, regardless of the original input format. Normally, the
audio signal, or \*(L"waveform\*(R", should be centered around the zero point.
That means if we calculate the mean value of all samples in a file, or in a
single frame, then the result should be 0.0 or at least very close to that
value. If, however, there is a significant deviation of the mean value from
0.0, in either positive or negative direction, this is referred to as a
\&\s-1DC\s0 bias or \s-1DC\s0 offset. Since a \s-1DC\s0 bias is clearly undesirable, the Dynamic
Audio Normalizer provides optional \s-1DC\s0 bias correction.
With \s-1DC\s0 bias correction enabled, the Dynamic Audio Normalizer will determine
the mean value, or \*(L"\s-1DC\s0 correction\*(R" offset, of each input frame and subtract
that value from all of the frame's sample values which ensures those samples
are centered around 0.0 again. Also, in order to avoid \*(L"gaps\*(R" at the frame
boundaries, the \s-1DC\s0 correction offset values will be interpolated smoothly
between neighbouring frames.
.IP "\fBb\fR" 4
.IX Item "b"
Enable alternative boundary mode. By default is disabled.
The Dynamic Audio Normalizer takes into account a certain neighbourhood
around each frame. This includes the preceding frames as well as the
subsequent frames. However, for the \*(L"boundary\*(R" frames, located at the very
beginning and at the very end of the audio file, not all neighbouring
frames are available. In particular, for the first few frames in the audio
file, the preceding frames are not known. And, similarly, for the last few
frames in the audio file, the subsequent frames are not known. Thus, the
question arises which gain factors should be assumed for the missing frames
in the \*(L"boundary\*(R" region. The Dynamic Audio Normalizer implements two modes
to deal with this situation. The default boundary mode assumes a gain factor
of exactly 1.0 for the missing frames, resulting in a smooth \*(L"fade in\*(R" and
\&\*(L"fade out\*(R" at the beginning and at the end of the input, respectively.
.IP "\fBs\fR" 4
.IX Item "s"
Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
By default, the Dynamic Audio Normalizer does not apply \*(L"traditional\*(R"
compression. This means that signal peaks will not be pruned and thus the
full dynamic range will be retained within each local neighbourhood. However,
in some cases it may be desirable to combine the Dynamic Audio Normalizer's
normalization algorithm with a more \*(L"traditional\*(R" compression.
For this purpose, the Dynamic Audio Normalizer provides an optional compression
(thresholding) function. If (and only if) the compression feature is enabled,
all input frames will be processed by a soft knee thresholding function prior
to the actual normalization process. Put simply, the thresholding function is
going to prune all samples whose magnitude exceeds a certain threshold value.
However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
value. Instead, the threshold value will be adjusted for each individual
frame.
In general, smaller parameters result in stronger compression, and vice versa.
Values below 3.0 are not recommended, because audible distortion may appear.
.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 "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.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
.Sp
.Vb 1
\&        equalizer=f=1000:width_type=h:width=200:g=\-10
.Ve
.IP "\(bu" 4
Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
.Sp
.Vb 1
\&        equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g=\-5
.Ve
.SS "extrastereo"
.IX Subsection "extrastereo"
Linearly increases the difference between left and right channels which
adds some sort of \*(L"live\*(R" effect to playback.
.PP
The filter accepts the following options:
.IP "\fBm\fR" 4
.IX Item "m"
Sets the difference coefficient (default: 2.5). 0.0 means mono sound
(average of both channels), with 1.0 sound will be unchanged, with
\&\-1.0 left and right channels will be swapped.
.IP "\fBc\fR" 4
.IX Item "c"
Enable clipping. By default is enabled.
.SS "firequalizer"
.IX Subsection "firequalizer"
Apply \s-1FIR\s0 Equalization using arbitrary frequency response.
.PP
The filter accepts the following option:
.IP "\fBgain\fR" 4
.IX Item "gain"
Set gain curve equation (in dB). The expression can contain variables:
.RS 4
.IP "\fBf\fR" 4
.IX Item "f"
the evaluated frequency
.IP "\fBsr\fR" 4
.IX Item "sr"
sample rate
.IP "\fBch\fR" 4
.IX Item "ch"
channel number, set to 0 when multichannels evaluation is disabled
.IP "\fBchid\fR" 4
.IX Item "chid"
channel id, see libavutil/channel_layout.h, set to the first channel id when
multichannels evaluation is disabled
.IP "\fBchs\fR" 4
.IX Item "chs"
number of channels
.IP "\fBchlayout\fR" 4
.IX Item "chlayout"
channel_layout, see libavutil/channel_layout.h
.RE
.RS 4
.Sp
and functions:
.IP "\fBgain_interpolate(f)\fR" 4
.IX Item "gain_interpolate(f)"
interpolate gain on frequency f based on gain_entry
.IP "\fBcubic_interpolate(f)\fR" 4
.IX Item "cubic_interpolate(f)"
same as gain_interpolate, but smoother
.RE
.RS 4
.Sp
This option is also available as command. Default is \f(CWgain_interpolate(f)\fR.
.RE
.IP "\fBgain_entry\fR" 4
.IX Item "gain_entry"
Set gain entry for gain_interpolate function. The expression can
contain functions:
.RS 4
.IP "\fBentry(f, g)\fR" 4
.IX Item "entry(f, g)"
store gain entry at frequency f with value g
.RE
.RS 4
.Sp
This option is also available as command.
.RE
.IP "\fBdelay\fR" 4
.IX Item "delay"
Set filter delay in seconds. Higher value means more accurate.
Default is \f(CW0.01\fR.
.IP "\fBaccuracy\fR" 4
.IX Item "accuracy"
Set filter accuracy in Hz. Lower value means more accurate.
Default is \f(CW5\fR.
.IP "\fBwfunc\fR" 4
.IX Item "wfunc"
Set window function. Acceptable values are:
.RS 4
.IP "\fBrectangular\fR" 4
.IX Item "rectangular"
rectangular window, useful when gain curve is already smooth
.IP "\fBhann\fR" 4
.IX Item "hann"
hann window (default)
.IP "\fBhamming\fR" 4
.IX Item "hamming"
hamming window
.IP "\fBblackman\fR" 4
.IX Item "blackman"
blackman window
.IP "\fBnuttall3\fR" 4
.IX Item "nuttall3"
3\-terms continuous 1st derivative nuttall window
.IP "\fBmnuttall3\fR" 4
.IX Item "mnuttall3"
minimum 3\-terms discontinuous nuttall window
.IP "\fBnuttall\fR" 4
.IX Item "nuttall"
4\-terms continuous 1st derivative nuttall window
.IP "\fBbnuttall\fR" 4
.IX Item "bnuttall"
minimum 4\-terms discontinuous nuttall (blackman-nuttall) window
.IP "\fBbharris\fR" 4
.IX Item "bharris"
blackman-harris window
.IP "\fBtukey\fR" 4
.IX Item "tukey"
tukey window
.RE
.RS 4
.RE
.IP "\fBfixed\fR" 4
.IX Item "fixed"
If enabled, use fixed number of audio samples. This improves speed when
filtering with large delay. Default is disabled.
.IP "\fBmulti\fR" 4
.IX Item "multi"
Enable multichannels evaluation on gain. Default is disabled.
.IP "\fBzero_phase\fR" 4
.IX Item "zero_phase"
Enable zero phase mode by subtracting timestamp to compensate delay.
Default is disabled.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set scale used by gain. Acceptable values are:
.RS 4
.IP "\fBlinlin\fR" 4
.IX Item "linlin"
linear frequency, linear gain
.IP "\fBlinlog\fR" 4
.IX Item "linlog"
linear frequency, logarithmic (in dB) gain (default)
.IP "\fBloglin\fR" 4
.IX Item "loglin"
logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
.IP "\fBloglog\fR" 4
.IX Item "loglog"
logarithmic frequency, logarithmic gain
.RE
.RS 4
.RE
.IP "\fBdumpfile\fR" 4
.IX Item "dumpfile"
Set file for dumping, suitable for gnuplot.
.IP "\fBdumpscale\fR" 4
.IX Item "dumpscale"
Set scale for dumpfile. Acceptable values are same with scale option.
Default is linlog.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
lowpass at 1000 Hz:
.Sp
.Vb 1
\&        firequalizer=gain=\*(Aqif(lt(f,1000), 0, \-INF)\*(Aq
.Ve
.IP "\(bu" 4
lowpass at 1000 Hz with gain_entry:
.Sp
.Vb 1
\&        firequalizer=gain_entry=\*(Aqentry(1000,0); entry(1001, \-INF)\*(Aq
.Ve
.IP "\(bu" 4
custom equalization:
.Sp
.Vb 1
\&        firequalizer=gain_entry=\*(Aqentry(100,0); entry(400, \-4); entry(1000, \-6); entry(2000, 0)\*(Aq
.Ve
.IP "\(bu" 4
higher delay with zero phase to compensate delay:
.Sp
.Vb 1
\&        firequalizer=delay=0.1:fixed=on:zero_phase=on
.Ve
.IP "\(bu" 4
lowpass on left channel, highpass on right channel:
.Sp
.Vb 2
\&        firequalizer=gain=\*(Aqif(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))\*(Aq
\&        :gain_entry=\*(Aqentry(1000, 0); entry(1001,\-INF); entry(1e6+1000,0)\*(Aq:multi=on
.Ve
.SS "flanger"
.IX Subsection "flanger"
Apply a flanging effect to the audio.
.PP
The filter accepts the following options:
.IP "\fBdelay\fR" 4
.IX Item "delay"
Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
.IP "\fBdepth\fR" 4
.IX Item "depth"
Set added swep delay in milliseconds. Range from 0 to 10. Default value is 2.
.IP "\fBregen\fR" 4
.IX Item "regen"
Set percentage regeneration (delayed signal feedback). Range from \-95 to 95.
Default value is 0.
.IP "\fBwidth\fR" 4
.IX Item "width"
Set percentage of delayed signal mixed with original. Range from 0 to 100.
Default value is 71.
.IP "\fBspeed\fR" 4
.IX Item "speed"
Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
.IP "\fBshape\fR" 4
.IX Item "shape"
Set swept wave shape, can be \fItriangular\fR or \fIsinusoidal\fR.
Default value is \fIsinusoidal\fR.
.IP "\fBphase\fR" 4
.IX Item "phase"
Set swept wave percentage-shift for multi channel. Range from 0 to 100.
Default value is 25.
.IP "\fBinterp\fR" 4
.IX Item "interp"
Set delay-line interpolation, \fIlinear\fR or \fIquadratic\fR.
Default is \fIlinear\fR.
.SS "hdcd"
.IX Subsection "hdcd"
Decodes High Definition Compatible Digital (\s-1HDCD\s0) data. A 16\-bit \s-1PCM\s0 stream with
embedded \s-1HDCD\s0 codes is expanded into a 20\-bit \s-1PCM\s0 stream.
.PP
The filter supports the Peak Extend and Low-level Gain Adjustment features
of \s-1HDCD,\s0 and detects the Transient Filter flag.
.PP
.Vb 1
\&        ffmpeg \-i HDCD16.flac \-af hdcd OUT24.flac
.Ve
.PP
When using the filter with wav, note the default encoding for wav is 16\-bit,
so the resulting 20\-bit stream will be truncated back to 16\-bit. Use something
like \fB\-acodec pcm_s24le\fR after the filter to get 24\-bit \s-1PCM\s0 output.
.PP
.Vb 2
\&        ffmpeg \-i HDCD16.wav \-af hdcd OUT16.wav
\&        ffmpeg \-i HDCD16.wav \-af hdcd \-acodec pcm_s24le OUT24.wav
.Ve
.PP
The filter accepts the following options:
.IP "\fBdisable_autoconvert\fR" 4
.IX Item "disable_autoconvert"
Disable any automatic format conversion or resampling in the filter graph.
.IP "\fBprocess_stereo\fR" 4
.IX Item "process_stereo"
Process the stereo channels together. If target_gain does not match between
channels, consider it invalid and use the last valid target_gain.
.IP "\fBcdt_ms\fR" 4
.IX Item "cdt_ms"
Set the code detect timer period in ms.
.IP "\fBforce_pe\fR" 4
.IX Item "force_pe"
Always extend peaks above \-3dBFS even if \s-1PE\s0 isn't signaled.
.IP "\fBanalyze_mode\fR" 4
.IX Item "analyze_mode"
Replace audio with a solid tone and adjust the amplitude to signal some
specific aspect of the decoding process. The output file can be loaded in
an audio editor alongside the original to aid analysis.
.Sp
\&\f(CW\*(C`analyze_mode=pe:force_pe=true\*(C'\fR can be used to see all samples above the \s-1PE\s0 level.
.Sp
Modes are:
.RS 4
.IP "\fB0, off\fR" 4
.IX Item "0, off"
Disabled
.IP "\fB1, lle\fR" 4
.IX Item "1, lle"
Gain adjustment level at each sample
.IP "\fB2, pe\fR" 4
.IX Item "2, pe"
Samples where peak extend occurs
.IP "\fB3, cdt\fR" 4
.IX Item "3, cdt"
Samples where the code detect timer is active
.IP "\fB4, tgm\fR" 4
.IX Item "4, tgm"
Samples where the target gain does not match between channels
.RE
.RS 4
.RE
.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 "join"
.IX Subsection "join"
Join multiple input streams into one multi-channel stream.
.PP
It accepts the following parameters:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
The number of input streams. It defaults to 2.
.IP "\fBchannel_layout\fR" 4
.IX Item "channel_layout"
The desired output channel layout. It 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 they 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
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
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 "ladspa"
.IX Subsection "ladspa"
Load a \s-1LADSPA \s0(Linux Audio Developer's Simple Plugin \s-1API\s0) plugin.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-ladspa\*(C'\fR.
.IP "\fBfile, f\fR" 4
.IX Item "file, f"
Specifies the name of \s-1LADSPA\s0 plugin library to load. If the environment
variable \fB\s-1LADSPA_PATH\s0\fR is defined, the \s-1LADSPA\s0 plugin is searched in
each one of the directories specified by the colon separated list in
\&\fB\s-1LADSPA_PATH\s0\fR, otherwise in the standard \s-1LADSPA\s0 paths, which are in
this order: \fI\s-1HOME/\s0.ladspa/lib/\fR, \fI/usr/local/lib/ladspa/\fR,
\&\fI/usr/lib/ladspa/\fR.
.IP "\fBplugin, p\fR" 4
.IX Item "plugin, p"
Specifies the plugin within the library. Some libraries contain only
one plugin, but others contain many of them. If this is not set filter
will list all available plugins within the specified library.
.IP "\fBcontrols, c\fR" 4
.IX Item "controls, c"
Set the '|' separated list of controls which are zero or more floating point
values that determine the behavior of the loaded plugin (for example delay,
threshold or gain).
Controls need to be defined using the following syntax:
c0=\fIvalue0\fR|c1=\fIvalue1\fR|c2=\fIvalue2\fR|..., where
\&\fIvaluei\fR is the value set on the \fIi\fR\-th control.
Alternatively they can be also defined using the following syntax:
\&\fIvalue0\fR|\fIvalue1\fR|\fIvalue2\fR|..., where
\&\fIvaluei\fR is the value set on the \fIi\fR\-th control.
If \fBcontrols\fR is set to \f(CW\*(C`help\*(C'\fR, all available controls and
their valid ranges are printed.
.IP "\fBsample_rate, s\fR" 4
.IX Item "sample_rate, s"
Specify the sample rate, default to 44100. Only used if plugin have
zero inputs.
.IP "\fBnb_samples, n\fR" 4
.IX Item "nb_samples, n"
Set the number of samples per channel per each output frame, default
is 1024. Only used if plugin have zero inputs.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Set the minimum duration of the sourced audio. See
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
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.
If not specified, or the expressed duration is negative, the audio is
supposed to be generated forever.
Only used if plugin have zero inputs.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
List all available plugins within amp (\s-1LADSPA\s0 example plugin) library:
.Sp
.Vb 1
\&        ladspa=file=amp
.Ve
.IP "\(bu" 4
List all available controls and their valid ranges for \f(CW\*(C`vcf_notch\*(C'\fR
plugin from \f(CW\*(C`VCF\*(C'\fR library:
.Sp
.Vb 1
\&        ladspa=f=vcf:p=vcf_notch:c=help
.Ve
.IP "\(bu" 4
Simulate low quality audio equipment using \f(CW\*(C`Computer Music Toolkit\*(C'\fR (\s-1CMT\s0)
plugin library:
.Sp
.Vb 1
\&        ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
.Ve
.IP "\(bu" 4
Add reverberation to the audio using TAP-plugins
(Tom's Audio Processing plugins):
.Sp
.Vb 1
\&        ladspa=file=tap_reverb:tap_reverb
.Ve
.IP "\(bu" 4
Generate white noise, with 0.2 amplitude:
.Sp
.Vb 1
\&        ladspa=file=cmt:noise_source_white:c=c0=.2
.Ve
.IP "\(bu" 4
Generate 20 bpm clicks using plugin \f(CW\*(C`C* Click \- Metronome\*(C'\fR from the
\&\f(CW\*(C`C* Audio Plugin Suite\*(C'\fR (\s-1CAPS\s0) library:
.Sp
.Vb 1
\&        ladspa=file=caps:Click:c=c1=20\*(Aq
.Ve
.IP "\(bu" 4
Apply \f(CW\*(C`C* Eq10X2 \- Stereo 10\-band equaliser\*(C'\fR effect:
.Sp
.Vb 1
\&        ladspa=caps:Eq10X2:c=c0=\-48|c9=\-24|c3=12|c4=2
.Ve
.IP "\(bu" 4
Increase volume by 20dB using fast lookahead limiter from Steve Harris
\&\f(CW\*(C`SWH Plugins\*(C'\fR collection:
.Sp
.Vb 1
\&        ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
.Ve
.IP "\(bu" 4
Attenuate low frequencies using Multiband \s-1EQ\s0 from Steve Harris
\&\f(CW\*(C`SWH Plugins\*(C'\fR collection:
.Sp
.Vb 1
\&        ladspa=mbeq_1197:mbeq:\-24|\-24|\-24|0|0|0|0|0|0|0|0|0|0|0|0
.Ve
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBcN\fR" 4
.IX Item "cN"
Modify the \fIN\fR\-th control value.
.Sp
If the specified value is not valid, it is ignored and prior one is kept.
.SS "loudnorm"
.IX Subsection "loudnorm"
\&\s-1EBU R128\s0 loudness normalization. Includes both dynamic and linear normalization modes.
Support for both single pass (livestreams, files) and double pass (files) modes.
This algorithm can target \s-1IL, LRA,\s0 and maximum true peak.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libebur128\*(C'\fR.
.PP
The filter accepts the following options:
.IP "\fBI, i\fR" 4
.IX Item "I, i"
Set integrated loudness target.
Range is \-70.0 \- \-5.0. Default value is \-24.0.
.IP "\fB\s-1LRA,\s0 lra\fR" 4
.IX Item "LRA, lra"
Set loudness range target.
Range is 1.0 \- 20.0. Default value is 7.0.
.IP "\fB\s-1TP,\s0 tp\fR" 4
.IX Item "TP, tp"
Set maximum true peak.
Range is \-9.0 \- +0.0. Default value is \-2.0.
.IP "\fBmeasured_I, measured_i\fR" 4
.IX Item "measured_I, measured_i"
Measured \s-1IL\s0 of input file.
Range is \-99.0 \- +0.0.
.IP "\fBmeasured_LRA, measured_lra\fR" 4
.IX Item "measured_LRA, measured_lra"
Measured \s-1LRA\s0 of input file.
Range is  0.0 \- 99.0.
.IP "\fBmeasured_TP, measured_tp\fR" 4
.IX Item "measured_TP, measured_tp"
Measured true peak of input file.
Range is  \-99.0 \- +99.0.
.IP "\fBmeasured_thresh\fR" 4
.IX Item "measured_thresh"
Measured threshold of input file.
Range is \-99.0 \- +0.0.
.IP "\fBoffset\fR" 4
.IX Item "offset"
Set offset gain. Gain is applied before the true-peak limiter.
Range is  \-99.0 \- +99.0. Default is +0.0.
.IP "\fBlinear\fR" 4
.IX Item "linear"
Normalize linearly if possible.
measured_I, measured_LRA, measured_TP, and measured_thresh must also
to be specified in order to use this mode.
Options are true or false. Default is true.
.IP "\fBdual_mono\fR" 4
.IX Item "dual_mono"
Treat mono input files as \*(L"dual-mono\*(R". If a mono file is intended for playback
on a stereo system, its \s-1EBU R128\s0 measurement will be perceptually incorrect.
If set to \f(CW\*(C`true\*(C'\fR, this option will compensate for this effect.
Multi-channel input files are not affected by this option.
Options are true or false. Default is false.
.IP "\fBprint_format\fR" 4
.IX Item "print_format"
Set print format for stats. Options are summary, json, or none.
Default value is none.
.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 "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 efficiently remap 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, FR,\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=1c|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 "replaygain"
.IX Subsection "replaygain"
ReplayGain scanner filter. This filter takes an audio stream as an input and
outputs it unchanged.
At end of filtering it displays \f(CW\*(C`track_gain\*(C'\fR and \f(CW\*(C`track_peak\*(C'\fR.
.SS "resample"
.IX Subsection "resample"
Convert the audio sample format, sample rate and channel layout. It is
not meant to be used directly.
.SS "rubberband"
.IX Subsection "rubberband"
Apply time-stretching and pitch-shifting with librubberband.
.PP
The filter accepts the following options:
.IP "\fBtempo\fR" 4
.IX Item "tempo"
Set tempo scale factor.
.IP "\fBpitch\fR" 4
.IX Item "pitch"
Set pitch scale factor.
.IP "\fBtransients\fR" 4
.IX Item "transients"
Set transients detector.
Possible values are:
.RS 4
.IP "\fIcrisp\fR" 4
.IX Item "crisp"
.PD 0
.IP "\fImixed\fR" 4
.IX Item "mixed"
.IP "\fIsmooth\fR" 4
.IX Item "smooth"
.RE
.RS 4
.RE
.IP "\fBdetector\fR" 4
.IX Item "detector"
.PD
Set detector.
Possible values are:
.RS 4
.IP "\fIcompound\fR" 4
.IX Item "compound"
.PD 0
.IP "\fIpercussive\fR" 4
.IX Item "percussive"
.IP "\fIsoft\fR" 4
.IX Item "soft"
.RE
.RS 4
.RE
.IP "\fBphase\fR" 4
.IX Item "phase"
.PD
Set phase.
Possible values are:
.RS 4
.IP "\fIlaminar\fR" 4
.IX Item "laminar"
.PD 0
.IP "\fIindependent\fR" 4
.IX Item "independent"
.RE
.RS 4
.RE
.IP "\fBwindow\fR" 4
.IX Item "window"
.PD
Set processing window size.
Possible values are:
.RS 4
.IP "\fIstandard\fR" 4
.IX Item "standard"
.PD 0
.IP "\fIshort\fR" 4
.IX Item "short"
.IP "\fIlong\fR" 4
.IX Item "long"
.RE
.RS 4
.RE
.IP "\fBsmoothing\fR" 4
.IX Item "smoothing"
.PD
Set smoothing.
Possible values are:
.RS 4
.IP "\fIoff\fR" 4
.IX Item "off"
.PD 0
.IP "\fIon\fR" 4
.IX Item "on"
.RE
.RS 4
.RE
.IP "\fBformant\fR" 4
.IX Item "formant"
.PD
Enable formant preservation when shift pitching.
Possible values are:
.RS 4
.IP "\fIshifted\fR" 4
.IX Item "shifted"
.PD 0
.IP "\fIpreserved\fR" 4
.IX Item "preserved"
.RE
.RS 4
.RE
.IP "\fBpitchq\fR" 4
.IX Item "pitchq"
.PD
Set pitch quality.
Possible values are:
.RS 4
.IP "\fIquality\fR" 4
.IX Item "quality"
.PD 0
.IP "\fIspeed\fR" 4
.IX Item "speed"
.IP "\fIconsistency\fR" 4
.IX Item "consistency"
.RE
.RS 4
.RE
.IP "\fBchannels\fR" 4
.IX Item "channels"
.PD
Set channels.
Possible values are:
.RS 4
.IP "\fIapart\fR" 4
.IX Item "apart"
.PD 0
.IP "\fItogether\fR" 4
.IX Item "together"
.RE
.RS 4
.RE
.PD
.SS "sidechaincompress"
.IX Subsection "sidechaincompress"
This filter acts like normal compressor but has the ability to compress
detected signal using second input signal.
It needs two input streams and returns one output stream.
First input stream will be processed depending on second stream signal.
The filtered signal then can be filtered with other filters in later stages of
processing. See \fBpan\fR and \fBamerge\fR filter.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input gain. Default is 1. Range is between 0.015625 and 64.
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
If a signal of second stream raises above this level it will affect the gain
reduction of first stream.
By default is 0.125. Range is between 0.00097563 and 1.
.IP "\fBratio\fR" 4
.IX Item "ratio"
Set a ratio about which the signal is reduced. 1:2 means that if the level
raised 4dB above the threshold, it will be only 2dB above after the reduction.
Default is 2. Range is between 1 and 20.
.IP "\fBattack\fR" 4
.IX Item "attack"
Amount of milliseconds the signal has to rise above the threshold before gain
reduction starts. Default is 20. Range is between 0.01 and 2000.
.IP "\fBrelease\fR" 4
.IX Item "release"
Amount of milliseconds the signal has to fall below the threshold before
reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
.IP "\fBmakeup\fR" 4
.IX Item "makeup"
Set the amount by how much signal will be amplified after processing.
Default is 2. Range is from 1 and 64.
.IP "\fBknee\fR" 4
.IX Item "knee"
Curve the sharp knee around the threshold to enter gain reduction more softly.
Default is 2.82843. Range is between 1 and 8.
.IP "\fBlink\fR" 4
.IX Item "link"
Choose if the \f(CW\*(C`average\*(C'\fR level between all channels of side-chain stream
or the louder(\f(CW\*(C`maximum\*(C'\fR) channel of side-chain stream affects the
reduction. Default is \f(CW\*(C`average\*(C'\fR.
.IP "\fBdetection\fR" 4
.IX Item "detection"
Should the exact signal be taken in case of \f(CW\*(C`peak\*(C'\fR or an \s-1RMS\s0 one in case
of \f(CW\*(C`rms\*(C'\fR. Default is \f(CW\*(C`rms\*(C'\fR which is mainly smoother.
.IP "\fBlevel_sc\fR" 4
.IX Item "level_sc"
Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
.IP "\fBmix\fR" 4
.IX Item "mix"
How much to use compressed signal in output. Default is 1.
Range is between 0 and 1.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
depending on the signal of 2nd input and later compressed signal to be
merged with 2nd input:
.Sp
.Vb 1
\&        ffmpeg \-i main.flac \-i sidechain.flac \-filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
.Ve
.SS "sidechaingate"
.IX Subsection "sidechaingate"
A sidechain gate acts like a normal (wideband) gate but has the ability to
filter the detected signal before sending it to the gain reduction stage.
Normally a gate uses the full range signal to detect a level above the
threshold.
For example: If you cut all lower frequencies from your sidechain signal
the gate will decrease the volume of your track only if not enough highs
appear. With this technique you are able to reduce the resonation of a
natural drum or remove \*(L"rumbling\*(R" of muted strokes from a heavily distorted
guitar.
It needs two input streams and returns one output stream.
First input stream will be processed depending on second stream signal.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input level before filtering.
Default is 1. Allowed range is from 0.015625 to 64.
.IP "\fBrange\fR" 4
.IX Item "range"
Set the level of gain reduction when the signal is below the threshold.
Default is 0.06125. Allowed range is from 0 to 1.
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
If a signal rises above this level the gain reduction is released.
Default is 0.125. Allowed range is from 0 to 1.
.IP "\fBratio\fR" 4
.IX Item "ratio"
Set a ratio about which the signal is reduced.
Default is 2. Allowed range is from 1 to 9000.
.IP "\fBattack\fR" 4
.IX Item "attack"
Amount of milliseconds the signal has to rise above the threshold before gain
reduction stops.
Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
.IP "\fBrelease\fR" 4
.IX Item "release"
Amount of milliseconds the signal has to fall below the threshold before the
reduction is increased again. Default is 250 milliseconds.
Allowed range is from 0.01 to 9000.
.IP "\fBmakeup\fR" 4
.IX Item "makeup"
Set amount of amplification of signal after processing.
Default is 1. Allowed range is from 1 to 64.
.IP "\fBknee\fR" 4
.IX Item "knee"
Curve the sharp knee around the threshold to enter gain reduction more softly.
Default is 2.828427125. Allowed range is from 1 to 8.
.IP "\fBdetection\fR" 4
.IX Item "detection"
Choose if exact signal should be taken for detection or an \s-1RMS\s0 like one.
Default is rms. Can be peak or rms.
.IP "\fBlink\fR" 4
.IX Item "link"
Choose if the average level between all channels or the louder channel affects
the reduction.
Default is average. Can be average or maximum.
.IP "\fBlevel_sc\fR" 4
.IX Item "level_sc"
Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
.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 "silenceremove"
.IX Subsection "silenceremove"
Remove silence from the beginning, middle or end of the audio.
.PP
The filter accepts the following options:
.IP "\fBstart_periods\fR" 4
.IX Item "start_periods"
This value is used to indicate if audio should be trimmed at beginning of
the audio. A value of zero indicates no silence should be trimmed from the
beginning. When specifying a non-zero value, it trims audio up until it
finds non-silence. Normally, when trimming silence from beginning of audio
the \fIstart_periods\fR will be \f(CW1\fR but it can be increased to higher
values to trim all audio up to specific count of non-silence periods.
Default value is \f(CW0\fR.
.IP "\fBstart_duration\fR" 4
.IX Item "start_duration"
Specify the amount of time that non-silence must be detected before it stops
trimming audio. By increasing the duration, bursts of noises can be treated
as silence and trimmed off. Default value is \f(CW0\fR.
.IP "\fBstart_threshold\fR" 4
.IX Item "start_threshold"
This indicates what sample value should be treated as silence. For digital
audio, a value of \f(CW0\fR may be fine but for audio recorded from analog,
you may wish to increase the value to account for background noise.
Can be specified in dB (in case \*(L"dB\*(R" is appended to the specified value)
or amplitude ratio. Default value is \f(CW0\fR.
.IP "\fBstop_periods\fR" 4
.IX Item "stop_periods"
Set the count for trimming silence from the end of audio.
To remove silence from the middle of a file, specify a \fIstop_periods\fR
that is negative. This value is then treated as a positive value and is
used to indicate the effect should restart processing as specified by
\&\fIstart_periods\fR, making it suitable for removing periods of silence
in the middle of the audio.
Default value is \f(CW0\fR.
.IP "\fBstop_duration\fR" 4
.IX Item "stop_duration"
Specify a duration of silence that must exist before audio is not copied any
more. By specifying a higher duration, silence that is wanted can be left in
the audio.
Default value is \f(CW0\fR.
.IP "\fBstop_threshold\fR" 4
.IX Item "stop_threshold"
This is the same as \fBstart_threshold\fR but for trimming silence from
the end of audio.
Can be specified in dB (in case \*(L"dB\*(R" is appended to the specified value)
or amplitude ratio. Default value is \f(CW0\fR.
.IP "\fBleave_silence\fR" 4
.IX Item "leave_silence"
This indicates that \fIstop_duration\fR length of audio should be left intact
at the beginning of each period of silence.
For example, if you want to remove long pauses between words but do not want
to remove the pauses completely. Default value is \f(CW0\fR.
.IP "\fBdetection\fR" 4
.IX Item "detection"
Set how is silence detected. Can be \f(CW\*(C`rms\*(C'\fR or \f(CW\*(C`peak\*(C'\fR. Second is faster
and works better with digital silence which is exactly 0.
Default value is \f(CW\*(C`rms\*(C'\fR.
.IP "\fBwindow\fR" 4
.IX Item "window"
Set ratio used to calculate size of window for detecting silence.
Default value is \f(CW0.02\fR. Allowed range is from \f(CW0\fR to \f(CW10\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
The following example shows how this filter can be used to start a recording
that does not contain the delay at the start which usually occurs between
pressing the record button and the start of the performance:
.Sp
.Vb 1
\&        silenceremove=1:5:0.02
.Ve
.IP "\(bu" 4
Trim all silence encountered from beginning to end where there is more than 1
second of silence in audio:
.Sp
.Vb 1
\&        silenceremove=0:0:0:\-1:1:\-90dB
.Ve
.SS "sofalizer"
.IX Subsection "sofalizer"
SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
loudspeakers around the user for binaural listening via headphones (audio
formats up to 9 channels supported).
The HRTFs are stored in \s-1SOFA\s0 files (see <\fBhttp://www.sofacoustics.org/\fR> for a database).
SOFAlizer is developed at the Acoustics Research Institute (\s-1ARI\s0) of the
Austrian Academy of Sciences.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-netcdf\*(C'\fR.
.PP
The filter accepts the following options:
.IP "\fBsofa\fR" 4
.IX Item "sofa"
Set the \s-1SOFA\s0 file used for rendering.
.IP "\fBgain\fR" 4
.IX Item "gain"
Set gain applied to audio. Value is in dB. Default is 0.
.IP "\fBrotation\fR" 4
.IX Item "rotation"
Set rotation of virtual loudspeakers in deg. Default is 0.
.IP "\fBelevation\fR" 4
.IX Item "elevation"
Set elevation of virtual speakers in deg. Default is 0.
.IP "\fBradius\fR" 4
.IX Item "radius"
Set distance in meters between loudspeakers and the listener with near-field
HRTFs. Default is 1.
.IP "\fBtype\fR" 4
.IX Item "type"
Set processing type. Can be \fItime\fR or \fIfreq\fR. \fItime\fR is
processing audio in time domain which is slow.
\&\fIfreq\fR is processing audio in frequency domain which is fast.
Default is \fIfreq\fR.
.IP "\fBspeakers\fR" 4
.IX Item "speakers"
Set custom positions of virtual loudspeakers. Syntax for this option is:
<\s-1CH\s0> <\s-1AZIM\s0> <\s-1ELEV\s0>[|<\s-1CH\s0> <\s-1AZIM\s0> <\s-1ELEV\s0>|...].
Each virtual loudspeaker is described with short channel name following with
azimuth and elevation in degreees.
Each virtual loudspeaker description is separated by '|'.
For example to override front left and front right channel positions use:
\&'speakers=FL 45 15|FR 345 15'.
Descriptions with unrecognised channel names are ignored.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Using ClubFritz6 sofa file:
.Sp
.Vb 1
\&        sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
.Ve
.IP "\(bu" 4
Using ClubFritz12 sofa file and bigger radius with small rotation:
.Sp
.Vb 1
\&        sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
.Ve
.IP "\(bu" 4
Similar as above but with custom speaker positions for front left, front right, rear left and rear right
and also with custom gain:
.Sp
.Vb 1
\&        "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|RL 135|RR 225:gain=28"
.Ve
.SS "stereotools"
.IX Subsection "stereotools"
This filter has some handy utilities to manage stereo signals, for converting
M/S stereo recordings to L/R signal while having control over the parameters
or spreading the stereo image of master track.
.PP
The filter accepts the following options:
.IP "\fBlevel_in\fR" 4
.IX Item "level_in"
Set input level before filtering for both channels. Defaults is 1.
Allowed range is from 0.015625 to 64.
.IP "\fBlevel_out\fR" 4
.IX Item "level_out"
Set output level after filtering for both channels. Defaults is 1.
Allowed range is from 0.015625 to 64.
.IP "\fBbalance_in\fR" 4
.IX Item "balance_in"
Set input balance between both channels. Default is 0.
Allowed range is from \-1 to 1.
.IP "\fBbalance_out\fR" 4
.IX Item "balance_out"
Set output balance between both channels. Default is 0.
Allowed range is from \-1 to 1.
.IP "\fBsoftclip\fR" 4
.IX Item "softclip"
Enable softclipping. Results in analog distortion instead of harsh digital 0dB
clipping. Disabled by default.
.IP "\fBmutel\fR" 4
.IX Item "mutel"
Mute the left channel. Disabled by default.
.IP "\fBmuter\fR" 4
.IX Item "muter"
Mute the right channel. Disabled by default.
.IP "\fBphasel\fR" 4
.IX Item "phasel"
Change the phase of the left channel. Disabled by default.
.IP "\fBphaser\fR" 4
.IX Item "phaser"
Change the phase of the right channel. Disabled by default.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set stereo mode. Available values are:
.RS 4
.IP "\fBlr>lr\fR" 4
.IX Item "lr>lr"
Left/Right to Left/Right, this is default.
.IP "\fBlr>ms\fR" 4
.IX Item "lr>ms"
Left/Right to Mid/Side.
.IP "\fBms>lr\fR" 4
.IX Item "ms>lr"
Mid/Side to Left/Right.
.IP "\fBlr>ll\fR" 4
.IX Item "lr>ll"
Left/Right to Left/Left.
.IP "\fBlr>rr\fR" 4
.IX Item "lr>rr"
Left/Right to Right/Right.
.IP "\fBlr>l+r\fR" 4
.IX Item "lr>l+r"
Left/Right to Left + Right.
.IP "\fBlr>rl\fR" 4
.IX Item "lr>rl"
Left/Right to Right/Left.
.RE
.RS 4
.RE
.IP "\fBslev\fR" 4
.IX Item "slev"
Set level of side signal. Default is 1.
Allowed range is from 0.015625 to 64.
.IP "\fBsbal\fR" 4
.IX Item "sbal"
Set balance of side signal. Default is 0.
Allowed range is from \-1 to 1.
.IP "\fBmlev\fR" 4
.IX Item "mlev"
Set level of the middle signal. Default is 1.
Allowed range is from 0.015625 to 64.
.IP "\fBmpan\fR" 4
.IX Item "mpan"
Set middle signal pan. Default is 0. Allowed range is from \-1 to 1.
.IP "\fBbase\fR" 4
.IX Item "base"
Set stereo base between mono and inversed channels. Default is 0.
Allowed range is from \-1 to 1.
.IP "\fBdelay\fR" 4
.IX Item "delay"
Set delay in milliseconds how much to delay left from right channel and
vice versa. Default is 0. Allowed range is from \-20 to 20.
.IP "\fBsclevel\fR" 4
.IX Item "sclevel"
Set S/C level. Default is 1. Allowed range is from 1 to 100.
.IP "\fBphase\fR" 4
.IX Item "phase"
Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply karaoke like effect:
.Sp
.Vb 1
\&        stereotools=mlev=0.015625
.Ve
.IP "\(bu" 4
Convert M/S signal to L/R:
.Sp
.Vb 1
\&        "stereotools=mode=ms>lr"
.Ve
.SS "stereowiden"
.IX Subsection "stereowiden"
This filter enhance the stereo effect by suppressing signal common to both
channels and by delaying the signal of left into right and vice versa,
thereby widening the stereo effect.
.PP
The filter accepts the following options:
.IP "\fBdelay\fR" 4
.IX Item "delay"
Time in milliseconds of the delay of left signal into right and vice versa.
Default is 20 milliseconds.
.IP "\fBfeedback\fR" 4
.IX Item "feedback"
Amount of gain in delayed signal into right and vice versa. Gives a delay
effect of left signal in right output and vice versa which gives widening
effect. Default is 0.3.
.IP "\fBcrossfeed\fR" 4
.IX Item "crossfeed"
Cross feed of left into right with inverted phase. This helps in suppressing
the mono. If the value is 1 it will cancel all the signal common to both
channels. Default is 0.3.
.IP "\fBdrymix\fR" 4
.IX Item "drymix"
Set level of input signal of original channel. Default is 0.8.
.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 "tremolo"
.IX Subsection "tremolo"
Sinusoidal amplitude modulation.
.PP
The filter accepts the following options:
.IP "\fBf\fR" 4
.IX Item "f"
Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
(20 Hz or lower) will result in a tremolo effect.
This filter may also be used as a ring modulator by specifying
a modulation frequency higher than 20 Hz.
Range is 0.1 \- 20000.0. Default value is 5.0 Hz.
.IP "\fBd\fR" 4
.IX Item "d"
Depth of modulation as a percentage. Range is 0.0 \- 1.0.
Default value is 0.5.
.SS "vibrato"
.IX Subsection "vibrato"
Sinusoidal phase modulation.
.PP
The filter accepts the following options:
.IP "\fBf\fR" 4
.IX Item "f"
Modulation frequency in Hertz.
Range is 0.1 \- 20000.0. Default value is 5.0 Hz.
.IP "\fBd\fR" 4
.IX Item "d"
Depth of modulation as a percentage. Range is 0.0 \- 1.0.
Default value is 0.5.
.SS "volume"
.IX Subsection "volume"
Adjust the input audio volume.
.PP
It accepts the following parameters:
.IP "\fBvolume\fR" 4
.IX Item "volume"
Set audio volume expression.
.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
The default value for \fIvolume\fR is \*(L"1.0\*(R".
.IP "\fBprecision\fR" 4
.IX Item "precision"
This parameter represents the mathematical precision.
.Sp
It 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; this limits input sample format to U8, S16, and S32.
.IP "\fBfloat\fR" 4
.IX Item "float"
32\-bit floating-point; this limits input sample format to \s-1FLT. \s0(default)
.IP "\fBdouble\fR" 4
.IX Item "double"
64\-bit floating-point; this limits input sample format to \s-1DBL.\s0
.RE
.RS 4
.RE
.IP "\fBreplaygain\fR" 4
.IX Item "replaygain"
Choose the behaviour on encountering ReplayGain side data in input frames.
.RS 4
.IP "\fBdrop\fR" 4
.IX Item "drop"
Remove ReplayGain side data, ignoring its contents (the default).
.IP "\fBignore\fR" 4
.IX Item "ignore"
Ignore ReplayGain side data, but leave it in the frame.
.IP "\fBtrack\fR" 4
.IX Item "track"
Prefer the track gain, if present.
.IP "\fBalbum\fR" 4
.IX Item "album"
Prefer the album gain, if present.
.RE
.RS 4
.RE
.IP "\fBreplaygain_preamp\fR" 4
.IX Item "replaygain_preamp"
Pre-amplification gain in dB to apply to the selected replaygain gain.
.Sp
Default value for \fIreplaygain_preamp\fR is 0.0.
.IP "\fBeval\fR" 4
.IX Item "eval"
Set when the volume expression is evaluated.
.Sp
It accepts the following values:
.RS 4
.IP "\fBonce\fR" 4
.IX Item "once"
only evaluate expression once during the filter initialization, or
when the \fBvolume\fR command is sent
.IP "\fBframe\fR" 4
.IX Item "frame"
evaluate expression for each incoming frame
.RE
.RS 4
.Sp
Default value is \fBonce\fR.
.RE
.PP
The volume expression can contain the following parameters.
.IP "\fBn\fR" 4
.IX Item "n"
frame number (starting at zero)
.IP "\fBnb_channels\fR" 4
.IX Item "nb_channels"
number of channels
.IP "\fBnb_consumed_samples\fR" 4
.IX Item "nb_consumed_samples"
number of samples consumed by the filter
.IP "\fBnb_samples\fR" 4
.IX Item "nb_samples"
number of samples in the current frame
.IP "\fBpos\fR" 4
.IX Item "pos"
original frame position in the file
.IP "\fBpts\fR" 4
.IX Item "pts"
frame \s-1PTS\s0
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
sample rate
.IP "\fBstartpts\fR" 4
.IX Item "startpts"
\&\s-1PTS\s0 at start of stream
.IP "\fBstartt\fR" 4
.IX Item "startt"
time at start of stream
.IP "\fBt\fR" 4
.IX Item "t"
frame time
.IP "\fBtb\fR" 4
.IX Item "tb"
timestamp timebase
.IP "\fBvolume\fR" 4
.IX Item "volume"
last set volume value
.PP
Note that when \fBeval\fR is set to \fBonce\fR only the
\&\fIsample_rate\fR and \fItb\fR variables are available, all other
variables will evaluate to \s-1NAN.\s0
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBvolume\fR" 4
.IX Item "volume"
Modify the volume expression.
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.
.IP "\fBreplaygain_noclip\fR" 4
.IX Item "replaygain_noclip"
Prevent clipping by limiting the gain applied.
.Sp
Default value for \fIreplaygain_noclip\fR is 1.
.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
.IP "\(bu" 4
Fade volume after time 10 with an annihilation period of 5 seconds:
.Sp
.Vb 1
\&        volume=\*(Aqif(lt(t,10),1,max(1\-(t\-10)/5,0))\*(Aq:eval=frame
.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 a 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 parameters:
.IP "\fBtime_base\fR" 4
.IX Item "time_base"
The 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 corresponding 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. Otherwise the last
specified expression is applied to the remaining output channels.
.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
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
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"
The 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"
Specifies 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"
Specifies 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
.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 synthesize 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 "anoisesrc"
.IX Subsection "anoisesrc"
Generate a noise audio signal.
.PP
The filter accepts the following options:
.IP "\fBsample_rate, r\fR" 4
.IX Item "sample_rate, r"
Specify the sample rate. Default value is 48000 Hz.
.IP "\fBamplitude, a\fR" 4
.IX Item "amplitude, a"
Specify the amplitude (0.0 \- 1.0) of the generated audio stream. Default value
is 1.0.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
Specify the duration of the generated audio stream. Not specifying this option
results in noise with an infinite length.
.IP "\fBcolor, colour, c\fR" 4
.IX Item "color, colour, c"
Specify the color of noise. Available noise colors are white, pink, and brown.
Default color is white.
.IP "\fBseed, s\fR" 4
.IX Item "seed, s"
Specify a value used to seed the \s-1PRNG.\s0
.IP "\fBnb_samples, n\fR" 4
.IX Item "nb_samples, n"
Set the number of samples per each output frame, default is 1024.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
.Sp
.Vb 1
\&        anoisesrc=d=60:c=pink:r=44100:a=0.5
.Ve
.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, r\fR" 4
.IX Item "sample_rate, r"
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.
.Sp
The expression can contain the following constants:
.RS 4
.IP "\fBn\fR" 4
.IX Item "n"
The (sequential) number of the output audio frame, starting from 0.
.IP "\fBpts\fR" 4
.IX Item "pts"
The \s-1PTS \s0(Presentation TimeStamp) of the output audio frame,
expressed in \fI\s-1TB\s0\fR units.
.IP "\fBt\fR" 4
.IX Item "t"
The \s-1PTS\s0 of the output audio frame, expressed in seconds.
.IP "\fB\s-1TB\s0\fR" 4
.IX Item "TB"
The timebase of the output audio frames.
.RE
.RS 4
.Sp
Default is \f(CW1024\fR.
.RE
.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
.IP "\(bu" 4
Generate a 1 kHz sine wave following \f(CW\*(C`1602,1601,1602,1601,1602\*(C'\fR \s-1NTSC\s0
pattern:
.Sp
.Vb 1
\&        sine=1000:samples_per_frame=\*(Aqst(0,mod(n,5)); 1602\-not(not(eq(ld(0),1)+eq(ld(0),3)))\*(Aq
.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 for use 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 \fBsubtitles\fR 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.
.PP
This filter accepts the following option in addition to the common options from
the \fBsubtitles\fR filter:
.IP "\fBshaping\fR" 4
.IX Item "shaping"
Set the shaping engine
.Sp
Available values are:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
The default libass shaping engine, which is the best available.
.IP "\fBsimple\fR" 4
.IX Item "simple"
Fast, font-agnostic shaper that can do only substitutions
.IP "\fBcomplex\fR" 4
.IX Item "complex"
Slower shaper using OpenType for substitutions and positioning
.RE
.RS 4
.Sp
The default is \f(CW\*(C`auto\*(C'\fR.
.RE
.SS "atadenoise"
.IX Subsection "atadenoise"
Apply an Adaptive Temporal Averaging Denoiser to the video input.
.PP
The filter accepts the following options:
.IP "\fB0a\fR" 4
.IX Item "0a"
Set threshold A for 1st plane. Default is 0.02.
Valid range is 0 to 0.3.
.IP "\fB0b\fR" 4
.IX Item "0b"
Set threshold B for 1st plane. Default is 0.04.
Valid range is 0 to 5.
.IP "\fB1a\fR" 4
.IX Item "1a"
Set threshold A for 2nd plane. Default is 0.02.
Valid range is 0 to 0.3.
.IP "\fB1b\fR" 4
.IX Item "1b"
Set threshold B for 2nd plane. Default is 0.04.
Valid range is 0 to 5.
.IP "\fB2a\fR" 4
.IX Item "2a"
Set threshold A for 3rd plane. Default is 0.02.
Valid range is 0 to 0.3.
.IP "\fB2b\fR" 4
.IX Item "2b"
Set threshold B for 3rd plane. Default is 0.04.
Valid range is 0 to 5.
.Sp
Threshold A is designed to react on abrupt changes in the input signal and
threshold B is designed to react on continuous changes in the input signal.
.IP "\fBs\fR" 4
.IX Item "s"
Set number of frames filter will use for averaging. Default is 33. Must be odd
number in range [5, 129].
.IP "\fBp\fR" 4
.IX Item "p"
Set what planes of frame filter will use for averaging. Default is all.
.SS "avgblur"
.IX Subsection "avgblur"
Apply average blur filter.
.PP
The filter accepts the following options:
.IP "\fBsizeX\fR" 4
.IX Item "sizeX"
Set horizontal kernel size.
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes to filter. By default all planes are filtered.
.IP "\fBsizeY\fR" 4
.IX Item "sizeY"
Set vertical kernel size, if zero it will be same as \f(CW\*(C`sizeX\*(C'\fR.
Default is \f(CW0\fR.
.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.
.PP
The filter accepts the following option:
.IP "\fBmin_val\fR" 4
.IX Item "min_val"
Set the minimal luminance value. Default is \f(CW16\fR.
.SS "bitplanenoise"
.IX Subsection "bitplanenoise"
Show and measure bit plane noise.
.PP
The filter accepts the following options:
.IP "\fBbitplane\fR" 4
.IX Item "bitplane"
Set which plane to analyze. Default is \f(CW1\fR.
.IP "\fBfilter\fR" 4
.IX Item "filter"
Filter out noisy pixels from \f(CW\*(C`bitplane\*(C'\fR set above.
Default is disabled.
.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
It accepts the following parameters:
.IP "\fBamount\fR" 4
.IX Item "amount"
The percentage of the pixels that have to be below the threshold; it defaults to
\&\f(CW98\fR.
.IP "\fBthreshold, thresh\fR" 4
.IX Item "threshold, thresh"
The threshold below which a pixel value is considered black; it defaults to
\&\f(CW32\fR.
.SS "blend, tblend"
.IX Subsection "blend, tblend"
Blend two video frames into each other.
.PP
The \f(CW\*(C`blend\*(C'\fR filter 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.  By default, the output terminates when the longest input terminates.
.PP
The \f(CW\*(C`tblend\*(C'\fR (time blend) filter takes two consecutive frames
from one single stream, and outputs the result obtained by blending
the new frame on top of the old frame.
.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 "\fBaddition128\fR" 4
.IX Item "addition128"
.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 "\fBdifference128\fR" 4
.IX Item "difference128"
.IP "\fBdivide\fR" 4
.IX Item "divide"
.IP "\fBdodge\fR" 4
.IX Item "dodge"
.IP "\fBfreeze\fR" 4
.IX Item "freeze"
.IP "\fBexclusion\fR" 4
.IX Item "exclusion"
.IP "\fBglow\fR" 4
.IX Item "glow"
.IP "\fBhardlight\fR" 4
.IX Item "hardlight"
.IP "\fBhardmix\fR" 4
.IX Item "hardmix"
.IP "\fBheat\fR" 4
.IX Item "heat"
.IP "\fBlighten\fR" 4
.IX Item "lighten"
.IP "\fBlinearlight\fR" 4
.IX Item "linearlight"
.IP "\fBmultiply\fR" 4
.IX Item "multiply"
.IP "\fBmultiply128\fR" 4
.IX Item "multiply128"
.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, A\s0\fR" 4
.IX Item "TOP, A"
Value of pixel component at current location for first video frame (top layer).
.IP "\fB\s-1BOTTOM, B\s0\fR" 4
.IX Item "BOTTOM, B"
Value of pixel component at current location for second video frame (bottom layer).
.RE
.RS 4
.RE
.IP "\fBshortest\fR" 4
.IX Item "shortest"
Force termination when the shortest input terminates. Default is
\&\f(CW0\fR. This option is only defined for the \f(CW\*(C`blend\*(C'\fR filter.
.IP "\fBrepeatlast\fR" 4
.IX Item "repeatlast"
Continue applying the last bottom frame after the end of the stream. A value of
\&\f(CW0\fR disable the filter after the last frame of the bottom layer is reached.
Default is \f(CW1\fR. This option is only defined for the \f(CW\*(C`blend\*(C'\fR filter.
.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
.IP "\(bu" 4
Apply uncover left effect:
.Sp
.Vb 1
\&        blend=all_expr=\*(Aqif(gte(N*SW+X,W),A,B)\*(Aq
.Ve
.IP "\(bu" 4
Apply uncover down effect:
.Sp
.Vb 1
\&        blend=all_expr=\*(Aqif(gte(Y\-N*SH,0),A,B)\*(Aq
.Ve
.IP "\(bu" 4
Apply uncover up-left effect:
.Sp
.Vb 1
\&        blend=all_expr=\*(Aqif(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)\*(Aq
.Ve
.IP "\(bu" 4
Split diagonally video and shows top and bottom layer on each side:
.Sp
.Vb 1
\&        blend=all_expr=if(gt(X,Y*(W/H)),A,B)
.Ve
.IP "\(bu" 4
Display differences between the current and the previous frame:
.Sp
.Vb 1
\&        tblend=all_mode=difference128
.Ve
.SS "boxblur"
.IX Subsection "boxblur"
Apply a boxblur algorithm to the input video.
.PP
It accepts the following parameters:
.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\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
The input width and height in pixels.
.IP "\fBcw\fR" 4
.IX Item "cw"
.PD 0
.IP "\fBch\fR" 4
.IX Item "ch"
.PD
The input chroma image width and height in pixels.
.IP "\fBhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
The 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 the luma, chroma, and alpha radii
set to 2:
.Sp
.Vb 2
\&        boxblur=luma_radius=2:luma_power=1
\&        boxblur=2:1
.Ve
.IP "\(bu" 4
Set the luma radius to 2, and alpha and chroma radius to 0:
.Sp
.Vb 1
\&        boxblur=2:1:cr=0:ar=0
.Ve
.IP "\(bu" 4
Set the luma and chroma radii 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 "bwdif"
.IX Subsection "bwdif"
Deinterlace the input video (\*(L"bwdif\*(R" stands for \*(L"Bob Weaver
Deinterlacing Filter\*(R").
.PP
Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
interpolation algorithms.
It accepts the following parameters:
.IP "\fBmode\fR" 4
.IX Item "mode"
The interlacing mode to adopt. It accepts one of the following values:
.RS 4
.IP "\fB0, send_frame\fR" 4
.IX Item "0, send_frame"
Output one frame for each frame.
.IP "\fB1, send_field\fR" 4
.IX Item "1, send_field"
Output one frame for each field.
.RE
.RS 4
.Sp
The default value is \f(CW\*(C`send_field\*(C'\fR.
.RE
.IP "\fBparity\fR" 4
.IX Item "parity"
The picture field parity assumed for the input interlaced video. It accepts one
of the following values:
.RS 4
.IP "\fB0, tff\fR" 4
.IX Item "0, tff"
Assume the top field is first.
.IP "\fB1, bff\fR" 4
.IX Item "1, bff"
Assume the bottom field is first.
.IP "\fB\-1, auto\fR" 4
.IX Item "-1, auto"
Enable automatic detection of field parity.
.RE
.RS 4
.Sp
The default value is \f(CW\*(C`auto\*(C'\fR.
If the interlacing is unknown or the 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
The default value is \f(CW\*(C`all\*(C'\fR.
.RE
.SS "chromakey"
.IX Subsection "chromakey"
\&\s-1YUV\s0 colorspace color/chroma keying.
.PP
The filter accepts the following options:
.IP "\fBcolor\fR" 4
.IX Item "color"
The color which will be replaced with transparency.
.IP "\fBsimilarity\fR" 4
.IX Item "similarity"
Similarity percentage with the key color.
.Sp
0.01 matches only the exact key color, while 1.0 matches everything.
.IP "\fBblend\fR" 4
.IX Item "blend"
Blend percentage.
.Sp
0.0 makes pixels either fully transparent, or not transparent at all.
.Sp
Higher values result in semi-transparent pixels, with a higher transparency
the more similar the pixels color is to the key color.
.IP "\fByuv\fR" 4
.IX Item "yuv"
Signals that the color passed is already in \s-1YUV\s0 instead of \s-1RGB.\s0
.Sp
Litteral colors like \*(L"green\*(R" or \*(L"red\*(R" don't make sense with this enabled anymore.
This can be used to pass exact \s-1YUV\s0 values as hexadecimal numbers.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Make every green pixel in the input image transparent:
.Sp
.Vb 1
\&        ffmpeg \-i input.png \-vf chromakey=green out.png
.Ve
.IP "\(bu" 4
Overlay a greenscreen-video on top of a static black background.
.Sp
.Vb 1
\&        ffmpeg \-f lavfi \-i color=c=black:s=1280x720 \-i video.mp4 \-shortest \-filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" \-map "[out]" output.mkv
.Ve
.SS "ciescope"
.IX Subsection "ciescope"
Display \s-1CIE\s0 color diagram with pixels overlaid onto it.
.PP
The filter accepts the following options:
.IP "\fBsystem\fR" 4
.IX Item "system"
Set color system.
.RS 4
.IP "\fBntsc, 470m\fR" 4
.IX Item "ntsc, 470m"
.PD 0
.IP "\fBebu, 470bg\fR" 4
.IX Item "ebu, 470bg"
.IP "\fBsmpte\fR" 4
.IX Item "smpte"
.IP "\fB240m\fR" 4
.IX Item "240m"
.IP "\fBapple\fR" 4
.IX Item "apple"
.IP "\fBwidergb\fR" 4
.IX Item "widergb"
.IP "\fBcie1931\fR" 4
.IX Item "cie1931"
.IP "\fBrec709, hdtv\fR" 4
.IX Item "rec709, hdtv"
.IP "\fBuhdtv, rec2020\fR" 4
.IX Item "uhdtv, rec2020"
.RE
.RS 4
.RE
.IP "\fBcie\fR" 4
.IX Item "cie"
.PD
Set \s-1CIE\s0 system.
.RS 4
.IP "\fBxyy\fR" 4
.IX Item "xyy"
.PD 0
.IP "\fBucs\fR" 4
.IX Item "ucs"
.IP "\fBluv\fR" 4
.IX Item "luv"
.RE
.RS 4
.RE
.IP "\fBgamuts\fR" 4
.IX Item "gamuts"
.PD
Set what gamuts to draw.
.Sp
See \f(CW\*(C`system\*(C'\fR option for available values.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set ciescope size, by default set to 512.
.IP "\fBintensity, i\fR" 4
.IX Item "intensity, i"
Set intensity used to map input pixel values to \s-1CIE\s0 diagram.
.IP "\fBcontrast\fR" 4
.IX Item "contrast"
Set contrast used to draw tongue colors that are out of active color system gamut.
.IP "\fBcorrgamma\fR" 4
.IX Item "corrgamma"
Correct gamma displayed on scope, by default enabled.
.IP "\fBshowwhite\fR" 4
.IX Item "showwhite"
Show white point on \s-1CIE\s0 diagram, by default disabled.
.IP "\fBgamma\fR" 4
.IX Item "gamma"
Set input gamma. Used only with \s-1XYZ\s0 input color space.
.SS "codecview"
.IX Subsection "codecview"
Visualize information exported by some codecs.
.PP
Some codecs can export information through frames using side-data or other
means. For example, some \s-1MPEG\s0 based codecs export motion vectors through the
\&\fIexport_mvs\fR flag in the codec \fBflags2\fR option.
.PP
The filter accepts the following option:
.IP "\fBmv\fR" 4
.IX Item "mv"
Set motion vectors to visualize.
.Sp
Available flags for \fImv\fR are:
.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 "\fBqp\fR" 4
.IX Item "qp"
Display quantization parameters using the chroma planes.
.IP "\fBmv_type, mvt\fR" 4
.IX Item "mv_type, mvt"
Set motion vectors type to visualize. Includes MVs from all frames unless specified by \fIframe_type\fR option.
.Sp
Available flags for \fImv_type\fR are:
.RS 4
.IP "\fBfp\fR" 4
.IX Item "fp"
forward predicted MVs
.IP "\fBbp\fR" 4
.IX Item "bp"
backward predicted MVs
.RE
.RS 4
.RE
.IP "\fBframe_type, ft\fR" 4
.IX Item "frame_type, ft"
Set frame type to visualize motion vectors of.
.Sp
Available flags for \fIframe_type\fR are:
.RS 4
.IP "\fBif\fR" 4
.IX Item "if"
intra-coded frames (I\-frames)
.IP "\fBpf\fR" 4
.IX Item "pf"
predicted frames (P\-frames)
.IP "\fBbf\fR" 4
.IX Item "bf"
bi-directionally predicted frames (B\-frames)
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Visualize forward predicted MVs of all frames using \fBffplay\fR:
.Sp
.Vb 1
\&        ffplay \-flags2 +export_mvs input.mp4 \-vf codecview=mv_type=fp
.Ve
.IP "\(bu" 4
Visualize multi-directionals MVs of P and B\-Frames using \fBffplay\fR:
.Sp
.Vb 1
\&        ffplay \-flags2 +export_mvs input.mp4 \-vf codecview=mv=pf+bf+bb
.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 "colorkey"
.IX Subsection "colorkey"
\&\s-1RGB\s0 colorspace color keying.
.PP
The filter accepts the following options:
.IP "\fBcolor\fR" 4
.IX Item "color"
The color which will be replaced with transparency.
.IP "\fBsimilarity\fR" 4
.IX Item "similarity"
Similarity percentage with the key color.
.Sp
0.01 matches only the exact key color, while 1.0 matches everything.
.IP "\fBblend\fR" 4
.IX Item "blend"
Blend percentage.
.Sp
0.0 makes pixels either fully transparent, or not transparent at all.
.Sp
Higher values result in semi-transparent pixels, with a higher transparency
the more similar the pixels color is to the key color.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Make every green pixel in the input image transparent:
.Sp
.Vb 1
\&        ffmpeg \-i input.png \-vf colorkey=green out.png
.Ve
.IP "\(bu" 4
Overlay a greenscreen-video on top of a static background image.
.Sp
.Vb 1
\&        ffmpeg \-i background.png \-i video.mp4 \-filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" \-map "[out]" output.flv
.Ve
.SS "colorlevels"
.IX Subsection "colorlevels"
Adjust video input frames using levels.
.PP
The filter accepts the following options:
.IP "\fBrimin\fR" 4
.IX Item "rimin"
.PD 0
.IP "\fBgimin\fR" 4
.IX Item "gimin"
.IP "\fBbimin\fR" 4
.IX Item "bimin"
.IP "\fBaimin\fR" 4
.IX Item "aimin"
.PD
Adjust red, green, blue and alpha input black point.
Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR.
.IP "\fBrimax\fR" 4
.IX Item "rimax"
.PD 0
.IP "\fBgimax\fR" 4
.IX Item "gimax"
.IP "\fBbimax\fR" 4
.IX Item "bimax"
.IP "\fBaimax\fR" 4
.IX Item "aimax"
.PD
Adjust red, green, blue and alpha input white point.
Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW1\fR.
.Sp
Input levels are used to lighten highlights (bright tones), darken shadows
(dark tones), change the balance of bright and dark tones.
.IP "\fBromin\fR" 4
.IX Item "romin"
.PD 0
.IP "\fBgomin\fR" 4
.IX Item "gomin"
.IP "\fBbomin\fR" 4
.IX Item "bomin"
.IP "\fBaomin\fR" 4
.IX Item "aomin"
.PD
Adjust red, green, blue and alpha output black point.
Allowed ranges for options are \f(CW\*(C`[0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR.
.IP "\fBromax\fR" 4
.IX Item "romax"
.PD 0
.IP "\fBgomax\fR" 4
.IX Item "gomax"
.IP "\fBbomax\fR" 4
.IX Item "bomax"
.IP "\fBaomax\fR" 4
.IX Item "aomax"
.PD
Adjust red, green, blue and alpha output white point.
Allowed ranges for options are \f(CW\*(C`[0, 1.0]\*(C'\fR. Defaults are \f(CW1\fR.
.Sp
Output levels allows manual selection of a constrained output level range.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Make video output darker:
.Sp
.Vb 1
\&        colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
.Ve
.IP "\(bu" 4
Increase contrast:
.Sp
.Vb 1
\&        colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
.Ve
.IP "\(bu" 4
Make video output lighter:
.Sp
.Vb 1
\&        colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
.Ve
.IP "\(bu" 4
Increase brightness:
.Sp
.Vb 1
\&        colorlevels=romin=0.5:gomin=0.5:bomin=0.5
.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
.IP "\(bu" 4
Simulate sepia tones:
.Sp
.Vb 1
\&        colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
.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.709\s0
.IP "\fBbt601\fR" 4
.IX Item "bt601"
\&\s-1BT.601\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBfcc\fR" 4
.IX Item "fcc"
\&\s-1FCC\s0
.IP "\fBbt2020\fR" 4
.IX Item "bt2020"
\&\s-1BT.2020\s0
.RE
.RS 4
.RE
.PP
For example to convert from \s-1BT.601\s0 to \s-1SMPTE\-240M,\s0 use the command:
.PP
.Vb 1
\&        colormatrix=bt601:smpte240m
.Ve
.SS "colorspace"
.IX Subsection "colorspace"
Convert colorspace, transfer characteristics or color primaries.
.PP
The filter accepts the following options:
.IP "\fBall\fR" 4
.IX Item "all"
Specify all color properties at once.
.Sp
The accepted values are:
.RS 4
.IP "\fBbt470m\fR" 4
.IX Item "bt470m"
\&\s-1BT.470M\s0
.IP "\fBbt470bg\fR" 4
.IX Item "bt470bg"
\&\s-1BT.470BG\s0
.IP "\fBbt601\-6\-525\fR" 4
.IX Item "bt601-6-525"
\&\s-1BT.601\-6 525\s0
.IP "\fBbt601\-6\-625\fR" 4
.IX Item "bt601-6-625"
\&\s-1BT.601\-6 625\s0
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE\-170M\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBbt2020\fR" 4
.IX Item "bt2020"
\&\s-1BT.2020\s0
.RE
.RS 4
.RE
.IP "\fBspace\fR" 4
.IX Item "space"
Specify output colorspace.
.Sp
The accepted values are:
.RS 4
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBfcc\fR" 4
.IX Item "fcc"
\&\s-1FCC\s0
.IP "\fBbt470bg\fR" 4
.IX Item "bt470bg"
\&\s-1BT.470BG\s0 or \s-1BT.601\-6 625\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE\-170M\s0 or \s-1BT.601\-6 525\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBbt2020ncl\fR" 4
.IX Item "bt2020ncl"
\&\s-1BT.2020\s0 with non-constant luminance
.RE
.RS 4
.RE
.IP "\fBtrc\fR" 4
.IX Item "trc"
Specify output transfer characteristics.
.Sp
The accepted values are:
.RS 4
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBgamma22\fR" 4
.IX Item "gamma22"
Constant gamma of 2.2
.IP "\fBgamma28\fR" 4
.IX Item "gamma28"
Constant gamma of 2.8
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE\-170M, BT.601\-6 625\s0 or \s-1BT.601\-6 525\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBbt2020\-10\fR" 4
.IX Item "bt2020-10"
\&\s-1BT.2020\s0 for 10\-bits content
.IP "\fBbt2020\-12\fR" 4
.IX Item "bt2020-12"
\&\s-1BT.2020\s0 for 12\-bits content
.RE
.RS 4
.RE
.IP "\fBprimaries\fR" 4
.IX Item "primaries"
Specify output color primaries.
.Sp
The accepted values are:
.RS 4
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBbt470m\fR" 4
.IX Item "bt470m"
\&\s-1BT.470M\s0
.IP "\fBbt470bg\fR" 4
.IX Item "bt470bg"
\&\s-1BT.470BG\s0 or \s-1BT.601\-6 625\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE\-170M\s0 or \s-1BT.601\-6 525\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBbt2020\fR" 4
.IX Item "bt2020"
\&\s-1BT.2020\s0
.RE
.RS 4
.RE
.IP "\fBrange\fR" 4
.IX Item "range"
Specify output color range.
.Sp
The accepted values are:
.RS 4
.IP "\fBmpeg\fR" 4
.IX Item "mpeg"
\&\s-1MPEG \s0(restricted) range
.IP "\fBjpeg\fR" 4
.IX Item "jpeg"
\&\s-1JPEG \s0(full) range
.RE
.RS 4
.RE
.IP "\fBformat\fR" 4
.IX Item "format"
Specify output color format.
.Sp
The accepted values are:
.RS 4
.IP "\fByuv420p\fR" 4
.IX Item "yuv420p"
\&\s-1YUV 4:2:0\s0 planar 8\-bits
.IP "\fByuv420p10\fR" 4
.IX Item "yuv420p10"
\&\s-1YUV 4:2:0\s0 planar 10\-bits
.IP "\fByuv420p12\fR" 4
.IX Item "yuv420p12"
\&\s-1YUV 4:2:0\s0 planar 12\-bits
.IP "\fByuv422p\fR" 4
.IX Item "yuv422p"
\&\s-1YUV 4:2:2\s0 planar 8\-bits
.IP "\fByuv422p10\fR" 4
.IX Item "yuv422p10"
\&\s-1YUV 4:2:2\s0 planar 10\-bits
.IP "\fByuv422p12\fR" 4
.IX Item "yuv422p12"
\&\s-1YUV 4:2:2\s0 planar 12\-bits
.IP "\fByuv444p\fR" 4
.IX Item "yuv444p"
\&\s-1YUV 4:4:4\s0 planar 8\-bits
.IP "\fByuv444p10\fR" 4
.IX Item "yuv444p10"
\&\s-1YUV 4:4:4\s0 planar 10\-bits
.IP "\fByuv444p12\fR" 4
.IX Item "yuv444p12"
\&\s-1YUV 4:4:4\s0 planar 12\-bits
.RE
.RS 4
.RE
.IP "\fBfast\fR" 4
.IX Item "fast"
Do a fast conversion, which skips gamma/primary correction. This will take
significantly less \s-1CPU,\s0 but will be mathematically incorrect. To get output
compatible with that produced by the colormatrix filter, use fast=1.
.IP "\fBdither\fR" 4
.IX Item "dither"
Specify dithering mode.
.Sp
The accepted values are:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
No dithering
.IP "\fBfsb\fR" 4
.IX Item "fsb"
Floyd-Steinberg dithering
.RE
.RS 4
.RE
.IP "\fBwpadapt\fR" 4
.IX Item "wpadapt"
Whitepoint adaptation mode.
.Sp
The accepted values are:
.RS 4
.IP "\fBbradford\fR" 4
.IX Item "bradford"
Bradford whitepoint adaptation
.IP "\fBvonkries\fR" 4
.IX Item "vonkries"
von Kries whitepoint adaptation
.IP "\fBidentity\fR" 4
.IX Item "identity"
identity whitepoint adaptation (i.e. no whitepoint adaptation)
.RE
.RS 4
.RE
.IP "\fBiall\fR" 4
.IX Item "iall"
Override all input properties at once. Same accepted values as \fBall\fR.
.IP "\fBispace\fR" 4
.IX Item "ispace"
Override input colorspace. Same accepted values as \fBspace\fR.
.IP "\fBiprimaries\fR" 4
.IX Item "iprimaries"
Override input color primaries. Same accepted values as \fBprimaries\fR.
.IP "\fBitrc\fR" 4
.IX Item "itrc"
Override input transfer characteristics. Same accepted values as \fBtrc\fR.
.IP "\fBirange\fR" 4
.IX Item "irange"
Override input color range. Same accepted values as \fBrange\fR.
.PP
The filter converts the transfer characteristics, color space and color
primaries to the specified user values. The output value, if not specified,
is set to a default value based on the \*(L"all\*(R" property. If that property is
also not specified, the filter will log an error. The output color range and
format default to the same value as the input color range and format. The
input transfer characteristics, color space, color primaries and color range
should be set on the input data. If any of these are missing, the filter will
log an error and no conversion will take place.
.PP
For example to convert the input to \s-1SMPTE\-240M,\s0 use the command:
.PP
.Vb 1
\&        colorspace=smpte240m
.Ve
.SS "convolution"
.IX Subsection "convolution"
Apply convolution 3x3 or 5x5 filter.
.PP
The filter accepts the following options:
.IP "\fB0m\fR" 4
.IX Item "0m"
.PD 0
.IP "\fB1m\fR" 4
.IX Item "1m"
.IP "\fB2m\fR" 4
.IX Item "2m"
.IP "\fB3m\fR" 4
.IX Item "3m"
.PD
Set matrix for each plane.
Matrix is sequence of 9 or 25 signed integers.
.IP "\fB0rdiv\fR" 4
.IX Item "0rdiv"
.PD 0
.IP "\fB1rdiv\fR" 4
.IX Item "1rdiv"
.IP "\fB2rdiv\fR" 4
.IX Item "2rdiv"
.IP "\fB3rdiv\fR" 4
.IX Item "3rdiv"
.PD
Set multiplier for calculated value for each plane.
.IP "\fB0bias\fR" 4
.IX Item "0bias"
.PD 0
.IP "\fB1bias\fR" 4
.IX Item "1bias"
.IP "\fB2bias\fR" 4
.IX Item "2bias"
.IP "\fB3bias\fR" 4
.IX Item "3bias"
.PD
Set bias for each plane. This value is added to the result of the multiplication.
Useful for making the overall image brighter or darker. Default is 0.0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply sharpen:
.Sp
.Vb 1
\&        convolution="0 \-1 0 \-1 5 \-1 0 \-1 0:0 \-1 0 \-1 5 \-1 0 \-1 0:0 \-1 0 \-1 5 \-1 0 \-1 0:0 \-1 0 \-1 5 \-1 0 \-1 0"
.Ve
.IP "\(bu" 4
Apply blur:
.Sp
.Vb 1
\&        convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9"
.Ve
.IP "\(bu" 4
Apply edge enhance:
.Sp
.Vb 1
\&        convolution="0 0 0 \-1 1 0 0 0 0:0 0 0 \-1 1 0 0 0 0:0 0 0 \-1 1 0 0 0 0:0 0 0 \-1 1 0 0 0 0:5:1:1:1:0:128:128:128"
.Ve
.IP "\(bu" 4
Apply edge detect:
.Sp
.Vb 1
\&        convolution="0 1 0 1 \-4 1 0 1 0:0 1 0 1 \-4 1 0 1 0:0 1 0 1 \-4 1 0 1 0:0 1 0 1 \-4 1 0 1 0:5:5:5:1:0:128:128:128"
.Ve
.IP "\(bu" 4
Apply emboss:
.Sp
.Vb 1
\&        convolution="\-2 \-1 0 \-1 1 1 0 1 2:\-2 \-1 0 \-1 1 1 0 1 2:\-2 \-1 0 \-1 1 1 0 1 2:\-2 \-1 0 \-1 1 1 0 1 2"
.Ve
.SS "copy"
.IX Subsection "copy"
Copy the input source unchanged to the output. This is mainly useful for
testing purposes.
.SS "coreimage"
.IX Subsection "coreimage"
Video filtering on \s-1GPU\s0 using Apple's CoreImage \s-1API\s0 on \s-1OSX.\s0
.PP
Hardware acceleration is based on an OpenGL context. Usually, this means it is
processed by video hardware. However, software-based OpenGL implementations
exist which means there is no guarantee for hardware processing. It depends on
the respective \s-1OSX.\s0
.PP
There are many filters and image generators provided by Apple that come with a
large variety of options. The filter has to be referenced by its name along
with its options.
.PP
The coreimage filter accepts the following options:
.IP "\fBlist_filters\fR" 4
.IX Item "list_filters"
List all available filters and generators along with all their respective
options as well as possible minimum and maximum values along with the default
values.
.Sp
.Vb 1
\&        list_filters=true
.Ve
.IP "\fBfilter\fR" 4
.IX Item "filter"
Specify all filters by their respective name and options.
Use \fIlist_filters\fR to determine all valid filter names and options.
Numerical options are specified by a float value and are automatically clamped
to their respective value range.  Vector and color options have to be specified
by a list of space separated float values. Character escaping has to be done.
A special option name \f(CW\*(C`default\*(C'\fR is available to use default options for a
filter.
.Sp
It is required to specify either \f(CW\*(C`default\*(C'\fR or at least one of the filter options.
All omitted options are used with their default values.
The syntax of the filter string is as follows:
.Sp
.Vb 1
\&        filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]][#...]
.Ve
.IP "\fBoutput_rect\fR" 4
.IX Item "output_rect"
Specify a rectangle where the output of the filter chain is copied into the
input image. It is given by a list of space separated float values:
.Sp
.Vb 1
\&        output_rect=x\e y\e width\e height
.Ve
.Sp
If not given, the output rectangle equals the dimensions of the input image.
The output rectangle is automatically cropped at the borders of the input
image. Negative values are valid for each component.
.Sp
.Vb 1
\&        output_rect=25\e 25\e 100\e 100
.Ve
.PP
Several filters can be chained for successive processing without GPU-HOST
transfers allowing for fast processing of complex filter chains.
Currently, only filters with zero (generators) or exactly one (filters) input
image and one output image are supported. Also, transition filters are not yet
usable as intended.
.PP
Some filters generate output images with additional padding depending on the
respective filter kernel. The padding is automatically removed to ensure the
filter output has the same size as the input image.
.PP
For image generators, the size of the output image is determined by the
previous output image of the filter chain or the input image of the whole
filterchain, respectively. The generators do not use the pixel information of
this image to generate their output. However, the generated output is
blended onto this image, resulting in partial or complete coverage of the
output image.
.PP
The \fBcoreimagesrc\fR video source can be used for generating input images
which are directly fed into the filter chain. By using it, providing input
images by another video source or an input video is not required.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
List all filters available:
.Sp
.Vb 1
\&        coreimage=list_filters=true
.Ve
.IP "\(bu" 4
Use the CIBoxBlur filter with default options to blur an image:
.Sp
.Vb 1
\&        coreimage=filter=CIBoxBlur@default
.Ve
.IP "\(bu" 4
Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
its center at 100x100 and a radius of 50 pixels:
.Sp
.Vb 1
\&        coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\e 100@inputRadius=50
.Ve
.IP "\(bu" 4
Use nullsrc and CIQRCodeGenerator to create a \s-1QR\s0 code for the FFmpeg homepage,
given as complete and escaped command-line for Apple's standard bash shell:
.Sp
.Vb 1
\&        ffmpeg \-f lavfi \-i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\e\e\e\e\e://FFmpeg.org/@inputCorrectionLevel=H \-frames:v 1 QRCode.png
.Ve
.SS "crop"
.IX Subsection "crop"
Crop the input video to given dimensions.
.PP
It accepts the following parameters:
.IP "\fBw, out_w\fR" 4
.IX Item "w, out_w"
The width of the output video. It defaults to \f(CW\*(C`iw\*(C'\fR.
This expression is evaluated only once during the filter
configuration, or when the \fBw\fR or \fBout_w\fR command is sent.
.IP "\fBh, out_h\fR" 4
.IX Item "h, out_h"
The height of the output video. It defaults to \f(CW\*(C`ih\*(C'\fR.
This expression is evaluated only once during the filter
configuration, or when the \fBh\fR or \fBout_h\fR command is sent.
.IP "\fBx\fR" 4
.IX Item "x"
The 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"
The 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.
.IP "\fBexact\fR" 4
.IX Item "exact"
Enable exact cropping. If enabled, subsampled videos will be cropped at exact
width/height/x/y as specified and will not be rounded to nearest smaller value.
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\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 "\fBin_w\fR" 4
.IX Item "in_w"
.PD 0
.IP "\fBin_h\fR" 4
.IX Item "in_h"
.PD
The input width and height.
.IP "\fBiw\fR" 4
.IX Item "iw"
.PD 0
.IP "\fBih\fR" 4
.IX Item "ih"
.PD
These are the same as \fIin_w\fR and \fIin_h\fR.
.IP "\fBout_w\fR" 4
.IX Item "out_w"
.PD 0
.IP "\fBout_h\fR" 4
.IX Item "out_h"
.PD
The output (cropped) width and height.
.IP "\fBow\fR" 4
.IX Item "ow"
.PD 0
.IP "\fBoh\fR" 4
.IX Item "oh"
.PD
These are the 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\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
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 the 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"
The timestamp expressed in seconds. It's \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
Apply 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
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBw, out_w\fR" 4
.IX Item "w, out_w"
.PD 0
.IP "\fBh, out_h\fR" 4
.IX Item "h, out_h"
.IP "\fBx\fR" 4
.IX Item "x"
.IP "\fBy\fR" 4
.IX Item "y"
.PD
Set width/height of the output video and the horizontal/vertical position
in 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 "cropdetect"
.IX Subsection "cropdetect"
Auto-detect the crop size.
.PP
It calculates the necessary cropping parameters and prints the
recommended parameters via the logging system. The detected dimensions
correspond to the non-black area of the input video.
.PP
It accepts the following parameters:
.IP "\fBlimit\fR" 4
.IX Item "limit"
Set higher black value threshold, which can be optionally specified
from nothing (0) to everything (255 for 8\-bit based formats). An intensity
value greater to the set value is considered non-black. It defaults to 24.
You can also specify a value between 0.0 and 1.0 which will be scaled depending
on the bitdepth of the pixel format.
.IP "\fBround\fR" 4
.IX Item "round"
The value which the width/height should be divisible by. It defaults to
16. 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.
.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 returns 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
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`.acv\*(C'\fR) to import the settings from.
.IP "\fBplot\fR" 4
.IX Item "plot"
Save Gnuplot script of the curves in specified file.
.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/0 0.5/0.58 1/1\*(Aq
.Ve
.IP "\(bu" 4
Vintage effect:
.Sp
.Vb 1
\&        curves=r=\*(Aq0/0.11 .42/.51 1/0.95\*(Aq:g=\*(Aq0/0 0.50/0.48 1/1\*(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.acv\*(Aq:green=\*(Aq0/0 0.45/0.53 1/1\*(Aq
.Ve
.IP "\(bu" 4
Check out the curves of the \f(CW\*(C`cross_process\*(C'\fR profile using \fBffmpeg\fR
and \fBgnuplot\fR:
.Sp
.Vb 2
\&        ffmpeg \-f lavfi \-i color \-vf curves=cross_process:plot=/tmp/curves.plt \-frames:v 1 \-f null \-
\&        gnuplot \-p /tmp/curves.plt
.Ve
.SS "datascope"
.IX Subsection "datascope"
Video data analysis filter.
.PP
This filter shows hexadecimal pixel values of part of video.
.PP
The filter accepts the following options:
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set output video size.
.IP "\fBx\fR" 4
.IX Item "x"
Set x offset from where to pick pixels.
.IP "\fBy\fR" 4
.IX Item "y"
Set y offset from where to pick pixels.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set scope mode, can be one of the following:
.RS 4
.IP "\fBmono\fR" 4
.IX Item "mono"
Draw hexadecimal pixel values with white color on black background.
.IP "\fBcolor\fR" 4
.IX Item "color"
Draw hexadecimal pixel values with input video pixel color on black
background.
.IP "\fBcolor2\fR" 4
.IX Item "color2"
Draw hexadecimal pixel values on color background picked from input video,
the text color is picked in such way so its always visible.
.RE
.RS 4
.RE
.IP "\fBaxis\fR" 4
.IX Item "axis"
Draw rows and columns numbers on left and top of video.
.IP "\fBopacity\fR" 4
.IX Item "opacity"
Set background opacity.
.SS "dctdnoiz"
.IX Subsection "dctdnoiz"
Denoise frames using 2D \s-1DCT \s0(frequency domain filtering).
.PP
This filter is not designed for real time.
.PP
The filter accepts the following options:
.IP "\fBsigma, s\fR" 4
.IX Item "sigma, s"
Set the noise sigma constant.
.Sp
This \fIsigma\fR defines a hard threshold of \f(CW\*(C`3 * sigma\*(C'\fR; every \s-1DCT\s0
coefficient (absolute value) below this threshold with be dropped.
.Sp
If you need a more advanced filtering, see \fBexpr\fR.
.Sp
Default is \f(CW0\fR.
.IP "\fBoverlap\fR" 4
.IX Item "overlap"
Set number overlapping pixels for each block. Since the filter can be slow, you
may want to reduce this value, at the cost of a less effective filter and the
risk of various artefacts.
.Sp
If the overlapping value doesn't permit processing the whole input width or
height, a warning will be displayed and according borders won't be denoised.
.Sp
Default value is \fIblocksize\fR\-1, which is the best possible setting.
.IP "\fBexpr, e\fR" 4
.IX Item "expr, e"
Set the coefficient factor expression.
.Sp
For each coefficient of a \s-1DCT\s0 block, this expression will be evaluated as a
multiplier value for the coefficient.
.Sp
If this is option is set, the \fBsigma\fR option will be ignored.
.Sp
The absolute value of the coefficient can be accessed through the \fIc\fR
variable.
.IP "\fBn\fR" 4
.IX Item "n"
Set the \fIblocksize\fR using the number of bits. \f(CW\*(C`1<<\f(CIn\f(CW\*(C'\fR defines the
\&\fIblocksize\fR, which is the width and height of the processed blocks.
.Sp
The default value is \fI3\fR (8x8) and can be raised to \fI4\fR for a
\&\fIblocksize\fR of 16x16. Note that changing this setting has huge consequences
on the speed processing. Also, a larger block size does not necessarily means a
better de-noising.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Apply a denoise with a \fBsigma\fR of \f(CW4.5\fR:
.PP
.Vb 1
\&        dctdnoiz=4.5
.Ve
.PP
The same operation can be achieved using the expression system:
.PP
.Vb 1
\&        dctdnoiz=e=\*(Aqgte(c, 4.5*3)\*(Aq
.Ve
.PP
Violent denoise using a block size of \f(CW\*(C`16x16\*(C'\fR:
.PP
.Vb 1
\&        dctdnoiz=15:n=4
.Ve
.SS "deband"
.IX Subsection "deband"
Remove banding artifacts from input video.
It works by replacing banded pixels with average value of referenced pixels.
.PP
The filter accepts the following options:
.IP "\fB1thr\fR" 4
.IX Item "1thr"
.PD 0
.IP "\fB2thr\fR" 4
.IX Item "2thr"
.IP "\fB3thr\fR" 4
.IX Item "3thr"
.IP "\fB4thr\fR" 4
.IX Item "4thr"
.PD
Set banding detection threshold for each plane. Default is 0.02.
Valid range is 0.00003 to 0.5.
If difference between current pixel and reference pixel is less than threshold,
it will be considered as banded.
.IP "\fBrange, r\fR" 4
.IX Item "range, r"
Banding detection range in pixels. Default is 16. If positive, random number
in range 0 to set value will be used. If negative, exact absolute value
will be used.
The range defines square of four pixels around current pixel.
.IP "\fBdirection, d\fR" 4
.IX Item "direction, d"
Set direction in radians from which four pixel will be compared. If positive,
random direction from 0 to set direction will be picked. If negative, exact of
absolute value will be picked. For example direction 0, \-PI or \-2*PI radians
will pick only pixels on same row and \-PI/2 will pick only pixels on same
column.
.IP "\fBblur\fR" 4
.IX Item "blur"
If enabled, current pixel is compared with average value of all four
surrounding pixels. The default is enabled. If disabled current pixel is
compared with all four surrounding pixels. The pixel is considered banded
if only all four differences with surrounding pixels are less than threshold.
.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 "deflate"
.IX Subsection "deflate"
Apply deflate effect to the video.
.PP
This filter replaces the pixel by the local(3x3) average by taking into account
only values lower than the pixel.
.PP
It accepts the following options:
.IP "\fBthreshold0\fR" 4
.IX Item "threshold0"
.PD 0
.IP "\fBthreshold1\fR" 4
.IX Item "threshold1"
.IP "\fBthreshold2\fR" 4
.IX Item "threshold2"
.IP "\fBthreshold3\fR" 4
.IX Item "threshold3"
.PD
Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged.
.SS "dejudder"
.IX Subsection "dejudder"
Remove judder produced by partially interlaced telecined content.
.PP
Judder can be introduced, for instance, by \fBpullup\fR filter. If the original
source was partially telecined content then the output of \f(CW\*(C`pullup,dejudder\*(C'\fR
will have a variable frame rate. May change the recorded frame rate of the
container. Aside from that change, this filter will not affect constant frame
rate video.
.PP
The option available in this filter is:
.IP "\fBcycle\fR" 4
.IX Item "cycle"
Specify the length of the window over which the judder repeats.
.Sp
Accepts any integer greater than 1. Useful values are:
.RS 4
.IP "\fB4\fR" 4
.IX Item "4"
If the original was telecined from 24 to 30 fps (Film to \s-1NTSC\s0).
.IP "\fB5\fR" 4
.IX Item "5"
If the original was telecined from 25 to 30 fps (\s-1PAL\s0 to \s-1NTSC\s0).
.IP "\fB20\fR" 4
.IX Item "20"
If a mixture of the two.
.RE
.RS 4
.Sp
The default is \fB4\fR.
.RE
.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
It accepts the following parameters:
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
Specify the top left corner coordinates of the logo. They must be
specified.
.IP "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
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 1. This option is
deprecated, setting higher values should no longer be necessary and
is not recommended.
.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, and \fIh\fR parameters.
The default value is 0.
.Sp
The rectangle is drawn on the outermost pixels which will be (partly)
replaced with interpolated values. The values of the next pixels
immediately outside this rectangle in each direction will be used to
compute the interpolated pixel values inside the rectangle.
.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, and 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 "detelecine"
.IX Subsection "detelecine"
Apply an exact inverse of the telecine operation. It requires a predefined
pattern specified using the pattern option which must be the same as that passed
to the telecine filter.
.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.
.IP "\fBstart_frame\fR" 4
.IX Item "start_frame"
A number representing position of the first frame with respect to the telecine
pattern. This is to be used if the stream is cut. The default value is \f(CW0\fR.
.SS "dilation"
.IX Subsection "dilation"
Apply dilation effect to the video.
.PP
This filter replaces the pixel by the local(3x3) maximum.
.PP
It accepts the following options:
.IP "\fBthreshold0\fR" 4
.IX Item "threshold0"
.PD 0
.IP "\fBthreshold1\fR" 4
.IX Item "threshold1"
.IP "\fBthreshold2\fR" 4
.IX Item "threshold2"
.IP "\fBthreshold3\fR" 4
.IX Item "threshold3"
.PD
Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged.
.IP "\fBcoordinates\fR" 4
.IX Item "coordinates"
Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
pixels are used.
.Sp
Flags to local 3x3 coordinates maps like this:
.Sp
.Vb 3
\&    1 2 3
\&    4   5
\&    6 7 8
.Ve
.SS "displace"
.IX Subsection "displace"
Displace pixels as indicated by second and third input stream.
.PP
It takes three input streams and outputs one stream, the first input is the
source, and second and third input are displacement maps.
.PP
The second input specifies how much to displace pixels along the
x\-axis, while the third input specifies how much to displace pixels
along the y\-axis.
If one of displacement map streams terminates, last frame from that
displacement map will be used.
.PP
Note that once generated, displacements maps can be reused over and over again.
.PP
A description of the accepted options follows.
.IP "\fBedge\fR" 4
.IX Item "edge"
Set displace behavior for pixels that are out of range.
.Sp
Available values are:
.RS 4
.IP "\fBblank\fR" 4
.IX Item "blank"
Missing pixels are replaced by black pixels.
.IP "\fBsmear\fR" 4
.IX Item "smear"
Adjacent pixels will spread out to replace missing pixels.
.IP "\fBwrap\fR" 4
.IX Item "wrap"
Out of range pixels are wrapped so they point to pixels of other side.
.RE
.RS 4
.Sp
Default is \fBsmear\fR.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Add ripple effect to rgb input of video size hd720:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-f lavfi \-i nullsrc=s=hd720,lutrgb=128:128:128 \-f lavfi \-i nullsrc=s=hd720,geq=\*(Aqr=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)\*(Aq \-lavfi \*(Aq[0][1][2]displace\*(Aq OUTPUT
.Ve
.IP "\(bu" 4
Add wave effect to rgb input of video size hd720:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-f lavfi \-i nullsrc=hd720,geq=\*(Aqr=128+80*(sin(sqrt((X\-W/2)*(X\-W/2)+(Y\-H/2)*(Y\-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X\-W/2)*(X\-W/2)+(Y\-H/2)*(Y\-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X\-W/2)*(X\-W/2)+(Y\-H/2)*(Y\-H/2))/220*2*PI+T))\*(Aq \-lavfi \*(Aq[1]split[x][y],[0][x][y]displace\*(Aq OUTPUT
.Ve
.SS "drawbox"
.IX Subsection "drawbox"
Draw a colored box on the input image.
.PP
It accepts the following parameters:
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
The expressions which specify the top left corner coordinates of the box. It defaults to 0.
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
The expressions which specify the width and height of the box; if 0 they are interpreted as
the input width and height. It defaults to 0.
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Specify the color of the box to write. For the general syntax of this option,
check the \*(L"Color\*(R" section in the ffmpeg-utils manual. 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"
The expression which sets the thickness of the box edge. Default value is \f(CW3\fR.
.Sp
See below for the list of accepted constants.
.PP
The parameters for \fIx\fR, \fIy\fR, \fIw\fR and \fIh\fR and \fIt\fR are expressions containing the
following constants:
.IP "\fBdar\fR" 4
.IX Item "dar"
The input display aspect ratio, it is the same as (\fIw\fR / \fIh\fR) * \fIsar\fR.
.IP "\fBhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
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 "\fBin_h, ih\fR" 4
.IX Item "in_h, ih"
.PD 0
.IP "\fBin_w, iw\fR" 4
.IX Item "in_w, iw"
.PD
The input width and height.
.IP "\fBsar\fR" 4
.IX Item "sar"
The input sample aspect ratio.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
The x and y offset coordinates where the box is drawn.
.IP "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
The width and height of the drawn box.
.IP "\fBt\fR" 4
.IX Item "t"
The thickness of the drawn box.
.Sp
These constants allow the \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR and \fIt\fR expressions to refer to
each other, so you may for example specify \f(CW\*(C`y=x/dar\*(C'\fR or \f(CW\*(C`h=w/dar\*(C'\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
.IP "\(bu" 4
Draw a 2\-pixel red 2.40:1 mask:
.Sp
.Vb 1
\&        drawbox=x=\-t:y=0.5*(ih\-iw/2.4)\-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
.Ve
.SS "drawgrid"
.IX Subsection "drawgrid"
Draw a grid on the input image.
.PP
It accepts the following parameters:
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
input width and height, respectively, minus \f(CW\*(C`thickness\*(C'\fR, so image gets
framed. Default to 0.
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Specify the color of the grid. For the general syntax of this option,
check the \*(L"Color\*(R" section in the ffmpeg-utils manual. If the special
value \f(CW\*(C`invert\*(C'\fR is used, the grid color is the same as the
video with inverted luma.
.IP "\fBthickness, t\fR" 4
.IX Item "thickness, t"
The expression which sets the thickness of the grid line. Default value is \f(CW1\fR.
.Sp
See below for the list of accepted constants.
.PP
The parameters for \fIx\fR, \fIy\fR, \fIw\fR and \fIh\fR and \fIt\fR are expressions containing the
following constants:
.IP "\fBdar\fR" 4
.IX Item "dar"
The input display aspect ratio, it is the same as (\fIw\fR / \fIh\fR) * \fIsar\fR.
.IP "\fBhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
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 "\fBin_h, ih\fR" 4
.IX Item "in_h, ih"
.PD 0
.IP "\fBin_w, iw\fR" 4
.IX Item "in_w, iw"
.PD
The input grid cell width and height.
.IP "\fBsar\fR" 4
.IX Item "sar"
The input sample aspect ratio.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
The x and y coordinates of some point of grid intersection (meant to configure offset).
.IP "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
The width and height of the drawn cell.
.IP "\fBt\fR" 4
.IX Item "t"
The thickness of the drawn cell.
.Sp
These constants allow the \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR and \fIt\fR expressions to refer to
each other, so you may for example specify \f(CW\*(C`y=x/dar\*(C'\fR or \f(CW\*(C`h=w/dar\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
.Sp
.Vb 1
\&        drawgrid=width=100:height=100:thickness=2:color=red@0.5
.Ve
.IP "\(bu" 4
Draw a white 3x3 grid with an opacity of 50%:
.Sp
.Vb 1
\&        drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
.Ve
.SS "drawtext"
.IX Subsection "drawtext"
Draw a text string or text from a specified file on top of a 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.
To enable default font fallback and the \fIfont\fR option you need to
configure FFmpeg with \f(CW\*(C`\-\-enable\-libfontconfig\*(C'\fR.
To enable the \fItext_shaping\fR option, you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libfribidi\*(C'\fR.
.PP
\fISyntax\fR
.IX Subsection "Syntax"
.PP
It accepts the following parameters:
.IP "\fBbox\fR" 4
.IX Item "box"
Used to draw a box around text using the background color.
The value must be either 1 (enable) or 0 (disable).
The default value of \fIbox\fR is 0.
.IP "\fBboxborderw\fR" 4
.IX Item "boxborderw"
Set the width of the border to be drawn around the box using \fIboxcolor\fR.
The default value of \fIboxborderw\fR is 0.
.IP "\fBboxcolor\fR" 4
.IX Item "boxcolor"
The color to be used for drawing box around text. For the syntax of this
option, check the \*(L"Color\*(R" section in the ffmpeg-utils manual.
.Sp
The default value of \fIboxcolor\fR is \*(L"white\*(R".
.IP "\fBborderw\fR" 4
.IX Item "borderw"
Set the width of the border to be drawn around the text using \fIbordercolor\fR.
The default value of \fIborderw\fR is 0.
.IP "\fBbordercolor\fR" 4
.IX Item "bordercolor"
Set the color to be used for drawing border around text. For the syntax of this
option, check the \*(L"Color\*(R" section in the ffmpeg-utils manual.
.Sp
The default value of \fIbordercolor\fR is \*(L"black\*(R".
.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 \fBdrawtext_expansion, Text expansion\fR 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. For the syntax of this option, check
the \*(L"Color\*(R" section in the ffmpeg-utils manual.
.Sp
The default value of \fIfontcolor\fR is \*(L"black\*(R".
.IP "\fBfontcolor_expr\fR" 4
.IX Item "fontcolor_expr"
String which is expanded the same way as \fItext\fR to obtain dynamic
\&\fIfontcolor\fR value. By default this option has empty value and is not
processed. When this option is set, it overrides \fIfontcolor\fR option.
.IP "\fBfont\fR" 4
.IX Item "font"
The font family to be used for drawing text. By default Sans.
.IP "\fBfontfile\fR" 4
.IX Item "fontfile"
The font file to be used for drawing text. The path must be included.
This parameter is mandatory if the fontconfig support is disabled.
.IP "\fBdraw\fR" 4
.IX Item "draw"
This option does not exist, please see the timeline system
.IP "\fBalpha\fR" 4
.IX Item "alpha"
Draw the text applying alpha blending. The value can
be a number between 0.0 and 1.0.
The expression accepts the same variables \fIx, y\fR as well.
The default value is 1.
Please see \fIfontcolor_expr\fR.
.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 "\fBtext_shaping\fR" 4
.IX Item "text_shaping"
If set to 1, attempt to shape the text (for example, reverse the order of
right-to-left text and join Arabic characters) before drawing it.
Otherwise, just draw the text exactly as given.
By default 1 (if supported).
.IP "\fBft_load_flags\fR" 4
.IX Item "ft_load_flags"
The 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"
.RE
.RS 4
.PD
.Sp
Default value is \*(L"default\*(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. For the
syntax of this option, check the \*(L"Color\*(R" section in the ffmpeg-utils manual.
.Sp
The default value of \fIshadowcolor\fR is \*(L"black\*(R".
.IP "\fBshadowx\fR" 4
.IX Item "shadowx"
.PD 0
.IP "\fBshadowy\fR" 4
.IX Item "shadowy"
.PD
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. The default value for both is \*(L"0\*(R".
.IP "\fBstart_number\fR" 4
.IX Item "start_number"
The starting frame number for the n/frame_num variable. The default value
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\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
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\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
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"
The 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\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
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
\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 \fB\e\fR, followed by any character, always expands to
the second character.
.PP
Sequences 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 "\fBexpr_int_format, eif\fR" 4
.IX Item "expr_int_format, eif"
Evaluate the expression's value and output as formatted integer.
.Sp
The first argument is the expression to be evaluated, just as for the \fIexpr\fR function.
The second argument specifies the output format. Allowed values are \fBx\fR,
\&\fBX\fR, \fBd\fR and \fBu\fR. They are treated exactly as in the
\&\f(CW\*(C`printf\*(C'\fR function.
The third parameter is optional and sets the number of positions taken by the output.
It can be used to add padding with zeros from the left.
.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 "\fBmetadata\fR" 4
.IX Item "metadata"
Frame metadata. Takes one or two arguments.
.Sp
The first argument is mandatory and specifies the metadata key.
.Sp
The second argument is optional and specifies a default value, used when the
metadata key is not found or empty.
.IP "\fBn, frame_num\fR" 4
.IX Item "n, frame_num"
The frame number, starting from 0.
.IP "\fBpict_type\fR" 4
.IX Item "pict_type"
A 1 character description of the current picture type.
.IP "\fBpts\fR" 4
.IX Item "pts"
The timestamp of the current frame.
It can take up to three arguments.
.Sp
The first argument is the format of the timestamp; it defaults to \f(CW\*(C`flt\*(C'\fR
for seconds as a decimal number with microsecond accuracy; \f(CW\*(C`hms\*(C'\fR stands
for a formatted \fI[\-]HH:MM:SS.mmm\fR timestamp with millisecond accuracy.
\&\f(CW\*(C`gmtime\*(C'\fR stands for the timestamp of the frame formatted as \s-1UTC\s0 time;
\&\f(CW\*(C`localtime\*(C'\fR stands for the timestamp of the frame formatted as
local time zone time.
.Sp
The second argument is an offset added to the timestamp.
.Sp
If the format is set to \f(CW\*(C`localtime\*(C'\fR or \f(CW\*(C`gmtime\*(C'\fR,
a third argument may be supplied: a \fIstrftime()\fR format string.
By default, \fIYYYY-MM-DD \s-1HH:MM:SS\s0\fR format will be used.
.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)/2"
.Ve
.IP "\(bu" 4
Show the text at a random position, switching to a new position every 30 seconds:
.Sp
.Vb 1
\&        drawtext="fontsize=30:fontfile=FreeSerif.ttf:text=\*(Aqhello world\*(Aq:x=if(eq(mod(t\e,30)\e,0)\e,rand(0\e,(w\-text_w))\e,x):y=if(eq(mod(t\e,30)\e,0)\e,rand(0\e,(h\-text_h))\e,y)"
.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:enable=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\e:%a %b %d %Y}\*(Aq
.Ve
.IP "\(bu" 4
Show text fading in and out (appearing/disappearing):
.Sp
.Vb 6
\&        #!/bin/sh
\&        DS=1.0 # display start
\&        DE=10.0 # display end
\&        FID=1.5 # fade in duration
\&        FOD=5 # fade out duration
\&        ffplay \-f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\e\e\e\e: clip(255*(1*between(t\e\e, $DS + $FID\e\e, $DE \- $FOD) + ((t \- $DS)/$FID)*between(t\e\e, $DS\e\e, $DS + $FID) + (\-(t \- $DE)/$FOD)*between(t\e\e, $DE \- $FOD\e\e, $DE) )\e\e, 0\e\e, 255) \e\e\e\e: x\e\e\e\e: 2 }"
.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>.
.PP
For more information about libfribidi, check:
<\fBhttp://fribidi.org/\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\fR" 4
.IX Item "low"
.PD 0
.IP "\fBhigh\fR" 4
.IX Item "high"
.PD
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 chosen 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.
.IP "\fBmode\fR" 4
.IX Item "mode"
Define the drawing mode.
.RS 4
.IP "\fBwires\fR" 4
.IX Item "wires"
Draw white/gray wires on black background.
.IP "\fBcolormix\fR" 4
.IX Item "colormix"
Mix the colors to create a paint/cartoon effect.
.RE
.RS 4
.Sp
Default value is \fIwires\fR.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Standard edge detection with custom values for the hysteresis thresholding:
.Sp
.Vb 1
\&        edgedetect=low=0.1:high=0.4
.Ve
.IP "\(bu" 4
Painting effect without thresholding:
.Sp
.Vb 1
\&        edgedetect=mode=colormix:high=0
.Ve
.SS "eq"
.IX Subsection "eq"
Set brightness, contrast, saturation and approximate gamma adjustment.
.PP
The filter accepts the following options:
.IP "\fBcontrast\fR" 4
.IX Item "contrast"
Set the contrast expression. The value must be a float value in range
\&\f(CW\*(C`\-2.0\*(C'\fR to \f(CW2.0\fR. The default value is \*(L"1\*(R".
.IP "\fBbrightness\fR" 4
.IX Item "brightness"
Set the brightness expression. The value must be a float value in
range \f(CW\*(C`\-1.0\*(C'\fR to \f(CW1.0\fR. The default value is \*(L"0\*(R".
.IP "\fBsaturation\fR" 4
.IX Item "saturation"
Set the saturation expression. The value must be a float in
range \f(CW0.0\fR to \f(CW3.0\fR. The default value is \*(L"1\*(R".
.IP "\fBgamma\fR" 4
.IX Item "gamma"
Set the gamma expression. The value must be a float in range
\&\f(CW0.1\fR to \f(CW10.0\fR.  The default value is \*(L"1\*(R".
.IP "\fBgamma_r\fR" 4
.IX Item "gamma_r"
Set the gamma expression for red. The value must be a float in
range \f(CW0.1\fR to \f(CW10.0\fR. The default value is \*(L"1\*(R".
.IP "\fBgamma_g\fR" 4
.IX Item "gamma_g"
Set the gamma expression for green. The value must be a float in range
\&\f(CW0.1\fR to \f(CW10.0\fR. The default value is \*(L"1\*(R".
.IP "\fBgamma_b\fR" 4
.IX Item "gamma_b"
Set the gamma expression for blue. The value must be a float in range
\&\f(CW0.1\fR to \f(CW10.0\fR. The default value is \*(L"1\*(R".
.IP "\fBgamma_weight\fR" 4
.IX Item "gamma_weight"
Set the gamma weight expression. It can be used to reduce the effect
of a high gamma value on bright image areas, e.g. keep them from
getting overamplified and just plain white. The value must be a float
in range \f(CW0.0\fR to \f(CW1.0\fR. A value of \f(CW0.0\fR turns the
gamma correction all the way down while \f(CW1.0\fR leaves it at its
full strength. Default is \*(L"1\*(R".
.IP "\fBeval\fR" 4
.IX Item "eval"
Set when the expressions for brightness, contrast, saturation and
gamma expressions 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 \fBinit\fR.
.RE
.PP
The expressions accept the following parameters:
.IP "\fBn\fR" 4
.IX Item "n"
frame count of the input frame starting from 0
.IP "\fBpos\fR" 4
.IX Item "pos"
byte position of the corresponding packet in the input file, \s-1NAN\s0 if
unspecified
.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
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
The filter supports the following commands:
.IP "\fBcontrast\fR" 4
.IX Item "contrast"
Set the contrast expression.
.IP "\fBbrightness\fR" 4
.IX Item "brightness"
Set the brightness expression.
.IP "\fBsaturation\fR" 4
.IX Item "saturation"
Set the saturation expression.
.IP "\fBgamma\fR" 4
.IX Item "gamma"
Set the gamma expression.
.IP "\fBgamma_r\fR" 4
.IX Item "gamma_r"
Set the gamma_r expression.
.IP "\fBgamma_g\fR" 4
.IX Item "gamma_g"
Set gamma_g expression.
.IP "\fBgamma_b\fR" 4
.IX Item "gamma_b"
Set gamma_b expression.
.IP "\fBgamma_weight\fR" 4
.IX Item "gamma_weight"
Set gamma_weight expression.
.Sp
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 "erosion"
.IX Subsection "erosion"
Apply erosion effect to the video.
.PP
This filter replaces the pixel by the local(3x3) minimum.
.PP
It accepts the following options:
.IP "\fBthreshold0\fR" 4
.IX Item "threshold0"
.PD 0
.IP "\fBthreshold1\fR" 4
.IX Item "threshold1"
.IP "\fBthreshold2\fR" 4
.IX Item "threshold2"
.IP "\fBthreshold3\fR" 4
.IX Item "threshold3"
.PD
Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged.
.IP "\fBcoordinates\fR" 4
.IX Item "coordinates"
Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
pixels are used.
.Sp
Flags to local 3x3 coordinates maps like this:
.Sp
.Vb 3
\&    1 2 3
\&    4   5
\&    6 7 8
.Ve
.SS "extractplanes"
.IX Subsection "extractplanes"
Extract color channel components from input video stream into
separate grayscale video streams.
.PP
The filter accepts the following option:
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set plane(s) to extract.
.Sp
Available values for planes are:
.RS 4
.IP "\fBy\fR" 4
.IX Item "y"
.PD 0
.IP "\fBu\fR" 4
.IX Item "u"
.IP "\fBv\fR" 4
.IX Item "v"
.IP "\fBa\fR" 4
.IX Item "a"
.IP "\fBr\fR" 4
.IX Item "r"
.IP "\fBg\fR" 4
.IX Item "g"
.IP "\fBb\fR" 4
.IX Item "b"
.RE
.RS 4
.PD
.Sp
Choosing planes not available in the input will result in an error.
That means you cannot select \f(CW\*(C`r\*(C'\fR, \f(CW\*(C`g\*(C'\fR, \f(CW\*(C`b\*(C'\fR planes
with \f(CW\*(C`y\*(C'\fR, \f(CW\*(C`u\*(C'\fR, \f(CW\*(C`v\*(C'\fR planes at same time.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Extract luma, u and v color channel component from input video frame
into 3 grayscale outputs:
.Sp
.Vb 1
\&        ffmpeg \-i video.avi \-filter_complex \*(Aqextractplanes=y+u+v[y][u][v]\*(Aq \-map \*(Aq[y]\*(Aq y.avi \-map \*(Aq[u]\*(Aq u.avi \-map \*(Aq[v]\*(Aq v.avi
.Ve
.SS "elbg"
.IX Subsection "elbg"
Apply a posterize effect using the \s-1ELBG \s0(Enhanced \s-1LBG\s0) algorithm.
.PP
For each input image, the filter will compute the optimal mapping from
the input to the output given the codebook length, that is the number
of distinct output colors.
.PP
This filter accepts the following options.
.IP "\fBcodebook_length, l\fR" 4
.IX Item "codebook_length, l"
Set codebook length. The value must be a positive integer, and
represents the number of distinct output colors. Default value is 256.
.IP "\fBnb_steps, n\fR" 4
.IX Item "nb_steps, n"
Set the maximum number of iterations to apply for computing the optimal
mapping. The higher the value the better the result and the higher the
computation time. Default value is 1.
.IP "\fBseed, s\fR" 4
.IX Item "seed, s"
Set a random seed, 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 "\fBpal8\fR" 4
.IX Item "pal8"
Set pal8 output pixel format. This option does not work with codebook
length greater than 256.
.SS "fade"
.IX Subsection "fade"
Apply a fade\-in/out effect to the input video.
.PP
It accepts the following parameters:
.IP "\fBtype, t\fR" 4
.IX Item "type, t"
The effect type can be either \*(L"in\*(R" for a 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 frame to start applying the fade
effect at. Default is 0.
.IP "\fBnb_frames, n\fR" 4
.IX Item "nb_frames, n"
The number of frames that the fade effect lasts. 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 filled with the
selected \fBcolor\fR.
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.
.IP "\fBstart_time, st\fR" 4
.IX Item "start_time, st"
Specify the timestamp (in seconds) of the frame to start to apply the fade
effect. If both start_frame and start_time are specified, the fade will start at
whichever comes last.  Default is 0.
.IP "\fBduration, d\fR" 4
.IX Item "duration, d"
The number of seconds 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 filled with the
selected \fBcolor\fR.
If both duration and nb_frames are specified, duration is used. Default is 0
(nb_frames is used by default).
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Specify the color of the fade. Default is \*(L"black\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Fade in the 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 the 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 the first 25 frames and fade out the last 25 frames of a 1000\-frame video:
.Sp
.Vb 1
\&        fade=in:0:25, fade=out:975:25
.Ve
.IP "\(bu" 4
Make the first 5 frames yellow, then fade in from frame 5\-24:
.Sp
.Vb 1
\&        fade=in:5:20:color=yellow
.Ve
.IP "\(bu" 4
Fade in alpha over first 25 frames of video:
.Sp
.Vb 1
\&        fade=in:0:25:alpha=1
.Ve
.IP "\(bu" 4
Make the first 5.5 seconds black, then fade in for 0.5 seconds:
.Sp
.Vb 1
\&        fade=t=in:st=5.5:d=0.5
.Ve
.SS "fftfilt"
.IX Subsection "fftfilt"
Apply arbitrary expressions to samples in frequency domain
.IP "\fBdc_Y\fR" 4
.IX Item "dc_Y"
Adjust the dc value (gain) of the luma plane of the image. The filter
accepts an integer value in range \f(CW0\fR to \f(CW1000\fR. The default
value is set to \f(CW0\fR.
.IP "\fBdc_U\fR" 4
.IX Item "dc_U"
Adjust the dc value (gain) of the 1st chroma plane of the image. The
filter accepts an integer value in range \f(CW0\fR to \f(CW1000\fR. The
default value is set to \f(CW0\fR.
.IP "\fBdc_V\fR" 4
.IX Item "dc_V"
Adjust the dc value (gain) of the 2nd chroma plane of the image. The
filter accepts an integer value in range \f(CW0\fR to \f(CW1000\fR. The
default value is set to \f(CW0\fR.
.IP "\fBweight_Y\fR" 4
.IX Item "weight_Y"
Set the frequency domain weight expression for the luma plane.
.IP "\fBweight_U\fR" 4
.IX Item "weight_U"
Set the frequency domain weight expression for the 1st chroma plane.
.IP "\fBweight_V\fR" 4
.IX Item "weight_V"
Set the frequency domain weight expression for the 2nd chroma plane.
.Sp
The filter accepts the following variables:
.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.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
High-pass:
.Sp
.Vb 1
\&        fftfilt=dc_Y=128:weight_Y=\*(Aqsquish(1\-(Y+X)/100)\*(Aq
.Ve
.IP "\(bu" 4
Low-pass:
.Sp
.Vb 1
\&        fftfilt=dc_Y=0:weight_Y=\*(Aqsquish((Y+X)/100\-1)\*(Aq
.Ve
.IP "\(bu" 4
Sharpen:
.Sp
.Vb 1
\&        fftfilt=dc_Y=0:weight_Y=\*(Aq1+squish(1\-(Y+X)/100)\*(Aq
.Ve
.IP "\(bu" 4
Blur:
.Sp
.Vb 1
\&        fftfilt=dc_Y=0:weight_Y=\*(Aqexp(\-4 * ((Y+X)/(W+H)))\*(Aq
.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 "fieldhint"
.IX Subsection "fieldhint"
Create new frames by copying the top and bottom fields from surrounding frames
supplied as numbers by the hint file.
.IP "\fBhint\fR" 4
.IX Item "hint"
Set file containing hints: absolute/relative frame numbers.
.Sp
There must be one line for each frame in a clip. Each line must contain two
numbers separated by the comma, optionally followed by \f(CW\*(C`\-\*(C'\fR or \f(CW\*(C`+\*(C'\fR.
Numbers supplied on each line of file can not be out of [N\-1,N+1] where N
is current frame number for \f(CW\*(C`absolute\*(C'\fR mode or out of [\-1, 1] range
for \f(CW\*(C`relative\*(C'\fR mode. First number tells from which frame to pick up top
field and second number tells from which frame to pick up bottom field.
.Sp
If optionally followed by \f(CW\*(C`+\*(C'\fR output frame will be marked as interlaced,
else if followed by \f(CW\*(C`\-\*(C'\fR output frame will be marked as progressive, else
it will be marked same as input frame.
If line starts with \f(CW\*(C`#\*(C'\fR or \f(CW\*(C`;\*(C'\fR that line is skipped.
.IP "\fBmode\fR" 4
.IX Item "mode"
Can be item \f(CW\*(C`absolute\*(C'\fR or \f(CW\*(C`relative\*(C'\fR. Default is \f(CW\*(C`absolute\*(C'\fR.
.PP
Example of first several lines of \f(CW\*(C`hint\*(C'\fR file for \f(CW\*(C`relative\*(C'\fR mode:
.PP
.Vb 10
\&        0,0 \- # first frame
\&        1,0 \- # second frame, use third\*(Aqs frame top field and second\*(Aqs frame bottom field
\&        1,0 \- # third frame, use fourth\*(Aqs frame top field and third\*(Aqs frame bottom field
\&        1,0 \-
\&        0,0 \-
\&        0,0 \-
\&        1,0 \-
\&        1,0 \-
\&        1,0 \-
\&        0,0 \-
\&        0,0 \-
\&        1,0 \-
\&        1,0 \-
\&        1,0 \-
\&        0,0 \-
.Ve
.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 \fBdecimate\fR 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 \fByadif\fR 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 \fBdecimate\fR filter currently only works for constant frame rate input.
If your input has mixed telecined (30fps) and progressive content with a lower
framerate like 24fps use the following filterchain to produce the necessary cfr
stream: \f(CW\*(C`dejudder,fps=30000/1001,fieldmatch,decimate\*(C'\fR.
.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 won't 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 \fBp/c/n/u/b meaning\fR 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 \fBdecimate\fR 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 \fByadif\fR 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
It accepts the following parameters:
.IP "\fBorder\fR" 4
.IX Item "order"
The output field order. Valid values are \fItff\fR for top field first or \fIbff\fR
for bottom field first.
.PP
The default value is \fBtff\fR.
.PP
The transformation is done 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
It is very useful when converting to or from \s-1PAL DV\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, afifo"
.IX Subsection "fifo, afifo"
Buffer input images and send them when they are requested.
.PP
It is mainly useful when auto-inserted by the libavfilter
framework.
.PP
It does not take parameters.
.SS "find_rect"
.IX Subsection "find_rect"
Find a rectangular object
.PP
It accepts the following options:
.IP "\fBobject\fR" 4
.IX Item "object"
Filepath of the object image, needs to be in gray8.
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
Detection threshold, default is 0.5.
.IP "\fBmipmaps\fR" 4
.IX Item "mipmaps"
Number of mipmaps, default is 3.
.IP "\fBxmin, ymin, xmax, ymax\fR" 4
.IX Item "xmin, ymin, xmax, ymax"
Specifies the rectangle in which to search.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Generate a representative palette of a given video using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i file.ts \-vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
.Ve
.SS "cover_rect"
.IX Subsection "cover_rect"
Cover a rectangular object
.PP
It accepts the following options:
.IP "\fBcover\fR" 4
.IX Item "cover"
Filepath of the optional cover image, needs to be in yuv420.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set covering mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBcover\fR" 4
.IX Item "cover"
cover it by the supplied image
.IP "\fBblur\fR" 4
.IX Item "blur"
cover it by interpolating the surrounding pixels
.RE
.RS 4
.Sp
Default value is \fIblur\fR.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Generate a representative palette of a given video using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i file.ts \-vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
.Ve
.SS "format"
.IX Subsection "format"
Convert the input video to one of the specified pixel formats.
Libavfilter will try to pick one that is suitable as input to
the next filter.
.PP
It accepts the following parameters:
.IP "\fBpix_fmts\fR" 4
.IX Item "pix_fmts"
A '|'\-separated list of pixel format names, such as
\&\*(L"pix_fmts=yuv420p|monow|rgb24\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Convert the input video to the \fIyuv420p\fR format
.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
It accepts the following parameters:
.IP "\fBfps\fR" 4
.IX Item "fps"
The 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
.IP "\fBstart_time\fR" 4
.IX Item "start_time"
Assume the first \s-1PTS\s0 should be the given value, in seconds. This allows for
padding/trimming at the start of stream. By default, no assumption is made
about the first frame's expected \s-1PTS,\s0 so no padding or trimming is done.
For example, this could be set to 0 to pad the beginning with duplicates of
the first frame if a video stream starts after the audio stream or to trim any
frames with a negative \s-1PTS.\s0
.PP
Alternatively, the options can be specified as a flat string:
\&\fIfps\fR[:\fIround\fR].
.PP
See also the \fBsetpts\fR filter.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
A typical usage in order to set the fps to 25:
.Sp
.Vb 1
\&        fps=fps=25
.Ve
.IP "\(bu" 4
Sets the fps to 24, using abbreviation and rounding method to round to nearest:
.Sp
.Vb 1
\&        fps=fps=film:round=near
.Ve
.SS "framepack"
.IX Subsection "framepack"
Pack two different video streams into a stereoscopic video, setting proper
metadata on supported codecs. The two views should have the same size and
framerate and processing will stop when the shorter video ends. Please note
that you may conveniently adjust view properties with the \fBscale\fR and
\&\fBfps\fR filters.
.PP
It accepts the following parameters:
.IP "\fBformat\fR" 4
.IX Item "format"
The desired packing format. Supported values are:
.RS 4
.IP "\fBsbs\fR" 4
.IX Item "sbs"
The views are next to each other (default).
.IP "\fBtab\fR" 4
.IX Item "tab"
The views are on top of each other.
.IP "\fBlines\fR" 4
.IX Item "lines"
The views are packed by line.
.IP "\fBcolumns\fR" 4
.IX Item "columns"
The views are packed by column.
.IP "\fBframeseq\fR" 4
.IX Item "frameseq"
The views are temporally interleaved.
.RE
.RS 4
.RE
.PP
Some examples:
.PP
.Vb 2
\&        # Convert left and right views into a frame\-sequential video
\&        ffmpeg \-i LEFT \-i RIGHT \-filter_complex framepack=frameseq OUTPUT
\&        
\&        # Convert views into a side\-by\-side video with the same output resolution as the input
\&        ffmpeg \-i LEFT \-i RIGHT \-filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
.Ve
.SS "framerate"
.IX Subsection "framerate"
Change the frame rate by interpolating new video output frames from the source
frames.
.PP
This filter is not designed to function correctly with interlaced media. If
you wish to change the frame rate of interlaced media then you are required
to deinterlace before this filter and re-interlace after this filter.
.PP
A description of the accepted options follows.
.IP "\fBfps\fR" 4
.IX Item "fps"
Specify the output frames per second. This option can also be specified
as a value alone. The default is \f(CW50\fR.
.IP "\fBinterp_start\fR" 4
.IX Item "interp_start"
Specify the start of a range where the output frame will be created as a
linear interpolation of two frames. The range is [\f(CW0\fR\-\f(CW255\fR],
the default is \f(CW15\fR.
.IP "\fBinterp_end\fR" 4
.IX Item "interp_end"
Specify the end of a range where the output frame will be created as a
linear interpolation of two frames. The range is [\f(CW0\fR\-\f(CW255\fR],
the default is \f(CW240\fR.
.IP "\fBscene\fR" 4
.IX Item "scene"
Specify the level at which a scene change is detected as a value between
0 and 100 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.
The default is \f(CW7\fR.
.IP "\fBflags\fR" 4
.IX Item "flags"
Specify flags influencing the filter process.
.Sp
Available value for \fIflags\fR is:
.RS 4
.IP "\fBscene_change_detect, scd\fR" 4
.IX Item "scene_change_detect, scd"
Enable scene change detection using the value of the option \fIscene\fR.
This flag is enabled by default.
.RE
.RS 4
.RE
.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 the compilation of this filter, you need to install the frei0r
header and configure FFmpeg with \f(CW\*(C`\-\-enable\-frei0r\*(C'\fR.
.PP
It accepts the following parameters:
.IP "\fBfilter_name\fR" 4
.IX Item "filter_name"
The name of the frei0r effect to load. If the environment variable
\&\fB\s-1FREI0R_PATH\s0\fR is defined, the frei0r effect is searched for in each of the
directories specified by the colon-separated list in \fB\s-1FREIOR_PATH\s0\fR.
Otherwise, the standard frei0r paths are searched, 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 (its value is either
\&\*(L"y\*(R" or \*(L"n\*(R"), a double, a color (specified as
\&\fIR\fR/\fIG\fR/\fIB\fR, where \fIR\fR, \fIG\fR, and \fIB\fR are floating point
numbers between 0.0 and 1.0, inclusive) or by a color description specified in the \*(L"Color\*(R"
section in the ffmpeg-utils manual), a position (specified as \fIX\fR/\fIY\fR, where
\&\fIX\fR and \fIY\fR are floating point numbers) and/or a string.
.PP
The number and types 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, setting 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, taking a color as the 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, specifying 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 "fspp"
.IX Subsection "fspp"
Apply fast and simple postprocessing. It is a faster version of \fBspp\fR.
.PP
It splits (I)DCT into horizontal/vertical passes. Unlike the simple post\-
processing filter, one of them is performed once per block, not per pixel.
This allows for much higher speed.
.PP
The filter accepts the following options:
.IP "\fBquality\fR" 4
.IX Item "quality"
Set quality. This option defines the number of levels for averaging. It accepts
an integer in the range 4\-5. Default value is \f(CW4\fR.
.IP "\fBqp\fR" 4
.IX Item "qp"
Force a constant quantization parameter. It accepts an integer in range 0\-63.
If not set, the filter will use the \s-1QP\s0 from the video stream (if available).
.IP "\fBstrength\fR" 4
.IX Item "strength"
Set filter strength. It accepts an integer in range \-15 to 32. Lower values mean
more details but also more artifacts, while higher values make the image smoother
but also blurrier. Default value is \f(CW0\fR X \s-1PSNR\s0 optimal.
.IP "\fBuse_bframe_qp\fR" 4
.IX Item "use_bframe_qp"
Enable the use of the \s-1QP\s0 from the B\-Frames if set to \f(CW1\fR. Using this
option may cause flicker since the B\-Frames have often larger \s-1QP.\s0 Default is
\&\f(CW0\fR (not enabled).
.SS "gblur"
.IX Subsection "gblur"
Apply Gaussian blur filter.
.PP
The filter accepts the following options:
.IP "\fBsigma\fR" 4
.IX Item "sigma"
Set horizontal sigma, standard deviation of Gaussian blur. Default is \f(CW0.5\fR.
.IP "\fBsteps\fR" 4
.IX Item "steps"
Set number of steps for Gaussian approximation. Defauls is \f(CW1\fR.
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes to filter. By default all planes are filtered.
.IP "\fBsigmaV\fR" 4
.IX Item "sigmaV"
Set vertical sigma, if negative it will be same as \f(CW\*(C`sigma\*(C'\fR.
Default is \f(CW\*(C`\-1\*(C'\fR.
.SS "geq"
.IX Subsection "geq"
The filter accepts the following options:
.IP "\fBlum_expr, lum\fR" 4
.IX Item "lum_expr, lum"
Set the luminance expression.
.IP "\fBcb_expr, cb\fR" 4
.IX Item "cb_expr, cb"
Set the chrominance blue expression.
.IP "\fBcr_expr, cr\fR" 4
.IX Item "cr_expr, cr"
Set the chrominance red expression.
.IP "\fBalpha_expr, a\fR" 4
.IX Item "alpha_expr, a"
Set the alpha expression.
.IP "\fBred_expr, r\fR" 4
.IX Item "red_expr, r"
Set the red expression.
.IP "\fBgreen_expr, g\fR" 4
.IX Item "green_expr, g"
Set the green expression.
.IP "\fBblue_expr, b\fR" 4
.IX Item "blue_expr, b"
Set the blue expression.
.PP
The colorspace is selected according to the specified options. If one
of the \fBlum_expr\fR, \fBcb_expr\fR, or \fBcr_expr\fR
options is specified, the filter will automatically select a YCbCr
colorspace. If one of the \fBred_expr\fR, \fBgreen_expr\fR, or
\&\fBblue_expr\fR options is specified, it will select an \s-1RGB\s0
colorspace.
.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
to 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. Return 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. Return 0 if there is no such plane.
.IP "\fBr(x, y)\fR" 4
.IX Item "r(x, y)"
.PD 0
.IP "\fBg(x, y)\fR" 4
.IX Item "g(x, y)"
.IP "\fBb(x, y)\fR" 4
.IX Item "b(x, y)"
.PD
Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the
red/green/blue component. Return 0 if there is no such component.
.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. Return 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
.IP "\(bu" 4
Modify \s-1RGB\s0 components depending on pixel position:
.Sp
.Vb 1
\&        geq=r=\*(AqX/W*r(X,Y)\*(Aq:g=\*(Aq(1\-X/W)*g(X,Y)\*(Aq:b=\*(Aq(H\-Y)/H*b(X,Y)\*(Aq
.Ve
.IP "\(bu" 4
Create a radial gradient that is the same size as the input (also see
the \fBvignette\fR filter):
.Sp
.Vb 1
\&        geq=lum=255*gauss((X/W\-0.5)*3)*gauss((Y/H\-0.5)*3)/gauss(0)/gauss(0),format=gray
.Ve
.SS "gradfun"
.IX Subsection "gradfun"
Fix the banding artifacts that are sometimes introduced into nearly flat
regions by truncation to 8\-bit color depth.
Interpolate the gradients that should go where the bands are, and
dither them.
.PP
It 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
It accepts the following parameters:
.IP "\fBstrength\fR" 4
.IX Item "strength"
The maximum amount by which the filter will change any one pixel. This is also
the threshold for detecting nearly flat regions. Acceptable values range from
\&.51 to 64; the 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; the 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 "haldclut"
.IX Subsection "haldclut"
Apply a Hald \s-1CLUT\s0 to a video stream.
.PP
First input is the video stream to process, and second one is the Hald \s-1CLUT.\s0
The Hald \s-1CLUT\s0 input can be a simple picture or a complete video stream.
.PP
The filter accepts the following options:
.IP "\fBshortest\fR" 4
.IX Item "shortest"
Force termination when the shortest input terminates. Default is \f(CW0\fR.
.IP "\fBrepeatlast\fR" 4
.IX Item "repeatlast"
Continue applying the last \s-1CLUT\s0 after the end of the stream. A value of
\&\f(CW0\fR disable the filter after the last frame of the \s-1CLUT\s0 is reached.
Default is \f(CW1\fR.
.PP
\&\f(CW\*(C`haldclut\*(C'\fR also has the same interpolation options as \fBlut3d\fR (both
filters share the same internals).
.PP
More information about the Hald \s-1CLUT\s0 can be found on Eskil Steenberg's website
(Hald \s-1CLUT\s0 author) at <\fBhttp://www.quelsolaar.com/technology/clut.html\fR>.
.PP
\fIWorkflow examples\fR
.IX Subsection "Workflow examples"
.PP
Hald \s-1CLUT\s0 video stream
.IX Subsection "Hald CLUT video stream"
.PP
Generate an identity Hald \s-1CLUT\s0 stream altered with various effects:
.PP
.Vb 1
\&        ffmpeg \-f lavfi \-i B<haldclutsrc>=8 \-vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" \-t 10 \-c:v ffv1 clut.nut
.Ve
.PP
Note: make sure you use a lossless codec.
.PP
Then use it with \f(CW\*(C`haldclut\*(C'\fR to apply it on some random stream:
.PP
.Vb 1
\&        ffmpeg \-f lavfi \-i mandelbrot \-i clut.nut \-filter_complex \*(Aq[0][1] haldclut\*(Aq \-t 20 mandelclut.mkv
.Ve
.PP
The Hald \s-1CLUT\s0 will be applied to the 10 first seconds (duration of
\&\fIclut.nut\fR), then the latest picture of that \s-1CLUT\s0 stream will be applied
to the remaining frames of the \f(CW\*(C`mandelbrot\*(C'\fR stream.
.PP
Hald \s-1CLUT\s0 with preview
.IX Subsection "Hald CLUT with preview"
.PP
A Hald \s-1CLUT\s0 is supposed to be a squared image of \f(CW\*(C`Level*Level*Level\*(C'\fR by
\&\f(CW\*(C`Level*Level*Level\*(C'\fR pixels. For a given Hald \s-1CLUT,\s0 FFmpeg will select the
biggest possible square starting at the top left of the picture. The remaining
padding pixels (bottom or right) will be ignored. This area can be used to add
a preview of the Hald \s-1CLUT.\s0
.PP
Typically, the following generated Hald \s-1CLUT\s0 will be supported by the
\&\f(CW\*(C`haldclut\*(C'\fR filter:
.PP
.Vb 5
\&        ffmpeg \-f lavfi \-i B<haldclutsrc>=8 \-vf "
\&           pad=iw+320 [padded_clut];
\&           smptebars=s=320x256, split [a][b];
\&           [padded_clut][a] overlay=W\-320:h, curves=color_negative [main];
\&           [main][b] overlay=W\-320" \-frames:v 1 clut.png
.Ve
.PP
It contains the original and a preview of the effect of the \s-1CLUT: SMPTE\s0 color
bars are displayed on the right-top, and below the same color bars processed by
the color changes.
.PP
Then, the effect of this Hald \s-1CLUT\s0 can be visualized with:
.PP
.Vb 1
\&        ffplay input.mkv \-vf "movie=clut.png, [in] haldclut"
.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 the color component
distribution in an image.
.PP
Standard histogram displays the color components distribution in an image.
Displays color graph for each color component. Shows distribution of
the Y, U, V, A or R, G, B components, depending on input format, in the
current frame. Below each graph a color component scale meter is shown.
.PP
The filter accepts the following options:
.IP "\fBlevel_height\fR" 4
.IX Item "level_height"
Set height of level. 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. Default value is \f(CW12\fR.
Allowed range is [0, 40].
.IP "\fBdisplay_mode\fR" 4
.IX Item "display_mode"
Set display mode.
It accepts the following values:
.RS 4
.IP "\fBparade\fR" 4
.IX Item "parade"
Per color component graphs are placed below each other.
.IP "\fBoverlay\fR" 4
.IX Item "overlay"
Presents information identical to that in the \f(CW\*(C`parade\*(C'\fR, except
that the graphs representing color components are superimposed directly
over one another.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`parade\*(C'\fR.
.RE
.IP "\fBlevels_mode\fR" 4
.IX Item "levels_mode"
Set mode. Can be either \f(CW\*(C`linear\*(C'\fR, or \f(CW\*(C`logarithmic\*(C'\fR.
Default is \f(CW\*(C`linear\*(C'\fR.
.IP "\fBcomponents\fR" 4
.IX Item "components"
Set what color components to display.
Default is \f(CW7\fR.
.IP "\fBfgopacity\fR" 4
.IX Item "fgopacity"
Set foreground opacity. Default is \f(CW0.7\fR.
.IP "\fBbgopacity\fR" 4
.IX Item "bgopacity"
Set background opacity. Default is \f(CW0.5\fR.
.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"
This is a high precision/quality 3d denoise filter. It 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 floating point number which specifies spatial luma strength.
It defaults to 4.0.
.IP "\fBchroma_spatial\fR" 4
.IX Item "chroma_spatial"
A non-negative floating point number which specifies spatial chroma strength.
It defaults to 3.0*\fIluma_spatial\fR/4.0.
.IP "\fBluma_tmp\fR" 4
.IX Item "luma_tmp"
A floating point number which specifies luma temporal strength. It defaults to
6.0*\fIluma_spatial\fR/4.0.
.IP "\fBchroma_tmp\fR" 4
.IX Item "chroma_tmp"
A floating point number which specifies chroma temporal strength. It defaults to
\&\fIluma_tmp\fR*\fIchroma_spatial\fR/\fIluma_spatial\fR.
.SS "hwupload_cuda"
.IX Subsection "hwupload_cuda"
Upload system memory frames to a \s-1CUDA\s0 device.
.PP
It accepts the following optional parameters:
.IP "\fBdevice\fR" 4
.IX Item "device"
The number of the \s-1CUDA\s0 device to use
.SS "hqx"
.IX Subsection "hqx"
Apply a high-quality magnification filter designed for pixel art. This filter
was originally created by Maxim Stepin.
.PP
It accepts the following option:
.IP "\fBn\fR" 4
.IX Item "n"
Set the scaling dimension: \f(CW2\fR for \f(CW\*(C`hq2x\*(C'\fR, \f(CW3\fR for
\&\f(CW\*(C`hq3x\*(C'\fR and \f(CW4\fR for \f(CW\*(C`hq4x\*(C'\fR.
Default is \f(CW3\fR.
.SS "hstack"
.IX Subsection "hstack"
Stack input videos horizontally.
.PP
All streams must be of same pixel format and of same height.
.PP
Note that this filter is faster than using \fBoverlay\fR and \fBpad\fR filter
to create same output.
.PP
The filter accept the following option:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
Set number of input streams. Default is 2.
.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.
.SS "hue"
.IX Subsection "hue"
Modify the hue and/or the saturation of the input.
.PP
It accepts the following parameters:
.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 an expression and
defaults to \*(L"1\*(R".
.IP "\fBH\fR" 4
.IX Item "H"
Specify the hue angle as a number of radians. It accepts an
expression, and defaults to \*(L"0\*(R".
.IP "\fBb\fR" 4
.IX Item "b"
Specify the brightness in the [\-10,10] range. It accepts 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 \fBb\fR, \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 "\fBb\fR" 4
.IX Item "b"
.PD 0
.IP "\fBs\fR" 4
.IX Item "s"
.IP "\fBh\fR" 4
.IX Item "h"
.IP "\fBH\fR" 4
.IX Item "H"
.PD
Modify the hue and/or the saturation and/or brightness 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 "hysteresis"
.IX Subsection "hysteresis"
Grow first stream into second stream by connecting components.
This makes it possible to build more robust edge masks.
.PP
This filter accepts the following options:
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes will be processed as bitmap, unprocessed planes will be
copied from first stream.
By default value 0xf, all planes will be processed.
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
Set threshold which is used in filtering. If pixel component value is higher than
this value filter algorithm for connecting components is activated.
By default value is 0.
.SS "idet"
.IX Subsection "idet"
Detect video interlacing type.
.PP
This filter tries to detect if the input frames are interlaced, progressive,
top or bottom field first. It will also try to detect fields that are
repeated between adjacent frames (a sign of telecine).
.PP
Single frame detection considers only immediately adjacent frames when classifying each frame.
Multiple frame detection incorporates the classification history of previous frames.
.PP
The filter will log these metadata values:
.IP "\fBsingle.current_frame\fR" 4
.IX Item "single.current_frame"
Detected type of current frame using single-frame detection. One of:
``tff'' (top field first), ``bff'' (bottom field first),
``progressive'', or ``undetermined''
.IP "\fBsingle.tff\fR" 4
.IX Item "single.tff"
Cumulative number of frames detected as top field first using single-frame detection.
.IP "\fBmultiple.tff\fR" 4
.IX Item "multiple.tff"
Cumulative number of frames detected as top field first using multiple-frame detection.
.IP "\fBsingle.bff\fR" 4
.IX Item "single.bff"
Cumulative number of frames detected as bottom field first using single-frame detection.
.IP "\fBmultiple.current_frame\fR" 4
.IX Item "multiple.current_frame"
Detected type of current frame using multiple-frame detection. One of:
``tff'' (top field first), ``bff'' (bottom field first),
``progressive'', or ``undetermined''
.IP "\fBmultiple.bff\fR" 4
.IX Item "multiple.bff"
Cumulative number of frames detected as bottom field first using multiple-frame detection.
.IP "\fBsingle.progressive\fR" 4
.IX Item "single.progressive"
Cumulative number of frames detected as progressive using single-frame detection.
.IP "\fBmultiple.progressive\fR" 4
.IX Item "multiple.progressive"
Cumulative number of frames detected as progressive using multiple-frame detection.
.IP "\fBsingle.undetermined\fR" 4
.IX Item "single.undetermined"
Cumulative number of frames that could not be classified using single-frame detection.
.IP "\fBmultiple.undetermined\fR" 4
.IX Item "multiple.undetermined"
Cumulative number of frames that could not be classified using multiple-frame detection.
.IP "\fBrepeated.current_frame\fR" 4
.IX Item "repeated.current_frame"
Which field in the current frame is repeated from the last. One of ``neither'', ``top'', or ``bottom''.
.IP "\fBrepeated.neither\fR" 4
.IX Item "repeated.neither"
Cumulative number of frames with no repeated field.
.IP "\fBrepeated.top\fR" 4
.IX Item "repeated.top"
Cumulative number of frames with the top field repeated from the previous frame's top field.
.IP "\fBrepeated.bottom\fR" 4
.IX Item "repeated.bottom"
Cumulative number of frames with the bottom field repeated from the previous frame's bottom field.
.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.
.IP "\fBrep_thres\fR" 4
.IX Item "rep_thres"
Threshold for repeated field detection.
.IP "\fBhalf_life\fR" 4
.IX Item "half_life"
Number of frames after which a given frame's contribution to the
statistics is halved (i.e., it contributes only 0.5 to its
classification). The default of 0 means that all frames seen are given
full weight of 1.0 forever.
.IP "\fBanalyze_interlaced_flag\fR" 4
.IX Item "analyze_interlaced_flag"
When this is not 0 then idet will use the specified number of frames to determine
if the interlaced flag is accurate, it will not count undetermined frames.
If the flag is found to be accurate it will be used without any further
computations, if it is found to be inaccurate it will be cleared without any
further computations. This allows inserting the idet filter as a low computational
method to clean up the interlaced flag
.SS "il"
.IX Subsection "il"
Deinterleave or interleave fields.
.PP
This filter allows one 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, c\fR" 4
.IX Item "chroma_mode, c"
.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 "inflate"
.IX Subsection "inflate"
Apply inflate effect to the video.
.PP
This filter replaces the pixel by the local(3x3) average by taking into account
only values higher than the pixel.
.PP
It accepts the following options:
.IP "\fBthreshold0\fR" 4
.IX Item "threshold0"
.PD 0
.IP "\fBthreshold1\fR" 4
.IX Item "threshold1"
.IP "\fBthreshold2\fR" 4
.IX Item "threshold2"
.IP "\fBthreshold3\fR" 4
.IX Item "threshold3"
.PD
Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged.
.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"
This 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 "lenscorrection"
.IX Subsection "lenscorrection"
Correct radial lens distortion
.PP
This filter can be used to correct for radial distortion as can result from the use
of wide angle lenses, and thereby re-rectify the image. To find the right parameters
one can use tools available for example as part of opencv or simply trial-and-error.
To use opencv use the calibration sample (under samples/cpp) from the opencv sources
and extract the k1 and k2 coefficients from the resulting matrix.
.PP
Note that effectively the same filter is available in the open-source tools Krita and
Digikam from the \s-1KDE\s0 project.
.PP
In contrast to the \fBvignette\fR filter, which can also be used to compensate lens errors,
this filter corrects the distortion of the image, whereas \fBvignette\fR corrects the
brightness distribution, so you may want to use both filters together in certain
cases, though you will have to take care of ordering, i.e. whether vignetting should
be applied before or after lens correction.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The filter accepts the following options:
.IP "\fBcx\fR" 4
.IX Item "cx"
Relative x\-coordinate of the focal point of the image, and thereby the center of the
distortion. This value has a range [0,1] and is expressed as fractions of the image
width.
.IP "\fBcy\fR" 4
.IX Item "cy"
Relative y\-coordinate of the focal point of the image, and thereby the center of the
distortion. This value has a range [0,1] and is expressed as fractions of the image
height.
.IP "\fBk1\fR" 4
.IX Item "k1"
Coefficient of the quadratic correction term. 0.5 means no correction.
.IP "\fBk2\fR" 4
.IX Item "k2"
Coefficient of the double quadratic correction term. 0.5 means no correction.
.PP
The formula that generates the correction is:
.PP
\&\fIr_src\fR = \fIr_tgt\fR * (1 + \fIk1\fR * (\fIr_tgt\fR / \fIr_0\fR)^2 + \fIk2\fR * (\fIr_tgt\fR / \fIr_0\fR)^4)
.PP
where \fIr_0\fR is halve of the image diagonal and \fIr_src\fR and \fIr_tgt\fR are the
distances from the focal point in the source and target images, respectively.
.SS "loop"
.IX Subsection "loop"
Loop video frames.
.PP
The filter accepts the following options:
.IP "\fBloop\fR" 4
.IX Item "loop"
Set the number of loops.
.IP "\fBsize\fR" 4
.IX Item "size"
Set maximal size in number of frames.
.IP "\fBstart\fR" 4
.IX Item "start"
Set first frame of loop.
.SS "lut3d"
.IX Subsection "lut3d"
Apply a 3D \s-1LUT\s0 to an input video.
.PP
The filter accepts the following options:
.IP "\fBfile\fR" 4
.IX Item "file"
Set the 3D \s-1LUT\s0 file name.
.Sp
Currently supported formats:
.RS 4
.IP "\fB3dl\fR" 4
.IX Item "3dl"
AfterEffects
.IP "\fBcube\fR" 4
.IX Item "cube"
Iridas
.IP "\fBdat\fR" 4
.IX Item "dat"
DaVinci
.IP "\fBm3d\fR" 4
.IX Item "m3d"
Pandora
.RE
.RS 4
.RE
.IP "\fBinterp\fR" 4
.IX Item "interp"
Select interpolation mode.
.Sp
Available values are:
.RS 4
.IP "\fBnearest\fR" 4
.IX Item "nearest"
Use values from the nearest defined point.
.IP "\fBtrilinear\fR" 4
.IX Item "trilinear"
Interpolate values using the 8 points defining a cube.
.IP "\fBtetrahedral\fR" 4
.IX Item "tetrahedral"
Interpolate values using a tetrahedron.
.RE
.RS 4
.RE
.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 the 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 parameters:
.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\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
The input width and height.
.IP "\fBval\fR" 4
.IX Item "val"
The input value for the pixel component.
.IP "\fBclipval\fR" 4
.IX Item "clipval"
The input value, clipped to the \fIminval\fR\-\fImaxval\fR range.
.IP "\fBmaxval\fR" 4
.IX Item "maxval"
The maximum value for the pixel component.
.IP "\fBminval\fR" 4
.IX Item "minval"
The minimum value for the pixel component.
.IP "\fBnegval\fR" 4
.IX Item "negval"
The negated value for the pixel component value, clipped to 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 to 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 to the \fIminval\fR\-\fImaxval\fR range. It 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, turning 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 factor of 0.5:
.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
.IP "\(bu" 4
Technicolor like effect:
.Sp
.Vb 1
\&        lutyuv=u=\*(Aq(val\-maxval/2)*2+maxval/2\*(Aq:v=\*(Aq(val\-maxval/2)*2+maxval/2\*(Aq
.Ve
.SS "lut2"
.IX Subsection "lut2"
Compute and apply a lookup table from two video inputs.
.PP
This filter accepts the following parameters:
.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
.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 inputs.
.PP
The expressions can contain the following constants:
.IP "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
The input width and height.
.IP "\fBx\fR" 4
.IX Item "x"
The first input value for the pixel component.
.IP "\fBy\fR" 4
.IX Item "y"
The second input value for the pixel component.
.IP "\fBbdx\fR" 4
.IX Item "bdx"
The first input video bit depth.
.IP "\fBbdy\fR" 4
.IX Item "bdy"
The second input video bit depth.
.PP
All expressions default to \*(L"x\*(R".
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Highlight differences between two \s-1RGB\s0 video streams:
.Sp
.Vb 1
\&        lut2=\*(Aqifnot(x\-y,0,pow(2,bdx)\-1):ifnot(x\-y,0,pow(2,bdx)\-1):ifnot(x\-y,0,pow(2,bdx)\-1)\*(Aq
.Ve
.IP "\(bu" 4
Highlight differences between two \s-1YUV\s0 video streams:
.Sp
.Vb 1
\&        lut2=\*(Aqifnot(x\-y,0,pow(2,bdx)\-1):ifnot(x\-y,pow(2,bdx\-1),pow(2,bdx)\-1):ifnot(x\-y,pow(2,bdx\-1),pow(2,bdx)\-1)\*(Aq
.Ve
.SS "maskedclamp"
.IX Subsection "maskedclamp"
Clamp the first input stream with the second input and third input stream.
.PP
Returns the value of first stream to be between second input
stream \- \f(CW\*(C`undershoot\*(C'\fR and third input stream + \f(CW\*(C`overshoot\*(C'\fR.
.PP
This filter accepts the following options:
.IP "\fBundershoot\fR" 4
.IX Item "undershoot"
Default value is \f(CW0\fR.
.IP "\fBovershoot\fR" 4
.IX Item "overshoot"
Default value is \f(CW0\fR.
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes will be processed as bitmap, unprocessed planes will be
copied from first stream.
By default value 0xf, all planes will be processed.
.SS "maskedmerge"
.IX Subsection "maskedmerge"
Merge the first input stream with the second input stream using per pixel
weights in the third input stream.
.PP
A value of 0 in the third stream pixel component means that pixel component
from first stream is returned unchanged, while maximum value (eg. 255 for
8\-bit videos) means that pixel component from second stream is returned
unchanged. Intermediate values define the amount of merging between both
input stream's pixel components.
.PP
This filter accepts the following options:
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes will be processed as bitmap, unprocessed planes will be
copied from first stream.
By default value 0xf, all planes will be processed.
.SS "mcdeint"
.IX Subsection "mcdeint"
Apply motion-compensation deinterlacing.
.PP
It needs one field per frame as input and must thus be used together
with yadif=1/3 or equivalent.
.PP
This filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Set the deinterlacing mode.
.Sp
It accepts one of the following values:
.RS 4
.IP "\fBfast\fR" 4
.IX Item "fast"
.PD 0
.IP "\fBmedium\fR" 4
.IX Item "medium"
.IP "\fBslow\fR" 4
.IX Item "slow"
.PD
use iterative motion estimation
.IP "\fBextra_slow\fR" 4
.IX Item "extra_slow"
like \fBslow\fR, but use multiple reference frames.
.RE
.RS 4
.Sp
Default value is \fBfast\fR.
.RE
.IP "\fBparity\fR" 4
.IX Item "parity"
Set the picture field parity assumed for the input video. It must be
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
.RE
.RS 4
.Sp
Default value is \fBbff\fR.
.RE
.IP "\fBqp\fR" 4
.IX Item "qp"
Set per-block quantization parameter (\s-1QP\s0) used by the internal
encoder.
.Sp
Higher values should result in a smoother motion vector field but less
optimal individual vectors. Default value is 1.
.SS "mergeplanes"
.IX Subsection "mergeplanes"
Merge color channel components from several video streams.
.PP
The filter accepts up to 4 input streams, and merge selected input
planes to the output video.
.PP
This filter accepts the following options:
.IP "\fBmapping\fR" 4
.IX Item "mapping"
Set input to output plane mapping. Default is \f(CW0\fR.
.Sp
The mappings is specified as a bitmap. It should be specified as a
hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. 'Aa' describes the
mapping for the first plane of the output stream. 'A' sets the number of
the input stream to use (from 0 to 3), and 'a' the plane number of the
corresponding input to use (from 0 to 3). The rest of the mappings is
similar, 'Bb' describes the mapping for the output stream second
plane, 'Cc' describes the mapping for the output stream third plane and
\&'Dd' describes the mapping for the output stream fourth plane.
.IP "\fBformat\fR" 4
.IX Item "format"
Set output pixel format. Default is \f(CW\*(C`yuva444p\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Merge three gray video streams of same width and height into single video stream:
.Sp
.Vb 1
\&        [a0][a1][a2]mergeplanes=0x001020:yuv444p
.Ve
.IP "\(bu" 4
Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
.Sp
.Vb 1
\&        [a0][a1]mergeplanes=0x00010210:yuva444p
.Ve
.IP "\(bu" 4
Swap Y and A plane in yuva444p stream:
.Sp
.Vb 1
\&        format=yuva444p,mergeplanes=0x03010200:yuva444p
.Ve
.IP "\(bu" 4
Swap U and V plane in yuv420p stream:
.Sp
.Vb 1
\&        format=yuv420p,mergeplanes=0x000201:yuv420p
.Ve
.IP "\(bu" 4
Cast a rgb24 clip to yuv444p:
.Sp
.Vb 1
\&        format=rgb24,mergeplanes=0x000102:yuv444p
.Ve
.SS "mestimate"
.IX Subsection "mestimate"
Estimate and export motion vectors using block matching algorithms.
Motion vectors are stored in frame side data to be used by other filters.
.PP
This filter accepts the following options:
.IP "\fBmethod\fR" 4
.IX Item "method"
Specify the motion estimation method. Accepts one of the following values:
.RS 4
.IP "\fBesa\fR" 4
.IX Item "esa"
Exhaustive search algorithm.
.IP "\fBtss\fR" 4
.IX Item "tss"
Three step search algorithm.
.IP "\fBtdls\fR" 4
.IX Item "tdls"
Two dimensional logarithmic search algorithm.
.IP "\fBntss\fR" 4
.IX Item "ntss"
New three step search algorithm.
.IP "\fBfss\fR" 4
.IX Item "fss"
Four step search algorithm.
.IP "\fBds\fR" 4
.IX Item "ds"
Diamond search algorithm.
.IP "\fBhexbs\fR" 4
.IX Item "hexbs"
Hexagon-based search algorithm.
.IP "\fBepzs\fR" 4
.IX Item "epzs"
Enhanced predictive zonal search algorithm.
.IP "\fBumh\fR" 4
.IX Item "umh"
Uneven multi-hexagon search algorithm.
.RE
.RS 4
.Sp
Default value is \fBesa\fR.
.RE
.IP "\fBmb_size\fR" 4
.IX Item "mb_size"
Macroblock size. Default \f(CW16\fR.
.IP "\fBsearch_param\fR" 4
.IX Item "search_param"
Search parameter. Default \f(CW7\fR.
.SS "minterpolate"
.IX Subsection "minterpolate"
Convert the video to specified frame rate using motion interpolation.
.PP
This filter accepts the following options:
.IP "\fBfps\fR" 4
.IX Item "fps"
Specify the output frame rate. This can be rational e.g. \f(CW\*(C`60000/1001\*(C'\fR. Frames are dropped if \fIfps\fR is lower than source fps. Default \f(CW60\fR.
.IP "\fBmi_mode\fR" 4
.IX Item "mi_mode"
Motion interpolation mode. Following values are accepted:
.RS 4
.IP "\fBdup\fR" 4
.IX Item "dup"
Duplicate previous or next frame for interpolating new ones.
.IP "\fBblend\fR" 4
.IX Item "blend"
Blend source frames. Interpolated frame is mean of previous and next frames.
.IP "\fBmci\fR" 4
.IX Item "mci"
Motion compensated interpolation. Following options are effective when this mode is selected:
.RS 4
.IP "\fBmc_mode\fR" 4
.IX Item "mc_mode"
Motion compensation mode. Following values are accepted:
.RS 4
.IP "\fBobmc\fR" 4
.IX Item "obmc"
Overlapped block motion compensation.
.IP "\fBaobmc\fR" 4
.IX Item "aobmc"
Adaptive overlapped block motion compensation. Window weighting coefficients are controlled adaptively according to the reliabilities of the neighboring motion vectors to reduce oversmoothing.
.RE
.RS 4
.Sp
Default mode is \fBobmc\fR.
.RE
.IP "\fBme_mode\fR" 4
.IX Item "me_mode"
Motion estimation mode. Following values are accepted:
.RS 4
.IP "\fBbidir\fR" 4
.IX Item "bidir"
Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
.IP "\fBbilat\fR" 4
.IX Item "bilat"
Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
.RE
.RS 4
.Sp
Default mode is \fBbilat\fR.
.RE
.IP "\fBme\fR" 4
.IX Item "me"
The algorithm to be used for motion estimation. Following values are accepted:
.RS 4
.IP "\fBesa\fR" 4
.IX Item "esa"
Exhaustive search algorithm.
.IP "\fBtss\fR" 4
.IX Item "tss"
Three step search algorithm.
.IP "\fBtdls\fR" 4
.IX Item "tdls"
Two dimensional logarithmic search algorithm.
.IP "\fBntss\fR" 4
.IX Item "ntss"
New three step search algorithm.
.IP "\fBfss\fR" 4
.IX Item "fss"
Four step search algorithm.
.IP "\fBds\fR" 4
.IX Item "ds"
Diamond search algorithm.
.IP "\fBhexbs\fR" 4
.IX Item "hexbs"
Hexagon-based search algorithm.
.IP "\fBepzs\fR" 4
.IX Item "epzs"
Enhanced predictive zonal search algorithm.
.IP "\fBumh\fR" 4
.IX Item "umh"
Uneven multi-hexagon search algorithm.
.RE
.RS 4
.Sp
Default algorithm is \fBepzs\fR.
.RE
.IP "\fBmb_size\fR" 4
.IX Item "mb_size"
Macroblock size. Default \f(CW16\fR.
.IP "\fBsearch_param\fR" 4
.IX Item "search_param"
Motion estimation search parameter. Default \f(CW32\fR.
.IP "\fBvsmbc\fR" 4
.IX Item "vsmbc"
Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is \f(CW0\fR (disabled).
.RE
.RS 4
.RE
.RE
.RS 4
.RE
.IP "\fBscd\fR" 4
.IX Item "scd"
Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Disable scene change detection.
.IP "\fBfdiff\fR" 4
.IX Item "fdiff"
Frame difference. Corresponding pixel values are compared and if it satisfies \fIscd_threshold\fR scene change is detected.
.RE
.RS 4
.Sp
Default method is \fBfdiff\fR.
.RE
.IP "\fBscd_threshold\fR" 4
.IX Item "scd_threshold"
Scene change detection threshold. Default is \f(CW5.0\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
It accepts an integer in input; if non-zero it negates the
alpha component (if available). The default value in input is 0.
.SS "nlmeans"
.IX Subsection "nlmeans"
Denoise frames using Non-Local Means algorithm.
.PP
Each pixel is adjusted by looking for other pixels with similar contexts. This
context similarity is defined by comparing their surrounding patches of size
\&\fBp\fRx\fBp\fR. Patches are searched in an area of \fBr\fRx\fBr\fR
around the pixel.
.PP
Note that the research area defines centers for patches, which means some
patches will be made of pixels outside that research area.
.PP
The filter accepts the following options.
.IP "\fBs\fR" 4
.IX Item "s"
Set denoising strength.
.IP "\fBp\fR" 4
.IX Item "p"
Set patch size.
.IP "\fBpc\fR" 4
.IX Item "pc"
Same as \fBp\fR but for chroma planes.
.Sp
The default value is \fI0\fR and means automatic.
.IP "\fBr\fR" 4
.IX Item "r"
Set research size.
.IP "\fBrc\fR" 4
.IX Item "rc"
Same as \fBr\fR but for chroma planes.
.Sp
The default value is \fI0\fR and means automatic.
.SS "nnedi"
.IX Subsection "nnedi"
Deinterlace video using neural network edge directed interpolation.
.PP
This filter accepts the following options:
.IP "\fBweights\fR" 4
.IX Item "weights"
Mandatory option, without binary file filter can not work.
Currently file can be found here:
https://github.com/dubhater/vapoursynth\-nnedi3/blob/master/src/nnedi3_weights.bin
.IP "\fBdeint\fR" 4
.IX Item "deint"
Set which frames to deinterlace, by default it is \f(CW\*(C`all\*(C'\fR.
Can be \f(CW\*(C`all\*(C'\fR or \f(CW\*(C`interlaced\*(C'\fR.
.IP "\fBfield\fR" 4
.IX Item "field"
Set mode of operation.
.Sp
Can be one of the following:
.RS 4
.IP "\fBaf\fR" 4
.IX Item "af"
Use frame flags, both fields.
.IP "\fBa\fR" 4
.IX Item "a"
Use frame flags, single field.
.IP "\fBt\fR" 4
.IX Item "t"
Use top field only.
.IP "\fBb\fR" 4
.IX Item "b"
Use bottom field only.
.IP "\fBtf\fR" 4
.IX Item "tf"
Use both fields, top first.
.IP "\fBbf\fR" 4
.IX Item "bf"
Use both fields, bottom first.
.RE
.RS 4
.RE
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes to process, by default filter process all frames.
.IP "\fBnsize\fR" 4
.IX Item "nsize"
Set size of local neighborhood around each pixel, used by the predictor neural
network.
.Sp
Can be one of the following:
.RS 4
.IP "\fBs8x6\fR" 4
.IX Item "s8x6"
.PD 0
.IP "\fBs16x6\fR" 4
.IX Item "s16x6"
.IP "\fBs32x6\fR" 4
.IX Item "s32x6"
.IP "\fBs48x6\fR" 4
.IX Item "s48x6"
.IP "\fBs8x4\fR" 4
.IX Item "s8x4"
.IP "\fBs16x4\fR" 4
.IX Item "s16x4"
.IP "\fBs32x4\fR" 4
.IX Item "s32x4"
.RE
.RS 4
.RE
.IP "\fBnns\fR" 4
.IX Item "nns"
.PD
Set the number of neurons in predicctor neural network.
Can be one of the following:
.RS 4
.IP "\fBn16\fR" 4
.IX Item "n16"
.PD 0
.IP "\fBn32\fR" 4
.IX Item "n32"
.IP "\fBn64\fR" 4
.IX Item "n64"
.IP "\fBn128\fR" 4
.IX Item "n128"
.IP "\fBn256\fR" 4
.IX Item "n256"
.RE
.RS 4
.RE
.IP "\fBqual\fR" 4
.IX Item "qual"
.PD
Controls the number of different neural network predictions that are blended
together to compute the final output value. Can be \f(CW\*(C`fast\*(C'\fR, default or
\&\f(CW\*(C`slow\*(C'\fR.
.IP "\fBetype\fR" 4
.IX Item "etype"
Set which set of weights to use in the predictor.
Can be one of the following:
.RS 4
.IP "\fBa\fR" 4
.IX Item "a"
weights trained to minimize absolute error
.IP "\fBs\fR" 4
.IX Item "s"
weights trained to minimize squared error
.RE
.RS 4
.RE
.IP "\fBpscrn\fR" 4
.IX Item "pscrn"
Controls whether or not the prescreener neural network is used to decide
which pixels should be processed by the predictor neural network and which
can be handled by simple cubic interpolation.
The prescreener is trained to know whether cubic interpolation will be
sufficient for a pixel or whether it should be predicted by the predictor nn.
The computational complexity of the prescreener nn is much less than that of
the predictor nn. Since most pixels can be handled by cubic interpolation,
using the prescreener generally results in much faster processing.
The prescreener is pretty accurate, so the difference between using it and not
using it is almost always unnoticeable.
.Sp
Can be one of the following:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBoriginal\fR" 4
.IX Item "original"
.IP "\fBnew\fR" 4
.IX Item "new"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`new\*(C'\fR.
.RE
.IP "\fBfapprox\fR" 4
.IX Item "fapprox"
Set various debugging flags.
.SS "noformat"
.IX Subsection "noformat"
Force libavfilter not to use any of the specified pixel formats for the
input to the next filter.
.PP
It accepts the following parameters:
.IP "\fBpix_fmts\fR" 4
.IX Item "pix_fmts"
A '|'\-separated list of pixel format names, such as
apix_fmts=yuv420p|monow|rgb24".
.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 "\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 "ocr"
.IX Subsection "ocr"
Optical Character Recognition
.PP
This filter uses Tesseract for optical character recognition.
.PP
It accepts the following options:
.IP "\fBdatapath\fR" 4
.IX Item "datapath"
Set datapath to tesseract data. Default is to use whatever was
set at installation.
.IP "\fBlanguage\fR" 4
.IX Item "language"
Set language, default is \*(L"eng\*(R".
.IP "\fBwhitelist\fR" 4
.IX Item "whitelist"
Set character whitelist.
.IP "\fBblacklist\fR" 4
.IX Item "blacklist"
Set character blacklist.
.PP
The filter exports recognized text as the frame metadata \f(CW\*(C`lavfi.ocr.text\*(C'\fR.
.SS "ocv"
.IX Subsection "ocv"
Apply a video transform using libopencv.
.PP
To enable this filter, install the libopencv library and headers and
configure FFmpeg with \f(CW\*(C`\-\-enable\-libopencv\*(C'\fR.
.PP
It 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://docs.opencv.org/master/modules/imgproc/doc/filtering.html\fR>
.PP
Several libopencv filters are supported; see the following subsections.
.PP
\fIdilate\fR
.IX Subsection "dilate"
.PP
Dilate an image by using a specific structuring element.
It 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. \fIshape\fR
must be \*(L"rect\*(R", \*(L"cross\*(R", \*(L"ellipse\*(R", or \*(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
Some examples:
.PP
.Vb 2
\&        # Use the default values
\&        ocv=dilate
\&        
\&        # Dilate using a structuring element with a 5x5 cross, iterating two times
\&        ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
\&        
\&        # Read the shape from the file diamond.shape, iterating two times.
\&        # The file diamond.shape may contain a pattern of characters like this
\&        #   *
\&        #  ***
\&        # *****
\&        #  ***
\&        #   *
\&        # The specified columns and rows are ignored
\&        # but the anchor point coordinates are not
\&        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.
It corresponds to the libopencv function \f(CW\*(C`cvErode\*(C'\fR.
.PP
It accepts the parameters: \fIstruct_el\fR:\fInb_iterations\fR,
with the same syntax and semantics as the \fBdilate\fR 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 must be one of
the following values: \*(L"blur\*(R", \*(L"blur_no_scale\*(R", \*(L"median\*(R", \*(L"gaussian\*(R",
or \*(L"bilateral\*(R". The default value is \*(L"gaussian\*(R".
.PP
The meaning of \fIparam1\fR, \fIparam2\fR, \fIparam3\fR, and \fIparam4\fR
depend on the smooth type. \fIparam1\fR and
\&\fIparam2\fR accept integer positive values or 0. \fIparam3\fR and
\&\fIparam4\fR accept floating point 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 has one output. The first input is the \*(L"main\*(R"
video on which the second input is overlaid.
.PP
It 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 overlaid 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 "\fBeof_action\fR" 4
.IX Item "eof_action"
The action to take when \s-1EOF\s0 is encountered on the secondary input; it accepts
one of the following values:
.RS 4
.IP "\fBrepeat\fR" 4
.IX Item "repeat"
Repeat the last frame (the default).
.IP "\fBendall\fR" 4
.IX Item "endall"
End both streams.
.IP "\fBpass\fR" 4
.IX Item "pass"
Pass the main input through.
.RE
.RS 4
.RE
.IP "\fBeval\fR" 4
.IX Item "eval"
Set when the expressions for \fBx\fR, and \fBy\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 "\fByuv422\fR" 4
.IX Item "yuv422"
force \s-1YUV422\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. Default value is 1.
.PP
The \fBx\fR, and \fBy\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
The 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
The 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"
The timestamp, expressed in seconds. It's \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 good idea
to pass the two inputs through a \fIsetpts=PTS\-STARTPTS\fR filter to
have them begin in the same zero timestamp, as the example for
the \fImovie\fR filter does.
.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"
.PD
Modify the x and y 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
Mask 10\-20 seconds of a video by applying the delogo filter to a section
.Sp
.Vb 3
\&        ffmpeg \-i test.avi \-codec:v:0 wmv2 \-ar 11025 \-b:v 9000k
\&        \-vf \*(Aq[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]\*(Aq
\&        masked.avi
.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 "owdenoise"
.IX Subsection "owdenoise"
Apply Overcomplete Wavelet denoiser.
.PP
The filter accepts the following options:
.IP "\fBdepth\fR" 4
.IX Item "depth"
Set depth.
.Sp
Larger depth values will denoise lower frequency components more, but
slow down filtering.
.Sp
Must be an int in the range 8\-16, default is \f(CW8\fR.
.IP "\fBluma_strength, ls\fR" 4
.IX Item "luma_strength, ls"
Set luma strength.
.Sp
Must be a double value in the range 0\-1000, default is \f(CW1.0\fR.
.IP "\fBchroma_strength, cs\fR" 4
.IX Item "chroma_strength, cs"
Set chroma strength.
.Sp
Must be a double value in the range 0\-1000, default is \f(CW1.0\fR.
.SS "pad"
.IX Subsection "pad"
Add paddings to the input image, and place the original input at the
provided \fIx\fR, \fIy\fR coordinates.
.PP
It 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 the offsets to place the input image at within 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. For the syntax of this option,
check the \*(L"Color\*(R" section in the ffmpeg-utils manual.
.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\fR" 4
.IX Item "in_w"
.PD 0
.IP "\fBin_h\fR" 4
.IX Item "in_h"
.PD
The input video width and height.
.IP "\fBiw\fR" 4
.IX Item "iw"
.PD 0
.IP "\fBih\fR" 4
.IX Item "ih"
.PD
These are the same as \fIin_w\fR and \fIin_h\fR.
.IP "\fBout_w\fR" 4
.IX Item "out_w"
.PD 0
.IP "\fBout_h\fR" 4
.IX Item "out_h"
.PD
The output width and height (the size of the padded area), as
specified by the \fIwidth\fR and \fIheight\fR expressions.
.IP "\fBow\fR" 4
.IX Item "ow"
.PD 0
.IP "\fBoh\fR" 4
.IX Item "oh"
.PD
These are the same as \fIout_w\fR and \fIout_h\fR.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
The 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\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
The 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 the color \*(L"violet\*(R" to the input video. The output video
size is 640x480, and 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 the 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 "palettegen"
.IX Subsection "palettegen"
Generate one palette for a whole video stream.
.PP
It accepts the following options:
.IP "\fBmax_colors\fR" 4
.IX Item "max_colors"
Set the maximum number of colors to quantize in the palette.
Note: the palette will still contain 256 colors; the unused palette entries
will be black.
.IP "\fBreserve_transparent\fR" 4
.IX Item "reserve_transparent"
Create a palette of 255 colors maximum and reserve the last one for
transparency. Reserving the transparency color is useful for \s-1GIF\s0 optimization.
If not set, the maximum of colors in the palette will be 256. You probably want
to disable this option for a standalone image.
Set by default.
.IP "\fBstats_mode\fR" 4
.IX Item "stats_mode"
Set statistics mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBfull\fR" 4
.IX Item "full"
Compute full frame histograms.
.IP "\fBdiff\fR" 4
.IX Item "diff"
Compute histograms only for the part that differs from previous frame. This
might be relevant to give more importance to the moving part of your input if
the background is static.
.IP "\fBsingle\fR" 4
.IX Item "single"
Compute new histogram for each frame.
.RE
.RS 4
.Sp
Default value is \fIfull\fR.
.RE
.PP
The filter also exports the frame metadata \f(CW\*(C`lavfi.color_quant_ratio\*(C'\fR
(\f(CW\*(C`nb_color_in / nb_color_out\*(C'\fR) which you can use to evaluate the degree of
color quantization of the palette. This information is also visible at
\&\fIinfo\fR logging level.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Generate a representative palette of a given video using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i input.mkv \-vf palettegen palette.png
.Ve
.SS "paletteuse"
.IX Subsection "paletteuse"
Use a palette to downsample an input video stream.
.PP
The filter takes two inputs: one video stream and a palette. The palette must
be a 256 pixels image.
.PP
It accepts the following options:
.IP "\fBdither\fR" 4
.IX Item "dither"
Select dithering mode. Available algorithms are:
.RS 4
.IP "\fBbayer\fR" 4
.IX Item "bayer"
Ordered 8x8 bayer dithering (deterministic)
.IP "\fBheckbert\fR" 4
.IX Item "heckbert"
Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
Note: this dithering is sometimes considered \*(L"wrong\*(R" and is included as a
reference.
.IP "\fBfloyd_steinberg\fR" 4
.IX Item "floyd_steinberg"
Floyd and Steingberg dithering (error diffusion)
.IP "\fBsierra2\fR" 4
.IX Item "sierra2"
Frankie Sierra dithering v2 (error diffusion)
.IP "\fBsierra2_4a\fR" 4
.IX Item "sierra2_4a"
Frankie Sierra dithering v2 \*(L"Lite\*(R" (error diffusion)
.RE
.RS 4
.Sp
Default is \fIsierra2_4a\fR.
.RE
.IP "\fBbayer_scale\fR" 4
.IX Item "bayer_scale"
When \fIbayer\fR dithering is selected, this option defines the scale of the
pattern (how much the crosshatch pattern is visible). A low value means more
visible pattern for less banding, and higher value means less visible pattern
at the cost of more banding.
.Sp
The option must be an integer value in the range [0,5]. Default is \fI2\fR.
.IP "\fBdiff_mode\fR" 4
.IX Item "diff_mode"
If set, define the zone to process
.RS 4
.IP "\fBrectangle\fR" 4
.IX Item "rectangle"
Only the changing rectangle will be reprocessed. This is similar to \s-1GIF\s0
cropping/offsetting compression mechanism. This option can be useful for speed
if only a part of the image is changing, and has use cases such as limiting the
scope of the error diffusal \fBdither\fR to the rectangle that bounds the
moving scene (it leads to more deterministic output if the scene doesn't change
much, and as a result less moving noise and better \s-1GIF\s0 compression).
.RE
.RS 4
.Sp
Default is \fInone\fR.
.RE
.IP "\fBnew\fR" 4
.IX Item "new"
Take new palette for each output frame.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use a palette (generated for example with \fBpalettegen\fR) to encode a \s-1GIF\s0
using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i input.mkv \-i palette.png \-lavfi paletteuse output.gif
.Ve
.SS "perspective"
.IX Subsection "perspective"
Correct perspective of video not recorded perpendicular to the screen.
.PP
A description of the accepted parameters follows.
.IP "\fBx0\fR" 4
.IX Item "x0"
.PD 0
.IP "\fBy0\fR" 4
.IX Item "y0"
.IP "\fBx1\fR" 4
.IX Item "x1"
.IP "\fBy1\fR" 4
.IX Item "y1"
.IP "\fBx2\fR" 4
.IX Item "x2"
.IP "\fBy2\fR" 4
.IX Item "y2"
.IP "\fBx3\fR" 4
.IX Item "x3"
.IP "\fBy3\fR" 4
.IX Item "y3"
.PD
Set coordinates expression for top left, top right, bottom left and bottom right corners.
Default values are \f(CW\*(C`0:0:W:0:0:H:W:H\*(C'\fR with which perspective will remain unchanged.
If the \f(CW\*(C`sense\*(C'\fR option is set to \f(CW\*(C`source\*(C'\fR, then the specified points will be sent
to the corners of the destination. If the \f(CW\*(C`sense\*(C'\fR option is set to \f(CW\*(C`destination\*(C'\fR,
then the corners of the source will be sent to the specified coordinates.
.Sp
The expressions can use the following variables:
.RS 4
.IP "\fBW\fR" 4
.IX Item "W"
.PD 0
.IP "\fBH\fR" 4
.IX Item "H"
.PD
the width and height of video frame.
.IP "\fBin\fR" 4
.IX Item "in"
Input frame count.
.IP "\fBon\fR" 4
.IX Item "on"
Output frame count.
.RE
.RS 4
.RE
.IP "\fBinterpolation\fR" 4
.IX Item "interpolation"
Set interpolation for perspective correction.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlinear\fR" 4
.IX Item "linear"
.PD 0
.IP "\fBcubic\fR" 4
.IX Item "cubic"
.RE
.RS 4
.PD
.Sp
Default value is \fBlinear\fR.
.RE
.IP "\fBsense\fR" 4
.IX Item "sense"
Set interpretation of coordinate options.
.Sp
It accepts the following values:
.RS 4
.IP "\fB0, source\fR" 4
.IX Item "0, source"
Send point in the source specified by the given coordinates to
the corners of the destination.
.IP "\fB1, destination\fR" 4
.IX Item "1, destination"
Send the corners of the source to the point in the destination specified
by the given coordinates.
.Sp
Default value is \fBsource\fR.
.RE
.RS 4
.RE
.IP "\fBeval\fR" 4
.IX Item "eval"
Set when the expressions for coordinates \fBx0,y0,...x3,y3\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 \fBinit\fR.
.RE
.SS "phase"
.IX Subsection "phase"
Delay interlaced video by one field time so that the field order changes.
.PP
The intended use is to fix \s-1PAL\s0 movies that have been captured with the
opposite field order to the film-to-video transfer.
.PP
A description of the accepted parameters follows.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set phase mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBt\fR" 4
.IX Item "t"
Capture field order top-first, transfer bottom-first.
Filter will delay the bottom field.
.IP "\fBb\fR" 4
.IX Item "b"
Capture field order bottom-first, transfer top-first.
Filter will delay the top field.
.IP "\fBp\fR" 4
.IX Item "p"
Capture and transfer with the same field order. This mode only exists
for the documentation of the other options to refer to, but if you
actually select it, the filter will faithfully do nothing.
.IP "\fBa\fR" 4
.IX Item "a"
Capture field order determined automatically by field flags, transfer
opposite.
Filter selects among \fBt\fR and \fBb\fR modes on a frame by frame
basis using field flags. If no field information is available,
then this works just like \fBu\fR.
.IP "\fBu\fR" 4
.IX Item "u"
Capture unknown or varying, transfer opposite.
Filter selects among \fBt\fR and \fBb\fR on a frame by frame basis by
analyzing the images and selecting the alternative that produces best
match between the fields.
.IP "\fBT\fR" 4
.IX Item "T"
Capture top-first, transfer unknown or varying.
Filter selects among \fBt\fR and \fBp\fR using image analysis.
.IP "\fBB\fR" 4
.IX Item "B"
Capture bottom-first, transfer unknown or varying.
Filter selects among \fBb\fR and \fBp\fR using image analysis.
.IP "\fBA\fR" 4
.IX Item "A"
Capture determined by field flags, transfer unknown or varying.
Filter selects among \fBt\fR, \fBb\fR and \fBp\fR using field flags and
image analysis. If no field information is available, then this works just
like \fBU\fR. This is the default mode.
.IP "\fBU\fR" 4
.IX Item "U"
Both capture and transfer unknown or varying.
Filter selects among \fBt\fR, \fBb\fR and \fBp\fR using image analysis only.
.RE
.RS 4
.RE
.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 "pp7"
.IX Subsection "pp7"
Apply Postprocessing filter 7. It is variant of the \fBspp\fR filter,
similar to spp = 6 with 7 point \s-1DCT,\s0 where only the center sample is
used after \s-1IDCT.\s0
.PP
The filter accepts the following options:
.IP "\fBqp\fR" 4
.IX Item "qp"
Force a constant quantization parameter. It accepts an integer in range
0 to 63. If not set, the filter will use the \s-1QP\s0 from the video stream
(if available).
.IP "\fBmode\fR" 4
.IX Item "mode"
Set thresholding mode. Available modes are:
.RS 4
.IP "\fBhard\fR" 4
.IX Item "hard"
Set hard thresholding.
.IP "\fBsoft\fR" 4
.IX Item "soft"
Set soft thresholding (better de-ringing effect, but likely blurrier).
.IP "\fBmedium\fR" 4
.IX Item "medium"
Set medium thresholding (good results, default).
.RE
.RS 4
.RE
.SS "prewitt"
.IX Subsection "prewitt"
Apply prewitt operator to input video stream.
.PP
The filter accepts the following option:
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes will be processed, unprocessed planes will be copied.
By default value 0xf, all planes will be processed.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set value which will be multiplied with filtered result.
.IP "\fBdelta\fR" 4
.IX Item "delta"
Set value which will be added to filtered result.
.SS "psnr"
.IX Subsection "psnr"
Obtain the average, maximum and minimum \s-1PSNR \s0(Peak Signal to Noise
Ratio) between two input videos.
.PP
This filter takes in input two input videos, the first input is
considered the \*(L"main\*(R" source and is passed unchanged to the
output. The second input is used as a \*(L"reference\*(R" video for computing
the \s-1PSNR.\s0
.PP
Both video inputs must have the same resolution and pixel format for
this filter to work correctly. Also it assumes that both inputs
have the same number of frames, which are compared one by one.
.PP
The obtained average \s-1PSNR\s0 is printed through the logging system.
.PP
The filter stores the accumulated \s-1MSE \s0(mean squared error) of each
frame, and at the end of the processing it is averaged across all frames
equally, and the following formula is applied to obtain the \s-1PSNR:\s0
.PP
.Vb 1
\&        PSNR = 10*log10(MAX^2/MSE)
.Ve
.PP
Where \s-1MAX\s0 is the average of the maximum values of each component of the
image.
.PP
The description of the accepted parameters follows.
.IP "\fBstats_file, f\fR" 4
.IX Item "stats_file, f"
If specified the filter will use the named file to save the \s-1PSNR\s0 of
each individual frame. When filename equals \*(L"\-\*(R" the data is sent to
standard output.
.IP "\fBstats_version\fR" 4
.IX Item "stats_version"
Specifies which version of the stats file format to use. Details of
each format are written below.
Default value is 1.
.IP "\fBstats_add_max\fR" 4
.IX Item "stats_add_max"
Determines whether the max value is output to the stats log.
Default value is 0.
Requires stats_version >= 2. If this is set and stats_version < 2,
the filter will return an error.
.PP
The file printed if \fIstats_file\fR is selected, contains a sequence of
key/value pairs of the form \fIkey\fR:\fIvalue\fR for each compared
couple of frames.
.PP
If a \fIstats_version\fR greater than 1 is specified, a header line precedes
the list of per-frame-pair stats, with key value pairs following the frame
format with the following parameters:
.IP "\fBpsnr_log_version\fR" 4
.IX Item "psnr_log_version"
The version of the log file format. Will match \fIstats_version\fR.
.IP "\fBfields\fR" 4
.IX Item "fields"
A comma separated list of the per-frame-pair parameters included in
the log.
.PP
A description of each shown per-frame-pair parameter follows:
.IP "\fBn\fR" 4
.IX Item "n"
sequential number of the input frame, starting from 1
.IP "\fBmse_avg\fR" 4
.IX Item "mse_avg"
Mean Square Error pixel-by-pixel average difference of the compared
frames, averaged over all the image components.
.IP "\fBmse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a\fR" 4
.IX Item "mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a"
Mean Square Error pixel-by-pixel average difference of the compared
frames for the component specified by the suffix.
.IP "\fBpsnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a\fR" 4
.IX Item "psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a"
Peak Signal to Noise ratio of the compared frames for the component
specified by the suffix.
.IP "\fBmax_avg, max_y, max_u, max_v\fR" 4
.IX Item "max_avg, max_y, max_u, max_v"
Maximum allowed value for each channel, and average over all
channels.
.PP
For example:
.PP
.Vb 2
\&        movie=ref_movie.mpg, setpts=PTS\-STARTPTS [main];
\&        [main][ref] psnr="stats_file=stats.log" [out]
.Ve
.PP
On this example the input file being processed is compared with the
reference file \fIref_movie.mpg\fR. The \s-1PSNR\s0 of each individual frame
is stored in \fIstats.log\fR.
.SS "pullup"
.IX Subsection "pullup"
Pulldown reversal (inverse telecine) filter, capable of handling mixed
hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
content.
.PP
The pullup filter is designed to take advantage of future context in making
its decisions. This filter is stateless in the sense that it does not lock
onto a pattern to follow, but it instead looks forward to the following
fields in order to identify matches and rebuild progressive frames.
.PP
To produce content with an even framerate, insert the fps filter after
pullup, use \f(CW\*(C`fps=24000/1001\*(C'\fR if the input frame rate is 29.97fps,
\&\f(CW\*(C`fps=24\*(C'\fR for 30fps and the (rare) telecined 25fps input.
.PP
The filter accepts the following options:
.IP "\fBjl\fR" 4
.IX Item "jl"
.PD 0
.IP "\fBjr\fR" 4
.IX Item "jr"
.IP "\fBjt\fR" 4
.IX Item "jt"
.IP "\fBjb\fR" 4
.IX Item "jb"
.PD
These options set the amount of \*(L"junk\*(R" to ignore at the left, right, top, and
bottom of the image, respectively. Left and right are in units of 8 pixels,
while top and bottom are in units of 2 lines.
The default is 8 pixels on each side.
.IP "\fBsb\fR" 4
.IX Item "sb"
Set the strict breaks. Setting this option to 1 will reduce the chances of
filter generating an occasional mismatched frame, but it may also cause an
excessive number of frames to be dropped during high motion sequences.
Conversely, setting it to \-1 will make filter match fields more easily.
This may help processing of video where there is slight blurring between
the fields, but may also cause there to be interlaced frames in the output.
Default value is \f(CW0\fR.
.IP "\fBmp\fR" 4
.IX Item "mp"
Set the metric plane to use. It accepts the following values:
.RS 4
.IP "\fBl\fR" 4
.IX Item "l"
Use luma plane.
.IP "\fBu\fR" 4
.IX Item "u"
Use chroma blue plane.
.IP "\fBv\fR" 4
.IX Item "v"
Use chroma red plane.
.RE
.RS 4
.Sp
This option may be set to use chroma plane instead of the default luma plane
for doing filter's computations. This may improve accuracy on very clean
source material, but more likely will decrease accuracy, especially if there
is chroma noise (rainbow effect) or any grayscale video.
The main purpose of setting \fBmp\fR to a chroma plane is to reduce \s-1CPU\s0
load and make pullup usable in realtime on slow machines.
.RE
.PP
For best results (without duplicated frames in the output file) it is
necessary to change the output frame rate. For example, to inverse
telecine \s-1NTSC\s0 input:
.PP
.Vb 1
\&        ffmpeg \-i input \-vf pullup \-r 24000/1001 ...
.Ve
.SS "qp"
.IX Subsection "qp"
Change video quantization parameters (\s-1QP\s0).
.PP
The filter accepts the following option:
.IP "\fBqp\fR" 4
.IX Item "qp"
Set expression for quantization parameter.
.PP
The expression is evaluated through the eval \s-1API\s0 and can contain, among others,
the following constants:
.IP "\fIknown\fR" 4
.IX Item "known"
1 if index is not 129, 0 otherwise.
.IP "\fIqp\fR" 4
.IX Item "qp"
Sequentional index starting from \-129 to 128.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Some equation like:
.Sp
.Vb 1
\&        qp=2+2*sin(PI*qp)
.Ve
.SS "random"
.IX Subsection "random"
Flush video frames from internal cache of frames into a random order.
No frame is discarded.
Inspired by \fBfrei0r\fR nervous filter.
.IP "\fBframes\fR" 4
.IX Item "frames"
Set size in number of frames of internal cache, in range from \f(CW2\fR to
\&\f(CW512\fR. Default is \f(CW30\fR.
.IP "\fBseed\fR" 4
.IX Item "seed"
Set seed for random number generator, 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
less than \f(CW0\fR, the filter will try to use a good random seed on a
best effort basis.
.SS "readvitc"
.IX Subsection "readvitc"
Read vertical interval timecode (\s-1VITC\s0) information from the top lines of a
video frame.
.PP
The filter adds frame metadata key \f(CW\*(C`lavfi.readvitc.tc_str\*(C'\fR with the
timecode value, if a valid timecode has been detected. Further metadata key
\&\f(CW\*(C`lavfi.readvitc.found\*(C'\fR is set to 0/1 depending on whether
timecode data has been found or not.
.PP
This filter accepts the following options:
.IP "\fBscan_max\fR" 4
.IX Item "scan_max"
Set the maximum number of lines to scan for \s-1VITC\s0 data. If the value is set to
\&\f(CW\*(C`\-1\*(C'\fR the full video frame is scanned. Default is \f(CW45\fR.
.IP "\fBthr_b\fR" 4
.IX Item "thr_b"
Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
default value is \f(CW0.2\fR. The value must be equal or less than \f(CW\*(C`thr_w\*(C'\fR.
.IP "\fBthr_w\fR" 4
.IX Item "thr_w"
Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
default value is \f(CW0.6\fR. The value must be equal or greater than \f(CW\*(C`thr_b\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Detect and draw \s-1VITC\s0 data onto the video frame; if no valid \s-1VITC\s0 is detected,
draw \f(CW\*(C`\-\-:\-\-:\-\-:\-\-\*(C'\fR as a placeholder:
.Sp
.Vb 1
\&        ffmpeg \-i input.avi \-filter:v \*(Aqreadvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\e\e:lavfi.readvitc.tc_str\e\e:\-\-\e\e\e\e\e\e:\-\-\e\e\e\e\e\e:\-\-\e\e\e\e\e\e:\-\-}:x=(w\-tw)/2:y=400\-ascent\*(Aq
.Ve
.SS "remap"
.IX Subsection "remap"
Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
.PP
Destination pixel at position (X, Y) will be picked from source (x, y) position
where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
value for pixel will be used for destination pixel.
.PP
Xmap and Ymap input video streams must be of same dimensions. Output video stream
will have Xmap/Ymap video stream dimensions.
Xmap and Ymap input video streams are 16bit depth, single channel.
.SS "removegrain"
.IX Subsection "removegrain"
The removegrain filter is a spatial denoiser for progressive video.
.IP "\fBm0\fR" 4
.IX Item "m0"
Set mode for the first plane.
.IP "\fBm1\fR" 4
.IX Item "m1"
Set mode for the second plane.
.IP "\fBm2\fR" 4
.IX Item "m2"
Set mode for the third plane.
.IP "\fBm3\fR" 4
.IX Item "m3"
Set mode for the fourth plane.
.PP
Range of mode is from 0 to 24. Description of each mode follows:
.IP "\fI0\fR" 4
.IX Item "0"
Leave input plane unchanged. Default.
.IP "\fI1\fR" 4
.IX Item "1"
Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
.IP "\fI2\fR" 4
.IX Item "2"
Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
.IP "\fI3\fR" 4
.IX Item "3"
Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
.IP "\fI4\fR" 4
.IX Item "4"
Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
This is equivalent to a median filter.
.IP "\fI5\fR" 4
.IX Item "5"
Line-sensitive clipping giving the minimal change.
.IP "\fI6\fR" 4
.IX Item "6"
Line-sensitive clipping, intermediate.
.IP "\fI7\fR" 4
.IX Item "7"
Line-sensitive clipping, intermediate.
.IP "\fI8\fR" 4
.IX Item "8"
Line-sensitive clipping, intermediate.
.IP "\fI9\fR" 4
.IX Item "9"
Line-sensitive clipping on a line where the neighbours pixels are the closest.
.IP "\fI10\fR" 4
.IX Item "10"
Replaces the target pixel with the closest neighbour.
.IP "\fI11\fR" 4
.IX Item "11"
[1 2 1] horizontal and vertical kernel blur.
.IP "\fI12\fR" 4
.IX Item "12"
Same as mode 11.
.IP "\fI13\fR" 4
.IX Item "13"
Bob mode, interpolates top field from the line where the neighbours
pixels are the closest.
.IP "\fI14\fR" 4
.IX Item "14"
Bob mode, interpolates bottom field from the line where the neighbours
pixels are the closest.
.IP "\fI15\fR" 4
.IX Item "15"
Bob mode, interpolates top field. Same as 13 but with a more complicated
interpolation formula.
.IP "\fI16\fR" 4
.IX Item "16"
Bob mode, interpolates bottom field. Same as 14 but with a more complicated
interpolation formula.
.IP "\fI17\fR" 4
.IX Item "17"
Clips the pixel with the minimum and maximum of respectively the maximum and
minimum of each pair of opposite neighbour pixels.
.IP "\fI18\fR" 4
.IX Item "18"
Line-sensitive clipping using opposite neighbours whose greatest distance from
the current pixel is minimal.
.IP "\fI19\fR" 4
.IX Item "19"
Replaces the pixel with the average of its 8 neighbours.
.IP "\fI20\fR" 4
.IX Item "20"
Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
.IP "\fI21\fR" 4
.IX Item "21"
Clips pixels using the averages of opposite neighbour.
.IP "\fI22\fR" 4
.IX Item "22"
Same as mode 21 but simpler and faster.
.IP "\fI23\fR" 4
.IX Item "23"
Small edge and halo removal, but reputed useless.
.IP "\fI24\fR" 4
.IX Item "24"
Similar as 23.
.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 filter accepts 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 "repeatfields"
.IX Subsection "repeatfields"
This filter uses the repeat_field flag from the Video \s-1ES\s0 headers and hard repeats
fields based on its value.
.SS "reverse"
.IX Subsection "reverse"
Reverse a video clip.
.PP
Warning: This filter requires memory to buffer the entire clip, so trimming
is suggested.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Take the first 5 seconds of a clip, and reverse it.
.Sp
.Vb 1
\&        trim=end=5,reverse
.Ve
.SS "rotate"
.IX Subsection "rotate"
Rotate video by an arbitrary angle expressed in radians.
.PP
The filter accepts the following options:
.PP
A description of the optional parameters follows.
.IP "\fBangle, a\fR" 4
.IX Item "angle, a"
Set an expression for the angle by which to rotate the input video
clockwise, expressed as a number of radians. A negative value will
result in a counter-clockwise rotation. By default it is set to \*(L"0\*(R".
.Sp
This expression is evaluated for each frame.
.IP "\fBout_w, ow\fR" 4
.IX Item "out_w, ow"
Set the output width expression, default value is \*(L"iw\*(R".
This expression is evaluated just once during configuration.
.IP "\fBout_h, oh\fR" 4
.IX Item "out_h, oh"
Set the output height expression, default value is \*(L"ih\*(R".
This expression is evaluated just once during configuration.
.IP "\fBbilinear\fR" 4
.IX Item "bilinear"
Enable bilinear interpolation if set to 1, a value of 0 disables
it. Default value is 1.
.IP "\fBfillcolor, c\fR" 4
.IX Item "fillcolor, c"
Set the color used to fill the output area not covered by the rotated
image. For the general syntax of this option, check the \*(L"Color\*(R" section in the
ffmpeg-utils manual. If the special value \*(L"none\*(R" is selected then no
background is printed (useful for example if the background is never shown).
.Sp
Default value is \*(L"black\*(R".
.PP
The expressions for the angle and the output size can contain the
following constants and functions:
.IP "\fBn\fR" 4
.IX Item "n"
sequential number of the input frame, starting from 0. It is always \s-1NAN\s0
before the first frame is filtered.
.IP "\fBt\fR" 4
.IX Item "t"
time in seconds of the input frame, it is set to 0 when the filter is
configured. It is always \s-1NAN\s0 before the first frame is filtered.
.IP "\fBhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fBvsub\fR" 4
.IX Item "vsub"
.PD
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 "\fBin_w, iw\fR" 4
.IX Item "in_w, iw"
.PD 0
.IP "\fBin_h, ih\fR" 4
.IX Item "in_h, ih"
.PD
the input video width and height
.IP "\fBout_w, ow\fR" 4
.IX Item "out_w, ow"
.PD 0
.IP "\fBout_h, oh\fR" 4
.IX Item "out_h, oh"
.PD
the output width and height, that is the size of the padded area as
specified by the \fIwidth\fR and \fIheight\fR expressions
.IP "\fBrotw(a)\fR" 4
.IX Item "rotw(a)"
.PD 0
.IP "\fBroth(a)\fR" 4
.IX Item "roth(a)"
.PD
the minimal width/height required for completely containing the input
video rotated by \fIa\fR radians.
.Sp
These are only available when computing the \fBout_w\fR and
\&\fBout_h\fR expressions.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Rotate the input by \s-1PI/6\s0 radians clockwise:
.Sp
.Vb 1
\&        rotate=PI/6
.Ve
.IP "\(bu" 4
Rotate the input by \s-1PI/6\s0 radians counter-clockwise:
.Sp
.Vb 1
\&        rotate=\-PI/6
.Ve
.IP "\(bu" 4
Rotate the input by 45 degrees clockwise:
.Sp
.Vb 1
\&        rotate=45*PI/180
.Ve
.IP "\(bu" 4
Apply a constant rotation with period T, starting from an angle of \s-1PI/3:\s0
.Sp
.Vb 1
\&        rotate=PI/3+2*PI*t/T
.Ve
.IP "\(bu" 4
Make the input video rotation oscillating with a period of T
seconds and an amplitude of A radians:
.Sp
.Vb 1
\&        rotate=A*sin(2*PI/T*t)
.Ve
.IP "\(bu" 4
Rotate the video, output size is chosen so that the whole rotating
input video is always completely contained in the output:
.Sp
.Vb 1
\&        rotate=\*(Aq2*PI*t:ow=hypot(iw,ih):oh=ow\*(Aq
.Ve
.IP "\(bu" 4
Rotate the video, reduce the output size so that no background is ever
shown:
.Sp
.Vb 1
\&        rotate=2*PI*t:ow=\*(Aqmin(iw,ih)/sqrt(2)\*(Aq:oh=ow:c=none
.Ve
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
The filter supports the following commands:
.IP "\fBa, angle\fR" 4
.IX Item "a, angle"
Set the angle expression.
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 "sab"
.IX Subsection "sab"
Apply Shape Adaptive Blur.
.PP
The filter accepts the following options:
.IP "\fBluma_radius, lr\fR" 4
.IX Item "luma_radius, lr"
Set luma blur filter strength, must be a value in range 0.1\-4.0, default
value is 1.0. A greater value will result in a more blurred image, and
in slower processing.
.IP "\fBluma_pre_filter_radius, lpfr\fR" 4
.IX Item "luma_pre_filter_radius, lpfr"
Set luma pre-filter radius, must be a value in the 0.1\-2.0 range, default
value is 1.0.
.IP "\fBluma_strength, ls\fR" 4
.IX Item "luma_strength, ls"
Set luma maximum difference between pixels to still be considered, must
be a value in the 0.1\-100.0 range, default value is 1.0.
.IP "\fBchroma_radius, cr\fR" 4
.IX Item "chroma_radius, cr"
Set chroma blur filter strength, must be a value in range \-0.9\-4.0. A
greater value will result in a more blurred image, and in slower
processing.
.IP "\fBchroma_pre_filter_radius, cpfr\fR" 4
.IX Item "chroma_pre_filter_radius, cpfr"
Set chroma pre-filter radius, must be a value in the \-0.9\-2.0 range.
.IP "\fBchroma_strength, cs\fR" 4
.IX Item "chroma_strength, cs"
Set chroma maximum difference between pixels to still be considered,
must be a value in the \-0.9\-100.0 range.
.PP
Each chroma option value, if not explicitly specified, is set to the
corresponding luma option value.
.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
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
\fIOptions\fR
.IX Subsection "Options"
.PP
The filter accepts the following options, or any of the options
supported by the libswscale scaler.
.PP
See \fBthe ffmpeg-scaler manual\fR for
the complete list of scaler options.
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
Set the output video dimension expression. Default value is the input
dimension.
.Sp
If the value is 0, the input width is used for the output.
.Sp
If one of the values is \-1, the scale filter will use a value that
maintains the aspect ratio of the input image, calculated from the
other specified dimension. If both of them are \-1, the input size is
used
.Sp
If one of the values is \-n with n > 1, the scale filter will also use a value
that maintains the aspect ratio of the input image, calculated from the other
specified dimension. After that it will, however, make sure that the calculated
dimension is divisible by n and adjust the value if necessary.
.Sp
See below for the list of accepted constants for use in the dimension
expression.
.IP "\fBeval\fR" 4
.IX Item "eval"
Specify when to evaluate \fIwidth\fR and \fIheight\fR expression. 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 \fBinit\fR.
.RE
.IP "\fBinterl\fR" 4
.IX Item "interl"
Set the interlacing mode. 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 \fB0\fR.
.RE
.IP "\fBflags\fR" 4
.IX Item "flags"
Set libswscale scaling flags. See
\&\fBthe ffmpeg-scaler manual\fR for the
complete list of values. If not explicitly specified the filter applies
the default flags.
.IP "\fBparam0, param1\fR" 4
.IX Item "param0, param1"
Set libswscale input parameters for scaling algorithms that need them. See
\&\fBthe ffmpeg-scaler manual\fR for the
complete documentation. If not explicitly specified the filter applies
empty parameters.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the video size. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.IP "\fBin_color_matrix\fR" 4
.IX Item "in_color_matrix"
.PD 0
.IP "\fBout_color_matrix\fR" 4
.IX Item "out_color_matrix"
.PD
Set in/output YCbCr color space type.
.Sp
This allows the autodetected value to be overridden as well as allows forcing
a specific value used for the output and encoder.
.Sp
If not specified, the color space type depends on the pixel format.
.Sp
Possible values:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
Choose automatically.
.IP "\fBbt709\fR" 4
.IX Item "bt709"
Format conforming to International Telecommunication Union (\s-1ITU\s0)
Recommendation \s-1BT.709.\s0
.IP "\fBfcc\fR" 4
.IX Item "fcc"
Set color space conforming to the United States Federal Communications
Commission (\s-1FCC\s0) Code of Federal Regulations (\s-1CFR\s0) Title 47 (2003) 73.682 (a).
.IP "\fBbt601\fR" 4
.IX Item "bt601"
Set color space conforming to:
.RS 4
.IP "\(bu" 4
\&\s-1ITU\s0 Radiocommunication Sector (ITU-R) Recommendation \s-1BT.601\s0
.IP "\(bu" 4
ITU-R Rec. \s-1BT.470\-6 \s0(1998) Systems B, B1, and G
.IP "\(bu" 4
Society of Motion Picture and Television Engineers (\s-1SMPTE\s0) \s-1ST 170:2004\s0
.RE
.RS 4
.RE
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
Set color space conforming to \s-1SMPTE ST 240:1999.\s0
.RE
.RS 4
.RE
.IP "\fBin_range\fR" 4
.IX Item "in_range"
.PD 0
.IP "\fBout_range\fR" 4
.IX Item "out_range"
.PD
Set in/output YCbCr sample range.
.Sp
This allows the autodetected value to be overridden as well as allows forcing
a specific value used for the output and encoder. If not specified, the
range depends on the pixel format. Possible values:
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
Choose automatically.
.IP "\fBjpeg/full/pc\fR" 4
.IX Item "jpeg/full/pc"
Set full range (0\-255 in case of 8\-bit luma).
.IP "\fBmpeg/tv\fR" 4
.IX Item "mpeg/tv"
Set \*(L"\s-1MPEG\*(R"\s0 range (16\-235 in case of 8\-bit luma).
.RE
.RS 4
.RE
.IP "\fBforce_original_aspect_ratio\fR" 4
.IX Item "force_original_aspect_ratio"
Enable decreasing or increasing output video width or height if necessary to
keep the original aspect ratio. Possible values:
.RS 4
.IP "\fBdisable\fR" 4
.IX Item "disable"
Scale the video as specified and disable this feature.
.IP "\fBdecrease\fR" 4
.IX Item "decrease"
The output video dimensions will automatically be decreased if needed.
.IP "\fBincrease\fR" 4
.IX Item "increase"
The output video dimensions will automatically be increased if needed.
.RE
.RS 4
.Sp
One useful instance of this option is that when you know a specific device's
maximum allowed resolution, you can use this to limit the output video to
that, while retaining the aspect ratio. For example, device A allows
1280x720 playback, and your video is 1920x800. Using this option (set it to
decrease) and specifying 1280x720 to the command line makes the output
1280x533.
.Sp
Please note that this is a different thing than specifying \-1 for \fBw\fR
or \fBh\fR, you still need to specify the output resolution for this option
to work.
.RE
.PP
The values of the \fBw\fR and \fBh\fR options are expressions
containing the following constants:
.IP "\fIin_w\fR" 4
.IX Item "in_w"
.PD 0
.IP "\fIin_h\fR" 4
.IX Item "in_h"
.PD
The input width and height
.IP "\fIiw\fR" 4
.IX Item "iw"
.PD 0
.IP "\fIih\fR" 4
.IX Item "ih"
.PD
These are the same as \fIin_w\fR and \fIin_h\fR.
.IP "\fIout_w\fR" 4
.IX Item "out_w"
.PD 0
.IP "\fIout_h\fR" 4
.IX Item "out_h"
.PD
The output (scaled) width and height
.IP "\fIow\fR" 4
.IX Item "ow"
.PD 0
.IP "\fIoh\fR" 4
.IX Item "oh"
.PD
These are the same as \fIout_w\fR and \fIout_h\fR
.IP "\fIa\fR" 4
.IX Item "a"
The same as \fIiw\fR / \fIih\fR
.IP "\fIsar\fR" 4
.IX Item "sar"
input sample aspect ratio
.IP "\fIdar\fR" 4
.IX Item "dar"
The input display aspect ratio. Calculated from \f(CW\*(C`(iw / ih) * sar\*(C'\fR.
.IP "\fIhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fIvsub\fR" 4
.IX Item "vsub"
.PD
horizontal and vertical input chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.IP "\fIohsub\fR" 4
.IX Item "ohsub"
.PD 0
.IP "\fIovsub\fR" 4
.IX Item "ovsub"
.PD
horizontal and vertical output 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
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=200: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 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, making 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,
keeping the same aspect ratio as the input:
.Sp
.Vb 1
\&        scale=w=\*(Aqmin(500\e, iw*3/2):h=\-1\*(Aq
.Ve
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
This filter supports the following commands:
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
Set the output video dimension expression.
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 "scale_npp"
.IX Subsection "scale_npp"
Use the \s-1NVIDIA\s0 Performance Primitives (libnpp) to perform scaling and/or pixel
format conversion on \s-1CUDA\s0 video frames. Setting the output width and height
works in the same way as for the \fIscale\fR filter.
.PP
The following additional options are accepted:
.IP "\fBformat\fR" 4
.IX Item "format"
The pixel format of the output \s-1CUDA\s0 frames. If set to the string \*(L"same\*(R" (the
default), the input format will be kept. Note that automatic format negotiation
and conversion is not yet supported for hardware frames
.IP "\fBinterp_algo\fR" 4
.IX Item "interp_algo"
The interpolation algorithm used for resizing. One of the following:
.RS 4
.IP "\fBnn\fR" 4
.IX Item "nn"
Nearest neighbour.
.IP "\fBlinear\fR" 4
.IX Item "linear"
.PD 0
.IP "\fBcubic\fR" 4
.IX Item "cubic"
.IP "\fBcubic2p_bspline\fR" 4
.IX Item "cubic2p_bspline"
.PD
2\-parameter cubic (B=1, C=0)
.IP "\fBcubic2p_catmullrom\fR" 4
.IX Item "cubic2p_catmullrom"
2\-parameter cubic (B=0, C=1/2)
.IP "\fBcubic2p_b05c03\fR" 4
.IX Item "cubic2p_b05c03"
2\-parameter cubic (B=1/2, C=3/10)
.IP "\fBsuper\fR" 4
.IX Item "super"
Supersampling
.IP "\fBlanczos\fR" 4
.IX Item "lanczos"
.RE
.RS 4
.RE
.SS "scale2ref"
.IX Subsection "scale2ref"
Scale (resize) the input video, based on a reference video.
.PP
See the scale filter for available options, scale2ref supports the same but
uses the reference video instead of the main input as basis.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Scale a subtitle stream to match the main video in size before overlaying
.Sp
.Vb 1
\&        \*(Aqscale2ref[b][a];[a][b]overlay\*(Aq
.Ve
.SS "selectivecolor"
.IX Subsection "selectivecolor"
Adjust cyan, magenta, yellow and black (\s-1CMYK\s0) to certain ranges of colors (such
as \*(L"reds\*(R", \*(L"yellows\*(R", \*(L"greens\*(R", \*(L"cyans\*(R", ...). The adjustment range is defined
by the \*(L"purity\*(R" of the color (that is, how saturated it already is).
.PP
This filter is similar to the Adobe Photoshop Selective Color tool.
.PP
The filter accepts the following options:
.IP "\fBcorrection_method\fR" 4
.IX Item "correction_method"
Select color correction method.
.Sp
Available values are:
.RS 4
.IP "\fBabsolute\fR" 4
.IX Item "absolute"
Specified adjustments are applied \*(L"as-is\*(R" (added/subtracted to original pixel
component value).
.IP "\fBrelative\fR" 4
.IX Item "relative"
Specified adjustments are relative to the original component value.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`absolute\*(C'\fR.
.RE
.IP "\fBreds\fR" 4
.IX Item "reds"
Adjustments for red pixels (pixels where the red component is the maximum)
.IP "\fByellows\fR" 4
.IX Item "yellows"
Adjustments for yellow pixels (pixels where the blue component is the minimum)
.IP "\fBgreens\fR" 4
.IX Item "greens"
Adjustments for green pixels (pixels where the green component is the maximum)
.IP "\fBcyans\fR" 4
.IX Item "cyans"
Adjustments for cyan pixels (pixels where the red component is the minimum)
.IP "\fBblues\fR" 4
.IX Item "blues"
Adjustments for blue pixels (pixels where the blue component is the maximum)
.IP "\fBmagentas\fR" 4
.IX Item "magentas"
Adjustments for magenta pixels (pixels where the green component is the minimum)
.IP "\fBwhites\fR" 4
.IX Item "whites"
Adjustments for white pixels (pixels where all components are greater than 128)
.IP "\fBneutrals\fR" 4
.IX Item "neutrals"
Adjustments for all pixels except pure black and pure white
.IP "\fBblacks\fR" 4
.IX Item "blacks"
Adjustments for black pixels (pixels where all components are lesser than 128)
.IP "\fBpsfile\fR" 4
.IX Item "psfile"
Specify a Photoshop selective color file (\f(CW\*(C`.asv\*(C'\fR) to import the settings from.
.PP
All the adjustment settings (\fBreds\fR, \fByellows\fR, ...) accept up to
4 space separated floating point adjustment values in the [\-1,1] range,
respectively to adjust the amount of cyan, magenta, yellow and black for the
pixels of its range.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Increase cyan by 50% and reduce yellow by 33% in every green areas, and
increase magenta by 27% in blue areas:
.Sp
.Vb 1
\&        selectivecolor=greens=.5 0 \-.33 0:blues=0 .27
.Ve
.IP "\(bu" 4
Use a Photoshop selective color preset:
.Sp
.Vb 1
\&        selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
.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 \fBsetfield\fR 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
It accepts the following parameters:
.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
The parameter \fIsar\fR is an expression containing
the following constants:
.IP "\fBE, \s-1PI, PHI\s0\fR" 4
.IX Item "E, PI, PHI"
These are approximated values for the mathematical constants e
(Euler's number), pi (Greek pi), and phi (the golden ratio).
.IP "\fBw, h\fR" 4
.IX Item "w, h"
The input width and height.
.IP "\fBa\fR" 4
.IX Item "a"
These are the same as \fIw\fR / \fIh\fR.
.IP "\fBsar\fR" 4
.IX Item "sar"
The input sample aspect ratio.
.IP "\fBdar\fR" 4
.IX Item "dar"
The 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.
.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 2
\&        setdar=dar=1.77777
\&        setdar=dar=16/9
.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
The following values are shown in the output:
.IP "\fBn\fR" 4
.IX Item "n"
The (sequential) number of the input frame, starting from 0.
.IP "\fBpts\fR" 4
.IX Item "pts"
The 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"
The Presentation TimeStamp of the input frame, expressed as a number of
seconds.
.IP "\fBpos\fR" 4
.IX Item "pos"
The position of the frame in the input stream, or \-1 if this information is
unavailable and/or meaningless (for example in case of synthetic video).
.IP "\fBfmt\fR" 4
.IX Item "fmt"
The pixel format name.
.IP "\fBsar\fR" 4
.IX Item "sar"
The sample aspect ratio of the input frame, expressed in the form
\&\fInum\fR/\fIden\fR.
.IP "\fBs\fR" 4
.IX Item "s"
The size of the input frame. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.IP "\fBi\fR" 4
.IX Item "i"
The type of 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"
This is 1 if the frame is a key frame, 0 otherwise.
.IP "\fBtype\fR" 4
.IX Item "type"
The 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, or \*(L"?\*(R" for an unknown type).
Also refer to 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"
The Adler\-32 checksum (printed in hexadecimal) of all the planes of the input frame.
.IP "\fBplane_checksum\fR" 4
.IX Item "plane_checksum"
The 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 "showpalette"
.IX Subsection "showpalette"
Displays the 256 colors palette of each frame. This filter is only relevant for
\&\fIpal8\fR pixel format frames.
.PP
It accepts the following option:
.IP "\fBs\fR" 4
.IX Item "s"
Set the size of the box used to represent one palette color entry. Default is
\&\f(CW30\fR (for a \f(CW\*(C`30x30\*(C'\fR pixel box).
.SS "shuffleframes"
.IX Subsection "shuffleframes"
Reorder and/or duplicate video frames.
.PP
It accepts the following parameters:
.IP "\fBmapping\fR" 4
.IX Item "mapping"
Set the destination indexes of input frames.
This is space or '|' separated list of indexes that maps input frames to output
frames. Number of indexes also sets maximal value that each index may have.
.PP
The first frame has the index 0. The default is to keep the input unchanged.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Swap second and third frame of every three frames of the input:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-vf "shuffleframes=0 2 1" OUTPUT
.Ve
.IP "\(bu" 4
Swap 10th and 1st frame of every ten frames of the input:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
.Ve
.SS "shuffleplanes"
.IX Subsection "shuffleplanes"
Reorder and/or duplicate video planes.
.PP
It accepts the following parameters:
.IP "\fBmap0\fR" 4
.IX Item "map0"
The index of the input plane to be used as the first output plane.
.IP "\fBmap1\fR" 4
.IX Item "map1"
The index of the input plane to be used as the second output plane.
.IP "\fBmap2\fR" 4
.IX Item "map2"
The index of the input plane to be used as the third output plane.
.IP "\fBmap3\fR" 4
.IX Item "map3"
The index of the input plane to be used as the fourth output plane.
.PP
The first plane has the index 0. The default is to keep the input unchanged.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Swap the second and third planes of the input:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-vf shuffleplanes=0:2:1:3 OUTPUT
.Ve
.SS "signalstats"
.IX Subsection "signalstats"
Evaluate various visual metrics that assist in determining issues associated
with the digitization of analog video media.
.PP
By default the filter will log these metadata values:
.IP "\fB\s-1YMIN\s0\fR" 4
.IX Item "YMIN"
Display the minimal Y value contained within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1YLOW\s0\fR" 4
.IX Item "YLOW"
Display the Y value at the 10% percentile within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1YAVG\s0\fR" 4
.IX Item "YAVG"
Display the average Y value within the input frame. Expressed in range of
[0\-255].
.IP "\fB\s-1YHIGH\s0\fR" 4
.IX Item "YHIGH"
Display the Y value at the 90% percentile within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1YMAX\s0\fR" 4
.IX Item "YMAX"
Display the maximum Y value contained within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1UMIN\s0\fR" 4
.IX Item "UMIN"
Display the minimal U value contained within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1ULOW\s0\fR" 4
.IX Item "ULOW"
Display the U value at the 10% percentile within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1UAVG\s0\fR" 4
.IX Item "UAVG"
Display the average U value within the input frame. Expressed in range of
[0\-255].
.IP "\fB\s-1UHIGH\s0\fR" 4
.IX Item "UHIGH"
Display the U value at the 90% percentile within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1UMAX\s0\fR" 4
.IX Item "UMAX"
Display the maximum U value contained within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1VMIN\s0\fR" 4
.IX Item "VMIN"
Display the minimal V value contained within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1VLOW\s0\fR" 4
.IX Item "VLOW"
Display the V value at the 10% percentile within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1VAVG\s0\fR" 4
.IX Item "VAVG"
Display the average V value within the input frame. Expressed in range of
[0\-255].
.IP "\fB\s-1VHIGH\s0\fR" 4
.IX Item "VHIGH"
Display the V value at the 90% percentile within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1VMAX\s0\fR" 4
.IX Item "VMAX"
Display the maximum V value contained within the input frame. Expressed in
range of [0\-255].
.IP "\fB\s-1SATMIN\s0\fR" 4
.IX Item "SATMIN"
Display the minimal saturation value contained within the input frame.
Expressed in range of [0\-~181.02].
.IP "\fB\s-1SATLOW\s0\fR" 4
.IX Item "SATLOW"
Display the saturation value at the 10% percentile within the input frame.
Expressed in range of [0\-~181.02].
.IP "\fB\s-1SATAVG\s0\fR" 4
.IX Item "SATAVG"
Display the average saturation value within the input frame. Expressed in range
of [0\-~181.02].
.IP "\fB\s-1SATHIGH\s0\fR" 4
.IX Item "SATHIGH"
Display the saturation value at the 90% percentile within the input frame.
Expressed in range of [0\-~181.02].
.IP "\fB\s-1SATMAX\s0\fR" 4
.IX Item "SATMAX"
Display the maximum saturation value contained within the input frame.
Expressed in range of [0\-~181.02].
.IP "\fB\s-1HUEMED\s0\fR" 4
.IX Item "HUEMED"
Display the median value for hue within the input frame. Expressed in range of
[0\-360].
.IP "\fB\s-1HUEAVG\s0\fR" 4
.IX Item "HUEAVG"
Display the average value for hue within the input frame. Expressed in range of
[0\-360].
.IP "\fB\s-1YDIF\s0\fR" 4
.IX Item "YDIF"
Display the average of sample value difference between all values of the Y
plane in the current frame and corresponding values of the previous input frame.
Expressed in range of [0\-255].
.IP "\fB\s-1UDIF\s0\fR" 4
.IX Item "UDIF"
Display the average of sample value difference between all values of the U
plane in the current frame and corresponding values of the previous input frame.
Expressed in range of [0\-255].
.IP "\fB\s-1VDIF\s0\fR" 4
.IX Item "VDIF"
Display the average of sample value difference between all values of the V
plane in the current frame and corresponding values of the previous input frame.
Expressed in range of [0\-255].
.IP "\fB\s-1YBITDEPTH\s0\fR" 4
.IX Item "YBITDEPTH"
Display bit depth of Y plane in current frame.
Expressed in range of [0\-16].
.IP "\fB\s-1UBITDEPTH\s0\fR" 4
.IX Item "UBITDEPTH"
Display bit depth of U plane in current frame.
Expressed in range of [0\-16].
.IP "\fB\s-1VBITDEPTH\s0\fR" 4
.IX Item "VBITDEPTH"
Display bit depth of V plane in current frame.
Expressed in range of [0\-16].
.PP
The filter accepts the following options:
.IP "\fBstat\fR" 4
.IX Item "stat"
.PD 0
.IP "\fBout\fR" 4
.IX Item "out"
.PD
\&\fBstat\fR specify an additional form of image analysis.
\&\fBout\fR output video with the specified type of pixel highlighted.
.Sp
Both options accept the following values:
.RS 4
.IP "\fBtout\fR" 4
.IX Item "tout"
Identify \fItemporal outliers\fR pixels. A \fItemporal outlier\fR is a pixel
unlike the neighboring pixels of the same field. Examples of temporal outliers
include the results of video dropouts, head clogs, or tape tracking issues.
.IP "\fBvrep\fR" 4
.IX Item "vrep"
Identify \fIvertical line repetition\fR. Vertical line repetition includes
similar rows of pixels within a frame. In born-digital video vertical line
repetition is common, but this pattern is uncommon in video digitized from an
analog source. When it occurs in video that results from the digitization of an
analog source it can indicate concealment from a dropout compensator.
.IP "\fBbrng\fR" 4
.IX Item "brng"
Identify pixels that fall outside of legal broadcast range.
.RE
.RS 4
.RE
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Set the highlight color for the \fBout\fR option. The default color is
yellow.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Output data of various video metrics:
.Sp
.Vb 1
\&        ffprobe \-f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" \-show_frames
.Ve
.IP "\(bu" 4
Output specific data about the minimum and maximum values of the Y plane per frame:
.Sp
.Vb 1
\&        ffprobe \-f lavfi movie=example.mov,signalstats \-show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
.Ve
.IP "\(bu" 4
Playback video while highlighting pixels that are outside of broadcast range in red.
.Sp
.Vb 1
\&        ffplay example.mov \-vf signalstats="out=brng:color=red"
.Ve
.IP "\(bu" 4
Playback video with signalstats metadata drawn over the frame.
.Sp
.Vb 1
\&        ffplay example.mov \-vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
.Ve
.Sp
The contents of signalstat_drawtext.txt used in the command are:
.Sp
.Vb 5
\&        time %{pts:hms}
\&        Y (%{metadata:lavfi.signalstats.YMIN}\-%{metadata:lavfi.signalstats.YMAX})
\&        U (%{metadata:lavfi.signalstats.UMIN}\-%{metadata:lavfi.signalstats.UMAX})
\&        V (%{metadata:lavfi.signalstats.VMIN}\-%{metadata:lavfi.signalstats.VMAX})
\&        saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
.Ve
.SS "smartblur"
.IX Subsection "smartblur"
Blur the input video without impacting the outlines.
.PP
It 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 "ssim"
.IX Subsection "ssim"
Obtain the \s-1SSIM \s0(Structural SImilarity Metric) between two input videos.
.PP
This filter takes in input two input videos, the first input is
considered the \*(L"main\*(R" source and is passed unchanged to the
output. The second input is used as a \*(L"reference\*(R" video for computing
the \s-1SSIM.\s0
.PP
Both video inputs must have the same resolution and pixel format for
this filter to work correctly. Also it assumes that both inputs
have the same number of frames, which are compared one by one.
.PP
The filter stores the calculated \s-1SSIM\s0 of each frame.
.PP
The description of the accepted parameters follows.
.IP "\fBstats_file, f\fR" 4
.IX Item "stats_file, f"
If specified the filter will use the named file to save the \s-1SSIM\s0 of
each individual frame. When filename equals \*(L"\-\*(R" the data is sent to
standard output.
.PP
The file printed if \fIstats_file\fR is selected, contains a sequence of
key/value pairs of the form \fIkey\fR:\fIvalue\fR for each compared
couple of frames.
.PP
A description of each shown parameter follows:
.IP "\fBn\fR" 4
.IX Item "n"
sequential number of the input frame, starting from 1
.IP "\fBY, U, V, R, G, B\fR" 4
.IX Item "Y, U, V, R, G, B"
\&\s-1SSIM\s0 of the compared frames for the component specified by the suffix.
.IP "\fBAll\fR" 4
.IX Item "All"
\&\s-1SSIM\s0 of the compared frames for the whole frame.
.IP "\fBdB\fR" 4
.IX Item "dB"
Same as above but in dB representation.
.PP
For example:
.PP
.Vb 2
\&        movie=ref_movie.mpg, setpts=PTS\-STARTPTS [main];
\&        [main][ref] ssim="stats_file=stats.log" [out]
.Ve
.PP
On this example the input file being processed is compared with the
reference file \fIref_movie.mpg\fR. The \s-1SSIM\s0 of each individual frame
is stored in \fIstats.log\fR.
.PP
Another example with both psnr and ssim at same time:
.PP
.Vb 1
\&        ffmpeg \-i main.mpg \-i ref.mpg \-lavfi  "ssim;[0:v][1:v]psnr" \-f null \-
.Ve
.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)
.IP "\fBal\fR" 4
.IX Item "al"
alternating frames (left eye first, right eye second)
.IP "\fBar\fR" 4
.IX Item "ar"
alternating frames (right eye first, left eye second)
.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 "\fBicl\fR" 4
.IX Item "icl"
interleaved columns, left eye first
.IP "\fBicr\fR" 4
.IX Item "icr"
interleaved columns, right eye first
.Sp
Default value is \fBsbsl\fR.
.RE
.RS 4
.RE
.IP "\fBout\fR" 4
.IX Item "out"
Set stereoscopic image format of output.
.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)
.IP "\fBal\fR" 4
.IX Item "al"
alternating frames (left eye first, right eye second)
.IP "\fBar\fR" 4
.IX Item "ar"
alternating frames (right eye first, left eye second)
.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 "\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 "\fBml\fR" 4
.IX Item "ml"
mono output (left eye only)
.IP "\fBmr\fR" 4
.IX Item "mr"
mono output (right eye only)
.IP "\fBchl\fR" 4
.IX Item "chl"
checkerboard, left eye first
.IP "\fBchr\fR" 4
.IX Item "chr"
checkerboard, right eye first
.IP "\fBicl\fR" 4
.IX Item "icl"
interleaved columns, left eye first
.IP "\fBicr\fR" 4
.IX Item "icr"
interleaved columns, right eye first
.IP "\fBhdmi\fR" 4
.IX Item "hdmi"
\&\s-1HDMI\s0 frame pack
.RE
.RS 4
.Sp
Default value is \fBarcd\fR.
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Convert input video from side by side parallel to anaglyph yellow/blue dubois:
.Sp
.Vb 1
\&        stereo3d=sbsl:aybd
.Ve
.IP "\(bu" 4
Convert input video from above below (left eye above, right eye below) to side by side crosseye.
.Sp
.Vb 1
\&        stereo3d=abl:sbsr
.Ve
.SS "streamselect, astreamselect"
.IX Subsection "streamselect, astreamselect"
Select video or audio streams.
.PP
The filter accepts the following options:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
Set number of inputs. Default is 2.
.IP "\fBmap\fR" 4
.IX Item "map"
Set input indexes to remap to outputs.
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
The \f(CW\*(C`streamselect\*(C'\fR and \f(CW\*(C`astreamselect\*(C'\fR filter supports the following
commands:
.IP "\fBmap\fR" 4
.IX Item "map"
Set input indexes to remap to outputs.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Select first 5 seconds 1st stream and rest of time 2nd stream:
.Sp
.Vb 1
\&        sendcmd=\*(Aq5.0 streamselect map 1\*(Aq,streamselect=inputs=2:map=0
.Ve
.IP "\(bu" 4
Same as above, but for audio:
.Sp
.Vb 1
\&        asendcmd=\*(Aq5.0 astreamselect map 1\*(Aq,astreamselect=inputs=2:map=0
.Ve
.SS "sobel"
.IX Subsection "sobel"
Apply sobel operator to input video stream.
.PP
The filter accepts the following option:
.IP "\fBplanes\fR" 4
.IX Item "planes"
Set which planes will be processed, unprocessed planes will be copied.
By default value 0xf, all planes will be processed.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set value which will be multiplied with filtered result.
.IP "\fBdelta\fR" 4
.IX Item "delta"
Set value which will be added to filtered result.
.SS "spp"
.IX Subsection "spp"
Apply a simple postprocessing filter that compresses and decompresses the image
at several (or \- in the case of \fBquality\fR level \f(CW6\fR \- all) shifts
and average the results.
.PP
The filter accepts the following options:
.IP "\fBquality\fR" 4
.IX Item "quality"
Set quality. This option defines the number of levels for averaging. It accepts
an integer in the range 0\-6. If set to \f(CW0\fR, the filter will have no
effect. A value of \f(CW6\fR means the higher quality. For each increment of
that value the speed drops by a factor of approximately 2.  Default value is
\&\f(CW3\fR.
.IP "\fBqp\fR" 4
.IX Item "qp"
Force a constant quantization parameter. If not set, the filter will use the \s-1QP\s0
from the video stream (if available).
.IP "\fBmode\fR" 4
.IX Item "mode"
Set thresholding mode. Available modes are:
.RS 4
.IP "\fBhard\fR" 4
.IX Item "hard"
Set hard thresholding (default).
.IP "\fBsoft\fR" 4
.IX Item "soft"
Set soft thresholding (better de-ringing effect, but likely blurrier).
.RE
.RS 4
.RE
.IP "\fBuse_bframe_qp\fR" 4
.IX Item "use_bframe_qp"
Enable the use of the \s-1QP\s0 from the B\-Frames if set to \f(CW1\fR. Using this
option may cause flicker since the B\-Frames have often larger \s-1QP.\s0 Default is
\&\f(CW0\fR (not enabled).
.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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
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 "\fBfontsdir\fR" 4
.IX Item "fontsdir"
Set a directory path containing fonts that can be used by the filter.
These fonts will be used in addition to whatever the font provider uses.
.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
.IP "\fBstream_index, si\fR" 4
.IX Item "stream_index, si"
Set subtitles stream index. \f(CW\*(C`subtitles\*(C'\fR filter only.
.IP "\fBforce_style\fR" 4
.IX Item "force_style"
Override default style or script info parameters of the subtitles. It accepts a
string containing \s-1ASS\s0 style format \f(CW\*(C`KEY=VALUE\*(C'\fR couples separated by \*(L",\*(R".
.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
.PP
To render the default subtitles stream from file \fIvideo.mkv\fR, use:
.PP
.Vb 1
\&        subtitles=video.mkv
.Ve
.PP
To render the second subtitles stream from that file, use:
.PP
.Vb 1
\&        subtitles=video.mkv:si=1
.Ve
.PP
To make the subtitles stream from \fIsub.srt\fR appear in transparent green
\&\f(CW\*(C`DejaVu Serif\*(C'\fR, use:
.PP
.Vb 1
\&        subtitles=sub.srt:force_style=\*(AqFontName=DejaVu Serif,PrimaryColour=&HAA00FF00\*(Aq
.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 "swaprect"
.IX Subsection "swaprect"
Swap two rectangular objects in video.
.PP
This filter accepts the following options:
.IP "\fBw\fR" 4
.IX Item "w"
Set object width.
.IP "\fBh\fR" 4
.IX Item "h"
Set object height.
.IP "\fBx1\fR" 4
.IX Item "x1"
Set 1st rect x coordinate.
.IP "\fBy1\fR" 4
.IX Item "y1"
Set 1st rect y coordinate.
.IP "\fBx2\fR" 4
.IX Item "x2"
Set 2nd rect x coordinate.
.IP "\fBy2\fR" 4
.IX Item "y2"
Set 2nd rect y coordinate.
.Sp
All expressions are evaluated once for each frame.
.PP
The all options are expressions containing the following constants:
.IP "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
The input width and height.
.IP "\fBa\fR" 4
.IX Item "a"
same as \fIw\fR / \fIh\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 (\fIw\fR / \fIh\fR) * \fIsar\fR
.IP "\fBn\fR" 4
.IX Item "n"
The number of the input frame, starting from 0.
.IP "\fBt\fR" 4
.IX Item "t"
The timestamp expressed in seconds. It's \s-1NAN\s0 if the input timestamp is unknown.
.IP "\fBpos\fR" 4
.IX Item "pos"
the position in the file of the input frame, \s-1NAN\s0 if unknown
.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). For the syntax of
this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\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.
.IP "\fBcolor\fR" 4
.IX Item "color"
Specify the color of the unused area. For the syntax of this option, check the
\&\*(L"Color\*(R" section in the ffmpeg-utils manual. The default value of \fIcolor\fR
is \*(L"black\*(R".
.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 accommodate 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.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        
\&        Output:
\&        11111                           33333
\&        22222                           44444
\&        11111                           33333
\&        22222                           44444
\&        11111                           33333
\&        22222                           44444
\&        11111                           33333
\&        22222                           44444
.Ve
.IP "\fBdrop_even, 1\fR" 4
.IX Item "drop_even, 1"
Only output odd frames, even frames are dropped, generating a frame with
unchanged height at half frame rate.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        
\&        Output:
\&        11111                           33333
\&        11111                           33333
\&        11111                           33333
\&        11111                           33333
.Ve
.IP "\fBdrop_odd, 2\fR" 4
.IX Item "drop_odd, 2"
Only output even frames, odd frames are dropped, generating a frame with
unchanged height at half frame rate.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        
\&        Output:
\&                        22222                           44444
\&                        22222                           44444
\&                        22222                           44444
\&                        22222                           44444
.Ve
.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.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        
\&        Output:
\&        11111           .....           33333           .....
\&        .....           22222           .....           44444
\&        11111           .....           33333           .....
\&        .....           22222           .....           44444
\&        11111           .....           33333           .....
\&        .....           22222           .....           44444
\&        11111           .....           33333           .....
\&        .....           22222           .....           44444
.Ve
.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.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111<\-         22222           33333<\-         44444
\&        11111           22222<\-         33333           44444<\-
\&        11111<\-         22222           33333<\-         44444
\&        11111           22222<\-         33333           44444<\-
\&        
\&        Output:
\&        11111                           33333
\&        22222                           44444
\&        11111                           33333
\&        22222                           44444
.Ve
.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.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222<\-         33333           44444<\-
\&        11111<\-         22222           33333<\-         44444
\&        11111           22222<\-         33333           44444<\-
\&        11111<\-         22222           33333<\-         44444
\&        
\&        Output:
\&        22222                           44444
\&        11111                           33333
\&        22222                           44444
\&        11111                           33333
.Ve
.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.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222           33333           44444
\&         11111           22222           33333           44444
\&        11111           22222           33333           44444
\&         11111           22222           33333           44444
\&        
\&        Output:
\&        11111   22222   22222   33333   33333   44444   44444
\&         11111   11111   22222   22222   33333   33333   44444
\&        11111   22222   22222   33333   33333   44444   44444
\&         11111   11111   22222   22222   33333   33333   44444
.Ve
.IP "\fBmergex2, 7\fR" 4
.IX Item "mergex2, 7"
Move odd frames into the upper field, even into the lower field,
generating a double height frame at same frame rate.
.Sp
.Vb 3
\&         \-\-\-\-\-\-> time
\&        Input:
\&        Frame 1         Frame 2         Frame 3         Frame 4
\&        
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        11111           22222           33333           44444
\&        
\&        Output:
\&        11111           33333           33333           55555
\&        22222           22222           44444           44444
\&        11111           33333           33333           55555
\&        22222           22222           44444           44444
\&        11111           33333           33333           55555
\&        22222           22222           44444           44444
\&        11111           33333           33333           55555
\&        22222           22222           44444           44444
.Ve
.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
It accepts the following parameters:
.IP "\fBdir\fR" 4
.IX Item "dir"
Specify the transposition direction.
.Sp
Can assume the following values:
.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.
.Sp
Numerical values are deprecated, and should be dropped in favor of
symbolic constants.
.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 "trim"
.IX Subsection "trim"
Trim the input so that the output contains one continuous subpart of the input.
.PP
It accepts the following parameters:
.IP "\fBstart\fR" 4
.IX Item "start"
Specify the time of the start of the kept section, i.e. the frame with the
timestamp \fIstart\fR will be the first frame in the output.
.IP "\fBend\fR" 4
.IX Item "end"
Specify the time of the first frame that will be dropped, i.e. the frame
immediately preceding the one with the timestamp \fIend\fR will be the last
frame in the output.
.IP "\fBstart_pts\fR" 4
.IX Item "start_pts"
This is the same as \fIstart\fR, except this option sets the start timestamp
in timebase units instead of seconds.
.IP "\fBend_pts\fR" 4
.IX Item "end_pts"
This is the same as \fIend\fR, except this option sets the end timestamp
in timebase units instead of seconds.
.IP "\fBduration\fR" 4
.IX Item "duration"
The maximum duration of the output in seconds.
.IP "\fBstart_frame\fR" 4
.IX Item "start_frame"
The number of the first frame that should be passed to the output.
.IP "\fBend_frame\fR" 4
.IX Item "end_frame"
The number of the first frame that should be dropped.
.PP
\&\fBstart\fR, \fBend\fR, and \fBduration\fR are expressed as time
duration specifications; see
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
.PP
Note that the first two sets of the start/end options and the \fBduration\fR
option look at the frame timestamp, while the _frame variants simply count the
frames that pass through the filter. Also note that this filter does not modify
the timestamps. If you wish for the output timestamps to start at zero, insert a
setpts filter after the trim filter.
.PP
If multiple start or end options are set, this filter tries to be greedy and
keep all the frames that match at least one of the specified constraints. To keep
only the part that matches all the constraints at once, chain multiple trim
filters.
.PP
The defaults are such that all the input is kept. So it is possible to set e.g.
just the end values to keep everything before the specified time.
.PP
Examples:
.IP "\(bu" 4
Drop everything except the second minute of input:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-vf trim=60:120
.Ve
.IP "\(bu" 4
Keep only the first second:
.Sp
.Vb 1
\&        ffmpeg \-i INPUT \-vf trim=duration=1
.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"
Set the luma matrix horizontal size. It must be an odd integer between
3 and 23. The default value is 5.
.IP "\fBluma_msize_y, ly\fR" 4
.IX Item "luma_msize_y, ly"
Set the luma matrix vertical size. It must be an odd integer between 3
and 23. The default value is 5.
.IP "\fBluma_amount, la\fR" 4
.IX Item "luma_amount, la"
Set the luma effect strength. It must be a floating point 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.
.IP "\fBchroma_msize_x, cx\fR" 4
.IX Item "chroma_msize_x, cx"
Set the chroma matrix horizontal size. It must be an odd integer
between 3 and 23. The default value is 5.
.IP "\fBchroma_msize_y, cy\fR" 4
.IX Item "chroma_msize_y, cy"
Set the chroma matrix vertical size. It must be an odd integer
between 3 and 23. The default value is 5.
.IP "\fBchroma_amount, ca\fR" 4
.IX Item "chroma_amount, ca"
Set the chroma effect strength. It must be a floating point 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 0.0.
.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.
.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 a strong blur of both luma and chroma parameters:
.Sp
.Vb 1
\&        unsharp=7:7:\-2:7:7:\-2
.Ve
.SS "uspp"
.IX Subsection "uspp"
Apply ultra slow/simple postprocessing filter that compresses and decompresses
the image at several (or \- in the case of \fBquality\fR level \f(CW8\fR \- all)
shifts and average the results.
.PP
The way this differs from the behavior of spp is that uspp actually encodes &
decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
\&\s-1DCT\s0 similar to \s-1MJPEG.\s0
.PP
The filter accepts the following options:
.IP "\fBquality\fR" 4
.IX Item "quality"
Set quality. This option defines the number of levels for averaging. It accepts
an integer in the range 0\-8. If set to \f(CW0\fR, the filter will have no
effect. A value of \f(CW8\fR means the higher quality. For each increment of
that value the speed drops by a factor of approximately 2.  Default value is
\&\f(CW3\fR.
.IP "\fBqp\fR" 4
.IX Item "qp"
Force a constant quantization parameter. If not set, the filter will use the \s-1QP\s0
from the video stream (if available).
.SS "vaguedenoiser"
.IX Subsection "vaguedenoiser"
Apply a wavelet based denoiser.
.PP
It transforms each frame from the video input into the wavelet domain,
using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
the obtained coefficients. It does an inverse wavelet transform after.
Due to wavelet properties, it should give a nice smoothed result, and
reduced noise, without blurring picture features.
.PP
This filter accepts the following options:
.IP "\fBthreshold\fR" 4
.IX Item "threshold"
The filtering strength. The higher, the more filtered the video will be.
Hard thresholding can use a higher threshold than soft thresholding
before the video looks overfiltered.
.IP "\fBmethod\fR" 4
.IX Item "method"
The filtering method the filter will use.
.Sp
It accepts the following values:
.RS 4
.IP "\fBhard\fR" 4
.IX Item "hard"
All values under the threshold will be zeroed.
.IP "\fBsoft\fR" 4
.IX Item "soft"
All values under the threshold will be zeroed. All values above will be
reduced by the threshold.
.IP "\fBgarrote\fR" 4
.IX Item "garrote"
Scales or nullifies coefficients \- intermediary between (more) soft and
(less) hard thresholding.
.RE
.RS 4
.RE
.IP "\fBnsteps\fR" 4
.IX Item "nsteps"
Number of times, the wavelet will decompose the picture. Picture can't
be decomposed beyond a particular point (typically, 8 for a 640x480
frame \- as 2^9 = 512 > 480)
.IP "\fBpercent\fR" 4
.IX Item "percent"
Partial of full denoising (limited coefficients shrinking), from 0 to 100.
.IP "\fBplanes\fR" 4
.IX Item "planes"
A list of the planes to process. By default all planes are processed.
.SS "vectorscope"
.IX Subsection "vectorscope"
Display 2 color component values in the two dimensional graph (which is called
a vectorscope).
.PP
This filter accepts the following options:
.IP "\fBmode, m\fR" 4
.IX Item "mode, m"
Set vectorscope mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBgray\fR" 4
.IX Item "gray"
Gray values are displayed on graph, higher brightness means more pixels have
same component color value on location in graph. This is the default mode.
.IP "\fBcolor\fR" 4
.IX Item "color"
Gray values are displayed on graph. Surrounding pixels values which are not
present in video frame are drawn in gradient of 2 color components which are
set by option \f(CW\*(C`x\*(C'\fR and \f(CW\*(C`y\*(C'\fR. The 3rd color component is static.
.IP "\fBcolor2\fR" 4
.IX Item "color2"
Actual color components values present in video frame are displayed on graph.
.IP "\fBcolor3\fR" 4
.IX Item "color3"
Similar as color2 but higher frequency of same values \f(CW\*(C`x\*(C'\fR and \f(CW\*(C`y\*(C'\fR
on graph increases value of another color component, which is luminance by
default values of \f(CW\*(C`x\*(C'\fR and \f(CW\*(C`y\*(C'\fR.
.IP "\fBcolor4\fR" 4
.IX Item "color4"
Actual colors present in video frame are displayed on graph. If two different
colors map to same position on graph then color with higher value of component
not present in graph is picked.
.IP "\fBcolor5\fR" 4
.IX Item "color5"
Gray values are displayed on graph. Similar to \f(CW\*(C`color\*(C'\fR but with 3rd color
component picked from radial gradient.
.RE
.RS 4
.RE
.IP "\fBx\fR" 4
.IX Item "x"
Set which color component will be represented on X\-axis. Default is \f(CW1\fR.
.IP "\fBy\fR" 4
.IX Item "y"
Set which color component will be represented on Y\-axis. Default is \f(CW2\fR.
.IP "\fBintensity, i\fR" 4
.IX Item "intensity, i"
Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
of color component which represents frequency of (X, Y) location in graph.
.IP "\fBenvelope, e\fR" 4
.IX Item "envelope, e"
.RS 4
.PD 0
.IP "\fBnone\fR" 4
.IX Item "none"
.PD
No envelope, this is default.
.IP "\fBinstant\fR" 4
.IX Item "instant"
Instant envelope, even darkest single pixel will be clearly highlighted.
.IP "\fBpeak\fR" 4
.IX Item "peak"
Hold maximum and minimum values presented in graph over time. This way you
can still spot out of range values without constantly looking at vectorscope.
.IP "\fBpeak+instant\fR" 4
.IX Item "peak+instant"
Peak and instant envelope combined together.
.RE
.RS 4
.RE
.IP "\fBgraticule, g\fR" 4
.IX Item "graticule, g"
Set what kind of graticule to draw.
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
.PD 0
.IP "\fBgreen\fR" 4
.IX Item "green"
.IP "\fBcolor\fR" 4
.IX Item "color"
.RE
.RS 4
.RE
.IP "\fBopacity, o\fR" 4
.IX Item "opacity, o"
.PD
Set graticule opacity.
.IP "\fBflags, f\fR" 4
.IX Item "flags, f"
Set graticule flags.
.RS 4
.IP "\fBwhite\fR" 4
.IX Item "white"
Draw graticule for white point.
.IP "\fBblack\fR" 4
.IX Item "black"
Draw graticule for black point.
.IP "\fBname\fR" 4
.IX Item "name"
Draw color points short names.
.RE
.RS 4
.RE
.IP "\fBbgopacity, b\fR" 4
.IX Item "bgopacity, b"
Set background opacity.
.IP "\fBlthreshold, l\fR" 4
.IX Item "lthreshold, l"
Set low threshold for color component not represented on X or Y axis.
Values lower than this value will be ignored. Default is 0.
Note this value is multiplied with actual max possible value one pixel component
can have. So for 8\-bit input and low threshold value of 0.1 actual threshold
is 0.1 * 255 = 25.
.IP "\fBhthreshold, h\fR" 4
.IX Item "hthreshold, h"
Set high threshold for color component not represented on X or Y axis.
Values higher than this value will be ignored. Default is 1.
Note this value is multiplied with actual max possible value one pixel component
can have. So for 8\-bit input and high threshold value of 0.9 actual threshold
is 0.9 * 255 = 230.
.IP "\fBcolorspace, c\fR" 4
.IX Item "colorspace, c"
Set what kind of colorspace to use when drawing graticule.
.RS 4
.IP "\fBauto\fR" 4
.IX Item "auto"
.PD 0
.IP "\fB601\fR" 4
.IX Item "601"
.IP "\fB709\fR" 4
.IX Item "709"
.RE
.RS 4
.PD
.Sp
Default is auto.
.RE
.SS "vidstabdetect"
.IX Subsection "vidstabdetect"
Analyze video stabilization/deshaking. Perform pass 1 of 2, see
\&\fBvidstabtransform\fR for pass 2.
.PP
This filter generates a file with relative translation and rotation
transform information about subsequent frames, which is then used by
the \fBvidstabtransform\fR filter.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libvidstab\*(C'\fR.
.PP
This filter accepts the following options:
.IP "\fBresult\fR" 4
.IX Item "result"
Set the path to the file used to write the transforms information.
Default value is \fItransforms.trf\fR.
.IP "\fBshakiness\fR" 4
.IX Item "shakiness"
Set how shaky the video is and how quick the camera is. It accepts an
integer in the range 1\-10, a value of 1 means little shakiness, a
value of 10 means strong shakiness. Default value is 5.
.IP "\fBaccuracy\fR" 4
.IX Item "accuracy"
Set the accuracy of the detection process. It must be a value in the
range 1\-15. A value of 1 means low accuracy, a value of 15 means high
accuracy. Default value is 15.
.IP "\fBstepsize\fR" 4
.IX Item "stepsize"
Set stepsize of the search process. The region around minimum is
scanned with 1 pixel resolution. Default value is 6.
.IP "\fBmincontrast\fR" 4
.IX Item "mincontrast"
Set minimum contrast. Below this value a local measurement field is
discarded. Must be a floating point value in the range 0\-1. Default
value is 0.3.
.IP "\fBtripod\fR" 4
.IX Item "tripod"
Set reference frame number for tripod mode.
.Sp
If enabled, the motion of the frames is compared to a reference frame
in the filtered stream, identified by the specified number. The idea
is to compensate all movements in a more-or-less static scene and keep
the camera view absolutely still.
.Sp
If set to 0, it is disabled. The frames are counted starting from 1.
.IP "\fBshow\fR" 4
.IX Item "show"
Show fields and transforms in the resulting frames. It accepts an
integer in the range 0\-2. Default value is 0, which disables any
visualization.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use default values:
.Sp
.Vb 1
\&        vidstabdetect
.Ve
.IP "\(bu" 4
Analyze strongly shaky movie and put the results in file
\&\fImytransforms.trf\fR:
.Sp
.Vb 1
\&        vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
.Ve
.IP "\(bu" 4
Visualize the result of internal transformations in the resulting
video:
.Sp
.Vb 1
\&        vidstabdetect=show=1
.Ve
.IP "\(bu" 4
Analyze a video with medium shakiness using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i input \-vf vidstabdetect=shakiness=5:show=1 dummy.avi
.Ve
.SS "vidstabtransform"
.IX Subsection "vidstabtransform"
Video stabilization/deshaking: pass 2 of 2,
see \fBvidstabdetect\fR for pass 1.
.PP
Read a file with transform information for each frame and
apply/compensate them. Together with the \fBvidstabdetect\fR
filter this can be used to deshake videos. See also
<\fBhttp://public.hronopik.de/vid.stab\fR>. It is important to also use
the \fBunsharp\fR filter, see below.
.PP
To enable compilation of this filter you need to configure FFmpeg with
\&\f(CW\*(C`\-\-enable\-libvidstab\*(C'\fR.
.PP
\fIOptions\fR
.IX Subsection "Options"
.IP "\fBinput\fR" 4
.IX Item "input"
Set path to the file used to read the transforms. Default value is
\&\fItransforms.trf\fR.
.IP "\fBsmoothing\fR" 4
.IX Item "smoothing"
Set the number of frames (value*2 + 1) used for lowpass filtering the
camera movements. Default value is 10.
.Sp
For example a number of 10 means that 21 frames are used (10 in the
past and 10 in the future) to smoothen the motion in the video. A
larger value leads to a smoother video, but limits the acceleration of
the camera (pan/tilt movements). 0 is a special case where a static
camera is simulated.
.IP "\fBoptalgo\fR" 4
.IX Item "optalgo"
Set the camera path optimization algorithm.
.Sp
Accepted values are:
.RS 4
.IP "\fBgauss\fR" 4
.IX Item "gauss"
gaussian kernel low-pass filter on camera motion (default)
.IP "\fBavg\fR" 4
.IX Item "avg"
averaging on transformations
.RE
.RS 4
.RE
.IP "\fBmaxshift\fR" 4
.IX Item "maxshift"
Set maximal number of pixels to translate frames. Default value is \-1,
meaning no limit.
.IP "\fBmaxangle\fR" 4
.IX Item "maxangle"
Set maximal angle in radians (degree*PI/180) to rotate frames. Default
value is \-1, meaning no limit.
.IP "\fBcrop\fR" 4
.IX Item "crop"
Specify how to deal with borders that may be visible due to movement
compensation.
.Sp
Available values are:
.RS 4
.IP "\fBkeep\fR" 4
.IX Item "keep"
keep image information from previous frame (default)
.IP "\fBblack\fR" 4
.IX Item "black"
fill the border black
.RE
.RS 4
.RE
.IP "\fBinvert\fR" 4
.IX Item "invert"
Invert transforms if set to 1. Default value is 0.
.IP "\fBrelative\fR" 4
.IX Item "relative"
Consider transforms as relative to previous frame if set to 1,
absolute if set to 0. Default value is 0.
.IP "\fBzoom\fR" 4
.IX Item "zoom"
Set percentage to zoom. A positive value will result in a zoom-in
effect, a negative value in a zoom-out effect. Default value is 0 (no
zoom).
.IP "\fBoptzoom\fR" 4
.IX Item "optzoom"
Set optimal zooming to avoid borders.
.Sp
Accepted values are:
.RS 4
.IP "\fB0\fR" 4
.IX Item "0"
disabled
.IP "\fB1\fR" 4
.IX Item "1"
optimal static zoom value is determined (only very strong movements
will lead to visible borders) (default)
.IP "\fB2\fR" 4
.IX Item "2"
optimal adaptive zoom value is determined (no borders will be
visible), see \fBzoomspeed\fR
.RE
.RS 4
.Sp
Note that the value given at zoom is added to the one calculated here.
.RE
.IP "\fBzoomspeed\fR" 4
.IX Item "zoomspeed"
Set percent to zoom maximally each frame (enabled when
\&\fBoptzoom\fR is set to 2). Range is from 0 to 5, default value is
0.25.
.IP "\fBinterpol\fR" 4
.IX Item "interpol"
Specify type of interpolation.
.Sp
Available values are:
.RS 4
.IP "\fBno\fR" 4
.IX Item "no"
no interpolation
.IP "\fBlinear\fR" 4
.IX Item "linear"
linear only horizontal
.IP "\fBbilinear\fR" 4
.IX Item "bilinear"
linear in both directions (default)
.IP "\fBbicubic\fR" 4
.IX Item "bicubic"
cubic in both directions (slow)
.RE
.RS 4
.RE
.IP "\fBtripod\fR" 4
.IX Item "tripod"
Enable virtual tripod mode if set to 1, which is equivalent to
\&\f(CW\*(C`relative=0:smoothing=0\*(C'\fR. Default value is 0.
.Sp
Use also \f(CW\*(C`tripod\*(C'\fR option of \fBvidstabdetect\fR.
.IP "\fBdebug\fR" 4
.IX Item "debug"
Increase log verbosity if set to 1. Also the detected global motions
are written to the temporary file \fIglobal_motions.trf\fR. Default
value is 0.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use \fBffmpeg\fR for a typical stabilization with default values:
.Sp
.Vb 1
\&        ffmpeg \-i inp.mpeg \-vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
.Ve
.Sp
Note the use of the \fBunsharp\fR filter which is always recommended.
.IP "\(bu" 4
Zoom in a bit more and load transform data from a given file:
.Sp
.Vb 1
\&        vidstabtransform=zoom=5:input="mytransforms.trf"
.Ve
.IP "\(bu" 4
Smoothen the video even more:
.Sp
.Vb 1
\&        vidstabtransform=smoothing=30
.Ve
.SS "vflip"
.IX Subsection "vflip"
Flip the input video vertically.
.PP
For example, to vertically flip a video with \fBffmpeg\fR:
.PP
.Vb 1
\&        ffmpeg \-i in.avi \-vf "vflip" out.avi
.Ve
.SS "vignette"
.IX Subsection "vignette"
Make or reverse a natural vignetting effect.
.PP
The filter accepts the following options:
.IP "\fBangle, a\fR" 4
.IX Item "angle, a"
Set lens angle expression as a number of radians.
.Sp
The value is clipped in the \f(CW\*(C`[0,PI/2]\*(C'\fR range.
.Sp
Default value: \f(CW"PI/5"\fR
.IP "\fBx0\fR" 4
.IX Item "x0"
.PD 0
.IP "\fBy0\fR" 4
.IX Item "y0"
.PD
Set center coordinates expressions. Respectively \f(CW"w/2"\fR and \f(CW"h/2"\fR
by default.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set forward/backward mode.
.Sp
Available modes are:
.RS 4
.IP "\fBforward\fR" 4
.IX Item "forward"
The larger the distance from the central point, the darker the image becomes.
.IP "\fBbackward\fR" 4
.IX Item "backward"
The larger the distance from the central point, the brighter the image becomes.
This can be used to reverse a vignette effect, though there is no automatic
detection to extract the lens \fBangle\fR and other settings (yet). It can
also be used to create a burning effect.
.RE
.RS 4
.Sp
Default value is \fBforward\fR.
.RE
.IP "\fBeval\fR" 4
.IX Item "eval"
Set evaluation mode for the expressions (\fBangle\fR, \fBx0\fR, \fBy0\fR).
.Sp
It accepts the following values:
.RS 4
.IP "\fBinit\fR" 4
.IX Item "init"
Evaluate expressions only once during the filter initialization.
.IP "\fBframe\fR" 4
.IX Item "frame"
Evaluate expressions for each incoming frame. This is way slower than the
\&\fBinit\fR mode since it requires all the scalers to be re-computed, but it
allows advanced dynamic expressions.
.RE
.RS 4
.Sp
Default value is \fBinit\fR.
.RE
.IP "\fBdither\fR" 4
.IX Item "dither"
Set dithering to reduce the circular banding effects. Default is \f(CW1\fR
(enabled).
.IP "\fBaspect\fR" 4
.IX Item "aspect"
Set vignette aspect. This setting allows one to adjust the shape of the vignette.
Setting this value to the \s-1SAR\s0 of the input will make a rectangular vignetting
following the dimensions of the video.
.Sp
Default is \f(CW\*(C`1/1\*(C'\fR.
.PP
\fIExpressions\fR
.IX Subsection "Expressions"
.PP
The \fBalpha\fR, \fBx0\fR and \fBy0\fR expressions can contain the
following parameters.
.IP "\fBw\fR" 4
.IX Item "w"
.PD 0
.IP "\fBh\fR" 4
.IX Item "h"
.PD
input width and height
.IP "\fBn\fR" 4
.IX Item "n"
the number of input frame, starting from 0
.IP "\fBpts\fR" 4
.IX Item "pts"
the \s-1PTS \s0(Presentation TimeStamp) time of the filtered video frame, expressed in
\&\fI\s-1TB\s0\fR units, \s-1NAN\s0 if undefined
.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"
the \s-1PTS \s0(Presentation TimeStamp) of the filtered video frame,
expressed in seconds, \s-1NAN\s0 if undefined
.IP "\fBtb\fR" 4
.IX Item "tb"
time base of the input video
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Apply simple strong vignetting effect:
.Sp
.Vb 1
\&        vignette=PI/4
.Ve
.IP "\(bu" 4
Make a flickering vignetting:
.Sp
.Vb 1
\&        vignette=\*(AqPI/4+random(1)*PI/50\*(Aq:eval=frame
.Ve
.SS "vstack"
.IX Subsection "vstack"
Stack input videos vertically.
.PP
All streams must be of same pixel format and of same width.
.PP
Note that this filter is faster than using \fBoverlay\fR and \fBpad\fR filter
to create same output.
.PP
The filter accept the following option:
.IP "\fBinputs\fR" 4
.IX Item "inputs"
Set number of input streams. Default is 2.
.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.
.SS "w3fdif"
.IX Subsection "w3fdif"
Deinterlace the input video (\*(L"w3fdif\*(R" stands for \*(L"Weston 3 Field
Deinterlacing Filter\*(R").
.PP
Based on the process described by Martin Weston for \s-1BBC R&D,\s0 and
implemented based on the de-interlace algorithm written by Jim
Easterbrook for \s-1BBC R&D,\s0 the Weston 3 field deinterlacing filter
uses filter coefficients calculated by \s-1BBC R&D.\s0
.PP
There are two sets of filter coefficients, so called \*(L"simple\*(R":
and \*(L"complex\*(R". Which set of filter coefficients is used can
be set by passing an optional parameter:
.IP "\fBfilter\fR" 4
.IX Item "filter"
Set the interlacing filter coefficients. Accepts one of the following values:
.RS 4
.IP "\fBsimple\fR" 4
.IX Item "simple"
Simple filter coefficient set.
.IP "\fBcomplex\fR" 4
.IX Item "complex"
More-complex filter coefficient set.
.RE
.RS 4
.Sp
Default value is \fBcomplex\fR.
.RE
.IP "\fBdeint\fR" 4
.IX Item "deint"
Specify which frames to deinterlace. Accept one of the following values:
.RS 4
.IP "\fBall\fR" 4
.IX Item "all"
Deinterlace all frames,
.IP "\fBinterlaced\fR" 4
.IX Item "interlaced"
Only deinterlace frames marked as interlaced.
.RE
.RS 4
.Sp
Default value is \fBall\fR.
.RE
.SS "waveform"
.IX Subsection "waveform"
Video waveform monitor.
.PP
The waveform monitor plots color component intensity. By default luminance
only. Each column of the waveform corresponds to a column of pixels in the
source video.
.PP
It accepts the following options:
.IP "\fBmode, m\fR" 4
.IX Item "mode, m"
Can be either \f(CW\*(C`row\*(C'\fR, or \f(CW\*(C`column\*(C'\fR. Default is \f(CW\*(C`column\*(C'\fR.
In row mode, the graph on the left side represents color component value 0 and
the right side represents value = 255. In column mode, the top side represents
color component value = 0 and bottom side represents value = 255.
.IP "\fBintensity, i\fR" 4
.IX Item "intensity, i"
Set intensity. Smaller values are useful to find out how many values of the same
luminance are distributed across input rows/columns.
Default value is \f(CW0.04\fR. Allowed range is [0, 1].
.IP "\fBmirror, r\fR" 4
.IX Item "mirror, r"
Set mirroring mode. \f(CW0\fR means unmirrored, \f(CW1\fR means mirrored.
In mirrored mode, higher values will be represented on the left
side for \f(CW\*(C`row\*(C'\fR mode and at the top for \f(CW\*(C`column\*(C'\fR mode. Default is
\&\f(CW1\fR (mirrored).
.IP "\fBdisplay, d\fR" 4
.IX Item "display, d"
Set display mode.
It accepts the following values:
.RS 4
.IP "\fBoverlay\fR" 4
.IX Item "overlay"
Presents information 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 makes it easier to spot relative differences or similarities
in overlapping areas of the color components that are supposed to be identical,
such as neutral whites, grays, or blacks.
.IP "\fBstack\fR" 4
.IX Item "stack"
Display separate graph for the color components side by side in
\&\f(CW\*(C`row\*(C'\fR mode or one below the other in \f(CW\*(C`column\*(C'\fR mode.
.IP "\fBparade\fR" 4
.IX Item "parade"
Display separate graph for the color components side by side in
\&\f(CW\*(C`column\*(C'\fR mode or one below the other in \f(CW\*(C`row\*(C'\fR mode.
.Sp
Using this display 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
graphs 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 perform by making level adjustments the three waveforms.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`stack\*(C'\fR.
.RE
.IP "\fBcomponents, c\fR" 4
.IX Item "components, c"
Set which color components to display. Default is 1, which means only luminance
or red color component if input is in \s-1RGB\s0 colorspace. If is set for example to
7 it will display all 3 (if) available color components.
.IP "\fBenvelope, e\fR" 4
.IX Item "envelope, e"
.RS 4
.PD 0
.IP "\fBnone\fR" 4
.IX Item "none"
.PD
No envelope, this is default.
.IP "\fBinstant\fR" 4
.IX Item "instant"
Instant envelope, minimum and maximum values presented in graph will be easily
visible even with small \f(CW\*(C`step\*(C'\fR value.
.IP "\fBpeak\fR" 4
.IX Item "peak"
Hold minimum and maximum values presented in graph across time. This way you
can still spot out of range values without constantly looking at waveforms.
.IP "\fBpeak+instant\fR" 4
.IX Item "peak+instant"
Peak and instant envelope combined together.
.RE
.RS 4
.RE
.IP "\fBfilter, f\fR" 4
.IX Item "filter, f"
.RS 4
.PD 0
.IP "\fBlowpass\fR" 4
.IX Item "lowpass"
.PD
No filtering, this is default.
.IP "\fBflat\fR" 4
.IX Item "flat"
Luma and chroma combined together.
.IP "\fBaflat\fR" 4
.IX Item "aflat"
Similar as above, but shows difference between blue and red chroma.
.IP "\fBchroma\fR" 4
.IX Item "chroma"
Displays only chroma.
.IP "\fBcolor\fR" 4
.IX Item "color"
Displays actual color value on waveform.
.IP "\fBacolor\fR" 4
.IX Item "acolor"
Similar as above, but with luma showing frequency of chroma values.
.RE
.RS 4
.RE
.IP "\fBgraticule, g\fR" 4
.IX Item "graticule, g"
Set which graticule to display.
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Do not display graticule.
.IP "\fBgreen\fR" 4
.IX Item "green"
Display green graticule showing legal broadcast ranges.
.RE
.RS 4
.RE
.IP "\fBopacity, o\fR" 4
.IX Item "opacity, o"
Set graticule opacity.
.IP "\fBflags, fl\fR" 4
.IX Item "flags, fl"
Set graticule flags.
.RS 4
.IP "\fBnumbers\fR" 4
.IX Item "numbers"
Draw numbers above lines. By default enabled.
.IP "\fBdots\fR" 4
.IX Item "dots"
Draw dots instead of lines.
.RE
.RS 4
.RE
.IP "\fBscale, s\fR" 4
.IX Item "scale, s"
Set scale used for displaying graticule.
.RS 4
.IP "\fBdigital\fR" 4
.IX Item "digital"
.PD 0
.IP "\fBmillivolts\fR" 4
.IX Item "millivolts"
.IP "\fBire\fR" 4
.IX Item "ire"
.RE
.RS 4
.PD
.Sp
Default is digital.
.RE
.IP "\fBbgopacity, b\fR" 4
.IX Item "bgopacity, b"
Set background opacity.
.SS "weave"
.IX Subsection "weave"
The \f(CW\*(C`weave\*(C'\fR takes a field-based video input and join
each two sequential fields into single frame, producing a new double
height clip with half the frame rate and half the frame count.
.PP
It accepts the following option:
.IP "\fBfirst_field\fR" 4
.IX Item "first_field"
Set first field. Available values are:
.RS 4
.IP "\fBtop, t\fR" 4
.IX Item "top, t"
Set the frame as top-field-first.
.IP "\fBbottom, b\fR" 4
.IX Item "bottom, b"
Set the frame as bottom-field-first.
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Interlace video using \fBselect\fR and \fBseparatefields\fR filter:
.Sp
.Vb 1
\&        separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
.Ve
.SS "xbr"
.IX Subsection "xbr"
Apply the xBR high-quality magnification filter which is designed for pixel
art. It follows a set of edge-detection rules, see
<\fBhttp://www.libretro.com/forums/viewtopic.php?f=6&t=134\fR>.
.PP
It accepts the following option:
.IP "\fBn\fR" 4
.IX Item "n"
Set the scaling dimension: \f(CW2\fR for \f(CW\*(C`2xBR\*(C'\fR, \f(CW3\fR for
\&\f(CW\*(C`3xBR\*(C'\fR and \f(CW4\fR for \f(CW\*(C`4xBR\*(C'\fR.
Default is \f(CW3\fR.
.SS "yadif"
.IX Subsection "yadif"
Deinterlace the input video (\*(L"yadif\*(R" means \*(L"yet another deinterlacing
filter\*(R").
.PP
It accepts the following parameters:
.IP "\fBmode\fR" 4
.IX Item "mode"
The interlacing mode to adopt. It accepts one of the following values:
.RS 4
.IP "\fB0, send_frame\fR" 4
.IX Item "0, send_frame"
Output one frame for each frame.
.IP "\fB1, send_field\fR" 4
.IX Item "1, send_field"
Output one 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 it skips the 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 it skips the spatial interlacing check.
.RE
.RS 4
.Sp
The 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. It accepts one
of the following values:
.RS 4
.IP "\fB0, tff\fR" 4
.IX Item "0, tff"
Assume the top field is first.
.IP "\fB1, bff\fR" 4
.IX Item "1, bff"
Assume the bottom field is first.
.IP "\fB\-1, auto\fR" 4
.IX Item "-1, auto"
Enable automatic detection of field parity.
.RE
.RS 4
.Sp
The default value is \f(CW\*(C`auto\*(C'\fR.
If the interlacing is unknown or the 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
The default value is \f(CW\*(C`all\*(C'\fR.
.RE
.SS "zoompan"
.IX Subsection "zoompan"
Apply Zoom & Pan effect.
.PP
This filter accepts the following options:
.IP "\fBzoom, z\fR" 4
.IX Item "zoom, z"
Set the zoom expression. Default is 1.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
Set the x and y expression. Default is 0.
.IP "\fBd\fR" 4
.IX Item "d"
Set the duration expression in number of frames.
This sets for how many number of frames effect will last for
single input image.
.IP "\fBs\fR" 4
.IX Item "s"
Set the output image size, default is 'hd720'.
.IP "\fBfps\fR" 4
.IX Item "fps"
Set the output frame rate, default is '25'.
.PP
Each expression can contain the following constants:
.IP "\fBin_w, iw\fR" 4
.IX Item "in_w, iw"
Input width.
.IP "\fBin_h, ih\fR" 4
.IX Item "in_h, ih"
Input height.
.IP "\fBout_w, ow\fR" 4
.IX Item "out_w, ow"
Output width.
.IP "\fBout_h, oh\fR" 4
.IX Item "out_h, oh"
Output height.
.IP "\fBin\fR" 4
.IX Item "in"
Input frame count.
.IP "\fBon\fR" 4
.IX Item "on"
Output frame count.
.IP "\fBx\fR" 4
.IX Item "x"
.PD 0
.IP "\fBy\fR" 4
.IX Item "y"
.PD
Last calculated 'x' and 'y' position from 'x' and 'y' expression
for current input frame.
.IP "\fBpx\fR" 4
.IX Item "px"
.PD 0
.IP "\fBpy\fR" 4
.IX Item "py"
.PD
\&'x' and 'y' of last output frame of previous input frame or 0 when there was
not yet such frame (first input frame).
.IP "\fBzoom\fR" 4
.IX Item "zoom"
Last calculated zoom from 'z' expression for current input frame.
.IP "\fBpzoom\fR" 4
.IX Item "pzoom"
Last calculated zoom of last output frame of previous input frame.
.IP "\fBduration\fR" 4
.IX Item "duration"
Number of output frames for current input frame. Calculated from 'd' expression
for each input frame.
.IP "\fBpduration\fR" 4
.IX Item "pduration"
number of output frames created for previous input frame
.IP "\fBa\fR" 4
.IX Item "a"
Rational number: input width / input height
.IP "\fBsar\fR" 4
.IX Item "sar"
sample aspect ratio
.IP "\fBdar\fR" 4
.IX Item "dar"
display aspect ratio
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
.Sp
.Vb 1
\&        zoompan=z=\*(Aqmin(zoom+0.0015,1.5)\*(Aq:d=700:x=\*(Aqif(gte(zoom,1.5),x,x+1/a)\*(Aq:y=\*(Aqif(gte(zoom,1.5),y,y+1)\*(Aq:s=640x360
.Ve
.IP "\(bu" 4
Zoom-in up to 1.5 and pan always at center of picture:
.Sp
.Vb 1
\&        zoompan=z=\*(Aqmin(zoom+0.0015,1.5)\*(Aq:d=700:x=\*(Aqiw/2\-(iw/zoom/2)\*(Aq:y=\*(Aqih/2\-(ih/zoom/2)\*(Aq
.Ve
.IP "\(bu" 4
Same as above but without pausing:
.Sp
.Vb 1
\&        zoompan=z=\*(Aqmin(max(zoom,pzoom)+0.0015,1.5)\*(Aq:d=1:x=\*(Aqiw/2\-(iw/zoom/2)\*(Aq:y=\*(Aqih/2\-(ih/zoom/2)\*(Aq
.Ve
.SS "zscale"
.IX Subsection "zscale"
Scale (resize) the input video, using the z.lib library:
https://github.com/sekrit\-twc/zimg.
.PP
The zscale filter forces the output display aspect ratio to be the same
as the input, by changing the output sample aspect ratio.
.PP
If the input image format is different from the format requested by
the next filter, the zscale filter will convert the input to the
requested format.
.PP
\fIOptions\fR
.IX Subsection "Options"
.PP
The filter accepts the following options.
.IP "\fBwidth, w\fR" 4
.IX Item "width, w"
.PD 0
.IP "\fBheight, h\fR" 4
.IX Item "height, h"
.PD
Set the output video dimension expression. Default value is the input
dimension.
.Sp
If the \fIwidth\fR or \fIw\fR is 0, the input width is used for the output.
If the \fIheight\fR or \fIh\fR is 0, the input height is used for the output.
.Sp
If one of the values is \-1, the zscale filter will use a value that
maintains the aspect ratio of the input image, calculated from the
other specified dimension. If both of them are \-1, the input size is
used
.Sp
If one of the values is \-n with n > 1, the zscale filter will also use a value
that maintains the aspect ratio of the input image, calculated from the other
specified dimension. After that it will, however, make sure that the calculated
dimension is divisible by n and adjust the value if necessary.
.Sp
See below for the list of accepted constants for use in the dimension
expression.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the video size. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.IP "\fBdither, d\fR" 4
.IX Item "dither, d"
Set the dither type.
.Sp
Possible values are:
.RS 4
.IP "\fInone\fR" 4
.IX Item "none"
.PD 0
.IP "\fIordered\fR" 4
.IX Item "ordered"
.IP "\fIrandom\fR" 4
.IX Item "random"
.IP "\fIerror_diffusion\fR" 4
.IX Item "error_diffusion"
.RE
.RS 4
.PD
.Sp
Default is none.
.RE
.IP "\fBfilter, f\fR" 4
.IX Item "filter, f"
Set the resize filter type.
.Sp
Possible values are:
.RS 4
.IP "\fIpoint\fR" 4
.IX Item "point"
.PD 0
.IP "\fIbilinear\fR" 4
.IX Item "bilinear"
.IP "\fIbicubic\fR" 4
.IX Item "bicubic"
.IP "\fIspline16\fR" 4
.IX Item "spline16"
.IP "\fIspline36\fR" 4
.IX Item "spline36"
.IP "\fIlanczos\fR" 4
.IX Item "lanczos"
.RE
.RS 4
.PD
.Sp
Default is bilinear.
.RE
.IP "\fBrange, r\fR" 4
.IX Item "range, r"
Set the color range.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fIlimited\fR" 4
.IX Item "limited"
.IP "\fIfull\fR" 4
.IX Item "full"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBprimaries, p\fR" 4
.IX Item "primaries, p"
Set the color primaries.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fI709\fR" 4
.IX Item "709"
.IP "\fIunspecified\fR" 4
.IX Item "unspecified"
.IP "\fI170m\fR" 4
.IX Item "170m"
.IP "\fI240m\fR" 4
.IX Item "240m"
.IP "\fI2020\fR" 4
.IX Item "2020"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBtransfer, t\fR" 4
.IX Item "transfer, t"
Set the transfer characteristics.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fI709\fR" 4
.IX Item "709"
.IP "\fIunspecified\fR" 4
.IX Item "unspecified"
.IP "\fI601\fR" 4
.IX Item "601"
.IP "\fIlinear\fR" 4
.IX Item "linear"
.IP "\fI2020_10\fR" 4
.IX Item "2020_10"
.IP "\fI2020_12\fR" 4
.IX Item "2020_12"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBmatrix, m\fR" 4
.IX Item "matrix, m"
Set the colorspace matrix.
.Sp
Possible value are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fI709\fR" 4
.IX Item "709"
.IP "\fIunspecified\fR" 4
.IX Item "unspecified"
.IP "\fI470bg\fR" 4
.IX Item "470bg"
.IP "\fI170m\fR" 4
.IX Item "170m"
.IP "\fI2020_ncl\fR" 4
.IX Item "2020_ncl"
.IP "\fI2020_cl\fR" 4
.IX Item "2020_cl"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBrangein, rin\fR" 4
.IX Item "rangein, rin"
Set the input color range.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fIlimited\fR" 4
.IX Item "limited"
.IP "\fIfull\fR" 4
.IX Item "full"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBprimariesin, pin\fR" 4
.IX Item "primariesin, pin"
Set the input color primaries.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fI709\fR" 4
.IX Item "709"
.IP "\fIunspecified\fR" 4
.IX Item "unspecified"
.IP "\fI170m\fR" 4
.IX Item "170m"
.IP "\fI240m\fR" 4
.IX Item "240m"
.IP "\fI2020\fR" 4
.IX Item "2020"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBtransferin, tin\fR" 4
.IX Item "transferin, tin"
Set the input transfer characteristics.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fI709\fR" 4
.IX Item "709"
.IP "\fIunspecified\fR" 4
.IX Item "unspecified"
.IP "\fI601\fR" 4
.IX Item "601"
.IP "\fIlinear\fR" 4
.IX Item "linear"
.IP "\fI2020_10\fR" 4
.IX Item "2020_10"
.IP "\fI2020_12\fR" 4
.IX Item "2020_12"
.RE
.RS 4
.PD
.Sp
Default is same as input.
.RE
.IP "\fBmatrixin, min\fR" 4
.IX Item "matrixin, min"
Set the input colorspace matrix.
.Sp
Possible value are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fI709\fR" 4
.IX Item "709"
.IP "\fIunspecified\fR" 4
.IX Item "unspecified"
.IP "\fI470bg\fR" 4
.IX Item "470bg"
.IP "\fI170m\fR" 4
.IX Item "170m"
.IP "\fI2020_ncl\fR" 4
.IX Item "2020_ncl"
.IP "\fI2020_cl\fR" 4
.IX Item "2020_cl"
.RE
.RS 4
.RE
.IP "\fBchromal, c\fR" 4
.IX Item "chromal, c"
.PD
Set the output chroma location.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fIleft\fR" 4
.IX Item "left"
.IP "\fIcenter\fR" 4
.IX Item "center"
.IP "\fItopleft\fR" 4
.IX Item "topleft"
.IP "\fItop\fR" 4
.IX Item "top"
.IP "\fIbottomleft\fR" 4
.IX Item "bottomleft"
.IP "\fIbottom\fR" 4
.IX Item "bottom"
.RE
.RS 4
.RE
.IP "\fBchromalin, cin\fR" 4
.IX Item "chromalin, cin"
.PD
Set the input chroma location.
.Sp
Possible values are:
.RS 4
.IP "\fIinput\fR" 4
.IX Item "input"
.PD 0
.IP "\fIleft\fR" 4
.IX Item "left"
.IP "\fIcenter\fR" 4
.IX Item "center"
.IP "\fItopleft\fR" 4
.IX Item "topleft"
.IP "\fItop\fR" 4
.IX Item "top"
.IP "\fIbottomleft\fR" 4
.IX Item "bottomleft"
.IP "\fIbottom\fR" 4
.IX Item "bottom"
.RE
.RS 4
.RE
.PD
.PP
The values of the \fBw\fR and \fBh\fR options are expressions
containing the following constants:
.IP "\fIin_w\fR" 4
.IX Item "in_w"
.PD 0
.IP "\fIin_h\fR" 4
.IX Item "in_h"
.PD
The input width and height
.IP "\fIiw\fR" 4
.IX Item "iw"
.PD 0
.IP "\fIih\fR" 4
.IX Item "ih"
.PD
These are the same as \fIin_w\fR and \fIin_h\fR.
.IP "\fIout_w\fR" 4
.IX Item "out_w"
.PD 0
.IP "\fIout_h\fR" 4
.IX Item "out_h"
.PD
The output (scaled) width and height
.IP "\fIow\fR" 4
.IX Item "ow"
.PD 0
.IP "\fIoh\fR" 4
.IX Item "oh"
.PD
These are the same as \fIout_w\fR and \fIout_h\fR
.IP "\fIa\fR" 4
.IX Item "a"
The same as \fIiw\fR / \fIih\fR
.IP "\fIsar\fR" 4
.IX Item "sar"
input sample aspect ratio
.IP "\fIdar\fR" 4
.IX Item "dar"
The input display aspect ratio. Calculated from \f(CW\*(C`(iw / ih) * sar\*(C'\fR.
.IP "\fIhsub\fR" 4
.IX Item "hsub"
.PD 0
.IP "\fIvsub\fR" 4
.IX Item "vsub"
.PD
horizontal and vertical input chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.IP "\fIohsub\fR" 4
.IX Item "ohsub"
.PD 0
.IP "\fIovsub\fR" 4
.IX Item "ovsub"
.PD
horizontal and vertical output chroma subsample values. For example for the
pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
.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
It accepts the following parameters:
.IP "\fBvideo_size\fR" 4
.IX Item "video_size"
Specify the size (width and height) of the buffered video frames. For the
syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.IP "\fBwidth\fR" 4
.IX Item "width"
The input video width.
.IP "\fBheight\fR" 4
.IX Item "height"
The 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"
The sample (pixel) aspect ratio of the input video.
.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.
.IP "\fBhw_frames_ctx\fR" 4
.IX Item "hw_frames_ctx"
When using a hardware pixel format, this should be a reference to an
AVHWFramesContext describing input frames.
.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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.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 "coreimagesrc"
.IX Subsection "coreimagesrc"
Video source generated on \s-1GPU\s0 using Apple's CoreImage \s-1API\s0 on \s-1OSX.\s0
.PP
This video source is a specialized version of the \fBcoreimage\fR video filter.
Use a core image generator at the beginning of the applied filterchain to
generate the content.
.PP
The coreimagesrc video source accepts the following options:
.IP "\fBlist_generators\fR" 4
.IX Item "list_generators"
List all available generators along with all their respective options as well as
possible minimum and maximum values along with the default values.
.Sp
.Vb 1
\&        list_generators=true
.Ve
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify the size of the sourced video. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
The default value is \f(CW\*(C`320x240\*(C'\fR.
.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 floating point
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 duration of the sourced video. See
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
.Sp
If not specified, or the expressed duration is negative, the video is
supposed to be generated forever.
.PP
Additionally, all options of the \fBcoreimage\fR video filter are accepted.
A complete filterchain can be used for further processing of the
generated input without CPU-HOST transfer. See \fBcoreimage\fR documentation
and examples for details.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Use CIQRCodeGenerator to create a \s-1QR\s0 code for the FFmpeg homepage,
given as complete and escaped command-line for Apple's standard bash shell:
.Sp
.Vb 1
\&        ffmpeg \-f lavfi \-i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\e\e\e\e\e://FFmpeg.org/@inputCorrectionLevel=H \-frames:v 1 QRCode.png
.Ve
.Sp
This example is equivalent to the QRCode example of \fBcoreimage\fR without the
need for a nullsrc video source.
.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. For the syntax of this option, check the \*(L"Video
size\*(R" section in the ffmpeg-utils manual. 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 floating point
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 duration of the sourced video. See
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
.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
Some examples:
.PP
.Vb 1
\&        mptestsrc=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 parameters:
.IP "\fBsize\fR" 4
.IX Item "size"
The size of the video to generate. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.IP "\fBframerate\fR" 4
.IX Item "framerate"
The framerate of the generated video. It 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 \fBfrei0r\fR section in the video filters
documentation.
.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 overlaid 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 one 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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
.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.
.Sp
For the syntax of these 3 color options, check the \*(L"Color\*(R" section in the
ffmpeg-utils manual.
.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 "allrgb, allyuv, color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc"
.IX Subsection "allrgb, allyuv, color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc"
The \f(CW\*(C`allrgb\*(C'\fR source returns frames of size 4096x4096 of all rgb colors.
.PP
The \f(CW\*(C`allyuv\*(C'\fR source returns frames of size 4096x4096 of all yuv colors.
.PP
The \f(CW\*(C`color\*(C'\fR source provides an uniformly colored input.
.PP
The \f(CW\*(C`haldclutsrc\*(C'\fR source provides an identity Hald \s-1CLUT.\s0 See also
\&\fBhaldclut\fR filter.
.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 1\-1990.\s0
.PP
The \f(CW\*(C`smptehdbars\*(C'\fR source generates a color bars pattern, based on
the \s-1SMPTE RP 219\-2002.\s0
.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 \f(CW\*(C`testsrc2\*(C'\fR source is similar to testsrc, but supports more
pixel formats instead of just \f(CW\*(C`rgb24\*(C'\fR. This allows using it as an
input for other tests without requiring a format conversion.
.PP
The \f(CW\*(C`yuvtestsrc\*(C'\fR source generates an \s-1YUV\s0 test pattern. You should
see a y, cb and cr stripe from top to bottom.
.PP
The sources accept the following parameters:
.IP "\fBcolor, c\fR" 4
.IX Item "color, c"
Specify the color of the source, only available in the \f(CW\*(C`color\*(C'\fR
source. For the syntax of this option, check the \*(L"Color\*(R" section in the
ffmpeg-utils manual.
.IP "\fBlevel\fR" 4
.IX Item "level"
Specify the level of the Hald \s-1CLUT,\s0 only available in the \f(CW\*(C`haldclutsrc\*(C'\fR
source. A level of \f(CW\*(C`N\*(C'\fR generates a picture of \f(CW\*(C`N*N*N\*(C'\fR by \f(CW\*(C`N*N*N\*(C'\fR
pixels to be used as identity matrix for 3D lookup tables. Each component is
coded on a \f(CW\*(C`1/(N*N)\*(C'\fR scale.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify the size of the sourced video. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
The default value is \f(CW\*(C`320x240\*(C'\fR.
.Sp
This option is not available with the \f(CW\*(C`haldclutsrc\*(C'\fR filter.
.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 floating point
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 duration of the sourced video. See
\&\fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR
for the accepted syntax.
.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 available 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
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
The \f(CW\*(C`color\*(C'\fR source supports the following commands:
.IP "\fBc, color\fR" 4
.IX Item "c, color"
Set the color of the created image. Accepts the same syntax of the
corresponding \fBcolor\fR option.
.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 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 for use in analysis / debugging
tools.
.SH "MULTIMEDIA FILTERS"
.IX Header "MULTIMEDIA FILTERS"
Below is a description of the currently available multimedia filters.
.SS "ahistogram"
.IX Subsection "ahistogram"
Convert input audio to a video output, displaying the volume histogram.
.PP
The filter accepts the following options:
.IP "\fBdmode\fR" 4
.IX Item "dmode"
Specify how histogram is calculated.
.Sp
It accepts the following values:
.RS 4
.IP "\fBsingle\fR" 4
.IX Item "single"
Use single histogram for all channels.
.IP "\fBseparate\fR" 4
.IX Item "separate"
Use separate histogram for each channel.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`single\*(C'\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"
Specify the video size for the output. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`hd720\*(C'\fR.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set display scale.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlog\fR" 4
.IX Item "log"
logarithmic
.IP "\fBsqrt\fR" 4
.IX Item "sqrt"
square root
.IP "\fBcbrt\fR" 4
.IX Item "cbrt"
cubic root
.IP "\fBlin\fR" 4
.IX Item "lin"
linear
.IP "\fBrlog\fR" 4
.IX Item "rlog"
reverse logarithmic
.RE
.RS 4
.Sp
Default is \f(CW\*(C`log\*(C'\fR.
.RE
.IP "\fBascale\fR" 4
.IX Item "ascale"
Set amplitude scale.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlog\fR" 4
.IX Item "log"
logarithmic
.IP "\fBlin\fR" 4
.IX Item "lin"
linear
.RE
.RS 4
.Sp
Default is \f(CW\*(C`log\*(C'\fR.
.RE
.IP "\fBacount\fR" 4
.IX Item "acount"
Set how much frames to accumulate in histogram.
Defauls is 1. Setting this to \-1 accumulates all frames.
.IP "\fBrheight\fR" 4
.IX Item "rheight"
Set histogram ratio of window height.
.IP "\fBslide\fR" 4
.IX Item "slide"
Set sonogram sliding.
.Sp
It accepts the following values:
.RS 4
.IP "\fBreplace\fR" 4
.IX Item "replace"
replace old rows with new ones.
.IP "\fBscroll\fR" 4
.IX Item "scroll"
scroll from top to bottom.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`replace\*(C'\fR.
.RE
.SS "aphasemeter"
.IX Subsection "aphasemeter"
Convert input audio to a video output, displaying the audio phase.
.PP
The filter accepts the following options:
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set the output frame rate. Default value is \f(CW25\fR.
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the video size for the output. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`800x400\*(C'\fR.
.IP "\fBrc\fR" 4
.IX Item "rc"
.PD 0
.IP "\fBgc\fR" 4
.IX Item "gc"
.IP "\fBbc\fR" 4
.IX Item "bc"
.PD
Specify the red, green, blue contrast. Default values are \f(CW2\fR,
\&\f(CW7\fR and \f(CW1\fR.
Allowed range is \f(CW\*(C`[0, 255]\*(C'\fR.
.IP "\fBmpc\fR" 4
.IX Item "mpc"
Set color which will be used for drawing median phase. If color is
\&\f(CW\*(C`none\*(C'\fR which is default, no median phase value will be drawn.
.PP
The filter also exports the frame metadata \f(CW\*(C`lavfi.aphasemeter.phase\*(C'\fR which
represents mean phase of current audio frame. Value is in range \f(CW\*(C`[\-1, 1]\*(C'\fR.
The \f(CW\*(C`\-1\*(C'\fR means left and right channels are completely out of phase and
\&\f(CW1\fR means channels are in phase.
.SS "avectorscope"
.IX Subsection "avectorscope"
Convert input audio to a video output, representing the audio vector
scope.
.PP
The filter is used to measure the difference between channels of stereo
audio stream. A monoaural signal, consisting of identical left and right
signal, results in straight vertical line. Any stereo separation is visible
as a deviation from this line, creating a Lissajous figure.
If the straight (or deviation from it) but horizontal line appears this
indicates that the left and right channels are out of phase.
.PP
The filter accepts the following options:
.IP "\fBmode, m\fR" 4
.IX Item "mode, m"
Set the vectorscope mode.
.Sp
Available values are:
.RS 4
.IP "\fBlissajous\fR" 4
.IX Item "lissajous"
Lissajous rotated by 45 degrees.
.IP "\fBlissajous_xy\fR" 4
.IX Item "lissajous_xy"
Same as above but not rotated.
.IP "\fBpolar\fR" 4
.IX Item "polar"
Shape resembling half of circle.
.RE
.RS 4
.Sp
Default value is \fBlissajous\fR.
.RE
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Set the video size for the output. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`400x400\*(C'\fR.
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set the output frame rate. Default value is \f(CW25\fR.
.IP "\fBrc\fR" 4
.IX Item "rc"
.PD 0
.IP "\fBgc\fR" 4
.IX Item "gc"
.IP "\fBbc\fR" 4
.IX Item "bc"
.IP "\fBac\fR" 4
.IX Item "ac"
.PD
Specify the red, green, blue and alpha contrast. Default values are \f(CW40\fR,
\&\f(CW160\fR, \f(CW80\fR and \f(CW255\fR.
Allowed range is \f(CW\*(C`[0, 255]\*(C'\fR.
.IP "\fBrf\fR" 4
.IX Item "rf"
.PD 0
.IP "\fBgf\fR" 4
.IX Item "gf"
.IP "\fBbf\fR" 4
.IX Item "bf"
.IP "\fBaf\fR" 4
.IX Item "af"
.PD
Specify the red, green, blue and alpha fade. Default values are \f(CW15\fR,
\&\f(CW10\fR, \f(CW5\fR and \f(CW5\fR.
Allowed range is \f(CW\*(C`[0, 255]\*(C'\fR.
.IP "\fBzoom\fR" 4
.IX Item "zoom"
Set the zoom factor. Default value is \f(CW1\fR. Allowed range is \f(CW\*(C`[1, 10]\*(C'\fR.
.IP "\fBdraw\fR" 4
.IX Item "draw"
Set the vectorscope drawing mode.
.Sp
Available values are:
.RS 4
.IP "\fBdot\fR" 4
.IX Item "dot"
Draw dot for each sample.
.IP "\fBline\fR" 4
.IX Item "line"
Draw line between previous and current sample.
.RE
.RS 4
.Sp
Default value is \fBdot\fR.
.RE
.IP "\fBscale\fR" 4
.IX Item "scale"
Specify amplitude scale of audio samples.
.Sp
Available values are:
.RS 4
.IP "\fBlin\fR" 4
.IX Item "lin"
Linear.
.IP "\fBsqrt\fR" 4
.IX Item "sqrt"
Square root.
.IP "\fBcbrt\fR" 4
.IX Item "cbrt"
Cubic root.
.IP "\fBlog\fR" 4
.IX Item "log"
Logarithmic.
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Complete example using \fBffplay\fR:
.Sp
.Vb 2
\&        ffplay \-f lavfi \*(Aqamovie=input.mp3, asplit [a][out1];
\&                     [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]\*(Aq
.Ve
.SS "bench, abench"
.IX Subsection "bench, abench"
Benchmark part of a filtergraph.
.PP
The filter accepts the following options:
.IP "\fBaction\fR" 4
.IX Item "action"
Start or stop a timer.
.Sp
Available values are:
.RS 4
.IP "\fBstart\fR" 4
.IX Item "start"
Get the current time, set it as frame metadata (using the key
\&\f(CW\*(C`lavfi.bench.start_time\*(C'\fR), and forward the frame to the next filter.
.IP "\fBstop\fR" 4
.IX Item "stop"
Get the current time and fetch the \f(CW\*(C`lavfi.bench.start_time\*(C'\fR metadata from
the input frame metadata to get the time difference. Time difference, average,
maximum and minimum time (respectively \f(CW\*(C`t\*(C'\fR, \f(CW\*(C`avg\*(C'\fR, \f(CW\*(C`max\*(C'\fR and
\&\f(CW\*(C`min\*(C'\fR) are then printed. The timestamps are expressed in seconds.
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Benchmark \fBselectivecolor\fR filter:
.Sp
.Vb 1
\&        bench=start,selectivecolor=reds=\-.2 .12 \-.49,bench=stop
.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 audio
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 "drawgraph, adrawgraph"
.IX Subsection "drawgraph, adrawgraph"
Draw a graph using input video or audio metadata.
.PP
It accepts the following parameters:
.IP "\fBm1\fR" 4
.IX Item "m1"
Set 1st frame metadata key from which metadata values will be used to draw a graph.
.IP "\fBfg1\fR" 4
.IX Item "fg1"
Set 1st foreground color expression.
.IP "\fBm2\fR" 4
.IX Item "m2"
Set 2nd frame metadata key from which metadata values will be used to draw a graph.
.IP "\fBfg2\fR" 4
.IX Item "fg2"
Set 2nd foreground color expression.
.IP "\fBm3\fR" 4
.IX Item "m3"
Set 3rd frame metadata key from which metadata values will be used to draw a graph.
.IP "\fBfg3\fR" 4
.IX Item "fg3"
Set 3rd foreground color expression.
.IP "\fBm4\fR" 4
.IX Item "m4"
Set 4th frame metadata key from which metadata values will be used to draw a graph.
.IP "\fBfg4\fR" 4
.IX Item "fg4"
Set 4th foreground color expression.
.IP "\fBmin\fR" 4
.IX Item "min"
Set minimal value of metadata value.
.IP "\fBmax\fR" 4
.IX Item "max"
Set maximal value of metadata value.
.IP "\fBbg\fR" 4
.IX Item "bg"
Set graph background color. Default is white.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set graph mode.
.Sp
Available values for mode is:
.RS 4
.IP "\fBbar\fR" 4
.IX Item "bar"
.PD 0
.IP "\fBdot\fR" 4
.IX Item "dot"
.IP "\fBline\fR" 4
.IX Item "line"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`line\*(C'\fR.
.RE
.IP "\fBslide\fR" 4
.IX Item "slide"
Set slide mode.
.Sp
Available values for slide is:
.RS 4
.IP "\fBframe\fR" 4
.IX Item "frame"
Draw new frame when right border is reached.
.IP "\fBreplace\fR" 4
.IX Item "replace"
Replace old columns with new ones.
.IP "\fBscroll\fR" 4
.IX Item "scroll"
Scroll from right to left.
.IP "\fBrscroll\fR" 4
.IX Item "rscroll"
Scroll from left to right.
.IP "\fBpicture\fR" 4
.IX Item "picture"
Draw single picture.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`frame\*(C'\fR.
.RE
.IP "\fBsize\fR" 4
.IX Item "size"
Set size of graph video. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
The default value is \f(CW\*(C`900x256\*(C'\fR.
.Sp
The foreground color expressions can use the following variables:
.RS 4
.IP "\fB\s-1MIN\s0\fR" 4
.IX Item "MIN"
Minimal value of metadata value.
.IP "\fB\s-1MAX\s0\fR" 4
.IX Item "MAX"
Maximal value of metadata value.
.IP "\fB\s-1VAL\s0\fR" 4
.IX Item "VAL"
Current metadata key value.
.RE
.RS 4
.Sp
The color is defined as 0xAABBGGRR.
.RE
.PP
Example using metadata from \fBsignalstats\fR filter:
.PP
.Vb 1
\&        signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
.Ve
.PP
Example using metadata from \fBebur128\fR filter:
.PP
.Vb 1
\&        ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=\-120:max=5
.Ve
.SS "ebur128"
.IX Subsection "ebur128"
\&\s-1EBU R128\s0 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 R128\s0 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. For the syntax of this
option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
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
.IP "\fBpeak\fR" 4
.IX Item "peak"
Set peak mode(s).
.Sp
Available modes can be cumulated (the option is a \f(CW\*(C`flag\*(C'\fR type). Possible
values are:
.RS 4
.IP "\fBnone\fR" 4
.IX Item "none"
Disable any peak mode (default).
.IP "\fBsample\fR" 4
.IX Item "sample"
Enable sample-peak mode.
.Sp
Simple peak mode looking for the higher sample value. It logs a message
for sample-peak (identified by \f(CW\*(C`SPK\*(C'\fR).
.IP "\fBtrue\fR" 4
.IX Item "true"
Enable true-peak mode.
.Sp
If enabled, the peak lookup is done on an over-sampled version of the input
stream for better peak accuracy. It logs a message for true-peak.
(identified by \f(CW\*(C`TPK\*(C'\fR) and true-peak per frame (identified by \f(CW\*(C`FTPK\*(C'\fR).
This mode requires a build with \f(CW\*(C`libswresample\*(C'\fR.
.RE
.RS 4
.RE
.IP "\fBdualmono\fR" 4
.IX Item "dualmono"
Treat mono input files as \*(L"dual mono\*(R". If a mono file is intended for playback
on a stereo system, its \s-1EBU R128\s0 measurement will be perceptually incorrect.
If set to \f(CW\*(C`true\*(C'\fR, this option will compensate for this effect.
Multi-channel input files are not affected by this option.
.IP "\fBpanlaw\fR" 4
.IX Item "panlaw"
Set a specific pan law to be used for the measurement of dual mono files.
This parameter is optional, and has a default value of \-3.01dB.
.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 "interleave, ainterleave"
.IX Subsection "interleave, ainterleave"
Temporally interleave frames from several inputs.
.PP
\&\f(CW\*(C`interleave\*(C'\fR works with video inputs, \f(CW\*(C`ainterleave\*(C'\fR with audio.
.PP
These filters read frames from several inputs and send the oldest
queued frame to the output.
.PP
Input streams must have well defined, monotonically increasing frame
timestamp values.
.PP
In order to submit one frame to output, these filters need to enqueue
at least one frame for each input, so they cannot work in case one
input is not yet terminated and will not receive incoming frames.
.PP
For example consider the case when one input is a \f(CW\*(C`select\*(C'\fR filter
which always drops input frames. The \f(CW\*(C`interleave\*(C'\fR filter will keep
reading from that input, but it will never be able to send new frames
to output until the input sends an end-of-stream signal.
.PP
Also, depending on inputs synchronization, the filters will drop
frames in case one input receives more frames than the other ones, and
the queue is already filled.
.PP
These filters accept the following options:
.IP "\fBnb_inputs, n\fR" 4
.IX Item "nb_inputs, n"
Set the number of different inputs, it is 2 by default.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Interleave frames belonging to different streams using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i bambi.avi \-i pr0n.mkv \-filter_complex "[0:v][1:v] interleave" out.avi
.Ve
.IP "\(bu" 4
Add flickering blur effect:
.Sp
.Vb 1
\&        select=\*(Aqif(gt(random(0), 0.2), 1, 2)\*(Aq:n=2 [tmp], boxblur=2:2, [tmp] interleave
.Ve
.SS "metadata, ametadata"
.IX Subsection "metadata, ametadata"
Manipulate frame metadata.
.PP
This filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Set mode of operation of the filter.
.Sp
Can be one of the following:
.RS 4
.IP "\fBselect\fR" 4
.IX Item "select"
If both \f(CW\*(C`value\*(C'\fR and \f(CW\*(C`key\*(C'\fR is set, select frames
which have such metadata. If only \f(CW\*(C`key\*(C'\fR is set, select
every frame that has such key in metadata.
.IP "\fBadd\fR" 4
.IX Item "add"
Add new metadata \f(CW\*(C`key\*(C'\fR and \f(CW\*(C`value\*(C'\fR. If key is already available
do nothing.
.IP "\fBmodify\fR" 4
.IX Item "modify"
Modify value of already present key.
.IP "\fBdelete\fR" 4
.IX Item "delete"
If \f(CW\*(C`value\*(C'\fR is set, delete only keys that have such value.
Otherwise, delete key. If \f(CW\*(C`key\*(C'\fR is not set, delete all metadata values in
the frame.
.IP "\fBprint\fR" 4
.IX Item "print"
Print key and its value if metadata was found. If \f(CW\*(C`key\*(C'\fR is not set print all
metadata values available in frame.
.RE
.RS 4
.RE
.IP "\fBkey\fR" 4
.IX Item "key"
Set key used with all modes. Must be set for all modes except \f(CW\*(C`print\*(C'\fR and \f(CW\*(C`delete\*(C'\fR.
.IP "\fBvalue\fR" 4
.IX Item "value"
Set metadata value which will be used. This option is mandatory for
\&\f(CW\*(C`modify\*(C'\fR and \f(CW\*(C`add\*(C'\fR mode.
.IP "\fBfunction\fR" 4
.IX Item "function"
Which function to use when comparing metadata value and \f(CW\*(C`value\*(C'\fR.
.Sp
Can be one of following:
.RS 4
.IP "\fBsame_str\fR" 4
.IX Item "same_str"
Values are interpreted as strings, returns true if metadata value is same as \f(CW\*(C`value\*(C'\fR.
.IP "\fBstarts_with\fR" 4
.IX Item "starts_with"
Values are interpreted as strings, returns true if metadata value starts with
the \f(CW\*(C`value\*(C'\fR option string.
.IP "\fBless\fR" 4
.IX Item "less"
Values are interpreted as floats, returns true if metadata value is less than \f(CW\*(C`value\*(C'\fR.
.IP "\fBequal\fR" 4
.IX Item "equal"
Values are interpreted as floats, returns true if \f(CW\*(C`value\*(C'\fR is equal with metadata value.
.IP "\fBgreater\fR" 4
.IX Item "greater"
Values are interpreted as floats, returns true if metadata value is greater than \f(CW\*(C`value\*(C'\fR.
.IP "\fBexpr\fR" 4
.IX Item "expr"
Values are interpreted as floats, returns true if expression from option \f(CW\*(C`expr\*(C'\fR
evaluates to true.
.RE
.RS 4
.RE
.IP "\fBexpr\fR" 4
.IX Item "expr"
Set expression which is used when \f(CW\*(C`function\*(C'\fR is set to \f(CW\*(C`expr\*(C'\fR.
The expression is evaluated through the eval \s-1API\s0 and can contain the following
constants:
.RS 4
.IP "\fB\s-1VALUE1\s0\fR" 4
.IX Item "VALUE1"
Float representation of \f(CW\*(C`value\*(C'\fR from metadata key.
.IP "\fB\s-1VALUE2\s0\fR" 4
.IX Item "VALUE2"
Float representation of \f(CW\*(C`value\*(C'\fR as supplied by user in \f(CW\*(C`value\*(C'\fR option.
.IP "\fBfile\fR" 4
.IX Item "file"
If specified in \f(CW\*(C`print\*(C'\fR mode, output is written to the named file. Instead of
plain filename any writable url can be specified. Filename ``\-'' is a shorthand
for standard output. If \f(CW\*(C`file\*(C'\fR option is not set, output is written to the log
with \s-1AV_LOG_INFO\s0 loglevel.
.RE
.RS 4
.RE
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Print all metadata values for frames with key \f(CW\*(C`lavfi.singnalstats.YDIF\*(C'\fR with values
between 0 and 1.
.Sp
.Vb 1
\&        signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr=\*(Aqbetween(VALUE1,0,1)\*(Aq
.Ve
.IP "\(bu" 4
Print silencedetect output to file \fImetadata.txt\fR.
.Sp
.Vb 1
\&        silencedetect,ametadata=mode=print:file=metadata.txt
.Ve
.IP "\(bu" 4
Direct all metadata to a pipe with file descriptor 4.
.Sp
.Vb 1
\&        metadata=mode=print:file=\*(Aqpipe\e:4\*(Aq
.Ve
.SS "perms, aperms"
.IX Subsection "perms, aperms"
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 \fBformat\fR or \fBaformat\fR filter before the
perms/aperms filter can avoid this problem.
.SS "realtime, arealtime"
.IX Subsection "realtime, arealtime"
Slow down filtering to match real time approximatively.
.PP
These filters will pause the filtering for a variable amount of time to
match the output rate with the input timestamps.
They are similar to the \fBre\fR option to \f(CW\*(C`ffmpeg\*(C'\fR.
.PP
They accept the following options:
.IP "\fBlimit\fR" 4
.IX Item "limit"
Time limit for the pauses. Any pause longer than that will be considered
a timestamp discontinuity and reset the timer. Default is 2 seconds.
.SS "select, aselect"
.IX Subsection "select, aselect"
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. It's \s-1NAN\s0 if undefined.
.IP "\fB\s-1TB\s0\fR" 4
.IX Item "TB"
The 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. It's \s-1NAN\s0 if undefined.
.IP "\fBt\fR" 4
.IX Item "t"
The \s-1PTS\s0 of the filtered video frame,
expressed in seconds. It's \s-1NAN\s0 if undefined.
.IP "\fBprev_pts\fR" 4
.IX Item "prev_pts"
The \s-1PTS\s0 of the previously filtered video frame. It's \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. It's \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. It's \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. It's \s-1NAN\s0 if undefined.
.IP "\fBstart_t\fR" 4
.IX Item "start_t"
The time of the first video frame in the video. It's \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. It 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. It 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"
This is 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)
.IP "\fBconcatdec_select\fR" 4
.IX Item "concatdec_select"
The concat demuxer can select only part of a concat input file by setting an
inpoint and an outpoint, but the output packets may not be entirely contained
in the selected interval. By using this variable, it is possible to skip frames
generated by the concat demuxer which are not exactly contained in the selected
interval.
.Sp
This works by comparing the frame pts against the \fIlavf.concat.start_time\fR
and the \fIlavf.concat.duration\fR packet metadata values which are also
present in the decoded frames.
.Sp
The \fIconcatdec_select\fR variable is \-1 if the frame pts is at least
start_time and either the duration metadata is missing or the frame pts is less
than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
missing.
.Sp
That basically means that an input frame is selected if its pts is within the
interval set by the concat demuxer.
.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=between(t\e,10\e,20)
.Ve
.IP "\(bu" 4
Select only I\-frames contained in the 10\-20 time interval:
.Sp
.Vb 1
\&        select=between(t\e,10\e,20)*eq(pict_type\e,I)
.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
.IP "\(bu" 4
Select useful frames from an ffconcat file which is using inpoints and
outpoints but where the source files are not intra frame only.
.Sp
.Vb 1
\&        ffmpeg \-copyts \-vsync 0 \-segment_time_metadata 1 \-i input.ffconcat \-vf select=concatdec_select \-af aselect=concatdec_select output.avi
.Ve
.SS "sendcmd, asendcmd"
.IX Subsection "sendcmd, asendcmd"
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`sendcmd\*(C'\fR must be inserted between two video filters,
\&\f(CW\*(C`asendcmd\*(C'\fR must be inserted between two audio 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 "setpts, asetpts"
.IX Subsection "setpts, asetpts"
Change the \s-1PTS \s0(presentation timestamp) of the input frames.
.PP
\&\f(CW\*(C`setpts\*(C'\fR works on video frames, \f(CW\*(C`asetpts\*(C'\fR on audio 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 for video or the number of consumed samples,
not including the current frame for audio, 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, S\s0\fR" 4
.IX Item "NB_SAMPLES, S"
The number of samples in the current frame (only audio)
.IP "\fB\s-1SAMPLE_RATE, SR\s0\fR" 4
.IX Item "SAMPLE_RATE, SR"
The 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"
State whether the current frame is interlaced.
.IP "\fBT\fR" 4
.IX Item "T"
the time in seconds of the current frame
.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"
The 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"
The 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"
The 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"
The wallclock (\s-1RTC\s0) time at the start of the movie in microseconds.
.IP "\fB\s-1TB\s0\fR" 4
.IX Item "TB"
The timebase of the input timestamps.
.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
.IP "\(bu" 4
Generate timestamps by counting samples:
.Sp
.Vb 1
\&        asetpts=N/SR/TB
.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
It accepts the following parameters:
.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\*(R" \s0(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 "showcqt"
.IX Subsection "showcqt"
Convert input audio to a video output representing frequency spectrum
logarithmically using Brown-Puckette constant Q transform algorithm with
direct frequency domain coefficient calculation (but the transform itself
is not really constant Q, instead the Q factor is actually variable/clamped),
with musical tone scale, from E0 to D#10.
.PP
The filter accepts the following options:
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify the video size for the output. It must be even. For the syntax of this option,
check the \fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`1920x1080\*(C'\fR.
.IP "\fBfps, rate, r\fR" 4
.IX Item "fps, rate, r"
Set the output frame rate. Default value is \f(CW25\fR.
.IP "\fBbar_h\fR" 4
.IX Item "bar_h"
Set the bargraph height. It must be even. Default value is \f(CW\*(C`\-1\*(C'\fR which
computes the bargraph height automatically.
.IP "\fBaxis_h\fR" 4
.IX Item "axis_h"
Set the axis height. It must be even. Default value is \f(CW\*(C`\-1\*(C'\fR which computes
the axis height automatically.
.IP "\fBsono_h\fR" 4
.IX Item "sono_h"
Set the sonogram height. It must be even. Default value is \f(CW\*(C`\-1\*(C'\fR which
computes the sonogram height automatically.
.IP "\fBfullhd\fR" 4
.IX Item "fullhd"
Set the fullhd resolution. This option is deprecated, use \fIsize\fR, \fIs\fR
instead. Default value is \f(CW1\fR.
.IP "\fBsono_v, volume\fR" 4
.IX Item "sono_v, volume"
Specify the sonogram volume expression. It can contain variables:
.RS 4
.IP "\fBbar_v\fR" 4
.IX Item "bar_v"
the \fIbar_v\fR evaluated expression
.IP "\fBfrequency, freq, f\fR" 4
.IX Item "frequency, freq, f"
the frequency where it is evaluated
.IP "\fBtimeclamp, tc\fR" 4
.IX Item "timeclamp, tc"
the value of \fItimeclamp\fR option
.RE
.RS 4
.Sp
and functions:
.IP "\fBa_weighting(f)\fR" 4
.IX Item "a_weighting(f)"
A\-weighting of equal loudness
.IP "\fBb_weighting(f)\fR" 4
.IX Item "b_weighting(f)"
B\-weighting of equal loudness
.IP "\fBc_weighting(f)\fR" 4
.IX Item "c_weighting(f)"
C\-weighting of equal loudness.
.RE
.RS 4
.Sp
Default value is \f(CW16\fR.
.RE
.IP "\fBbar_v, volume2\fR" 4
.IX Item "bar_v, volume2"
Specify the bargraph volume expression. It can contain variables:
.RS 4
.IP "\fBsono_v\fR" 4
.IX Item "sono_v"
the \fIsono_v\fR evaluated expression
.IP "\fBfrequency, freq, f\fR" 4
.IX Item "frequency, freq, f"
the frequency where it is evaluated
.IP "\fBtimeclamp, tc\fR" 4
.IX Item "timeclamp, tc"
the value of \fItimeclamp\fR option
.RE
.RS 4
.Sp
and functions:
.IP "\fBa_weighting(f)\fR" 4
.IX Item "a_weighting(f)"
A\-weighting of equal loudness
.IP "\fBb_weighting(f)\fR" 4
.IX Item "b_weighting(f)"
B\-weighting of equal loudness
.IP "\fBc_weighting(f)\fR" 4
.IX Item "c_weighting(f)"
C\-weighting of equal loudness.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`sono_v\*(C'\fR.
.RE
.IP "\fBsono_g, gamma\fR" 4
.IX Item "sono_g, gamma"
Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
higher gamma makes the spectrum having more range. Default value is \f(CW3\fR.
Acceptable range is \f(CW\*(C`[1, 7]\*(C'\fR.
.IP "\fBbar_g, gamma2\fR" 4
.IX Item "bar_g, gamma2"
Specify the bargraph gamma. Default value is \f(CW1\fR. Acceptable range is
\&\f(CW\*(C`[1, 7]\*(C'\fR.
.IP "\fBtimeclamp, tc\fR" 4
.IX Item "timeclamp, tc"
Specify the transform timeclamp. At low frequency, there is trade-off between
accuracy in time domain and frequency domain. If timeclamp is lower,
event in time domain is represented more accurately (such as fast bass drum),
otherwise event in frequency domain is represented more accurately
(such as bass guitar). Acceptable range is \f(CW\*(C`[0.1, 1]\*(C'\fR. Default value is \f(CW0.17\fR.
.IP "\fBbasefreq\fR" 4
.IX Item "basefreq"
Specify the transform base frequency. Default value is \f(CW20.01523126408007475\fR,
which is frequency 50 cents below E0. Acceptable range is \f(CW\*(C`[10, 100000]\*(C'\fR.
.IP "\fBendfreq\fR" 4
.IX Item "endfreq"
Specify the transform end frequency. Default value is \f(CW20495.59681441799654\fR,
which is frequency 50 cents above D#10. Acceptable range is \f(CW\*(C`[10, 100000]\*(C'\fR.
.IP "\fBcoeffclamp\fR" 4
.IX Item "coeffclamp"
This option is deprecated and ignored.
.IP "\fBtlength\fR" 4
.IX Item "tlength"
Specify the transform length in time domain. Use this option to control accuracy
trade-off between time domain and frequency domain at every frequency sample.
It can contain variables:
.RS 4
.IP "\fBfrequency, freq, f\fR" 4
.IX Item "frequency, freq, f"
the frequency where it is evaluated
.IP "\fBtimeclamp, tc\fR" 4
.IX Item "timeclamp, tc"
the value of \fItimeclamp\fR option.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`384*tc/(384+tc*f)\*(C'\fR.
.RE
.IP "\fBcount\fR" 4
.IX Item "count"
Specify the transform count for every video frame. Default value is \f(CW6\fR.
Acceptable range is \f(CW\*(C`[1, 30]\*(C'\fR.
.IP "\fBfcount\fR" 4
.IX Item "fcount"
Specify the transform count for every single pixel. Default value is \f(CW0\fR,
which makes it computed automatically. Acceptable range is \f(CW\*(C`[0, 10]\*(C'\fR.
.IP "\fBfontfile\fR" 4
.IX Item "fontfile"
Specify font file for use with freetype to draw the axis. If not specified,
use embedded font. Note that drawing with font file or embedded font is not
implemented with custom \fIbasefreq\fR and \fIendfreq\fR, use \fIaxisfile\fR
option instead.
.IP "\fBfont\fR" 4
.IX Item "font"
Specify fontconfig pattern. This has lower priority than \fIfontfile\fR.
The : in the pattern may be replaced by | to avoid unnecessary escaping.
.IP "\fBfontcolor\fR" 4
.IX Item "fontcolor"
Specify font color expression. This is arithmetic expression that should return
integer value 0xRRGGBB. It can contain variables:
.RS 4
.IP "\fBfrequency, freq, f\fR" 4
.IX Item "frequency, freq, f"
the frequency where it is evaluated
.IP "\fBtimeclamp, tc\fR" 4
.IX Item "timeclamp, tc"
the value of \fItimeclamp\fR option
.RE
.RS 4
.Sp
and functions:
.IP "\fBmidi(f)\fR" 4
.IX Item "midi(f)"
midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
.IP "\fBr(x), g(x), b(x)\fR" 4
.IX Item "r(x), g(x), b(x)"
red, green, and blue value of intensity x.
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`st(0, (midi(f)\-59.5)/12);
st(1, if(between(ld(0),0,1), 0.5\-0.5*cos(2*PI*ld(0)), 0));
r(1\-ld(1)) + b(ld(1))\*(C'\fR.
.RE
.IP "\fBaxisfile\fR" 4
.IX Item "axisfile"
Specify image file to draw the axis. This option override \fIfontfile\fR and
\&\fIfontcolor\fR option.
.IP "\fBaxis, text\fR" 4
.IX Item "axis, text"
Enable/disable drawing text to the axis. If it is set to \f(CW0\fR, drawing to
the axis is disabled, ignoring \fIfontfile\fR and \fIaxisfile\fR option.
Default value is \f(CW1\fR.
.IP "\fBcsp\fR" 4
.IX Item "csp"
Set colorspace. The accepted values are:
.RS 4
.IP "\fBunspecified\fR" 4
.IX Item "unspecified"
Unspecified (default)
.IP "\fBbt709\fR" 4
.IX Item "bt709"
\&\s-1BT.709\s0
.IP "\fBfcc\fR" 4
.IX Item "fcc"
\&\s-1FCC\s0
.IP "\fBbt470bg\fR" 4
.IX Item "bt470bg"
\&\s-1BT.470BG\s0 or \s-1BT.601\-6 625\s0
.IP "\fBsmpte170m\fR" 4
.IX Item "smpte170m"
\&\s-1SMPTE\-170M\s0 or \s-1BT.601\-6 525\s0
.IP "\fBsmpte240m\fR" 4
.IX Item "smpte240m"
\&\s-1SMPTE\-240M\s0
.IP "\fBbt2020ncl\fR" 4
.IX Item "bt2020ncl"
\&\s-1BT.2020\s0 with non-constant luminance
.RE
.RS 4
.RE
.IP "\fBcscheme\fR" 4
.IX Item "cscheme"
Set spectrogram color scheme. This is list of floating point values with format
\&\f(CW\*(C`left_r|left_g|left_b|right_r|right_g|right_b\*(C'\fR.
The default is \f(CW\*(C`1|0.5|0|0|0.5|1\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Playing audio while showing the spectrum:
.Sp
.Vb 1
\&        ffplay \-f lavfi \*(Aqamovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]\*(Aq
.Ve
.IP "\(bu" 4
Same as above, but with frame rate 30 fps:
.Sp
.Vb 1
\&        ffplay \-f lavfi \*(Aqamovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]\*(Aq
.Ve
.IP "\(bu" 4
Playing at 1280x720:
.Sp
.Vb 1
\&        ffplay \-f lavfi \*(Aqamovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]\*(Aq
.Ve
.IP "\(bu" 4
Disable sonogram display:
.Sp
.Vb 1
\&        sono_h=0
.Ve
.IP "\(bu" 4
A1 and its harmonics: A1, A2, (near)E3, A3:
.Sp
.Vb 2
\&        ffplay \-f lavfi \*(Aqaevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
\&                         asplit[a][out1]; [a] showcqt [out0]\*(Aq
.Ve
.IP "\(bu" 4
Same as above, but with more accuracy in frequency domain:
.Sp
.Vb 2
\&        ffplay \-f lavfi \*(Aqaevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
\&                         asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]\*(Aq
.Ve
.IP "\(bu" 4
Custom volume:
.Sp
.Vb 1
\&        bar_v=10:sono_v=bar_v*a_weighting(f)
.Ve
.IP "\(bu" 4
Custom gamma, now spectrum is linear to the amplitude.
.Sp
.Vb 1
\&        bar_g=2:sono_g=2
.Ve
.IP "\(bu" 4
Custom tlength equation:
.Sp
.Vb 1
\&        tc=0.33:tlength=\*(Aqst(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1\-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1\-ld(0)))\*(Aq
.Ve
.IP "\(bu" 4
Custom fontcolor and fontfile, C\-note is colored green, others are colored blue:
.Sp
.Vb 1
\&        fontcolor=\*(Aqif(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))\*(Aq:fontfile=myfont.ttf
.Ve
.IP "\(bu" 4
Custom font using fontconfig:
.Sp
.Vb 1
\&        font=\*(AqCourier New,Monospace,mono|bold\*(Aq
.Ve
.IP "\(bu" 4
Custom frequency range with custom axis using image file:
.Sp
.Vb 1
\&        axisfile=myaxis.png:basefreq=40:endfreq=10000
.Ve
.SS "showfreqs"
.IX Subsection "showfreqs"
Convert input audio to video output representing the audio power spectrum.
Audio amplitude is on Y\-axis while frequency is on X\-axis.
.PP
The filter accepts the following options:
.IP "\fBsize, s\fR" 4
.IX Item "size, s"
Specify size of video. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default is \f(CW\*(C`1024x512\*(C'\fR.
.IP "\fBmode\fR" 4
.IX Item "mode"
Set display mode.
This set how each frequency bin will be represented.
.Sp
It accepts the following values:
.RS 4
.IP "\fBline\fR" 4
.IX Item "line"
.PD 0
.IP "\fBbar\fR" 4
.IX Item "bar"
.IP "\fBdot\fR" 4
.IX Item "dot"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`bar\*(C'\fR.
.RE
.IP "\fBascale\fR" 4
.IX Item "ascale"
Set amplitude scale.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlin\fR" 4
.IX Item "lin"
Linear scale.
.IP "\fBsqrt\fR" 4
.IX Item "sqrt"
Square root scale.
.IP "\fBcbrt\fR" 4
.IX Item "cbrt"
Cubic root scale.
.IP "\fBlog\fR" 4
.IX Item "log"
Logarithmic scale.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`log\*(C'\fR.
.RE
.IP "\fBfscale\fR" 4
.IX Item "fscale"
Set frequency scale.
.Sp
It accepts the following values:
.RS 4
.IP "\fBlin\fR" 4
.IX Item "lin"
Linear scale.
.IP "\fBlog\fR" 4
.IX Item "log"
Logarithmic scale.
.IP "\fBrlog\fR" 4
.IX Item "rlog"
Reverse logarithmic scale.
.RE
.RS 4
.Sp
Default is \f(CW\*(C`lin\*(C'\fR.
.RE
.IP "\fBwin_size\fR" 4
.IX Item "win_size"
Set window size.
.Sp
It accepts the following values:
.RS 4
.IP "\fBw16\fR" 4
.IX Item "w16"
.PD 0
.IP "\fBw32\fR" 4
.IX Item "w32"
.IP "\fBw64\fR" 4
.IX Item "w64"
.IP "\fBw128\fR" 4
.IX Item "w128"
.IP "\fBw256\fR" 4
.IX Item "w256"
.IP "\fBw512\fR" 4
.IX Item "w512"
.IP "\fBw1024\fR" 4
.IX Item "w1024"
.IP "\fBw2048\fR" 4
.IX Item "w2048"
.IP "\fBw4096\fR" 4
.IX Item "w4096"
.IP "\fBw8192\fR" 4
.IX Item "w8192"
.IP "\fBw16384\fR" 4
.IX Item "w16384"
.IP "\fBw32768\fR" 4
.IX Item "w32768"
.IP "\fBw65536\fR" 4
.IX Item "w65536"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`w2048\*(C'\fR
.RE
.IP "\fBwin_func\fR" 4
.IX Item "win_func"
Set windowing function.
.Sp
It accepts the following values:
.RS 4
.IP "\fBrect\fR" 4
.IX Item "rect"
.PD 0
.IP "\fBbartlett\fR" 4
.IX Item "bartlett"
.IP "\fBhanning\fR" 4
.IX Item "hanning"
.IP "\fBhamming\fR" 4
.IX Item "hamming"
.IP "\fBblackman\fR" 4
.IX Item "blackman"
.IP "\fBwelch\fR" 4
.IX Item "welch"
.IP "\fBflattop\fR" 4
.IX Item "flattop"
.IP "\fBbharris\fR" 4
.IX Item "bharris"
.IP "\fBbnuttall\fR" 4
.IX Item "bnuttall"
.IP "\fBbhann\fR" 4
.IX Item "bhann"
.IP "\fBsine\fR" 4
.IX Item "sine"
.IP "\fBnuttall\fR" 4
.IX Item "nuttall"
.IP "\fBlanczos\fR" 4
.IX Item "lanczos"
.IP "\fBgauss\fR" 4
.IX Item "gauss"
.IP "\fBtukey\fR" 4
.IX Item "tukey"
.IP "\fBdolph\fR" 4
.IX Item "dolph"
.IP "\fBcauchy\fR" 4
.IX Item "cauchy"
.IP "\fBparzen\fR" 4
.IX Item "parzen"
.IP "\fBpoisson\fR" 4
.IX Item "poisson"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`hanning\*(C'\fR.
.RE
.IP "\fBoverlap\fR" 4
.IX Item "overlap"
Set window overlap. In range \f(CW\*(C`[0, 1]\*(C'\fR. Default is \f(CW1\fR,
which means optimal overlap for selected window function will be picked.
.IP "\fBaveraging\fR" 4
.IX Item "averaging"
Set time averaging. Setting this to 0 will display current maximal peaks.
Default is \f(CW1\fR, which means time averaging is disabled.
.IP "\fBcolors\fR" 4
.IX Item "colors"
Specify list of colors separated by space or by '|' which will be used to
draw channel frequencies. Unrecognized or missing colors will be replaced
by white color.
.IP "\fBcmode\fR" 4
.IX Item "cmode"
Set channel display mode.
.Sp
It accepts the following values:
.RS 4
.IP "\fBcombined\fR" 4
.IX Item "combined"
.PD 0
.IP "\fBseparate\fR" 4
.IX Item "separate"
.RE
.RS 4
.PD
.Sp
Default is \f(CW\*(C`combined\*(C'\fR.
.RE
.IP "\fBminamp\fR" 4
.IX Item "minamp"
Set minimum amplitude used in \f(CW\*(C`log\*(C'\fR amplitude scaler.
.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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`640x512\*(C'\fR.
.IP "\fBslide\fR" 4
.IX Item "slide"
Specify how the spectrum should slide along the window.
.Sp
It accepts the following values:
.RS 4
.IP "\fBreplace\fR" 4
.IX Item "replace"
the samples start again on the left when they reach the right
.IP "\fBscroll\fR" 4
.IX Item "scroll"
the samples scroll from right to left
.IP "\fBfullframe\fR" 4
.IX Item "fullframe"
frames are only produced when the samples reach the right
.IP "\fBrscroll\fR" 4
.IX Item "rscroll"
the samples scroll from left to right
.RE
.RS 4
.Sp
Default value is \f(CW\*(C`replace\*(C'\fR.
.RE
.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 displayed using the same color scheme
.IP "\fBrainbow\fR" 4
.IX Item "rainbow"
each channel is displayed using the rainbow color scheme
.IP "\fBmoreland\fR" 4
.IX Item "moreland"
each channel is displayed using the moreland color scheme
.IP "\fBnebulae\fR" 4
.IX Item "nebulae"
each channel is displayed using the nebulae color scheme
.IP "\fBfire\fR" 4
.IX Item "fire"
each channel is displayed using the fire color scheme
.IP "\fBfiery\fR" 4
.IX Item "fiery"
each channel is displayed using the fiery color scheme
.IP "\fBfruit\fR" 4
.IX Item "fruit"
each channel is displayed using the fruit color scheme
.IP "\fBcool\fR" 4
.IX Item "cool"
each channel is displayed using the cool 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
.IP "\fB4thrt\fR" 4
.IX Item "4thrt"
4th root
.IP "\fB5thrt\fR" 4
.IX Item "5thrt"
5th root
.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.
.IP "\fBwin_func\fR" 4
.IX Item "win_func"
Set window function.
.Sp
It accepts the following values:
.RS 4
.IP "\fBrect\fR" 4
.IX Item "rect"
.PD 0
.IP "\fBbartlett\fR" 4
.IX Item "bartlett"
.IP "\fBhann\fR" 4
.IX Item "hann"
.IP "\fBhanning\fR" 4
.IX Item "hanning"
.IP "\fBhamming\fR" 4
.IX Item "hamming"
.IP "\fBblackman\fR" 4
.IX Item "blackman"
.IP "\fBwelch\fR" 4
.IX Item "welch"
.IP "\fBflattop\fR" 4
.IX Item "flattop"
.IP "\fBbharris\fR" 4
.IX Item "bharris"
.IP "\fBbnuttall\fR" 4
.IX Item "bnuttall"
.IP "\fBbhann\fR" 4
.IX Item "bhann"
.IP "\fBsine\fR" 4
.IX Item "sine"
.IP "\fBnuttall\fR" 4
.IX Item "nuttall"
.IP "\fBlanczos\fR" 4
.IX Item "lanczos"
.IP "\fBgauss\fR" 4
.IX Item "gauss"
.IP "\fBtukey\fR" 4
.IX Item "tukey"
.IP "\fBdolph\fR" 4
.IX Item "dolph"
.IP "\fBcauchy\fR" 4
.IX Item "cauchy"
.IP "\fBparzen\fR" 4
.IX Item "parzen"
.IP "\fBpoisson\fR" 4
.IX Item "poisson"
.RE
.RS 4
.PD
.Sp
Default value is \f(CW\*(C`hann\*(C'\fR.
.RE
.IP "\fBorientation\fR" 4
.IX Item "orientation"
Set orientation of time vs frequency axis. Can be \f(CW\*(C`vertical\*(C'\fR or
\&\f(CW\*(C`horizontal\*(C'\fR. Default is \f(CW\*(C`vertical\*(C'\fR.
.IP "\fBoverlap\fR" 4
.IX Item "overlap"
Set ratio of overlap window. Default value is \f(CW0\fR.
When value is \f(CW1\fR overlap is set to recommended size for specific
window function currently used.
.IP "\fBgain\fR" 4
.IX Item "gain"
Set scale gain for calculating intensity color values.
Default value is \f(CW1\fR.
.IP "\fBdata\fR" 4
.IX Item "data"
Set which data to display. Can be \f(CW\*(C`magnitude\*(C'\fR, default or \f(CW\*(C`phase\*(C'\fR.
.IP "\fBrotation\fR" 4
.IX Item "rotation"
Set color rotation, must be in [\-1.0, 1.0] range.
Default value is \f(CW0\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 "showspectrumpic"
.IX Subsection "showspectrumpic"
Convert input audio to a single video frame, 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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`4096x2048\*(C'\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 displayed using the same color scheme
.IP "\fBrainbow\fR" 4
.IX Item "rainbow"
each channel is displayed using the rainbow color scheme
.IP "\fBmoreland\fR" 4
.IX Item "moreland"
each channel is displayed using the moreland color scheme
.IP "\fBnebulae\fR" 4
.IX Item "nebulae"
each channel is displayed using the nebulae color scheme
.IP "\fBfire\fR" 4
.IX Item "fire"
each channel is displayed using the fire color scheme
.IP "\fBfiery\fR" 4
.IX Item "fiery"
each channel is displayed using the fiery color scheme
.IP "\fBfruit\fR" 4
.IX Item "fruit"
each channel is displayed using the fruit color scheme
.IP "\fBcool\fR" 4
.IX Item "cool"
each channel is displayed using the cool color scheme
.RE
.RS 4
.Sp
Default value is \fBintensity\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
.IP "\fB4thrt\fR" 4
.IX Item "4thrt"
4th root
.IP "\fB5thrt\fR" 4
.IX Item "5thrt"
5th root
.RE
.RS 4
.Sp
Default value is \fBlog\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.
.IP "\fBwin_func\fR" 4
.IX Item "win_func"
Set window function.
.Sp
It accepts the following values:
.RS 4
.IP "\fBrect\fR" 4
.IX Item "rect"
.PD 0
.IP "\fBbartlett\fR" 4
.IX Item "bartlett"
.IP "\fBhann\fR" 4
.IX Item "hann"
.IP "\fBhanning\fR" 4
.IX Item "hanning"
.IP "\fBhamming\fR" 4
.IX Item "hamming"
.IP "\fBblackman\fR" 4
.IX Item "blackman"
.IP "\fBwelch\fR" 4
.IX Item "welch"
.IP "\fBflattop\fR" 4
.IX Item "flattop"
.IP "\fBbharris\fR" 4
.IX Item "bharris"
.IP "\fBbnuttall\fR" 4
.IX Item "bnuttall"
.IP "\fBbhann\fR" 4
.IX Item "bhann"
.IP "\fBsine\fR" 4
.IX Item "sine"
.IP "\fBnuttall\fR" 4
.IX Item "nuttall"
.IP "\fBlanczos\fR" 4
.IX Item "lanczos"
.IP "\fBgauss\fR" 4
.IX Item "gauss"
.IP "\fBtukey\fR" 4
.IX Item "tukey"
.IP "\fBdolph\fR" 4
.IX Item "dolph"
.IP "\fBcauchy\fR" 4
.IX Item "cauchy"
.IP "\fBparzen\fR" 4
.IX Item "parzen"
.IP "\fBpoisson\fR" 4
.IX Item "poisson"
.RE
.RS 4
.PD
.Sp
Default value is \f(CW\*(C`hann\*(C'\fR.
.RE
.IP "\fBorientation\fR" 4
.IX Item "orientation"
Set orientation of time vs frequency axis. Can be \f(CW\*(C`vertical\*(C'\fR or
\&\f(CW\*(C`horizontal\*(C'\fR. Default is \f(CW\*(C`vertical\*(C'\fR.
.IP "\fBgain\fR" 4
.IX Item "gain"
Set scale gain for calculating intensity color values.
Default value is \f(CW1\fR.
.IP "\fBlegend\fR" 4
.IX Item "legend"
Draw time and frequency axes and legends. Default is enabled.
.IP "\fBrotation\fR" 4
.IX Item "rotation"
Set color rotation, must be in [\-1.0, 1.0] range.
Default value is \f(CW0\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Extract an audio spectrogram of a whole audio track
in a 1024x1024 picture using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i audio.flac \-lavfi showspectrumpic=s=1024x1024 spectrogram.png
.Ve
.SS "showvolume"
.IX Subsection "showvolume"
Convert input audio volume to a video output.
.PP
The filter accepts the following options:
.IP "\fBrate, r\fR" 4
.IX Item "rate, r"
Set video rate.
.IP "\fBb\fR" 4
.IX Item "b"
Set border width, allowed range is [0, 5]. Default is 1.
.IP "\fBw\fR" 4
.IX Item "w"
Set channel width, allowed range is [80, 8192]. Default is 400.
.IP "\fBh\fR" 4
.IX Item "h"
Set channel height, allowed range is [1, 900]. Default is 20.
.IP "\fBf\fR" 4
.IX Item "f"
Set fade, allowed range is [0.001, 1]. Default is 0.95.
.IP "\fBc\fR" 4
.IX Item "c"
Set volume color expression.
.Sp
The expression can use the following variables:
.RS 4
.IP "\fB\s-1VOLUME\s0\fR" 4
.IX Item "VOLUME"
Current max volume of channel in dB.
.IP "\fB\s-1PEAK\s0\fR" 4
.IX Item "PEAK"
Current peak.
.IP "\fB\s-1CHANNEL\s0\fR" 4
.IX Item "CHANNEL"
Current channel number, starting from 0.
.RE
.RS 4
.RE
.IP "\fBt\fR" 4
.IX Item "t"
If set, displays channel names. Default is enabled.
.IP "\fBv\fR" 4
.IX Item "v"
If set, displays volume values. Default is enabled.
.IP "\fBo\fR" 4
.IX Item "o"
Set orientation, can be \f(CW\*(C`horizontal\*(C'\fR or \f(CW\*(C`vertical\*(C'\fR,
default is \f(CW\*(C`horizontal\*(C'\fR.
.IP "\fBs\fR" 4
.IX Item "s"
Set step size, allowed range s [0, 5]. Default is 0, which means
step is disabled.
.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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`600x240\*(C'\fR.
.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.
.IP "\fBp2p\fR" 4
.IX Item "p2p"
Draw a point for each sample and a line between them.
.IP "\fBcline\fR" 4
.IX Item "cline"
Draw a centered 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".
.IP "\fBsplit_channels\fR" 4
.IX Item "split_channels"
Set if channels should be drawn separately or overlap. Default value is 0.
.IP "\fBcolors\fR" 4
.IX Item "colors"
Set colors separated by '|' which are going to be used for drawing of each channel.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set amplitude scale.
.Sp
Available values are:
.RS 4
.IP "\fBlin\fR" 4
.IX Item "lin"
Linear.
.IP "\fBlog\fR" 4
.IX Item "log"
Logarithmic.
.IP "\fBsqrt\fR" 4
.IX Item "sqrt"
Square root.
.IP "\fBcbrt\fR" 4
.IX Item "cbrt"
Cubic root.
.RE
.RS 4
.Sp
Default is linear.
.RE
.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 "showwavespic"
.IX Subsection "showwavespic"
Convert input audio to a single video frame, 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. For the syntax of this option, check the
\&\fB\*(L"Video size\*(R" section in the ffmpeg-utils manual\fR.
Default value is \f(CW\*(C`600x240\*(C'\fR.
.IP "\fBsplit_channels\fR" 4
.IX Item "split_channels"
Set if channels should be drawn separately or overlap. Default value is 0.
.IP "\fBcolors\fR" 4
.IX Item "colors"
Set colors separated by '|' which are going to be used for drawing of each channel.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set amplitude scale. Can be linear \f(CW\*(C`lin\*(C'\fR or logarithmic \f(CW\*(C`log\*(C'\fR.
Default is linear.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
Extract a channel split representation of the wave form of a whole audio track
in a 1024x800 picture using \fBffmpeg\fR:
.Sp
.Vb 1
\&        ffmpeg \-i audio.flac \-lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
.Ve
.SS "sidedata, asidedata"
.IX Subsection "sidedata, asidedata"
Delete frame side data, or select frames based on it.
.PP
This filter accepts the following options:
.IP "\fBmode\fR" 4
.IX Item "mode"
Set mode of operation of the filter.
.Sp
Can be one of the following:
.RS 4
.IP "\fBselect\fR" 4
.IX Item "select"
Select every frame with side data of \f(CW\*(C`type\*(C'\fR.
.IP "\fBdelete\fR" 4
.IX Item "delete"
Delete side data of \f(CW\*(C`type\*(C'\fR. If \f(CW\*(C`type\*(C'\fR is not set, delete all side
data in the frame.
.RE
.RS 4
.RE
.IP "\fBtype\fR" 4
.IX Item "type"
Set side data type used with all modes. Must be set for \f(CW\*(C`select\*(C'\fR mode. For
the list of frame side data types, refer to the \f(CW\*(C`AVFrameSideDataType\*(C'\fR enum
in \fIlibavutil/frame.h\fR. For example, to choose
\&\f(CW\*(C`AV_FRAME_DATA_PANSCAN\*(C'\fR side data, you must specify \f(CW\*(C`PANSCAN\*(C'\fR.
.SS "spectrumsynth"
.IX Subsection "spectrumsynth"
Sythesize audio from 2 input video spectrums, first input stream represents
magnitude across time and second represents phase across time.
The filter will transform from frequency domain as displayed in videos back
to time domain as presented in audio output.
.PP
This filter is primarily created for reversing processed \fBshowspectrum\fR
filter outputs, but can synthesize sound from other spectrograms too.
But in such case results are going to be poor if the phase data is not
available, because in such cases phase data need to be recreated, usually
its just recreated from random noise.
For best results use gray only output (\f(CW\*(C`channel\*(C'\fR color mode in
\&\fBshowspectrum\fR filter) and \f(CW\*(C`log\*(C'\fR scale for magnitude video and
\&\f(CW\*(C`lin\*(C'\fR scale for phase video. To produce phase, for 2nd video, use
\&\f(CW\*(C`data\*(C'\fR option. Inputs videos should generally use \f(CW\*(C`fullframe\*(C'\fR
slide mode as that saves resources needed for decoding video.
.PP
The filter accepts the following options:
.IP "\fBsample_rate\fR" 4
.IX Item "sample_rate"
Specify sample rate of output audio, the sample rate of audio from which
spectrum was generated may differ.
.IP "\fBchannels\fR" 4
.IX Item "channels"
Set number of channels represented in input video spectrums.
.IP "\fBscale\fR" 4
.IX Item "scale"
Set scale which was used when generating magnitude input spectrum.
Can be \f(CW\*(C`lin\*(C'\fR or \f(CW\*(C`log\*(C'\fR. Default is \f(CW\*(C`log\*(C'\fR.
.IP "\fBslide\fR" 4
.IX Item "slide"
Set slide which was used when generating inputs spectrums.
Can be \f(CW\*(C`replace\*(C'\fR, \f(CW\*(C`scroll\*(C'\fR, \f(CW\*(C`fullframe\*(C'\fR or \f(CW\*(C`rscroll\*(C'\fR.
Default is \f(CW\*(C`fullframe\*(C'\fR.
.IP "\fBwin_func\fR" 4
.IX Item "win_func"
Set window function used for resynthesis.
.IP "\fBoverlap\fR" 4
.IX Item "overlap"
Set window overlap. In range \f(CW\*(C`[0, 1]\*(C'\fR. Default is \f(CW1\fR,
which means optimal overlap for selected window function will be picked.
.IP "\fBorientation\fR" 4
.IX Item "orientation"
Set orientation of input videos. Can be \f(CW\*(C`vertical\*(C'\fR or \f(CW\*(C`horizontal\*(C'\fR.
Default is \f(CW\*(C`vertical\*(C'\fR.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.IP "\(bu" 4
First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
then resynthesize videos back to audio with spectrumsynth:
.Sp
.Vb 3
\&        ffmpeg \-i input.flac \-lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude \-an \-c:v rawvideo magnitude.nut
\&        ffmpeg \-i input.flac \-lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase \-an \-c:v rawvideo phase.nut
\&        ffmpeg \-i magnitude.nut \-i phase.nut \-lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
.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
.SS "zmq, azmq"
.IX Subsection "zmq, azmq"
Receive commands sent through a libzmq client, and forward them to
filters in the filtergraph.
.PP
\&\f(CW\*(C`zmq\*(C'\fR and \f(CW\*(C`azmq\*(C'\fR work as a pass-through filters. \f(CW\*(C`zmq\*(C'\fR
must be inserted between two video filters, \f(CW\*(C`azmq\*(C'\fR between two
audio filters.
.PP
To enable these filters you need to install the libzmq library and
headers and configure FFmpeg with \f(CW\*(C`\-\-enable\-libzmq\*(C'\fR.
.PP
For more information about libzmq see:
<\fBhttp://www.zeromq.org/\fR>
.PP
The \f(CW\*(C`zmq\*(C'\fR and \f(CW\*(C`azmq\*(C'\fR filters work as a libzmq server, which
receives messages sent through a network interface defined by the
\&\fBbind_address\fR option.
.PP
The received message must be in the form:
.PP
.Vb 1
\&        <TARGET> <COMMAND> [<ARG>]
.Ve
.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 argument list for the
given \fI\s-1COMMAND\s0\fR.
.PP
Upon reception, the message is processed and the corresponding command
is injected into the filtergraph. Depending on the result, the filter
will send a reply to the client, adopting the format:
.PP
.Vb 2
\&        <ERROR_CODE> <ERROR_REASON>
\&        <MESSAGE>
.Ve
.PP
\&\fI\s-1MESSAGE\s0\fR is optional.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
Look at \fItools/zmqsend\fR for an example of a zmq client which can
be used to send commands processed by these filters.
.PP
Consider the following filtergraph generated by \fBffplay\fR
.PP
.Vb 6
\&        ffplay \-dumpgraph 1 \-f lavfi "
\&        color=s=100x100:c=red  [l];
\&        color=s=100x100:c=blue [r];
\&        nullsrc=s=200x100, zmq [bg];
\&        [bg][l]   overlay      [bg+l];
\&        [bg+l][r] overlay=x=100 "
.Ve
.PP
To change the color of the left side of the video, the following
command can be used:
.PP
.Vb 1
\&        echo Parsed_color_0 c yellow | tools/zmqsend
.Ve
.PP
To change the right side:
.PP
.Vb 1
\&        echo Parsed_color_1 c pink | tools/zmqsend
.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 \fBmovie\fR 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
It accepts the following parameters:
.IP "\fBfilename\fR" 4
.IX Item "filename"
The name of the resource to read (not necessarily a file; it can also be 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. The 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 most suitable video stream will be automatically selected. The 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.
.IP "\fBdiscontinuity\fR" 4
.IX Item "discontinuity"
Specifies the time difference between frames above which the point is
considered a timestamp discontinuity which is removed by adjusting the later
timestamps.
.PP
It allows overlaying a second video on top of the 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 \s-1AVI\s0 file in.avi, and overlay it
on top of the input labelled \*(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 \*(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
.PP
\fICommands\fR
.IX Subsection "Commands"
.PP
Both movie and amovie support the following commands:
.IP "\fBseek\fR" 4
.IX Item "seek"
Perform seek using \*(L"av_seek_frame\*(R".
The syntax is: seek \fIstream_index\fR|\fItimestamp\fR|\fIflags\fR
.RS 4
.IP "\(bu" 4
\&\fIstream_index\fR: If stream_index is \-1, a default
stream is selected, and \fItimestamp\fR is automatically converted
from \s-1AV_TIME_BASE\s0 units to the stream specific time_base.
.IP "\(bu" 4
\&\fItimestamp\fR: Timestamp in AVStream.time_base units
or, if no stream is specified, in \s-1AV_TIME_BASE\s0 units.
.IP "\(bu" 4
\&\fIflags\fR: Flags which select direction and seeking mode.
.RE
.RS 4
.RE
.IP "\fBget_duration\fR" 4
.IX Item "get_duration"
Get movie duration in \s-1AV_TIME_BASE\s0 units.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIffserver\fR\|(1),
the \fIdoc/ffserver.conf\fR example, \fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\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.

Youez - 2016 - github.com/yon3zu
LinuXploit