.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" 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`\*(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`\*(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://:/ .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://:/[] .Ve .PP The stream access \s-1RTSP URL\s0 is given by: .PP .Vb 1 \& http://:/[] .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 \& \& Format status \& \& # Only allow local people to get the status \& ACL allow localhost \& ACL allow 192.168.0.0 192.168.255.255 \& .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://: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=:device_idx= ... .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`\*(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-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
\& ACL DENY
.Ve .IP "\(bu" 4 Allow/deny access to ranges of addresses from \fIfirst_address\fR to \&\fIlast_address\fR. .Sp .Vb 2 \& ACL ALLOW \& ACL DENY .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 \& .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 \& .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 \& .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 \& \& Feed feed1.ffm \& Format mpjpeg \& VideoFrameRate 2 \& VideoIntraOnly \& NoAudio \& Strict \-1 \& .Ve .IP "\(bu" 4 Single \s-1JPEG\s0 .Sp .Vb 9 \& \& Feed feed1.ffm \& Format jpeg \& VideoFrameRate 2 \& VideoIntraOnly \& VideoSize 352x240 \& NoAudio \& Strict \-1 \& .Ve .IP "\(bu" 4 Flash .Sp .Vb 7 \& \& Feed feed1.ffm \& Format swf \& VideoFrameRate 2 \& VideoIntraOnly \& NoAudio \& .Ve .IP "\(bu" 4 \&\s-1ASF\s0 compatible .Sp .Vb 11 \& \& Feed feed1.ffm \& Format asf \& VideoFrameRate 15 \& VideoSize 352x240 \& VideoBitRate 256 \& VideoBufferSize 40 \& VideoGopSize 30 \& AudioBitRate 64 \& StartSendOnKey \& .Ve .IP "\(bu" 4 \&\s-1MP3\s0 audio .Sp .Vb 9 \& \& Feed feed1.ffm \& Format mp2 \& AudioCodec mp3 \& AudioBitRate 64 \& AudioChannels 1 \& AudioSampleRate 44100 \& NoVideo \& .Ve .IP "\(bu" 4 Ogg Vorbis audio .Sp .Vb 8 \& \& Feed feed1.ffm \& Metadata title "Stream title" \& AudioBitRate 64 \& AudioChannels 2 \& AudioSampleRate 44100 \& NoVideo \& .Ve .IP "\(bu" 4 Real with audio only at 32 kbits .Sp .Vb 6 \& \& Feed feed1.ffm \& Format rm \& AudioBitRate 32 \& NoVideo \& .Ve .IP "\(bu" 4 Real with audio and video at 64 kbits .Sp .Vb 8 \& \& Feed feed1.ffm \& Format rm \& AudioBitRate 32 \& VideoBitRate 128 \& VideoFrameRate 25 \& VideoGopSize 25 \& .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 \& \& File "/usr/local/httpd/htdocs/tlive.rm" \& NoAudio \& \& \& \& \& \& 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" \& .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 \& [\-][:]:[....] .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 \& [\-]+[....] .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 "*<>" .PD 0 .IP "*<<\fBhttp://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf\fR>>" 4 .IX Item "*<>" .IP "*<<\fBhttp://www.dolby.com/uploadedFiles/zz\-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf\fR>>" 4 .IX Item "*<>" .IP "*<<\fBhttp://www.dolby.com/uploadedFiles/zz\-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf\fR>>" 4 .IX Item "*<>" .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 "hls" .IX Subsection "hls" \&\s-1HLS\s0 demuxer .PP It accepts the following options: .IP "\fBlive_start_index\fR" 4 .IX Item "live_start_index" segment index to start live streams at (negative values are from the end). .IP "\fBallowed_extensions\fR" 4 .IX Item "allowed_extensions" \&',' separated list of file extensions that hls is allowed to access. .IP "\fBmax_reload\fR" 4 .IX Item "max_reload" Maximum number of times a insufficient list is attempted to be reloaded. Default value is 1000. .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 \& , , , , , 0x .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 \& , , , , , .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 \& \& \& (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 <> \-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 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 \& ,, .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: \& 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: .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:||...| .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: \& crypto+ .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: .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/\*(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://: \& \& # Client side (receiving): \& ffmpeg \-i http://: \-c copy somefile.ogg \& \& # Client can also be done with wget: \& wget http://: \-O somefile.ogg \& \& # Server side (receiving): \& ffmpeg \-listen 1 \-i http://: \-c copy somefile.ogg \& \& # Client side (sending): \& ffmpeg \-i somefile.ogg \-chunked_post 0 \-c copy \-f ogg http://: \& \& # Client can also be done with wget: \& wget \-\-post\-file=somefile.ogg http://: .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/\*(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://[[:]@]:/ .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://[:][/][/] .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:[] .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://[:@][:][/][/][/] .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; ).) .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 \-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 \& ://[:][/][/] .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://[:]/ .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 \-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 .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://[:][?] .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 \-f sap sap://224.0.0.255?same_port=1 .Ve .PP Similarly, for watching in \fBffplay\fR: .PP .Vb 1 \& ffmpeg \-re \-i \-f sap sap://224.0.0.255 .Ve .PP And for watching in \fBffplay\fR, over IPv6: .PP .Vb 1 \& ffmpeg \-re \-i \-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://[
][:] .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://:[?] .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://:[?] .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 \-f tcp://:?listen \& ffplay tcp://: .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://:[?] .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 \-f tls://:?listen&cert=&key= .Ve .PP To play back a stream from the \s-1TLS/SSL\s0 server using \fBffplay\fR: .PP .Vb 1 \& ffplay tls://: .Ve .SS "udp" .IX Subsection "udp" User Datagram Protocol. .PP The required syntax for an \s-1UDP URL\s0 is: .PP .Vb 1 \& udp://:[?] .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 \-f udp://: .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 \-f mpegts udp://:?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://[]: ... .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:// .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:[,[,]] .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 EINDEXE> .Ve .PP and/or .PP .Vb 1 \& B<\-audio_device_index EINDEXE> .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 \fR" 4 .IX Item "-list_devices " 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 " 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 " 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 " 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 \& =[:=] .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= .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 \& []:.[+,] .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 | \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 \& ::= sequence of alphanumeric characters and \*(Aq_\*(Aq \& ::= "[" "]" \& ::= [] \& ::= sequence of chars (possibly quoted) \& ::= [] ["=" ] [] \& ::= [,] \& ::= [sws_flags=;] [;] .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 "*" 4 .IX Item "*" .PD 0 .IP "*" 4 .IX Item "*" .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 \& = * .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 \& / .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 \& = + * .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 \& =* + * + * + * .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=@