.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 >0, 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 "FFMPEG-ALL 1" .TH FFMPEG-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" ffmpeg \- ffmpeg media converter .SH "SYNOPSIS" .IX Header "SYNOPSIS" ffmpeg [\fIglobal_options\fR] {[\fIinput_file_options\fR] \-i \fIinput_url\fR} ... {[\fIoutput_file_options\fR] \fIoutput_url\fR} ... .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBffmpeg\fR is a universal media converter. It can read a wide variety of inputs \- including live grabbing/recording devices \- filter, and transcode them into a plethora of output formats. .PP \&\fBffmpeg\fR reads from an arbitrary number of input \*(L"files\*(R" (which can be regular files, pipes, network streams, grabbing devices, etc.), specified by the \&\f(CW\*(C`\-i\*(C'\fR option, and writes to an arbitrary number of output \*(L"files\*(R", which are specified by a plain output url. Anything found on the command line which cannot be interpreted as an option is considered to be an output url. .PP Each input or output url can, in principle, contain any number of streams of different types (video/audio/subtitle/attachment/data). The allowed number and/or types of streams may be limited by the container format. Selecting which streams from which inputs will go into which output is either done automatically or with the \f(CW\*(C`\-map\*(C'\fR option (see the Stream selection chapter). .PP To refer to input files in options, you must use their indices (0\-based). E.g. the first input file is \f(CW0\fR, the second is \f(CW1\fR, etc. Similarly, streams within a file are referred to by their indices. E.g. \f(CW\*(C`2:3\*(C'\fR refers to the fourth stream in the third input file. Also see the Stream specifiers chapter. .PP As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times. Each occurrence is then applied to the next input or output file. Exceptions from this rule are the global options (e.g. verbosity level), which should be specified first. .PP Do not mix input and output files \*(-- first specify all input files, then all output files. Also do not mix options which belong to different files. All options apply \s-1ONLY\s0 to the next input or output file and are reset between files. .PP Some simple examples follow. .IP "\(bu" 4 Convert an input media file to a different format, by re-encoding media streams: .Sp .Vb 1 \& ffmpeg \-i input.avi output.mp4 .Ve .IP "\(bu" 4 Set the video bitrate of the output file to 64 kbit/s: .Sp .Vb 1 \& ffmpeg \-i input.avi \-b:v 64k \-bufsize 64k output.mp4 .Ve .IP "\(bu" 4 Force the frame rate of the output file to 24 fps: .Sp .Vb 1 \& ffmpeg \-i input.avi \-r 24 output.mp4 .Ve .IP "\(bu" 4 Force the frame rate of the input file (valid for raw formats only) to 1 fps and the frame rate of the output file to 24 fps: .Sp .Vb 1 \& ffmpeg \-r 1 \-i input.m2v \-r 24 output.mp4 .Ve .PP The format option may be needed for raw input files. .SH "DETAILED DESCRIPTION" .IX Header "DETAILED DESCRIPTION" The transcoding process in \fBffmpeg\fR for each output can be described by the following diagram: .PP .Vb 10 \& _\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ \& | | | | \& | input | demuxer | encoded data | decoder \& | file | \-\-\-\-\-\-\-\-\-> | packets | \-\-\-\-\-+ \& |_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_| | \& v \& _\|_\|_\|_\|_\|_\|_\|_\|_ \& | | \& | decoded | \& | frames | \& |_\|_\|_\|_\|_\|_\|_\|_\|_| \& _\|_\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ | \& | | | | | \& | output | <\-\-\-\-\-\-\-\- | encoded data | <\-\-\-\-+ \& | file | muxer | packets | encoder \& |_\|_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_| .Ve .PP \&\fBffmpeg\fR calls the libavformat library (containing demuxers) to read input files and get packets containing encoded data from them. When there are multiple input files, \fBffmpeg\fR tries to keep them synchronized by tracking lowest timestamp on any active input stream. .PP Encoded packets are then passed to the decoder (unless streamcopy is selected for the stream, see further for a description). The decoder produces uncompressed frames (raw video/PCM audio/...) which can be processed further by filtering (see next section). After filtering, the frames are passed to the encoder, which encodes them and outputs encoded packets. Finally, those are passed to the muxer, which writes the encoded packets to the output file. .SS "Filtering" .IX Subsection "Filtering" Before encoding, \fBffmpeg\fR can process raw audio and video frames using filters from the libavfilter library. Several chained filters form a filter graph. \fBffmpeg\fR distinguishes between two types of filtergraphs: simple and complex. .PP \fISimple filtergraphs\fR .IX Subsection "Simple filtergraphs" .PP Simple filtergraphs are those that have exactly one input and output, both of the same type. In the above diagram they can be represented by simply inserting an additional step between decoding and encoding: .PP .Vb 10 \& _\|_\|_\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ \& | | | | \& | decoded | | encoded data | \& | frames |\e _ | packets | \& |_\|_\|_\|_\|_\|_\|_\|_\|_| \e /||_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_| \& \e _\|_\|_\|_\|_\|_\|_\|_\|_\|_ / \& simple _\e|| | / encoder \& filtergraph | filtered |/ \& | frames | \& |_\|_\|_\|_\|_\|_\|_\|_\|_\|_| .Ve .PP Simple filtergraphs are configured with the per-stream \fB\-filter\fR option (with \fB\-vf\fR and \fB\-af\fR aliases for video and audio respectively). A simple filtergraph for video can look for example like this: .PP .Vb 4 \& _\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_ \& | | | | | | | | \& | input | \-\-\-> | deinterlace | \-\-\-> | scale | \-\-\-> | output | \& |_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_| .Ve .PP Note that some filters change frame properties but not frame contents. E.g. the \&\f(CW\*(C`fps\*(C'\fR filter in the example above changes number of frames, but does not touch the frame contents. Another example is the \f(CW\*(C`setpts\*(C'\fR filter, which only sets timestamps and otherwise passes the frames unchanged. .PP \fIComplex filtergraphs\fR .IX Subsection "Complex filtergraphs" .PP Complex filtergraphs are those which cannot be described as simply a linear processing chain applied to one stream. This is the case, for example, when the graph has more than one input and/or output, or when output stream type is different from input. They can be represented with the following diagram: .PP .Vb 10 \& _\|_\|_\|_\|_\|_\|_\|_\|_ \& | | \& | input 0 |\e _\|_\|_\|_\|_\|_\|_\|_\|_\|_ \& |_\|_\|_\|_\|_\|_\|_\|_\|_| \e | | \& \e _\|_\|_\|_\|_\|_\|_\|_\|_ /| output 0 | \& \e | | / |_\|_\|_\|_\|_\|_\|_\|_\|_\|_| \& _\|_\|_\|_\|_\|_\|_\|_\|_ \e| complex | / \& | | | |/ \& | input 1 |\-\-\-\->| filter |\e \& |_\|_\|_\|_\|_\|_\|_\|_\|_| | | \e _\|_\|_\|_\|_\|_\|_\|_\|_\|_ \& /| graph | \e | | \& / | | \e| output 1 | \& _\|_\|_\|_\|_\|_\|_\|_\|_ / |_\|_\|_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_\|_\|_| \& | | / \& | input 2 |/ \& |_\|_\|_\|_\|_\|_\|_\|_\|_| .Ve .PP Complex filtergraphs are configured with the \fB\-filter_complex\fR option. Note that this option is global, since a complex filtergraph, by its nature, cannot be unambiguously associated with a single stream or file. .PP The \fB\-lavfi\fR option is equivalent to \fB\-filter_complex\fR. .PP A trivial example of a complex filtergraph is the \f(CW\*(C`overlay\*(C'\fR filter, which has two video inputs and one video output, containing one video overlaid on top of the other. Its audio counterpart is the \f(CW\*(C`amix\*(C'\fR filter. .SS "Stream copy" .IX Subsection "Stream copy" Stream copy is a mode selected by supplying the \f(CW\*(C`copy\*(C'\fR parameter to the \&\fB\-codec\fR option. It makes \fBffmpeg\fR omit the decoding and encoding step for the specified stream, so it does only demuxing and muxing. It is useful for changing the container format or modifying container-level metadata. The diagram above will, in this case, simplify to this: .PP .Vb 5 \& _\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ _\|_\|_\|_\|_\|_\|_\|_ \& | | | | | | \& | input | demuxer | encoded data | muxer | output | \& | file | \-\-\-\-\-\-\-\-\-> | packets | \-\-\-\-\-\-\-> | file | \& |_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_| |_\|_\|_\|_\|_\|_\|_\|_| .Ve .PP Since there is no decoding or encoding, it is very fast and there is no quality loss. However, it might not work in some cases because of many factors. Applying filters is obviously also impossible, since filters work on uncompressed data. .SS "Loopback decoders" .IX Subsection "Loopback decoders" While decoders are normally associated with demuxer streams, it is also possible to create \*(L"loopback\*(R" decoders that decode the output from some encoder and allow it to be fed back to complex filtergraphs. This is done with the \f(CW\*(C`\-dec\*(C'\fR directive, which takes as a parameter the index of the output stream that should be decoded. Every such directive creates a new loopback decoder, indexed with successive integers starting at zero. These indices should then be used to refer to loopback decoders in complex filtergraph link labels, as described in the documentation for \fB\-filter_complex\fR. .PP E.g. the following example: .PP .Vb 4 \& ffmpeg \-i INPUT \e \& \-map 0:v:0 \-c:v libx264 \-crf 45 \-f null \- \e \& \-dec 0:0 \-filter_complex \*(Aq[0:v][dec:0]hstack[stack]\*(Aq \e \& \-map \*(Aq[stack]\*(Aq \-c:v ffv1 OUTPUT .Ve .PP reads an input video and .IP "\(bu" 4 (line 2) encodes it with \f(CW\*(C`libx264\*(C'\fR at low quality; .IP "\(bu" 4 (line 3) decodes this encoded stream and places it side by side with the original input video; .IP "\(bu" 4 (line 4) combined video is then losslessly encoded and written into \&\fI\s-1OUTPUT\s0\fR. .SH "STREAM SELECTION" .IX Header "STREAM SELECTION" \&\fBffmpeg\fR provides the \f(CW\*(C`\-map\*(C'\fR option for manual control of stream selection in each output file. Users can skip \f(CW\*(C`\-map\*(C'\fR and let ffmpeg perform automatic stream selection as described below. The \f(CW\*(C`\-vn / \-an / \-sn / \-dn\*(C'\fR options can be used to skip inclusion of video, audio, subtitle and data streams respectively, whether manually mapped or automatically selected, except for those streams which are outputs of complex filtergraphs. .SS "Description" .IX Subsection "Description" The sub-sections that follow describe the various rules that are involved in stream selection. The examples that follow next show how these rules are applied in practice. .PP While every effort is made to accurately reflect the behavior of the program, FFmpeg is under continuous development and the code may have changed since the time of this writing. .PP \fIAutomatic stream selection\fR .IX Subsection "Automatic stream selection" .PP In the absence of any map options for a particular output file, ffmpeg inspects the output format to check which type of streams can be included in it, viz. video, audio and/or subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available, from among all the inputs. .PP It will select that stream based upon the following criteria: .IP "\(bu" 4 for video, it is the stream with the highest resolution, .IP "\(bu" 4 for audio, it is the stream with the most channels, .IP "\(bu" 4 for subtitles, it is the first subtitle stream found but there's a caveat. The output format's default subtitle encoder can be either text-based or image-based, and only a subtitle stream of the same type will be chosen. .PP In the case where several streams of the same type rate equally, the stream with the lowest index is chosen. .PP Data or attachment streams are not automatically selected and can only be included using \f(CW\*(C`\-map\*(C'\fR. .PP \fIManual stream selection\fR .IX Subsection "Manual stream selection" .PP When \f(CW\*(C`\-map\*(C'\fR is used, only user-mapped streams are included in that output file, with one possible exception for filtergraph outputs described below. .PP \fIComplex filtergraphs\fR .IX Subsection "Complex filtergraphs" .PP If there are any complex filtergraph output streams with unlabeled pads, they will be added to the first output file. This will lead to a fatal error if the stream type is not supported by the output format. In the absence of the map option, the inclusion of these streams leads to the automatic stream selection of their types being skipped. If map options are present, these filtergraph streams are included in addition to the mapped streams. .PP Complex filtergraph output streams with labeled pads must be mapped once and exactly once. .PP \fIStream handling\fR .IX Subsection "Stream handling" .PP Stream handling is independent of stream selection, with an exception for subtitles described below. Stream handling is set via the \f(CW\*(C`\-codec\*(C'\fR option addressed to streams within a specific \fIoutput\fR file. In particular, codec options are applied by ffmpeg after the stream selection process and thus do not influence the latter. If no \f(CW\*(C`\-codec\*(C'\fR option is specified for a stream type, ffmpeg will select the default encoder registered by the output file muxer. .PP An exception exists for subtitles. If a subtitle encoder is specified for an output file, the first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate if the specified encoder can convert the selected stream or if the converted stream is acceptable within the output format. This applies generally as well: when the user sets an encoder manually, the stream selection process cannot check if the encoded stream can be muxed into the output file. If it cannot, ffmpeg will abort and \fIall\fR output files will fail to be processed. .SS "Examples" .IX Subsection "Examples" The following examples illustrate the behavior, quirks and limitations of ffmpeg's stream selection methods. .PP They assume the following three input files. .PP .Vb 3 \& input file \*(AqA.avi\*(Aq \& stream 0: video 640x360 \& stream 1: audio 2 channels \& \& input file \*(AqB.mp4\*(Aq \& stream 0: video 1920x1080 \& stream 1: audio 2 channels \& stream 2: subtitles (text) \& stream 3: audio 5.1 channels \& stream 4: subtitles (text) \& \& input file \*(AqC.mkv\*(Aq \& stream 0: video 1280x720 \& stream 1: audio 2 channels \& stream 2: subtitles (image) .Ve .PP Example: automatic stream selection .IX Subsection "Example: automatic stream selection" .PP .Vb 1 \& ffmpeg \-i A.avi \-i B.mp4 out1.mkv out2.wav \-map 1:a \-c:a copy out3.mov .Ve .PP There are three output files specified, and for the first two, no \f(CW\*(C`\-map\*(C'\fR options are set, so ffmpeg will select streams for these two files automatically. .PP \&\fIout1.mkv\fR is a Matroska container file and accepts video, audio and subtitle streams, so ffmpeg will try to select one of each type.For video, it will select \f(CW\*(C`stream 0\*(C'\fR from \fIB.mp4\fR, which has the highest resolution among all the input video streams.For audio, it will select \f(CW\*(C`stream 3\*(C'\fR from \fIB.mp4\fR, since it has the greatest number of channels.For subtitles, it will select \f(CW\*(C`stream 2\*(C'\fR from \fIB.mp4\fR, which is the first subtitle stream from among \fIA.avi\fR and \fIB.mp4\fR. .PP \&\fIout2.wav\fR accepts only audio streams, so only \f(CW\*(C`stream 3\*(C'\fR from \fIB.mp4\fR is selected. .PP For \fIout3.mov\fR, since a \f(CW\*(C`\-map\*(C'\fR option is set, no automatic stream selection will occur. The \f(CW\*(C`\-map 1:a\*(C'\fR option will select all audio streams from the second input \&\fIB.mp4\fR. No other streams will be included in this output file. .PP For the first two outputs, all included streams will be transcoded. The encoders chosen will be the default ones registered by each output format, which may not match the codec of the selected input streams. .PP For the third output, codec option for audio streams has been set to \f(CW\*(C`copy\*(C'\fR, so no decoding-filtering-encoding operations will occur, or \fIcan\fR occur. Packets of selected streams shall be conveyed from the input file and muxed within the output file. .PP Example: automatic subtitles selection .IX Subsection "Example: automatic subtitles selection" .PP .Vb 1 \& ffmpeg \-i C.mkv out1.mkv \-c:s dvdsub \-an out2.mkv .Ve .PP Although \fIout1.mkv\fR is a Matroska container file which accepts subtitle streams, only a video and audio stream shall be selected. The subtitle stream of \fIC.mkv\fR is image-based and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation for the subtitles is expected to fail and hence the stream isn't selected. However, in \&\fIout2.mkv\fR, a subtitle encoder is specified in the command and so, the subtitle stream is selected, in addition to the video stream. The presence of \f(CW\*(C`\-an\*(C'\fR disables audio stream selection for \fIout2.mkv\fR. .PP Example: unlabeled filtergraph outputs .IX Subsection "Example: unlabeled filtergraph outputs" .PP .Vb 1 \& ffmpeg \-i A.avi \-i C.mkv \-i B.mp4 \-filter_complex "overlay" out1.mp4 out2.srt .Ve .PP A filtergraph is setup here using the \f(CW\*(C`\-filter_complex\*(C'\fR option and consists of a single video filter. The \f(CW\*(C`overlay\*(C'\fR filter requires exactly two video inputs, but none are specified, so the first two available video streams are used, those of \fIA.avi\fR and \&\fIC.mkv\fR. The output pad of the filter has no label and so is sent to the first output file \&\fIout1.mp4\fR. Due to this, automatic selection of the video stream is skipped, which would have selected the stream in \fIB.mp4\fR. The audio stream with most channels viz. \f(CW\*(C`stream 3\*(C'\fR in \fIB.mp4\fR, is chosen automatically. No subtitle stream is chosen however, since the \s-1MP4\s0 format has no default subtitle encoder registered, and the user hasn't specified a subtitle encoder. .PP The 2nd output file, \fIout2.srt\fR, only accepts text-based subtitle streams. So, even though the first subtitle stream available belongs to \fIC.mkv\fR, it is image-based and hence skipped. The selected stream, \f(CW\*(C`stream 2\*(C'\fR in \fIB.mp4\fR, is the first text-based subtitle stream. .PP Example: labeled filtergraph outputs .IX Subsection "Example: labeled filtergraph outputs" .PP .Vb 4 \& ffmpeg \-i A.avi \-i B.mp4 \-i C.mkv \-filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \e \& \-map \*(Aq[outv]\*(Aq \-an out1.mp4 \e \& out2.mkv \e \& \-map \*(Aq[outv]\*(Aq \-map 1:a:0 out3.mkv .Ve .PP The above command will fail, as the output pad labelled \f(CW\*(C`[outv]\*(C'\fR has been mapped twice. None of the output files shall be processed. .PP .Vb 4 \& ffmpeg \-i A.avi \-i B.mp4 \-i C.mkv \-filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \e \& \-an out1.mp4 \e \& out2.mkv \e \& \-map 1:a:0 out3.mkv .Ve .PP This command above will also fail as the hue filter output has a label, \f(CW\*(C`[outv]\*(C'\fR, and hasn't been mapped anywhere. .PP The command should be modified as follows, .PP .Vb 4 \& ffmpeg \-i A.avi \-i B.mp4 \-i C.mkv \-filter_complex "[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample" \e \& \-map \*(Aq[outv1]\*(Aq \-an out1.mp4 \e \& out2.mkv \e \& \-map \*(Aq[outv2]\*(Aq \-map 1:a:0 out3.mkv .Ve .PP The video stream from \fIB.mp4\fR is sent to the hue filter, whose output is cloned once using the split filter, and both outputs labelled. Then a copy each is mapped to the first and third output files. .PP The overlay filter, requiring two video inputs, uses the first two unused video streams. Those are the streams from \fIA.avi\fR and \fIC.mkv\fR. The overlay output isn't labelled, so it is sent to the first output file \fIout1.mp4\fR, regardless of the presence of the \f(CW\*(C`\-map\*(C'\fR option. .PP The aresample filter is sent the first unused audio stream, that of \fIA.avi\fR. Since this filter output is also unlabelled, it too is mapped to the first output file. The presence of \f(CW\*(C`\-an\*(C'\fR only suppresses automatic or manual stream selection of audio streams, not outputs sent from filtergraphs. Both these mapped streams shall be ordered before the mapped stream in \fIout1.mp4\fR. .PP The video, audio and subtitle streams mapped to \f(CW\*(C`out2.mkv\*(C'\fR are entirely determined by automatic stream selection. .PP \&\fIout3.mkv\fR consists of the cloned video output from the hue filter and the first audio stream from \fIB.mp4\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. .PP Options that take arguments support a special syntax where the argument given on the command line is interpreted as a path to the file from which the actual argument value is loaded. To use this feature, add a forward slash '/' immediately before the option name (after the leading dash). E.g. .PP .Vb 1 \& ffmpeg \-i INPUT \-/filter:v filter.script OUTPUT .Ve .PP will load a filtergraph description from the file named \fIfilter.script\fR. .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. If \fIstream_index\fR is used as an additional stream specifier (see below), then it selects stream number \&\fIstream_index\fR from the matching streams. Stream numbering is based on the order of the streams as detected by libavformat except when a stream group specifier or program \s-1ID\s0 is also specified. In this case it is based on the ordering of the streams in the group or program. .IP "\fIstream_type\fR\fB[:\fR\fIadditional_stream_specifier\fR\fB]\fR" 4 .IX Item "stream_type[:additional_stream_specifier]" \&\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 \fIadditional_stream_specifier\fR is used, then it matches streams which both have this type and match the \&\fIadditional_stream_specifier\fR. Otherwise, it matches all streams of the specified type. .IP "\fBg:\fR\fIgroup_specifier\fR\fB[:\fR\fIadditional_stream_specifier\fR\fB]\fR" 4 .IX Item "g:group_specifier[:additional_stream_specifier]" Matches streams which are in the group with the specifier \fIgroup_specifier\fR. if \fIadditional_stream_specifier\fR is used, then it matches streams which both are part of the group and match the \fIadditional_stream_specifier\fR. \&\fIgroup_specifier\fR may be one of the following: .RS 4 .IP "\fIgroup_index\fR" 4 .IX Item "group_index" Match the stream with this group index. .IP "\fB#\fR\fIgroup_id\fR \fBor i:\fR\fIgroup_id\fR" 4 .IX Item "#group_id or i:group_id" Match the stream with this group id. .RE .RS 4 .RE .IP "\fBp:\fR\fIprogram_id\fR\fB[:\fR\fIadditional_stream_specifier\fR\fB]\fR" 4 .IX Item "p:program_id[:additional_stream_specifier]" Matches streams which are in the program with the id \fIprogram_id\fR. If \&\fIadditional_stream_specifier\fR is used, then it matches streams which both are part of the program and match the \fIadditional_stream_specifier\fR. .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 named \fIfilter_name\fR. Use the \&\fB\-filters\fR option to get a list of all filters. .IP "\fBbsf=\fR\fIbitstream_filter_name\fR" 4 .IX Item "bsf=bitstream_filter_name" Print detailed information about the bitstream filter named \fIbitstream_filter_name\fR. Use the \fB\-bsfs\fR option to get a list of all bitstream filters. .IP "\fBprotocol=\fR\fIprotocol_name\fR" 4 .IX Item "protocol=protocol_name" Print detailed information about the protocol named \fIprotocol_name\fR. Use the \fB\-protocols\fR option to get a list of all protocols. .RE .RS 4 .RE .IP "\fB\-version\fR" 4 .IX Item "-version" Show version. .IP "\fB\-buildconf\fR" 4 .IX Item "-buildconf" Show the build configuration, one option per line. .IP "\fB\-formats\fR" 4 .IX Item "-formats" Show available formats (including devices). .IP "\fB\-demuxers\fR" 4 .IX Item "-demuxers" Show available demuxers. .IP "\fB\-muxers\fR" 4 .IX Item "-muxers" Show available muxers. .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\-dispositions\fR" 4 .IX Item "-dispositions" Show stream dispositions. .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 input 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 [\fR\fIflags\fR\fB+]\fR\fIloglevel\fR \fB| \-v [\fR\fIflags\fR\fB+]\fR\fIloglevel\fR" 4 .IX Item "-loglevel [flags+]loglevel | -v [flags+]loglevel" Set logging level and flags used by the library. .Sp The optional \fIflags\fR prefix can consist of the following values: .RS 4 .IP "\fBrepeat\fR" 4 .IX Item "repeat" 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. .IP "\fBlevel\fR" 4 .IX Item "level" Indicates that log output should add a \f(CW\*(C`[level]\*(C'\fR prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file. .RE .RS 4 .Sp Flags can also be used alone by adding a '+'/'\-' prefix to set/reset a single flag without affecting other \fIflags\fR or changing \fIloglevel\fR. When setting both \fIflags\fR and \fIloglevel\fR, a '+' separator is expected between the last \fIflags\fR value and before \fIloglevel\fR. .Sp \&\fIloglevel\fR is a string or a number containing one of the following values: .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 For example to enable repeated log output, add the \f(CW\*(C`level\*(C'\fR prefix, and set \&\fIloglevel\fR to \f(CW\*(C`verbose\*(C'\fR: .Sp .Vb 1 \& ffmpeg \-loglevel repeat+level+verbose \-i input output .Ve .Sp Another example that enables repeated log output without affecting current state of \f(CW\*(C`level\*(C'\fR prefix flag or \fIloglevel\fR: .Sp .Vb 1 \& ffmpeg [...] \-loglevel +repeat .Ve .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 can be forced setting the environment variable \fB\s-1AV_LOG_FORCE_COLOR\s0\fR. .RE .IP "\fB\-report\fR" 4 .IX Item "-report" Dump full command line and log 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 debug\*(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\-cpucount\fR \fIcount\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-cpucount count (global)" .PD Override detection of \s-1CPU\s0 count. This option is intended for testing. Do not use it unless you know what you're doing. .Sp .Vb 1 \& ffmpeg \-cpucount 2 .Ve .IP "\fB\-max_alloc\fR \fIbytes\fR" 4 .IX Item "-max_alloc bytes" Set the maximum size limit for allocating a block on the heap by ffmpeg's family of malloc functions. Exercise \fBextreme caution\fR when using this option. Don't use if you do not understand the full consequence of doing so. Default is \s-1INT_MAX.\s0 .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 .Vb 1 \& ffmpeg \-i multichannel.mxf \-map 0:v:0 \-map 0:a:0 \-map 0:a:0 \-c:a:0 ac3 \-b:a:0 640k \-ac:a:1 2 \-c:a:1 aac \-b:2 128k out.mp4 .Ve .PP In the above example, a multichannel audio stream is mapped twice for output. The first instance is encoded with codec ac3 and bitrate 640k. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using absolute index of the output stream. .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 \fIfmt\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-f fmt (input/output)" Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. .IP "\fB\-i\fR \fIurl\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "-i url (input)" input file url .IP "\fB\-y (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-y (global)" Overwrite output files without asking. .IP "\fB\-n (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-n (global)" Do not overwrite output files, and exit immediately if a specified output file already exists. .IP "\fB\-stream_loop\fR \fInumber\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "-stream_loop number (input)" Set number of times input stream shall be looped. Loop 0 means no loop, loop \-1 means infinite loop. .IP "\fB\-recast_media (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-recast_media (global)" Allow forcing a decoder of a different media type than the one detected or designated by the demuxer. Useful for decoding media data muxed as data streams. .IP "\fB\-c[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-c[:stream_specifier] codec (input/output,per-stream)" .PD 0 .IP "\fB\-codec[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-codec[:stream_specifier] codec (input/output,per-stream)" .PD Select an encoder (when used before an output file) or a decoder (when used before an input file) for one or more streams. \fIcodec\fR is the name of a decoder/encoder or a special value \f(CW\*(C`copy\*(C'\fR (output only) to indicate that the stream is not to be re-encoded. .Sp For example .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0 \-c:v libx264 \-c:a copy OUTPUT .Ve .Sp encodes all video streams with libx264 and copies all audio streams. .Sp For each stream, the last matching \f(CW\*(C`c\*(C'\fR option is applied, so .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0 \-c copy \-c:v:1 libx264 \-c:a:137 libvorbis OUTPUT .Ve .Sp will copy all the streams except the second video, which will be encoded with libx264, and the 138th audio, which will be encoded with libvorbis. .IP "\fB\-t\fR \fIduration\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-t duration (input/output)" When used as an input option (before \f(CW\*(C`\-i\*(C'\fR), limit the \fIduration\fR of data read from the input file. .Sp When used as an output option (before an output url), stop writing the output after its duration reaches \fIduration\fR. .Sp \&\fIduration\fR must be a time duration specification, see \fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .Sp \&\-to and \-t are mutually exclusive and \-t has priority. .IP "\fB\-to\fR \fIposition\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-to position (input/output)" Stop writing the output or reading the input at \fIposition\fR. \&\fIposition\fR must be a time duration specification, see \fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .Sp \&\-to and \-t are mutually exclusive and \-t has priority. .IP "\fB\-fs\fR \fIlimit_size\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-fs limit_size (output)" Set the file size limit, expressed in bytes. No further chunk of bytes is written after the limit is exceeded. The size of the output file is slightly more than the requested file size. .IP "\fB\-ss\fR \fIposition\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-ss position (input/output)" When used as an input option (before \f(CW\*(C`\-i\*(C'\fR), seeks in this input file to \&\fIposition\fR. Note that in most formats it is not possible to seek exactly, so \fBffmpeg\fR will seek to the closest seek point before \fIposition\fR. When transcoding and \fB\-accurate_seek\fR is enabled (the default), this extra segment between the seek point and \fIposition\fR will be decoded and discarded. When doing stream copy or when \fB\-noaccurate_seek\fR is used, it will be preserved. .Sp When used as an output option (before an output url), decodes but discards input until the timestamps reach \fIposition\fR. .Sp \&\fIposition\fR must be a time duration specification, see \fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .IP "\fB\-sseof\fR \fIposition\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "-sseof position (input)" Like the \f(CW\*(C`\-ss\*(C'\fR option but relative to the \*(L"end of file\*(R". That is negative values are earlier in the file, 0 is at \s-1EOF.\s0 .IP "\fB\-isync\fR \fIinput_index\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "-isync input_index (input)" Assign an input as a sync source. .Sp This will take the difference between the start times of the target and reference inputs and offset the timestamps of the target file by that difference. The source timestamps of the two inputs should derive from the same clock source for expected results. If \f(CW\*(C`copyts\*(C'\fR is set then \f(CW\*(C`start_at_zero\*(C'\fR must also be set. If either of the inputs has no starting timestamp then no sync adjustment is made. .Sp Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is the target index itself or \fI\-1\fR, then no adjustment is made to target timestamps. A sync reference may not itself be synced to any other input. .Sp Default value is \fI\-1\fR. .IP "\fB\-itsoffset\fR \fIoffset\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "-itsoffset offset (input)" Set the input time offset. .Sp \&\fIoffset\fR must be a time duration specification, see \fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .Sp The offset is added to the timestamps of the input files. Specifying a positive offset means that the corresponding streams are delayed by the time duration specified in \fIoffset\fR. .IP "\fB\-itsscale\fR \fIscale\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-itsscale scale (input,per-stream)" Rescale input timestamps. \fIscale\fR should be a floating point number. .IP "\fB\-timestamp\fR \fIdate\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-timestamp date (output)" Set the recording timestamp in the container. .Sp \&\fIdate\fR must be a date specification, see \fBthe Date section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .IP "\fB\-metadata[:metadata_specifier]\fR \fIkey\fR\fB=\fR\fIvalue\fR \fB(\fR\fIoutput,per\-metadata\fR\fB)\fR" 4 .IX Item "-metadata[:metadata_specifier] key=value (output,per-metadata)" Set a metadata key/value pair. .Sp An optional \fImetadata_specifier\fR may be given to set metadata on streams, chapters or programs. See \f(CW\*(C`\-map_metadata\*(C'\fR documentation for details. .Sp This option overrides metadata set with \f(CW\*(C`\-map_metadata\*(C'\fR. It is also possible to delete metadata by using an empty value. .Sp For example, for setting the title in the output file: .Sp .Vb 1 \& ffmpeg \-i in.avi \-metadata title="my title" out.flv .Ve .Sp To set the language of the first audio stream: .Sp .Vb 1 \& ffmpeg \-i INPUT \-metadata:s:a:0 language=eng OUTPUT .Ve .IP "\fB\-disposition[:stream_specifier]\fR \fIvalue\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-disposition[:stream_specifier] value (output,per-stream)" Sets the disposition for a stream. .Sp By default, the disposition is copied from the input stream, unless the output stream this option applies to is fed by a complex filtergraph \- in that case the disposition is unset by default. .Sp \&\fIvalue\fR is a sequence of items separated by '+' or '\-'. The first item may also be prefixed with '+' or '\-', in which case this option modifies the default value. Otherwise (the first item is not prefixed) this options overrides the default value. A '+' prefix adds the given disposition, '\-' removes it. It is also possible to clear the disposition by setting it to 0. .Sp If no \f(CW\*(C`\-disposition\*(C'\fR options were specified for an output file, ffmpeg will automatically set the 'default' disposition on the first stream of each type, when there are multiple streams of this type in the output file and no stream of that type is already marked as default. .Sp The \f(CW\*(C`\-dispositions\*(C'\fR option lists the known dispositions. .Sp For example, to make the second audio stream the default stream: .Sp .Vb 1 \& ffmpeg \-i in.mkv \-c copy \-disposition:a:1 default out.mkv .Ve .Sp To make the second subtitle stream the default stream and remove the default disposition from the first subtitle stream: .Sp .Vb 1 \& ffmpeg \-i in.mkv \-c copy \-disposition:s:0 0 \-disposition:s:1 default out.mkv .Ve .Sp To add an embedded cover/thumbnail: .Sp .Vb 1 \& ffmpeg \-i in.mp4 \-i IMAGE \-map 0 \-map 1 \-c copy \-c:v:1 png \-disposition:v:1 attached_pic out.mp4 .Ve .Sp Not all muxers support embedded thumbnails, and those who do, only support a few formats, like \s-1JPEG\s0 or \s-1PNG.\s0 .IP "\fB\-program [title=\fR\fItitle\fR\fB:][program_num=\fR\fIprogram_num\fR\fB:]st=\fR\fIstream\fR\fB[:st=\fR\fIstream\fR\fB...] (\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-program [title=title:][program_num=program_num:]st=stream[:st=stream...] (output)" Creates a program with the specified \fItitle\fR, \fIprogram_num\fR and adds the specified \&\fIstream\fR(s) to it. .IP "\fB\-stream_group type=\fR\fItype\fR\fB:st=\fR\fIstream\fR\fB[:st=\fR\fIstream\fR\fB][:stg=\fR\fIstream_group\fR\fB][:id=\fR\fIstream_group_id\fR\fB...] (\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-stream_group type=type:st=stream[:st=stream][:stg=stream_group][:id=stream_group_id...] (output)" Creates a stream group of the specified \fItype\fR, \fIstream_group_id\fR and adds the specified \&\fIstream\fR(s) and/or previously defined \fIstream_group\fR(s) to it. .Sp \&\fItype\fR can be one of the following: .RS 4 .IP "\fBiamf_audio_element\fR" 4 .IX Item "iamf_audio_element" Groups \fIstream\fRs that belong to the same \s-1IAMF\s0 Audio Element .Sp For this group \fItype\fR, the following options are available .RS 4 .IP "\fBaudio_element_type\fR" 4 .IX Item "audio_element_type" The Audio Element type. The following values are supported: .RS 4 .IP "\fBchannel\fR" 4 .IX Item "channel" Scalable channel audio representation .IP "\fBscene\fR" 4 .IX Item "scene" Ambisonics representation .RE .RS 4 .RE .IP "\fBdemixing\fR" 4 .IX Item "demixing" Demixing information used to reconstruct a scalable channel audio representation. This option must be separated from the rest with a ',', and takes the following key=value options .RS 4 .IP "\fBparameter_id\fR" 4 .IX Item "parameter_id" An identifier parameters blocks in frames may refer to .IP "\fBdmixp_mode\fR" 4 .IX Item "dmixp_mode" A pre-defined combination of demixing parameters .RE .RS 4 .RE .IP "\fBrecon_gain\fR" 4 .IX Item "recon_gain" Recon gain information used to reconstruct a scalable channel audio representation. This option must be separated from the rest with a ',', and takes the following key=value options .RS 4 .IP "\fBparameter_id\fR" 4 .IX Item "parameter_id" An identifier parameters blocks in frames may refer to .RE .RS 4 .RE .IP "\fBlayer\fR" 4 .IX Item "layer" A layer defining a Channel Layout in the Audio Element. This option must be separated from the rest with a ','. Several ',' separated entries can be defined, and at least one must be set. .Sp It takes the following \*(L":\*(R"\-separated key=value options .RS 4 .IP "\fBch_layout\fR" 4 .IX Item "ch_layout" The layer's channel layout .IP "\fBflags\fR" 4 .IX Item "flags" The following flags are available: .RS 4 .IP "\fBrecon_gain\fR" 4 .IX Item "recon_gain" Wether to signal if recon_gain is present as metadata in parameter blocks within frames .RE .RS 4 .RE .IP "\fBoutput_gain\fR" 4 .IX Item "output_gain" .PD 0 .IP "\fBoutput_gain_flags\fR" 4 .IX Item "output_gain_flags" .PD Which channels output_gain applies to. The following flags are available: .RS 4 .IP "\fB\s-1FL\s0\fR" 4 .IX Item "FL" .PD 0 .IP "\fB\s-1FR\s0\fR" 4 .IX Item "FR" .IP "\fB\s-1BL\s0\fR" 4 .IX Item "BL" .IP "\fB\s-1BR\s0\fR" 4 .IX Item "BR" .IP "\fB\s-1TFL\s0\fR" 4 .IX Item "TFL" .IP "\fB\s-1TFR\s0\fR" 4 .IX Item "TFR" .RE .RS 4 .RE .IP "\fBambisonics_mode\fR" 4 .IX Item "ambisonics_mode" .PD The ambisonics mode. This has no effect if audio_element_type is set to channel. .Sp The following values are supported: .RS 4 .IP "\fBmono\fR" 4 .IX Item "mono" Each ambisonics channel is coded as an individual mono stream in the group .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fBdefault_w\fR" 4 .IX Item "default_w" Default weight value .RE .RS 4 .RE .IP "\fBiamf_mix_presentation\fR" 4 .IX Item "iamf_mix_presentation" Groups \fIstream\fRs that belong to all \s-1IAMF\s0 Audio Element the same \&\s-1IAMF\s0 Mix Presentation references .Sp For this group \fItype\fR, the following options are available .RS 4 .IP "\fBsubmix\fR" 4 .IX Item "submix" A sub-mix within the Mix Presentation. This option must be separated from the rest with a ','. Several ',' separated entries can be defined, and at least one must be set. .Sp It takes the following \*(L":\*(R"\-separated key=value options .RS 4 .IP "\fBparameter_id\fR" 4 .IX Item "parameter_id" An identifier parameters blocks in frames may refer to, for post-processing the mixed audio signal to generate the audio signal for playback .IP "\fBparameter_rate\fR" 4 .IX Item "parameter_rate" The sample rate duration fields in parameters blocks in frames that refer to this \&\fIparameter_id\fR are expressed as .IP "\fBdefault_mix_gain\fR" 4 .IX Item "default_mix_gain" Default mix gain value to apply when there are no parameter blocks sharing the same \&\fIparameter_id\fR for a given frame .IP "\fBelement\fR" 4 .IX Item "element" References an Audio Element used in this Mix Presentation to generate the final output audio signal for playback. This option must be separated from the rest with a '|'. Several '|' separated entries can be defined, and at least one must be set. .Sp It takes the following \*(L":\*(R"\-separated key=value options: .RS 4 .IP "\fBstg\fR" 4 .IX Item "stg" The \fIstream_group_id\fR for an Audio Element which this sub-mix refers to .IP "\fBparameter_id\fR" 4 .IX Item "parameter_id" An identifier parameters blocks in frames may refer to, for applying any processing to the referenced and rendered Audio Element before being summed with other processed Audio Elements .IP "\fBparameter_rate\fR" 4 .IX Item "parameter_rate" The sample rate duration fields in parameters blocks in frames that refer to this \&\fIparameter_id\fR are expressed as .IP "\fBdefault_mix_gain\fR" 4 .IX Item "default_mix_gain" Default mix gain value to apply when there are no parameter blocks sharing the same \&\fIparameter_id\fR for a given frame .IP "\fBannotations\fR" 4 .IX Item "annotations" A key=value string describing the sub-mix element where \*(L"key\*(R" is a string conforming to \&\s-1BCP\-47\s0 that specifies the language for the \*(L"value\*(R" string. \*(L"key\*(R" must be the same as the one in the mix's \fIannotations\fR .IP "\fBheadphones_rendering_mode\fR" 4 .IX Item "headphones_rendering_mode" Indicates whether the input channel-based Audio Element is rendered to stereo loudspeakers or spatialized with a binaural renderer when played back on headphones. This has no effect if the referenced Audio Element's \fIaudio_element_type\fR is set to channel. .Sp The following values are supported: .RS 4 .IP "\fBstereo\fR" 4 .IX Item "stereo" .PD 0 .IP "\fBbinaural\fR" 4 .IX Item "binaural" .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fBlayout\fR" 4 .IX Item "layout" .PD Specifies the layouts for this sub-mix on which the loudness information was measured. This option must be separated from the rest with a '|'. Several '|' separated entries can be defined, and at least one must be set. .Sp It takes the following \*(L":\*(R"\-separated key=value options: .RS 4 .IP "\fBlayout_type\fR" 4 .IX Item "layout_type" .RS 4 .PD 0 .IP "\fBloudspeakers\fR" 4 .IX Item "loudspeakers" .PD The layout follows the loudspeaker sound system convention of \s-1ITU\-2051\-3.\s0 .IP "\fBbinaural\fR" 4 .IX Item "binaural" The layout is binaural. .RE .RS 4 .RE .IP "\fBsound_system\fR" 4 .IX Item "sound_system" Channel layout matching one of Sound Systems A to J of \s-1ITU\-2051\-3,\s0 plus 7.1.2 and 3.1.2 This has no effect if \fIlayout_type\fR is set to binaural. .IP "\fBintegrated_loudness\fR" 4 .IX Item "integrated_loudness" The program integrated loudness information, as defined in \s-1ITU\-1770\-4.\s0 .IP "\fBdigital_peak\fR" 4 .IX Item "digital_peak" The digital (sampled) peak value of the audio signal, as defined in \s-1ITU\-1770\-4.\s0 .IP "\fBtrue_peak\fR" 4 .IX Item "true_peak" The true peak of the audio signal, as defined in \s-1ITU\-1770\-4.\s0 .IP "\fBdialog_anchored_loudness\fR" 4 .IX Item "dialog_anchored_loudness" The Dialogue loudness information, as defined in \s-1ITU\-1770\-4.\s0 .IP "\fBalbum_anchored_loudness\fR" 4 .IX Item "album_anchored_loudness" The Album loudness information, as defined in \s-1ITU\-1770\-4.\s0 .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fBannotations\fR" 4 .IX Item "annotations" A key=value string string describing the mix where \*(L"key\*(R" is a string conforming to \s-1BCP\-47\s0 that specifies the language for the \*(L"value\*(R" string. \*(L"key\*(R" must be the same as the ones in all sub-mix element's \fIannotations\fRs .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fB\-target\fR \fItype\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-target type (output)" Specify target file type (\f(CW\*(C`vcd\*(C'\fR, \f(CW\*(C`svcd\*(C'\fR, \f(CW\*(C`dvd\*(C'\fR, \f(CW\*(C`dv\*(C'\fR, \&\f(CW\*(C`dv50\*(C'\fR). \fItype\fR may be prefixed with \f(CW\*(C`pal\-\*(C'\fR, \f(CW\*(C`ntsc\-\*(C'\fR or \&\f(CW\*(C`film\-\*(C'\fR to use the corresponding standard. All the format options (bitrate, codecs, buffer sizes) are then set automatically. You can just type: .Sp .Vb 1 \& ffmpeg \-i myfile.avi \-target vcd /tmp/vcd.mpg .Ve .Sp Nevertheless you can specify additional options as long as you know they do not conflict with the standard, as in: .Sp .Vb 1 \& ffmpeg \-i myfile.avi \-target vcd \-bf 2 /tmp/vcd.mpg .Ve .Sp The parameters set for each target are as follows. .Sp \&\fB\s-1VCD\s0\fR .Sp .Vb 6 \& : \& \-f vcd \-muxrate 1411200 \-muxpreload 0.44 \-packetsize 2324 \& \-s 352x288 \-r 25 \& \-codec:v mpeg1video \-g 15 \-b:v 1150k \-maxrate:v 1150k \-minrate:v 1150k \-bufsize:v 327680 \& \-ar 44100 \-ac 2 \& \-codec:a mp2 \-b:a 224k \& \& : \& \-f vcd \-muxrate 1411200 \-muxpreload 0.44 \-packetsize 2324 \& \-s 352x240 \-r 30000/1001 \& \-codec:v mpeg1video \-g 18 \-b:v 1150k \-maxrate:v 1150k \-minrate:v 1150k \-bufsize:v 327680 \& \-ar 44100 \-ac 2 \& \-codec:a mp2 \-b:a 224k \& \& : \& \-f vcd \-muxrate 1411200 \-muxpreload 0.44 \-packetsize 2324 \& \-s 352x240 \-r 24000/1001 \& \-codec:v mpeg1video \-g 18 \-b:v 1150k \-maxrate:v 1150k \-minrate:v 1150k \-bufsize:v 327680 \& \-ar 44100 \-ac 2 \& \-codec:a mp2 \-b:a 224k .Ve .Sp \&\fB\s-1SVCD\s0\fR .Sp .Vb 6 \& : \& \-f svcd \-packetsize 2324 \& \-s 480x576 \-pix_fmt yuv420p \-r 25 \& \-codec:v mpeg2video \-g 15 \-b:v 2040k \-maxrate:v 2516k \-minrate:v 0 \-bufsize:v 1835008 \-scan_offset 1 \& \-ar 44100 \& \-codec:a mp2 \-b:a 224k \& \& : \& \-f svcd \-packetsize 2324 \& \-s 480x480 \-pix_fmt yuv420p \-r 30000/1001 \& \-codec:v mpeg2video \-g 18 \-b:v 2040k \-maxrate:v 2516k \-minrate:v 0 \-bufsize:v 1835008 \-scan_offset 1 \& \-ar 44100 \& \-codec:a mp2 \-b:a 224k \& \& : \& \-f svcd \-packetsize 2324 \& \-s 480x480 \-pix_fmt yuv420p \-r 24000/1001 \& \-codec:v mpeg2video \-g 18 \-b:v 2040k \-maxrate:v 2516k \-minrate:v 0 \-bufsize:v 1835008 \-scan_offset 1 \& \-ar 44100 \& \-codec:a mp2 \-b:a 224k .Ve .Sp \&\fB\s-1DVD\s0\fR .Sp .Vb 6 \& : \& \-f dvd \-muxrate 10080k \-packetsize 2048 \& \-s 720x576 \-pix_fmt yuv420p \-r 25 \& \-codec:v mpeg2video \-g 15 \-b:v 6000k \-maxrate:v 9000k \-minrate:v 0 \-bufsize:v 1835008 \& \-ar 48000 \& \-codec:a ac3 \-b:a 448k \& \& : \& \-f dvd \-muxrate 10080k \-packetsize 2048 \& \-s 720x480 \-pix_fmt yuv420p \-r 30000/1001 \& \-codec:v mpeg2video \-g 18 \-b:v 6000k \-maxrate:v 9000k \-minrate:v 0 \-bufsize:v 1835008 \& \-ar 48000 \& \-codec:a ac3 \-b:a 448k \& \& : \& \-f dvd \-muxrate 10080k \-packetsize 2048 \& \-s 720x480 \-pix_fmt yuv420p \-r 24000/1001 \& \-codec:v mpeg2video \-g 18 \-b:v 6000k \-maxrate:v 9000k \-minrate:v 0 \-bufsize:v 1835008 \& \-ar 48000 \& \-codec:a ac3 \-b:a 448k .Ve .Sp \&\fB\s-1DV\s0\fR .Sp .Vb 4 \& : \& \-f dv \& \-s 720x576 \-pix_fmt yuv420p \-r 25 \& \-ar 48000 \-ac 2 \& \& : \& \-f dv \& \-s 720x480 \-pix_fmt yuv411p \-r 30000/1001 \& \-ar 48000 \-ac 2 \& \& : \& \-f dv \& \-s 720x480 \-pix_fmt yuv411p \-r 24000/1001 \& \-ar 48000 \-ac 2 .Ve .Sp The \f(CW\*(C`dv50\*(C'\fR target is identical to the \f(CW\*(C`dv\*(C'\fR target except that the pixel format set is \f(CW\*(C`yuv422p\*(C'\fR for all three standards. .Sp Any user-set value for a parameter above will override the target preset value. In that case, the output may not comply with the target standard. .IP "\fB\-dn (\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-dn (input/output)" As an input option, blocks all data streams of a file from being filtered or being automatically selected or mapped for any output. See \f(CW\*(C`\-discard\*(C'\fR option to disable streams individually. .Sp As an output option, disables data recording i.e. automatic selection or mapping of any data stream. For full manual control see the \f(CW\*(C`\-map\*(C'\fR option. .IP "\fB\-dframes\fR \fInumber\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-dframes number (output)" Set the number of data frames to output. This is an obsolete alias for \&\f(CW\*(C`\-frames:d\*(C'\fR, which you should use instead. .IP "\fB\-frames[:\fR\fIstream_specifier\fR\fB]\fR \fIframecount\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-frames[:stream_specifier] framecount (output,per-stream)" Stop writing to the stream after \fIframecount\fR frames. .IP "\fB\-q[:\fR\fIstream_specifier\fR\fB]\fR \fIq\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-q[:stream_specifier] q (output,per-stream)" .PD 0 .IP "\fB\-qscale[:\fR\fIstream_specifier\fR\fB]\fR \fIq\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-qscale[:stream_specifier] q (output,per-stream)" .PD Use fixed quality scale (\s-1VBR\s0). The meaning of \fIq\fR/\fIqscale\fR is codec-dependent. If \fIqscale\fR is used without a \fIstream_specifier\fR then it applies only to the video stream, this is to maintain compatibility with previous behavior and as specifying the same codec specific value to 2 different codecs that is audio and video generally is not what is intended when no stream_specifier is used. .IP "\fB\-filter[:\fR\fIstream_specifier\fR\fB]\fR \fIfiltergraph\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-filter[:stream_specifier] filtergraph (output,per-stream)" Create the filtergraph specified by \fIfiltergraph\fR and use it to filter the stream. .Sp \&\fIfiltergraph\fR is a description of the filtergraph to apply to the stream, and must have a single input and a single output of the same type of the stream. In the filtergraph, the input is associated to the label \f(CW\*(C`in\*(C'\fR, and the output to the label \f(CW\*(C`out\*(C'\fR. See the ffmpeg-filters manual for more information about the filtergraph syntax. .Sp See the \fB\-filter_complex option\fR if you want to create filtergraphs with multiple inputs and/or outputs. .IP "\fB\-reinit_filter[:\fR\fIstream_specifier\fR\fB]\fR \fIinteger\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-reinit_filter[:stream_specifier] integer (input,per-stream)" This boolean option determines if the filtergraph(s) to which this stream is fed gets reinitialized when input frame parameters change mid-stream. This option is enabled by default as most video and all audio filters cannot handle deviation in input frame properties. Upon reinitialization, existing filter state is lost, like e.g. the frame count \f(CW\*(C`n\*(C'\fR reference available in some filters. Any frames buffered at time of reinitialization are lost. The properties where a change triggers reinitialization are, for video, frame resolution or pixel format; for audio, sample format, sample rate, channel count or channel layout. .IP "\fB\-filter_threads\fR \fInb_threads\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-filter_threads nb_threads (global)" Defines how many threads are used to process a filter pipeline. Each pipeline will produce a thread pool with this many threads available for parallel processing. The default is the number of available CPUs. .IP "\fB\-pre[:\fR\fIstream_specifier\fR\fB]\fR \fIpreset_name\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-pre[:stream_specifier] preset_name (output,per-stream)" Specify the preset for matching stream(s). .IP "\fB\-stats (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-stats (global)" Print encoding progress/statistics. It is on by default, to explicitly disable it you need to specify \f(CW\*(C`\-nostats\*(C'\fR. .IP "\fB\-stats_period\fR \fItime\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-stats_period time (global)" Set period at which encoding progress/statistics are updated. Default is 0.5 seconds. .IP "\fB\-progress\fR \fIurl\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-progress url (global)" Send program-friendly progress information to \fIurl\fR. .Sp Progress information is written periodically and at the end of the encoding process. It is made of "\fIkey\fR=\fIvalue\fR" lines. \fIkey\fR consists of only alphanumeric characters. The last key of a sequence of progress information is always \*(L"progress\*(R". .Sp The update period is set using \f(CW\*(C`\-stats_period\*(C'\fR. .IP "\fB\-stdin\fR" 4 .IX Item "-stdin" Enable interaction on standard input. On by default unless standard input is used as an input. To explicitly disable interaction you need to specify \&\f(CW\*(C`\-nostdin\*(C'\fR. .Sp Disabling interaction on standard input is useful, for example, if ffmpeg is in the background process group. Roughly the same result can be achieved with \f(CW\*(C`ffmpeg ... < /dev/null\*(C'\fR but it requires a shell. .IP "\fB\-debug_ts (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-debug_ts (global)" Print timestamp/latency information. It is off by default. This option is mostly useful for testing and debugging purposes, and the output format may change from one version to another, so it should not be employed by portable scripts. .Sp See also the option \f(CW\*(C`\-fdebug ts\*(C'\fR. .IP "\fB\-attach\fR \fIfilename\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-attach filename (output)" Add an attachment to the output file. This is supported by a few formats like Matroska for e.g. fonts used in rendering subtitles. Attachments are implemented as a specific type of stream, so this option will add a new stream to the file. It is then possible to use per-stream options on this stream in the usual way. Attachment streams created with this option will be created after all the other streams (i.e. those created with \f(CW\*(C`\-map\*(C'\fR or automatic mappings). .Sp Note that for Matroska you also have to set the mimetype metadata tag: .Sp .Vb 1 \& ffmpeg \-i INPUT \-attach DejaVuSans.ttf \-metadata:s:2 mimetype=application/x\-truetype\-font out.mkv .Ve .Sp (assuming that the attachment stream will be third in the output file). .IP "\fB\-dump_attachment[:\fR\fIstream_specifier\fR\fB]\fR \fIfilename\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-dump_attachment[:stream_specifier] filename (input,per-stream)" Extract the matching attachment stream into a file named \fIfilename\fR. If \&\fIfilename\fR is empty, then the value of the \f(CW\*(C`filename\*(C'\fR metadata tag will be used. .Sp E.g. to extract the first attachment to a file named 'out.ttf': .Sp .Vb 1 \& ffmpeg \-dump_attachment:t:0 out.ttf \-i INPUT .Ve .Sp To extract all attachments to files determined by the \f(CW\*(C`filename\*(C'\fR tag: .Sp .Vb 1 \& ffmpeg \-dump_attachment:t "" \-i INPUT .Ve .Sp Technical note \*(-- attachments are implemented as codec extradata, so this option can actually be used to extract extradata from any stream, not just attachments. .SS "Video Options" .IX Subsection "Video Options" .IP "\fB\-vframes\fR \fInumber\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-vframes number (output)" Set the number of video frames to output. This is an obsolete alias for \&\f(CW\*(C`\-frames:v\*(C'\fR, which you should use instead. .IP "\fB\-r[:\fR\fIstream_specifier\fR\fB]\fR \fIfps\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-r[:stream_specifier] fps (input/output,per-stream)" Set frame rate (Hz value, fraction or abbreviation). .Sp As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate \fIfps\fR. This is not the same as the \fB\-framerate\fR option used for some input formats like image2 or v4l2 (it used to be the same in older versions of FFmpeg). If in doubt use \fB\-framerate\fR instead of the input option \fB\-r\fR. .Sp As an output option: .RS 4 .IP "\fBvideo encoding\fR" 4 .IX Item "video encoding" Duplicate or drop frames right before encoding them to achieve constant output frame rate \fIfps\fR. .IP "\fBvideo streamcopy\fR" 4 .IX Item "video streamcopy" Indicate to the muxer that \fIfps\fR is the stream frame rate. No data is dropped or duplicated in this case. This may produce invalid files if \fIfps\fR does not match the actual stream frame rate as determined by packet timestamps. See also the \f(CW\*(C`setts\*(C'\fR bitstream filter. .RE .RS 4 .RE .IP "\fB\-fpsmax[:\fR\fIstream_specifier\fR\fB]\fR \fIfps\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-fpsmax[:stream_specifier] fps (output,per-stream)" Set maximum frame rate (Hz value, fraction or abbreviation). .Sp Clamps output frame rate when output framerate is auto-set and is higher than this value. Useful in batch processing or when input framerate is wrongly detected as very high. It cannot be set together with \f(CW\*(C`\-r\*(C'\fR. It is ignored during streamcopy. .IP "\fB\-s[:\fR\fIstream_specifier\fR\fB]\fR \fIsize\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-s[:stream_specifier] size (input/output,per-stream)" Set frame size. .Sp As an input option, this is a shortcut for the \fBvideo_size\fR private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable \*(-- e.g. raw video or video grabbers. .Sp As an output option, this inserts the \f(CW\*(C`scale\*(C'\fR video filter to the \&\fIend\fR of the corresponding filtergraph. Please use the \f(CW\*(C`scale\*(C'\fR filter directly to insert it at the beginning or some other place. .Sp The format is \fBwxh\fR (default \- same as source). .IP "\fB\-aspect[:\fR\fIstream_specifier\fR\fB]\fR \fIaspect\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-aspect[:stream_specifier] aspect (output,per-stream)" Set the video display aspect ratio specified by \fIaspect\fR. .Sp \&\fIaspect\fR can be a floating point number string, or a string of the form \fInum\fR:\fIden\fR, where \fInum\fR and \fIden\fR are the numerator and denominator of the aspect ratio. For example \*(L"4:3\*(R", \&\*(L"16:9\*(R", \*(L"1.3333\*(R", and \*(L"1.7777\*(R" are valid argument values. .Sp If used together with \fB\-vcodec copy\fR, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists. .IP "\fB\-display_rotation[:\fR\fIstream_specifier\fR\fB]\fR \fIrotation\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-display_rotation[:stream_specifier] rotation (input,per-stream)" Set video rotation metadata. .Sp \&\fIrotation\fR is a decimal number specifying the amount in degree by which the video should be rotated counter-clockwise before being displayed. .Sp This option overrides the rotation/display transform metadata stored in the file, if any. When the video is being transcoded (rather than copied) and \f(CW\*(C`\-autorotate\*(C'\fR is enabled, the video will be rotated at the filtering stage. Otherwise, the metadata will be written into the output file if the muxer supports it. .Sp If the \f(CW\*(C`\-display_hflip\*(C'\fR and/or \f(CW\*(C`\-display_vflip\*(C'\fR options are given, they are applied after the rotation specified by this option. .IP "\fB\-display_hflip[:\fR\fIstream_specifier\fR\fB] (\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-display_hflip[:stream_specifier] (input,per-stream)" Set whether on display the image should be horizontally flipped. .Sp See the \f(CW\*(C`\-display_rotation\*(C'\fR option for more details. .IP "\fB\-display_vflip[:\fR\fIstream_specifier\fR\fB] (\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-display_vflip[:stream_specifier] (input,per-stream)" Set whether on display the image should be vertically flipped. .Sp See the \f(CW\*(C`\-display_rotation\*(C'\fR option for more details. .IP "\fB\-vn (\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-vn (input/output)" As an input option, blocks all video streams of a file from being filtered or being automatically selected or mapped for any output. See \f(CW\*(C`\-discard\*(C'\fR option to disable streams individually. .Sp As an output option, disables video recording i.e. automatic selection or mapping of any video stream. For full manual control see the \f(CW\*(C`\-map\*(C'\fR option. .IP "\fB\-vcodec\fR \fIcodec\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-vcodec codec (output)" Set the video codec. This is an alias for \f(CW\*(C`\-codec:v\*(C'\fR. .IP "\fB\-pass[:\fR\fIstream_specifier\fR\fB]\fR \fIn\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-pass[:stream_specifier] n (output,per-stream)" Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics of the video are recorded in the first pass into a log file (see also the option \-passlogfile), and in the second pass that log file is used to generate the video at the exact requested bitrate. On pass 1, you may just deactivate audio and set output to null, examples for Windows and Unix: .Sp .Vb 2 \& ffmpeg \-i foo.mov \-c:v libxvid \-pass 1 \-an \-f rawvideo \-y NUL \& ffmpeg \-i foo.mov \-c:v libxvid \-pass 1 \-an \-f rawvideo \-y /dev/null .Ve .IP "\fB\-passlogfile[:\fR\fIstream_specifier\fR\fB]\fR \fIprefix\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-passlogfile[:stream_specifier] prefix (output,per-stream)" Set two-pass log file name prefix to \fIprefix\fR, the default file name prefix is ``ffmpeg2pass''. The complete file name will be \&\fI\s-1PREFIX\-N\s0.log\fR, where N is a number specific to the output stream .IP "\fB\-vf\fR \fIfiltergraph\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-vf filtergraph (output)" Create the filtergraph specified by \fIfiltergraph\fR and use it to filter the stream. .Sp This is an alias for \f(CW\*(C`\-filter:v\*(C'\fR, see the \fB\-filter option\fR. .IP "\fB\-autorotate\fR" 4 .IX Item "-autorotate" Automatically rotate the video according to file metadata. Enabled by default, use \fB\-noautorotate\fR to disable it. .IP "\fB\-autoscale\fR" 4 .IX Item "-autoscale" Automatically scale the video according to the resolution of first frame. Enabled by default, use \fB\-noautoscale\fR to disable it. When autoscale is disabled, all output frames of filter graph might not be in the same resolution and may be inadequate for some encoder/muxer. Therefore, it is not recommended to disable it unless you really know what you are doing. Disable autoscale at your own risk. .SS "Advanced Video options" .IX Subsection "Advanced Video options" .IP "\fB\-pix_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIformat\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-pix_fmt[:stream_specifier] format (input/output,per-stream)" Set pixel format. Use \f(CW\*(C`\-pix_fmts\*(C'\fR to show all the supported pixel formats. If the selected pixel format can not be selected, ffmpeg will print a warning and select the best pixel format supported by the encoder. If \fIpix_fmt\fR is prefixed by a \f(CW\*(C`+\*(C'\fR, ffmpeg will exit with an error if the requested pixel format can not be selected, and automatic conversions inside filtergraphs are disabled. If \fIpix_fmt\fR is a single \f(CW\*(C`+\*(C'\fR, ffmpeg selects the same pixel format as the input (or graph output) and automatic conversions are disabled. .IP "\fB\-sws_flags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-sws_flags flags (input/output)" Set default flags for the libswscale library. These flags are used by automatically inserted \f(CW\*(C`scale\*(C'\fR filters and those within simple filtergraphs, if not overridden within the filtergraph definition. .Sp See the \fBffmpeg-scaler manual\fR for a list of scaler options. .IP "\fB\-rc_override[:\fR\fIstream_specifier\fR\fB]\fR \fIoverride\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-rc_override[:stream_specifier] override (output,per-stream)" Rate control override for specific intervals, formatted as \*(L"int,int,int\*(R" list separated with slashes. Two first values are the beginning and end frame numbers, last one is quantizer to use if positive, or quality factor if negative. .IP "\fB\-vstats\fR" 4 .IX Item "-vstats" Dump video coding statistics to \fIvstats_HHMMSS.log\fR. See the \&\fBvstats file format\fR section for the format description. .IP "\fB\-vstats_file\fR \fIfile\fR" 4 .IX Item "-vstats_file file" Dump video coding statistics to \fIfile\fR. See the \&\fBvstats file format\fR section for the format description. .IP "\fB\-vstats_version\fR \fIfile\fR" 4 .IX Item "-vstats_version file" Specify which version of the vstats format to use. Default is \f(CW2\fR. See the \&\fBvstats file format\fR section for the format description. .IP "\fB\-vtag\fR \fIfourcc/tag\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-vtag fourcc/tag (output)" Force video tag/fourcc. This is an alias for \f(CW\*(C`\-tag:v\*(C'\fR. .IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB]\fR \fItime\fR\fB[,\fR\fItime\fR\fB...] (\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-force_key_frames[:stream_specifier] time[,time...] (output,per-stream)" .PD 0 .IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB] expr:\fR\fIexpr\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-force_key_frames[:stream_specifier] expr:expr (output,per-stream)" .IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB] source (\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-force_key_frames[:stream_specifier] source (output,per-stream)" .PD \&\fIforce_key_frames\fR can take arguments of the following form: .RS 4 .IP "\fItime\fR\fB[,\fR\fItime\fR\fB...]\fR" 4 .IX Item "time[,time...]" If the argument consists of timestamps, ffmpeg will round the specified times to the nearest output timestamp as per the encoder time base and force a keyframe at the first frame having timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too coarse, then the keyframes may be forced on frames with timestamps lower than the specified time. The default encoder time base is the inverse of the output framerate but may be set otherwise via \f(CW\*(C`\-enc_time_base\*(C'\fR. .Sp If one of the times is "\f(CW\*(C`chapters\*(C'\fR[\fIdelta\fR]", it is expanded into the time of the beginning of all chapters in the file, shifted by \&\fIdelta\fR, expressed as a time in seconds. This option can be useful to ensure that a seek point is present at a chapter mark or any other designated place in the output file. .Sp For example, to insert a key frame at 5 minutes, plus key frames 0.1 second before the beginning of every chapter: .Sp .Vb 1 \& \-force_key_frames 0:05:00,chapters\-0.1 .Ve .IP "\fBexpr:\fR\fIexpr\fR" 4 .IX Item "expr:expr" If the argument is prefixed with \f(CW\*(C`expr:\*(C'\fR, the string \fIexpr\fR is interpreted like an expression and is evaluated for each frame. A key frame is forced in case the evaluation is non-zero. .Sp The expression in \fIexpr\fR can contain the following constants: .RS 4 .IP "\fBn\fR" 4 .IX Item "n" the number of current processed frame, starting from 0 .IP "\fBn_forced\fR" 4 .IX Item "n_forced" the number of forced frames .IP "\fBprev_forced_n\fR" 4 .IX Item "prev_forced_n" the number of the previous forced frame, it is \f(CW\*(C`NAN\*(C'\fR when no keyframe was forced yet .IP "\fBprev_forced_t\fR" 4 .IX Item "prev_forced_t" the time of the previous forced frame, it is \f(CW\*(C`NAN\*(C'\fR when no keyframe was forced yet .IP "\fBt\fR" 4 .IX Item "t" the time of the current processed frame .RE .RS 4 .Sp For example to force a key frame every 5 seconds, you can specify: .Sp .Vb 1 \& \-force_key_frames expr:gte(t,n_forced*5) .Ve .Sp To force a key frame 5 seconds after the time of the last forced one, starting from second 13: .Sp .Vb 1 \& \-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5)) .Ve .RE .IP "\fBsource\fR" 4 .IX Item "source" If the argument is \f(CW\*(C`source\*(C'\fR, ffmpeg will force a key frame if the current frame being encoded is marked as a key frame in its source. In cases where this particular source frame has to be dropped, enforce the next available frame to become a key frame instead. .RE .RS 4 .Sp Note that forcing too many keyframes is very harmful for the lookahead algorithms of certain encoders: using fixed-GOP options or similar would be more efficient. .RE .IP "\fB\-copyinkf[:\fR\fIstream_specifier\fR\fB] (\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-copyinkf[:stream_specifier] (output,per-stream)" When doing stream copy, copy also non-key frames found at the beginning. .IP "\fB\-init_hw_device\fR \fItype\fR\fB[=\fR\fIname\fR\fB][:\fR\fIdevice\fR\fB[,\fR\fIkey=value\fR\fB...]]\fR" 4 .IX Item "-init_hw_device type[=name][:device[,key=value...]]" Initialise a new hardware device of type \fItype\fR called \fIname\fR, using the given device parameters. If no name is specified it will receive a default name of the form "\fItype\fR\f(CW%d\fR". .Sp The meaning of \fIdevice\fR and the following arguments depends on the device type: .RS 4 .IP "\fBcuda\fR" 4 .IX Item "cuda" \&\fIdevice\fR is the number of the \s-1CUDA\s0 device. .Sp The following options are recognized: .RS 4 .IP "\fBprimary_ctx\fR" 4 .IX Item "primary_ctx" If set to 1, uses the primary device context instead of creating a new one. .RE .RS 4 .Sp Examples: .IP "\fI\-init_hw_device cuda:1\fR" 4 .IX Item "-init_hw_device cuda:1" Choose the second device on the system. .IP "\fI\-init_hw_device cuda:0,primary_ctx=1\fR" 4 .IX Item "-init_hw_device cuda:0,primary_ctx=1" Choose the first device and use the primary device context. .RE .RS 4 .RE .IP "\fBdxva2\fR" 4 .IX Item "dxva2" \&\fIdevice\fR is the number of the Direct3D 9 display adapter. .IP "\fBd3d11va\fR" 4 .IX Item "d3d11va" \&\fIdevice\fR is the number of the Direct3D 11 display adapter. If not specified, it will attempt to use the default Direct3D 11 display adapter or the first Direct3D 11 display adapter whose hardware VendorId is specified by \fBvendor_id\fR. .Sp Examples: .RS 4 .IP "\fI\-init_hw_device d3d11va\fR" 4 .IX Item "-init_hw_device d3d11va" Create a d3d11va device on the default Direct3D 11 display adapter. .IP "\fI\-init_hw_device d3d11va:1\fR" 4 .IX Item "-init_hw_device d3d11va:1" Create a d3d11va device on the Direct3D 11 display adapter specified by index 1. .IP "\fI\-init_hw_device d3d11va:,vendor_id=0x8086\fR" 4 .IX Item "-init_hw_device d3d11va:,vendor_id=0x8086" Create a d3d11va device on the first Direct3D 11 display adapter whose hardware VendorId is 0x8086. .RE .RS 4 .RE .IP "\fBvaapi\fR" 4 .IX Item "vaapi" \&\fIdevice\fR is either an X11 display name, a \s-1DRM\s0 render node or a DirectX adapter index. If not specified, it will attempt to open the default X11 display (\fI\f(CI$DISPLAY\fI\fR) and then the first \s-1DRM\s0 render node (\fI/dev/dri/renderD128\fR), or the default DirectX adapter on Windows. .Sp The following options are recognized: .RS 4 .IP "\fBkernel_driver\fR" 4 .IX Item "kernel_driver" When \fIdevice\fR is not specified, use this option to specify the name of the kernel driver associated with the desired device. This option is available only when the hardware acceleration method \fIdrm\fR and \fIvaapi\fR are enabled. .RE .RS 4 .Sp Examples: .IP "\fI\-init_hw_device vaapi\fR" 4 .IX Item "-init_hw_device vaapi" Create a vaapi device on the default device. .IP "\fI\-init_hw_device vaapi:/dev/dri/renderD129\fR" 4 .IX Item "-init_hw_device vaapi:/dev/dri/renderD129" Create a vaapi device on \s-1DRM\s0 render node \fI/dev/dri/renderD129\fR. .IP "\fI\-init_hw_device vaapi:1\fR" 4 .IX Item "-init_hw_device vaapi:1" Create a vaapi device on DirectX adapter 1. .IP "\fI\-init_hw_device vaapi:,kernel_driver=i915\fR" 4 .IX Item "-init_hw_device vaapi:,kernel_driver=i915" Create a vaapi device on a device associated with kernel driver \fBi915\fR. .RE .RS 4 .RE .IP "\fBvdpau\fR" 4 .IX Item "vdpau" \&\fIdevice\fR is an X11 display name. If not specified, it will attempt to open the default X11 display (\fI\f(CI$DISPLAY\fI\fR). .IP "\fBqsv\fR" 4 .IX Item "qsv" \&\fIdevice\fR selects a value in \fBMFX_IMPL_*\fR. Allowed values are: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" .PD 0 .IP "\fBsw\fR" 4 .IX Item "sw" .IP "\fBhw\fR" 4 .IX Item "hw" .IP "\fBauto_any\fR" 4 .IX Item "auto_any" .IP "\fBhw_any\fR" 4 .IX Item "hw_any" .IP "\fBhw2\fR" 4 .IX Item "hw2" .IP "\fBhw3\fR" 4 .IX Item "hw3" .IP "\fBhw4\fR" 4 .IX Item "hw4" .RE .RS 4 .PD .Sp If not specified, \fBauto_any\fR is used. (Note that it may be easier to achieve the desired result for \s-1QSV\s0 by creating the platform-appropriate subdevice (\fBdxva2\fR or \fBd3d11va\fR or \fBvaapi\fR) and then deriving a \&\s-1QSV\s0 device from that.) .Sp The following options are recognized: .IP "\fBchild_device\fR" 4 .IX Item "child_device" Specify a \s-1DRM\s0 render node on Linux or DirectX adapter on Windows. .IP "\fBchild_device_type\fR" 4 .IX Item "child_device_type" Choose platform-appropriate subdevice type. On Windows \fBd3d11va\fR is used as default subdevice type when \f(CW\*(C`\-\-enable\-libvpl\*(C'\fR is specified at configuration time, \&\fBdxva2\fR is used as default subdevice type when \f(CW\*(C`\-\-enable\-libmfx\*(C'\fR is specified at configuration time. On Linux user can use \fBvaapi\fR only as subdevice type. .RE .RS 4 .Sp Examples: .IP "\fI\-init_hw_device qsv:hw,child_device=/dev/dri/renderD129\fR" 4 .IX Item "-init_hw_device qsv:hw,child_device=/dev/dri/renderD129" Create a \s-1QSV\s0 device with \fB\s-1MFX_IMPL_HARDWARE\s0\fR on \s-1DRM\s0 render node \fI/dev/dri/renderD129\fR. .IP "\fI\-init_hw_device qsv:hw,child_device=1\fR" 4 .IX Item "-init_hw_device qsv:hw,child_device=1" Create a \s-1QSV\s0 device with \fB\s-1MFX_IMPL_HARDWARE\s0\fR on DirectX adapter 1. .IP "\fI\-init_hw_device qsv:hw,child_device_type=d3d11va\fR" 4 .IX Item "-init_hw_device qsv:hw,child_device_type=d3d11va" Choose the \s-1GPU\s0 subdevice with type \fBd3d11va\fR and create \s-1QSV\s0 device with \fB\s-1MFX_IMPL_HARDWARE\s0\fR. .IP "\fI\-init_hw_device qsv:hw,child_device_type=dxva2\fR" 4 .IX Item "-init_hw_device qsv:hw,child_device_type=dxva2" Choose the \s-1GPU\s0 subdevice with type \fBdxva2\fR and create \s-1QSV\s0 device with \fB\s-1MFX_IMPL_HARDWARE\s0\fR. .IP "\fI\-init_hw_device qsv:hw,child_device=1,child_device_type=d3d11va\fR" 4 .IX Item "-init_hw_device qsv:hw,child_device=1,child_device_type=d3d11va" Create a \s-1QSV\s0 device with \fB\s-1MFX_IMPL_HARDWARE\s0\fR on DirectX adapter 1 with subdevice type \fBd3d11va\fR. .IP "\fI\-init_hw_device vaapi=va:/dev/dri/renderD129 \-init_hw_device qsv=hw1@\fIva\fI\fR" 4 .IX Item "-init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=hw1@va" Create a \s-1VAAPI\s0 device called \fBva\fR on \fI/dev/dri/renderD129\fR, then derive a \s-1QSV\s0 device called \fBhw1\fR from device \fBva\fR. .RE .RS 4 .RE .IP "\fBopencl\fR" 4 .IX Item "opencl" \&\fIdevice\fR selects the platform and device as \fIplatform_index.device_index\fR. .Sp The set of devices can also be filtered using the key-value pairs to find only devices matching particular platform or device strings. .Sp The strings usable as filters are: .RS 4 .IP "\fBplatform_profile\fR" 4 .IX Item "platform_profile" .PD 0 .IP "\fBplatform_version\fR" 4 .IX Item "platform_version" .IP "\fBplatform_name\fR" 4 .IX Item "platform_name" .IP "\fBplatform_vendor\fR" 4 .IX Item "platform_vendor" .IP "\fBplatform_extensions\fR" 4 .IX Item "platform_extensions" .IP "\fBdevice_name\fR" 4 .IX Item "device_name" .IP "\fBdevice_vendor\fR" 4 .IX Item "device_vendor" .IP "\fBdriver_version\fR" 4 .IX Item "driver_version" .IP "\fBdevice_version\fR" 4 .IX Item "device_version" .IP "\fBdevice_profile\fR" 4 .IX Item "device_profile" .IP "\fBdevice_extensions\fR" 4 .IX Item "device_extensions" .IP "\fBdevice_type\fR" 4 .IX Item "device_type" .RE .RS 4 .PD .Sp The indices and filters must together uniquely select a device. .Sp Examples: .IP "\fI\-init_hw_device opencl:0.1\fR" 4 .IX Item "-init_hw_device opencl:0.1" Choose the second device on the first platform. .IP "\fI\-init_hw_device opencl:,device_name=Foo9000\fR" 4 .IX Item "-init_hw_device opencl:,device_name=Foo9000" Choose the device with a name containing the string \fIFoo9000\fR. .IP "\fI\-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16\fR" 4 .IX Item "-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16" Choose the \s-1GPU\s0 device on the second platform supporting the \fIcl_khr_fp16\fR extension. .RE .RS 4 .RE .IP "\fBvulkan\fR" 4 .IX Item "vulkan" If \fIdevice\fR is an integer, it selects the device by its index in a system-dependent list of devices. If \fIdevice\fR is any other string, it selects the first device with a name containing that string as a substring. .Sp The following options are recognized: .RS 4 .IP "\fBdebug\fR" 4 .IX Item "debug" If set to 1, enables the validation layer, if installed. .IP "\fBlinear_images\fR" 4 .IX Item "linear_images" If set to 1, images allocated by the hwcontext will be linear and locally mappable. .IP "\fBinstance_extensions\fR" 4 .IX Item "instance_extensions" A plus separated list of additional instance extensions to enable. .IP "\fBdevice_extensions\fR" 4 .IX Item "device_extensions" A plus separated list of additional device extensions to enable. .RE .RS 4 .Sp Examples: .IP "\fI\-init_hw_device vulkan:1\fR" 4 .IX Item "-init_hw_device vulkan:1" Choose the second device on the system. .IP "\fI\-init_hw_device vulkan:RADV\fR" 4 .IX Item "-init_hw_device vulkan:RADV" Choose the first device with a name containing the string \fI\s-1RADV\s0\fR. .IP "\fI\-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface\fR" 4 .IX Item "-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface" Choose the first device and enable the Wayland and \s-1XCB\s0 instance extensions. .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fB\-init_hw_device\fR \fItype\fR\fB[=\fR\fIname\fR\fB]@\fR\fIsource\fR" 4 .IX Item "-init_hw_device type[=name]@source" Initialise a new hardware device of type \fItype\fR called \fIname\fR, deriving it from the existing device with the name \fIsource\fR. .IP "\fB\-init_hw_device list\fR" 4 .IX Item "-init_hw_device list" List all hardware device types supported in this build of ffmpeg. .IP "\fB\-filter_hw_device\fR \fIname\fR" 4 .IX Item "-filter_hw_device name" Pass the hardware device called \fIname\fR to all filters in any filter graph. This can be used to set the device to upload to with the \f(CW\*(C`hwupload\*(C'\fR filter, or the device to map to with the \f(CW\*(C`hwmap\*(C'\fR filter. Other filters may also make use of this parameter when they require a hardware device. Note that this is typically only required when the input is not already in hardware frames \- when it is, filters will derive the device they require from the context of the frames they receive as input. .Sp This is a global setting, so all filters will receive the same device. .IP "\fB\-hwaccel[:\fR\fIstream_specifier\fR\fB]\fR \fIhwaccel\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-hwaccel[:stream_specifier] hwaccel (input,per-stream)" Use hardware acceleration to decode the matching stream(s). The allowed values of \fIhwaccel\fR are: .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" Do not use any hardware acceleration (the default). .IP "\fBauto\fR" 4 .IX Item "auto" Automatically select the hardware acceleration method. .IP "\fBvdpau\fR" 4 .IX Item "vdpau" Use \s-1VDPAU\s0 (Video Decode and Presentation \s-1API\s0 for Unix) hardware acceleration. .IP "\fBdxva2\fR" 4 .IX Item "dxva2" Use \s-1DXVA2\s0 (DirectX Video Acceleration) hardware acceleration. .IP "\fBd3d11va\fR" 4 .IX Item "d3d11va" Use D3D11VA (DirectX Video Acceleration) hardware acceleration. .IP "\fBvaapi\fR" 4 .IX Item "vaapi" Use \s-1VAAPI\s0 (Video Acceleration \s-1API\s0) hardware acceleration. .IP "\fBqsv\fR" 4 .IX Item "qsv" Use the Intel QuickSync Video acceleration for video transcoding. .Sp Unlike most other values, this option does not enable accelerated decoding (that is used automatically whenever a qsv decoder is selected), but accelerated transcoding, without copying the frames into the system memory. .Sp For it to work, both the decoder and the encoder must support \s-1QSV\s0 acceleration and no filters must be used. .RE .RS 4 .Sp This option has no effect if the selected hwaccel is not available or not supported by the chosen decoder. .Sp Note that most acceleration methods are intended for playback and will not be faster than software decoding on modern CPUs. Additionally, \fBffmpeg\fR will usually need to copy the decoded frames from the \s-1GPU\s0 memory into the system memory, resulting in further performance loss. This option is thus mainly useful for testing. .RE .IP "\fB\-hwaccel_device[:\fR\fIstream_specifier\fR\fB]\fR \fIhwaccel_device\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-hwaccel_device[:stream_specifier] hwaccel_device (input,per-stream)" Select a device to use for hardware acceleration. .Sp This option only makes sense when the \fB\-hwaccel\fR option is also specified. It can either refer to an existing device created with \fB\-init_hw_device\fR by name, or it can create a new device as if \&\fB\-init_hw_device\fR \fItype\fR:\fIhwaccel_device\fR were called immediately before. .IP "\fB\-hwaccels\fR" 4 .IX Item "-hwaccels" List all hardware acceleration components enabled in this build of ffmpeg. Actual runtime availability depends on the hardware and its suitable driver being installed. .IP "\fB\-fix_sub_duration_heartbeat[:\fR\fIstream_specifier\fR\fB]\fR" 4 .IX Item "-fix_sub_duration_heartbeat[:stream_specifier]" Set a specific output video stream as the heartbeat stream according to which to split and push through currently in-progress subtitle upon receipt of a random access packet. .Sp This lowers the latency of subtitles for which the end packet or the following subtitle has not yet been received. As a drawback, this will most likely lead to duplication of subtitle events in order to cover the full duration, so when dealing with use cases where latency of when the subtitle event is passed on to output is not relevant this option should not be utilized. .Sp Requires \fB\-fix_sub_duration\fR to be set for the relevant input subtitle stream for this to have any effect, as well as for the input subtitle stream having to be directly mapped to the same output in which the heartbeat stream resides. .SS "Audio Options" .IX Subsection "Audio Options" .IP "\fB\-aframes\fR \fInumber\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-aframes number (output)" Set the number of audio frames to output. This is an obsolete alias for \&\f(CW\*(C`\-frames:a\*(C'\fR, which you should use instead. .IP "\fB\-ar[:\fR\fIstream_specifier\fR\fB]\fR \fIfreq\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-ar[:stream_specifier] freq (input/output,per-stream)" Set the audio sampling frequency. For output streams it is set by default to the frequency of the corresponding input stream. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options. .IP "\fB\-aq\fR \fIq\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-aq q (output)" Set the audio quality (codec-specific, \s-1VBR\s0). This is an alias for \-q:a. .IP "\fB\-ac[:\fR\fIstream_specifier\fR\fB]\fR \fIchannels\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-ac[:stream_specifier] channels (input/output,per-stream)" Set the number of audio channels. For output streams it is set by default to the number of input audio channels. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options. .IP "\fB\-an (\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-an (input/output)" As an input option, blocks all audio streams of a file from being filtered or being automatically selected or mapped for any output. See \f(CW\*(C`\-discard\*(C'\fR option to disable streams individually. .Sp As an output option, disables audio recording i.e. automatic selection or mapping of any audio stream. For full manual control see the \f(CW\*(C`\-map\*(C'\fR option. .IP "\fB\-acodec\fR \fIcodec\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-acodec codec (input/output)" Set the audio codec. This is an alias for \f(CW\*(C`\-codec:a\*(C'\fR. .IP "\fB\-sample_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIsample_fmt\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-sample_fmt[:stream_specifier] sample_fmt (output,per-stream)" Set the audio sample format. Use \f(CW\*(C`\-sample_fmts\*(C'\fR to get a list of supported sample formats. .IP "\fB\-af\fR \fIfiltergraph\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-af filtergraph (output)" Create the filtergraph specified by \fIfiltergraph\fR and use it to filter the stream. .Sp This is an alias for \f(CW\*(C`\-filter:a\*(C'\fR, see the \fB\-filter option\fR. .SS "Advanced Audio options" .IX Subsection "Advanced Audio options" .IP "\fB\-atag\fR \fIfourcc/tag\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-atag fourcc/tag (output)" Force audio tag/fourcc. This is an alias for \f(CW\*(C`\-tag:a\*(C'\fR. .IP "\fB\-guess_layout_max\fR \fIchannels\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-guess_layout_max channels (input,per-stream)" If some input channel layout is not known, try to guess only if it corresponds to at most the specified number of channels. For example, 2 tells to \fBffmpeg\fR to recognize 1 channel as mono and 2 channels as stereo but not 6 channels as 5.1. The default is to always try to guess. Use 0 to disable all guessing. .SS "Subtitle options" .IX Subsection "Subtitle options" .IP "\fB\-scodec\fR \fIcodec\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-scodec codec (input/output)" Set the subtitle codec. This is an alias for \f(CW\*(C`\-codec:s\*(C'\fR. .IP "\fB\-sn (\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-sn (input/output)" As an input option, blocks all subtitle streams of a file from being filtered or being automatically selected or mapped for any output. See \f(CW\*(C`\-discard\*(C'\fR option to disable streams individually. .Sp As an output option, disables subtitle recording i.e. automatic selection or mapping of any subtitle stream. For full manual control see the \f(CW\*(C`\-map\*(C'\fR option. .SS "Advanced Subtitle options" .IX Subsection "Advanced Subtitle options" .IP "\fB\-fix_sub_duration\fR" 4 .IX Item "-fix_sub_duration" Fix subtitles durations. For each subtitle, wait for the next packet in the same stream and adjust the duration of the first to avoid overlap. This is necessary with some subtitles codecs, especially \s-1DVB\s0 subtitles, because the duration in the original packet is only a rough estimate and the end is actually marked by an empty subtitle frame. Failing to use this option when necessary can result in exaggerated durations or muxing failures due to non-monotonic timestamps. .Sp Note that this option will delay the output of all data until the next subtitle packet is decoded: it may increase memory consumption and latency a lot. .IP "\fB\-canvas_size\fR \fIsize\fR" 4 .IX Item "-canvas_size size" Set the size of the canvas used to render subtitles. .SS "Advanced options" .IX Subsection "Advanced options" .IP "\fB\-map [\-]\fR\fIinput_file_id\fR\fB[:\fR\fIstream_specifier\fR\fB][?] |\fR \fI[linklabel]\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-map [-]input_file_id[:stream_specifier][?] | [linklabel] (output)" Create one or more streams in the output file. This option has two forms for specifying the data source(s): the first selects one or more streams from some input file (specified with \f(CW\*(C`\-i\*(C'\fR), the second takes an output from some complex filtergraph (specified with \f(CW\*(C`\-filter_complex\*(C'\fR). .Sp In the first form, an output stream is created for every stream from the input file with the index \fIinput_file_id\fR. If \fIstream_specifier\fR is given, only those streams that match the specifier are used (see the \&\fBStream specifiers\fR section for the \fIstream_specifier\fR syntax). .Sp A \f(CW\*(C`\-\*(C'\fR character before the stream identifier creates a \*(L"negative\*(R" mapping. It disables matching streams from already created mappings. .Sp A trailing \f(CW\*(C`?\*(C'\fR after the stream index will allow the map to be optional: if the map matches no streams the map will be ignored instead of failing. Note the map will still fail if an invalid input file index is used; such as if the map refers to a non-existent input. .Sp An alternative \fI[linklabel]\fR form will map outputs from complex filter graphs (see the \fB\-filter_complex\fR option) to the output file. \&\fIlinklabel\fR must correspond to a defined output link label in the graph. .Sp This option may be specified multiple times, each adding more streams to the output file. Any given input stream may also be mapped any number of times as a source for different output streams, e.g. in order to use different encoding options and/or filters. The streams are created in the output in the same order in which the \f(CW\*(C`\-map\*(C'\fR options are given on the commandline. .Sp Using this option disables the default mappings for this output file. .Sp Examples: .RS 4 .IP "\fImap everything\fR" 4 .IX Item "map everything" To map \s-1ALL\s0 streams from the first input file to output .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0 output .Ve .IP "\fIselect specific stream\fR" 4 .IX Item "select specific stream" If you have two audio streams in the first input file, these streams are identified by \fI0:0\fR and \fI0:1\fR. You can use \f(CW\*(C`\-map\*(C'\fR to select which streams to place in an output file. For example: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:1 out.wav .Ve .Sp will map the second input stream in \fI\s-1INPUT\s0\fR to the (single) output stream in \fIout.wav\fR. .IP "\fIcreate multiple streams\fR" 4 .IX Item "create multiple streams" To select the stream with index 2 from input file \fIa.mov\fR (specified by the identifier \fI0:2\fR), and stream with index 6 from input \fIb.mov\fR (specified by the identifier \fI1:6\fR), and copy them to the output file \&\fIout.mov\fR: .Sp .Vb 1 \& ffmpeg \-i a.mov \-i b.mov \-c copy \-map 0:2 \-map 1:6 out.mov .Ve .IP "\fIcreate multiple streams 2\fR" 4 .IX Item "create multiple streams 2" To select all video and the third audio stream from an input file: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:v \-map 0:a:2 OUTPUT .Ve .IP "\fInegative map\fR" 4 .IX Item "negative map" To map all the streams except the second audio, use negative mappings .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0 \-map \-0:a:1 OUTPUT .Ve .IP "\fIoptional map\fR" 4 .IX Item "optional map" To map the video and audio streams from the first input, and using the trailing \f(CW\*(C`?\*(C'\fR, ignore the audio mapping if no audio streams exist in the first input: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:v \-map 0:a? OUTPUT .Ve .IP "\fImap by language\fR" 4 .IX Item "map by language" To pick the English audio stream: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:m:language:eng OUTPUT .Ve .RE .RS 4 .RE .IP "\fB\-ignore_unknown\fR" 4 .IX Item "-ignore_unknown" Ignore input streams with unknown type instead of failing if copying such streams is attempted. .IP "\fB\-copy_unknown\fR" 4 .IX Item "-copy_unknown" Allow input streams with unknown type to be copied instead of failing if copying such streams is attempted. .IP "\fB\-map_metadata[:\fR\fImetadata_spec_out\fR\fB]\fR \fIinfile\fR\fB[:\fR\fImetadata_spec_in\fR\fB] (\fR\fIoutput,per\-metadata\fR\fB)\fR" 4 .IX Item "-map_metadata[:metadata_spec_out] infile[:metadata_spec_in] (output,per-metadata)" Set metadata information of the next output file from \fIinfile\fR. Note that those are file indices (zero-based), not filenames. Optional \fImetadata_spec_in/out\fR parameters specify, which metadata to copy. A metadata specifier can have the following forms: .RS 4 .IP "\fIg\fR" 4 .IX Item "g" global metadata, i.e. metadata that applies to the whole file .IP "\fIs\fR\fB[:\fR\fIstream_spec\fR\fB]\fR" 4 .IX Item "s[:stream_spec]" per-stream metadata. \fIstream_spec\fR is a stream specifier as described in the \fBStream specifiers\fR chapter. In an input metadata specifier, the first matching stream is copied from. In an output metadata specifier, all matching streams are copied to. .IP "\fIc\fR\fB:\fR\fIchapter_index\fR" 4 .IX Item "c:chapter_index" per-chapter metadata. \fIchapter_index\fR is the zero-based chapter index. .IP "\fIp\fR\fB:\fR\fIprogram_index\fR" 4 .IX Item "p:program_index" per-program metadata. \fIprogram_index\fR is the zero-based program index. .RE .RS 4 .Sp If metadata specifier is omitted, it defaults to global. .Sp By default, global metadata is copied from the first input file, per-stream and per-chapter metadata is copied along with streams/chapters. These default mappings are disabled by creating any mapping of the relevant type. A negative file index can be used to create a dummy mapping that just disables automatic copying. .Sp For example to copy metadata from the first stream of the input file to global metadata of the output file: .Sp .Vb 1 \& ffmpeg \-i in.ogg \-map_metadata 0:s:0 out.mp3 .Ve .Sp To do the reverse, i.e. copy global metadata to all audio streams: .Sp .Vb 1 \& ffmpeg \-i in.mkv \-map_metadata:s:a 0:g out.mkv .Ve .Sp Note that simple \f(CW0\fR would work as well in this example, since global metadata is assumed by default. .RE .IP "\fB\-map_chapters\fR \fIinput_file_index\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-map_chapters input_file_index (output)" Copy chapters from input file with index \fIinput_file_index\fR to the next output file. If no chapter mapping is specified, then chapters are copied from the first input file with at least one chapter. Use a negative file index to disable any chapter copying. .IP "\fB\-benchmark (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-benchmark (global)" Show benchmarking information at the end of an encode. Shows real, system and user time used and maximum memory consumption. Maximum memory consumption is not supported on all systems, it will usually display as 0 if not supported. .IP "\fB\-benchmark_all (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-benchmark_all (global)" Show benchmarking information during the encode. Shows real, system and user time used in various steps (audio/video encode/decode). .IP "\fB\-timelimit\fR \fIduration\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-timelimit duration (global)" Exit after ffmpeg has been running for \fIduration\fR seconds in \s-1CPU\s0 user time. .IP "\fB\-dump (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-dump (global)" Dump each input packet to stderr. .IP "\fB\-hex (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-hex (global)" When dumping packets, also dump the payload. .IP "\fB\-readrate\fR \fIspeed\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "-readrate speed (input)" Limit input read speed. .Sp Its value is a floating-point positive number which represents the maximum duration of media, in seconds, that should be ingested in one second of wallclock time. Default value is zero and represents no imposed limitation on speed of ingestion. Value \f(CW1\fR represents real-time speed and is equivalent to \f(CW\*(C`\-re\*(C'\fR. .Sp Mainly used to simulate a capture device or live input stream (e.g. when reading from a file). Should not be used with a low value when input is an actual capture device or live stream as it may cause packet loss. .Sp It is useful for when flow speed of output packets is important, such as live streaming. .IP "\fB\-re (\fR\fIinput\fR\fB)\fR" 4 .IX Item "-re (input)" Read input at native frame rate. This is equivalent to setting \f(CW\*(C`\-readrate 1\*(C'\fR. .IP "\fB\-readrate_initial_burst\fR \fIseconds\fR" 4 .IX Item "-readrate_initial_burst seconds" Set an initial read burst time, in seconds, after which \fB\-re/\-readrate\fR will be enforced. .IP "\fB\-vsync\fR \fIparameter\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-vsync parameter (global)" .PD 0 .IP "\fB\-fps_mode[:\fR\fIstream_specifier\fR\fB]\fR \fIparameter\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-fps_mode[:stream_specifier] parameter (output,per-stream)" .PD Set video sync method / framerate mode. vsync is applied to all output video streams but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be removed in the future. .Sp For compatibility reasons some of the values for vsync can be specified as numbers (shown in parentheses in the following table). .RS 4 .IP "\fBpassthrough (0)\fR" 4 .IX Item "passthrough (0)" Each frame is passed with its timestamp from the demuxer to the muxer. .IP "\fBcfr (1)\fR" 4 .IX Item "cfr (1)" Frames will be duplicated and dropped to achieve exactly the requested constant frame rate. .IP "\fBvfr (2)\fR" 4 .IX Item "vfr (2)" Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp. .IP "\fBauto (\-1)\fR" 4 .IX Item "auto (-1)" Chooses between cfr and vfr depending on muxer capabilities. This is the default method. .RE .RS 4 .Sp Note that the timestamps may be further modified by the muxer, after this. For example, in the case that the format option \fBavoid_negative_ts\fR is enabled. .Sp With \-map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one. .RE .IP "\fB\-frame_drop_threshold\fR \fIparameter\fR" 4 .IX Item "-frame_drop_threshold parameter" Frame drop threshold, which specifies how much behind video frames can be before they are dropped. In frame rate units, so 1.0 is one frame. The default is \-1.1. One possible usecase is to avoid framedrops in case of noisy timestamps or to increase frame drop precision in case of exact timestamps. .IP "\fB\-apad\fR \fIparameters\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-apad parameters (output,per-stream)" Pad the output audio stream(s). This is the same as applying \f(CW\*(C`\-af apad\*(C'\fR. Argument is a string of filter parameters composed the same as with the \f(CW\*(C`apad\*(C'\fR filter. \&\f(CW\*(C`\-shortest\*(C'\fR must be set for this output for the option to take effect. .IP "\fB\-copyts\fR" 4 .IX Item "-copyts" Do not process input timestamps, but keep their values without trying to sanitize them. In particular, do not remove the initial start time offset value. .Sp Note that, depending on the \fBvsync\fR option or on specific muxer processing (e.g. in case the format option \fBavoid_negative_ts\fR is enabled) the output timestamps may mismatch with the input timestamps even when this option is selected. .IP "\fB\-start_at_zero\fR" 4 .IX Item "-start_at_zero" When used with \fBcopyts\fR, shift input timestamps so they start at zero. .Sp This means that using e.g. \f(CW\*(C`\-ss 50\*(C'\fR will make output timestamps start at 50 seconds, regardless of what timestamp the input file started at. .IP "\fB\-copytb\fR \fImode\fR" 4 .IX Item "-copytb mode" Specify how to set the encoder timebase when stream copying. \fImode\fR is an integer numeric value, and can assume one of the following values: .RS 4 .IP "\fB1\fR" 4 .IX Item "1" Use the demuxer timebase. .Sp The time base is copied to the output encoder from the corresponding input demuxer. This is sometimes required to avoid non monotonically increasing timestamps when copying video streams with variable frame rate. .IP "\fB0\fR" 4 .IX Item "0" Use the decoder timebase. .Sp The time base is copied to the output encoder from the corresponding input decoder. .IP "\fB\-1\fR" 4 .IX Item "-1" Try to make the choice automatically, in order to generate a sane output. .RE .RS 4 .Sp Default value is \-1. .RE .IP "\fB\-enc_time_base[:\fR\fIstream_specifier\fR\fB]\fR \fItimebase\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-enc_time_base[:stream_specifier] timebase (output,per-stream)" Set the encoder timebase. \fItimebase\fR can assume one of the following values: .RS 4 .IP "\fB0\fR" 4 .IX Item "0" Assign a default value according to the media type. .Sp For video \- use 1/framerate, for audio \- use 1/samplerate. .IP "\fBdemux\fR" 4 .IX Item "demux" Use the timebase from the demuxer. .IP "\fBfilter\fR" 4 .IX Item "filter" Use the timebase from the filtergraph. .IP "\fBa positive number\fR" 4 .IX Item "a positive number" Use the provided number as the timebase. .Sp This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000) or as a decimal number (e.g. 0.04166, 2.0833e\-5) .RE .RS 4 .Sp Default value is 0. .RE .IP "\fB\-bitexact (\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-bitexact (input/output)" Enable bitexact mode for (de)muxer and (de/en)coder .IP "\fB\-shortest (\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-shortest (output)" Finish encoding when the shortest output stream ends. .Sp Note that this option may require buffering frames, which introduces extra latency. The maximum amount of this latency may be controlled with the \&\f(CW\*(C`\-shortest_buf_duration\*(C'\fR option. .IP "\fB\-shortest_buf_duration\fR \fIduration\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-shortest_buf_duration duration (output)" The \f(CW\*(C`\-shortest\*(C'\fR option may require buffering potentially large amounts of data when at least one of the streams is \*(L"sparse\*(R" (i.e. has large gaps between frames X this is typically the case for subtitles). .Sp This option controls the maximum duration of buffered frames in seconds. Larger values may allow the \f(CW\*(C`\-shortest\*(C'\fR option to produce more accurate results, but increase memory use and latency. .Sp The default value is 10 seconds. .IP "\fB\-dts_delta_threshold\fR \fIthreshold\fR" 4 .IX Item "-dts_delta_threshold threshold" Timestamp discontinuity delta threshold, expressed as a decimal number of seconds. .Sp The timestamp discontinuity correction enabled by this option is only applied to input formats accepting timestamp discontinuity (for which the \f(CW\*(C`AVFMT_TS_DISCONT\*(C'\fR flag is enabled), e.g. MPEG-TS and \s-1HLS,\s0 and is automatically disabled when employing the \f(CW\*(C`\-copyts\*(C'\fR option (unless wrapping is detected). .Sp If a timestamp discontinuity is detected whose absolute value is greater than \fIthreshold\fR, ffmpeg will remove the discontinuity by decreasing/increasing the current \s-1DTS\s0 and \s-1PTS\s0 by the corresponding delta value. .Sp The default value is 10. .IP "\fB\-dts_error_threshold\fR \fIthreshold\fR" 4 .IX Item "-dts_error_threshold threshold" Timestamp error delta threshold, expressed as a decimal number of seconds. .Sp The timestamp correction enabled by this option is only applied to input formats not accepting timestamp discontinuity (for which the \&\f(CW\*(C`AVFMT_TS_DISCONT\*(C'\fR flag is not enabled). .Sp If a timestamp discontinuity is detected whose absolute value is greater than \fIthreshold\fR, ffmpeg will drop the \s-1PTS/DTS\s0 timestamp value. .Sp The default value is \f(CW\*(C`3600*30\*(C'\fR (30 hours), which is arbitrarily picked and quite conservative. .IP "\fB\-muxdelay\fR \fIseconds\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-muxdelay seconds (output)" Set the maximum demux-decode delay. .IP "\fB\-muxpreload\fR \fIseconds\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-muxpreload seconds (output)" Set the initial demux-decode delay. .IP "\fB\-streamid\fR \fIoutput-stream-index\fR\fB:\fR\fInew-value\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-streamid output-stream-index:new-value (output)" Assign a new stream-id value to an output stream. This option should be specified prior to the output filename to which it applies. For the situation where multiple output files exist, a streamid may be reassigned to a different value. .Sp For example, to set the stream 0 \s-1PID\s0 to 33 and the stream 1 \s-1PID\s0 to 36 for an output mpegts file: .Sp .Vb 1 \& ffmpeg \-i inurl \-streamid 0:33 \-streamid 1:36 out.ts .Ve .IP "\fB\-bsf[:\fR\fIstream_specifier\fR\fB]\fR \fIbitstream_filters\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-bsf[:stream_specifier] bitstream_filters (input/output,per-stream)" Apply bitstream filters to matching streams. The filters are applied to each packet as it is received from the demuxer (when used as an input option) or before it is sent to the muxer (when used as an output option). .Sp \&\fIbitstream_filters\fR is a comma-separated list of bitstream filter specifications, each of the form .Sp .Vb 1 \& [==:=:...] .Ve .Sp Any of the ',=:' characters that are to be a part of an option value need to be escaped with a backslash. .Sp Use the \f(CW\*(C`\-bsfs\*(C'\fR option to get the list of bitstream filters. .Sp E.g. .Sp .Vb 1 \& ffmpeg \-bsf:v h264_mp4toannexb \-i h264.mp4 \-c:v copy \-an out.h264 .Ve .Sp applies the \f(CW\*(C`h264_mp4toannexb\*(C'\fR bitstream filter (which converts MP4\-encapsulated H.264 stream to Annex B) to the \fIinput\fR video stream. .Sp On the other hand, .Sp .Vb 1 \& ffmpeg \-i file.mov \-an \-vn \-bsf:s mov2textsub \-c:s copy \-f rawvideo sub.txt .Ve .Sp applies the \f(CW\*(C`mov2textsub\*(C'\fR bitstream filter (which extracts text from \s-1MOV\s0 subtitles) to the \fIoutput\fR subtitle stream. Note, however, that since both examples use \f(CW\*(C`\-c copy\*(C'\fR, it matters little whether the filters are applied on input or output \- that would change if transcoding was happening. .IP "\fB\-tag[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec_tag\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-tag[:stream_specifier] codec_tag (input/output,per-stream)" Force a tag/fourcc for matching streams. .IP "\fB\-timecode\fR \fIhh\fR\fB:\fR\fImm\fR\fB:\fR\fIss\fR\fB\s-1SEP\s0\fR\fIff\fR" 4 .IX Item "-timecode hh:mm:ssSEPff" Specify Timecode for writing. \fI\s-1SEP\s0\fR is ':' for non drop timecode and ';' (or '.') for drop. .Sp .Vb 1 \& ffmpeg \-i input.mpg \-timecode 01:02:03.04 \-r 30000/1001 \-s ntsc output.mpg .Ve .IP "\fB\-filter_complex\fR \fIfiltergraph\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-filter_complex filtergraph (global)" Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or outputs. For simple graphs \*(-- those with one input and one output of the same type \*(-- see the \fB\-filter\fR options. \fIfiltergraph\fR is a description of the filtergraph, as described in the ``Filtergraph syntax'' section of the ffmpeg-filters manual. .Sp Input link labels must refer to either input streams or loopback decoders. For input streams, use the \f(CW\*(C`[file_index:stream_specifier]\*(C'\fR syntax (i.e. the same as \fB\-map\fR uses). If \fIstream_specifier\fR matches multiple streams, the first one will be used. .Sp For decoders, the link label must be [dec:\fIdec_idx\fR], where \fIdec_idx\fR is the index of the loopback decoder to be connected to given input. .Sp An unlabeled input will be connected to the first unused input stream of the matching type. .Sp Output link labels are referred to with \fB\-map\fR. Unlabeled outputs are added to the first output file. .Sp Note that with this option it is possible to use only lavfi sources without normal input files. .Sp For example, to overlay an image over video .Sp .Vb 2 \& ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aq[0:v][1:v]overlay[out]\*(Aq \-map \& \*(Aq[out]\*(Aq out.mkv .Ve .Sp Here \f(CW\*(C`[0:v]\*(C'\fR refers to the first video stream in the first input file, which is linked to the first (main) input of the overlay filter. Similarly the first video stream in the second input is linked to the second (overlay) input of overlay. .Sp Assuming there is only one video stream in each input file, we can omit input labels, so the above is equivalent to .Sp .Vb 2 \& ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aqoverlay[out]\*(Aq \-map \& \*(Aq[out]\*(Aq out.mkv .Ve .Sp Furthermore we can omit the output label and the single output from the filter graph will be added to the output file automatically, so we can simply write .Sp .Vb 1 \& ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aqoverlay\*(Aq out.mkv .Ve .Sp As a special exception, you can use a bitmap subtitle stream as input: it will be converted into a video with the same size as the largest video in the file, or 720x576 if no video is present. Note that this is an experimental and temporary solution. It will be removed once libavfilter has proper support for subtitles. .Sp For example, to hardcode subtitles on top of a DVB-T recording stored in MPEG-TS format, delaying the subtitles by 1 second: .Sp .Vb 3 \& ffmpeg \-i input.ts \-filter_complex \e \& \*(Aq[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay\*(Aq \e \& \-sn \-map \*(Aq#0x2dc\*(Aq output.mkv .Ve .Sp (0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video, audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too) .Sp To generate 5 seconds of pure red video using lavfi \f(CW\*(C`color\*(C'\fR source: .Sp .Vb 1 \& ffmpeg \-filter_complex \*(Aqcolor=c=red\*(Aq \-t 5 out.mkv .Ve .IP "\fB\-filter_complex_threads\fR \fInb_threads\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-filter_complex_threads nb_threads (global)" Defines how many threads are used to process a filter_complex graph. Similar to filter_threads but used for \f(CW\*(C`\-filter_complex\*(C'\fR graphs only. The default is the number of available CPUs. .IP "\fB\-lavfi\fR \fIfiltergraph\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-lavfi filtergraph (global)" Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or outputs. Equivalent to \fB\-filter_complex\fR. .IP "\fB\-accurate_seek (\fR\fIinput\fR\fB)\fR" 4 .IX Item "-accurate_seek (input)" This option enables or disables accurate seeking in input files with the \&\fB\-ss\fR option. It is enabled by default, so seeking is accurate when transcoding. Use \fB\-noaccurate_seek\fR to disable it, which may be useful e.g. when copying some streams and transcoding the others. .IP "\fB\-seek_timestamp (\fR\fIinput\fR\fB)\fR" 4 .IX Item "-seek_timestamp (input)" This option enables or disables seeking by timestamp in input files with the \&\fB\-ss\fR option. It is disabled by default. If enabled, the argument to the \fB\-ss\fR option is considered an actual timestamp, and is not offset by the start time of the file. This matters only for files which do not start from timestamp 0, such as transport streams. .IP "\fB\-thread_queue_size\fR \fIsize\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-thread_queue_size size (input/output)" For input, this option sets the maximum number of queued packets when reading from the file or device. With low latency / high rate live streams, packets may be discarded if they are not read in a timely manner; setting this value can force ffmpeg to use a separate input thread and read packets as soon as they arrive. By default ffmpeg only does this if multiple inputs are specified. .Sp For output, this option specified the maximum number of packets that may be queued to each muxing thread. .IP "\fB\-sdp_file\fR \fIfile\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-sdp_file file (global)" Print sdp information for an output stream to \fIfile\fR. This allows dumping sdp information when at least one output isn't an rtp stream. (Requires at least one of the output formats to be rtp). .IP "\fB\-discard (\fR\fIinput\fR\fB)\fR" 4 .IX Item "-discard (input)" Allows discarding specific streams or frames from streams. Any input stream can be fully discarded, using value \f(CW\*(C`all\*(C'\fR whereas selective discarding of frames from a stream occurs at the demuxer and is not supported by all demuxers. .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" Discard no frame. .IP "\fBdefault\fR" 4 .IX Item "default" Default, which discards no 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 .RE .IP "\fB\-abort_on\fR \fIflags\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-abort_on flags (global)" Stop and abort on various conditions. The following flags are available: .RS 4 .IP "\fBempty_output\fR" 4 .IX Item "empty_output" No packets were passed to the muxer, the output is empty. .IP "\fBempty_output_stream\fR" 4 .IX Item "empty_output_stream" No packets were passed to the muxer in some of the output streams. .RE .RS 4 .RE .IP "\fB\-max_error_rate (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-max_error_rate (global)" Set fraction of decoding frame failures across all inputs which when crossed ffmpeg will return exit code 69. Crossing this threshold does not terminate processing. Range is a floating-point number between 0 to 1. Default is 2/3. .IP "\fB\-xerror (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-xerror (global)" Stop and exit on error .IP "\fB\-max_muxing_queue_size\fR \fIpackets\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-max_muxing_queue_size packets (output,per-stream)" When transcoding audio and/or video streams, ffmpeg will not begin writing into the output until it has one packet for each such stream. While waiting for that to happen, packets for other streams are buffered. This option sets the size of this buffer, in packets, for the matching output stream. .Sp The default value of this option should be high enough for most uses, so only touch this option if you are sure that you need it. .IP "\fB\-muxing_queue_data_threshold\fR \fIbytes\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-muxing_queue_data_threshold bytes (output,per-stream)" This is a minimum threshold until which the muxing queue size is not taken into account. Defaults to 50 megabytes per stream, and is based on the overall size of packets passed to the muxer. .IP "\fB\-auto_conversion_filters (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-auto_conversion_filters (global)" Enable automatically inserting format conversion filters in all filter graphs, including those defined by \fB\-vf\fR, \fB\-af\fR, \&\fB\-filter_complex\fR and \fB\-lavfi\fR. If filter format negotiation requires a conversion, the initialization of the filters will fail. Conversions can still be performed by inserting the relevant conversion filter (scale, aresample) in the graph. On by default, to explicitly disable it you need to specify \&\f(CW\*(C`\-noauto_conversion_filters\*(C'\fR. .IP "\fB\-bits_per_raw_sample[:\fR\fIstream_specifier\fR\fB]\fR \fIvalue\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-bits_per_raw_sample[:stream_specifier] value (output,per-stream)" Declare the number of bits per raw sample in the given output stream to be \&\fIvalue\fR. Note that this option sets the information provided to the encoder/muxer, it does not change the stream to conform to this value. Setting values that do not match the stream properties may result in encoding failures or invalid output files. .IP "\fB\-stats_enc_pre[:\fR\fIstream_specifier\fR\fB]\fR \fIpath\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-stats_enc_pre[:stream_specifier] path (output,per-stream)" .PD 0 .IP "\fB\-stats_enc_post[:\fR\fIstream_specifier\fR\fB]\fR \fIpath\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-stats_enc_post[:stream_specifier] path (output,per-stream)" .IP "\fB\-stats_mux_pre[:\fR\fIstream_specifier\fR\fB]\fR \fIpath\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-stats_mux_pre[:stream_specifier] path (output,per-stream)" .PD Write per-frame encoding information about the matching streams into the file given by \fIpath\fR. .Sp \&\fB\-stats_enc_pre\fR writes information about raw video or audio frames right before they are sent for encoding, while \fB\-stats_enc_post\fR writes information about encoded packets as they are received from the encoder. \&\fB\-stats_mux_pre\fR writes information about packets just as they are about to be sent to the muxer. Every frame or packet produces one line in the specified file. The format of this line is controlled by \fB\-stats_enc_pre_fmt\fR / \&\fB\-stats_enc_post_fmt\fR / \fB\-stats_mux_pre_fmt\fR. .Sp When stats for multiple streams are written into a single file, the lines corresponding to different streams will be interleaved. The precise order of this interleaving is not specified and not guaranteed to remain stable between different invocations of the program, even with the same options. .IP "\fB\-stats_enc_pre_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIformat_spec\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-stats_enc_pre_fmt[:stream_specifier] format_spec (output,per-stream)" .PD 0 .IP "\fB\-stats_enc_post_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIformat_spec\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-stats_enc_post_fmt[:stream_specifier] format_spec (output,per-stream)" .IP "\fB\-stats_mux_pre_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIformat_spec\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-stats_mux_pre_fmt[:stream_specifier] format_spec (output,per-stream)" .PD Specify the format for the lines written with \fB\-stats_enc_pre\fR / \&\fB\-stats_enc_post\fR / \fB\-stats_mux_pre\fR. .Sp \&\fIformat_spec\fR is a string that may contain directives of the form \&\fI{fmt}\fR. \fIformat_spec\fR is backslash-escaped \-\-\- use \e{, \e}, and \e\e to write a literal {, }, or \e, respectively, into the output. .Sp The directives given with \fIfmt\fR may be one of the following: .RS 4 .IP "\fBfidx\fR" 4 .IX Item "fidx" Index of the output file. .IP "\fBsidx\fR" 4 .IX Item "sidx" Index of the output stream in the file. .IP "\fBn\fR" 4 .IX Item "n" Frame number. Pre-encoding: number of frames sent to the encoder so far. Post-encoding: number of packets received from the encoder so far. Muxing: number of packets submitted to the muxer for this stream so far. .IP "\fBni\fR" 4 .IX Item "ni" Input frame number. Index of the input frame (i.e. output by a decoder) that corresponds to this output frame or packet. \-1 if unavailable. .IP "\fBtb\fR" 4 .IX Item "tb" Timebase in which this frame/packet's timestamps are expressed, as a rational number \fInum/den\fR. Note that encoder and muxer may use different timebases. .IP "\fBtbi\fR" 4 .IX Item "tbi" Timebase for \fIptsi\fR, as a rational number \fInum/den\fR. Available when \&\fIptsi\fR is available, \fI0/1\fR otherwise. .IP "\fBpts\fR" 4 .IX Item "pts" Presentation timestamp of the frame or packet, as an integer. Should be multiplied by the timebase to compute presentation time. .IP "\fBptsi\fR" 4 .IX Item "ptsi" Presentation timestamp of the input frame (see \fIni\fR), as an integer. Should be multiplied by \fItbi\fR to compute presentation time. Printed as (2^63 \- 1 = 9223372036854775807) when not available. .IP "\fBt\fR" 4 .IX Item "t" Presentation time of the frame or packet, as a decimal number. Equal to \&\fIpts\fR multiplied by \fItb\fR. .IP "\fBti\fR" 4 .IX Item "ti" Presentation time of the input frame (see \fIni\fR), as a decimal number. Equal to \fIptsi\fR multiplied by \fItbi\fR. Printed as inf when not available. .IP "\fBdts (\fR\fIpacket\fR\fB)\fR" 4 .IX Item "dts (packet)" Decoding timestamp of the packet, as an integer. Should be multiplied by the timebase to compute presentation time. .IP "\fBdt (\fR\fIpacket\fR\fB)\fR" 4 .IX Item "dt (packet)" Decoding time of the frame or packet, as a decimal number. Equal to \&\fIdts\fR multiplied by \fItb\fR. .IP "\fBsn (\fR\fIframe,audio\fR\fB)\fR" 4 .IX Item "sn (frame,audio)" Number of audio samples sent to the encoder so far. .IP "\fBsamp (\fR\fIframe,audio\fR\fB)\fR" 4 .IX Item "samp (frame,audio)" Number of audio samples in the frame. .IP "\fBsize (\fR\fIpacket\fR\fB)\fR" 4 .IX Item "size (packet)" Size of the encoded packet in bytes. .IP "\fBbr (\fR\fIpacket\fR\fB)\fR" 4 .IX Item "br (packet)" Current bitrate in bits per second. .IP "\fBabr (\fR\fIpacket\fR\fB)\fR" 4 .IX Item "abr (packet)" Average bitrate for the whole stream so far, in bits per second, \-1 if it cannot be determined at this point. .IP "\fBkey (\fR\fIpacket\fR\fB)\fR" 4 .IX Item "key (packet)" Character 'K' if the packet contains a keyframe, character 'N' otherwise. .RE .RS 4 .Sp Directives tagged with \fIpacket\fR may only be used with \&\fB\-stats_enc_post_fmt\fR and \fB\-stats_mux_pre_fmt\fR. .Sp Directives tagged with \fIframe\fR may only be used with \&\fB\-stats_enc_pre_fmt\fR. .Sp Directives tagged with \fIaudio\fR may only be used with audio streams. .Sp The default format strings are: .IP "\fBpre-encoding\fR" 4 .IX Item "pre-encoding" {fidx} {sidx} {n} {t} .IP "\fBpost-encoding\fR" 4 .IX Item "post-encoding" {fidx} {sidx} {n} {t} .RE .RS 4 .Sp In the future, new items may be added to the end of the default formatting strings. Users who depend on the format staying exactly the same, should prescribe it manually. .Sp Note that stats for different streams written into the same file may have different formats. .RE .SS "Preset files" .IX Subsection "Preset files" A preset file contains a sequence of \fIoption\fR=\fIvalue\fR pairs, one for each line, specifying a sequence of options which would be awkward to specify on the command line. Lines starting with the hash ('#') character are ignored and are used to provide comments. Check the \fIpresets\fR directory in the FFmpeg source tree for examples. .PP There are two types of preset files: ffpreset and avpreset files. .PP \fIffpreset files\fR .IX Subsection "ffpreset files" .PP ffpreset files are specified with the \f(CW\*(C`vpre\*(C'\fR, \f(CW\*(C`apre\*(C'\fR, \&\f(CW\*(C`spre\*(C'\fR, and \f(CW\*(C`fpre\*(C'\fR options. The \f(CW\*(C`fpre\*(C'\fR option takes the filename of the preset instead of a preset name as input and can be used for any kind of codec. For the \f(CW\*(C`vpre\*(C'\fR, \f(CW\*(C`apre\*(C'\fR, and \&\f(CW\*(C`spre\*(C'\fR options, the options specified in a preset file are applied to the currently selected codec of the same type as the preset option. .PP The argument passed to the \f(CW\*(C`vpre\*(C'\fR, \f(CW\*(C`apre\*(C'\fR, and \f(CW\*(C`spre\*(C'\fR preset options identifies the preset file to use according to the following rules: .PP First ffmpeg searches for a file named \fIarg\fR.ffpreset in the directories \fI\f(CI$FFMPEG_DATADIR\fI\fR (if set), and \fI\f(CI$HOME\fI/.ffmpeg\fR, and in the datadir defined at configuration time (usually \fIPREFIX/share/ffmpeg\fR) or in a \fIffpresets\fR folder along the executable on win32, in that order. For example, if the argument is \f(CW\*(C`libvpx\-1080p\*(C'\fR, it will search for the file \fIlibvpx\-1080p.ffpreset\fR. .PP If no such file is found, then ffmpeg will search for a file named \&\fIcodec_name\fR\-\fIarg\fR.ffpreset in the above-mentioned directories, where \fIcodec_name\fR is the name of the codec to which the preset file options will be applied. For example, if you select the video codec with \f(CW\*(C`\-vcodec libvpx\*(C'\fR and use \f(CW\*(C`\-vpre 1080p\*(C'\fR, then it will search for the file \fIlibvpx\-1080p.ffpreset\fR. .PP \fIavpreset files\fR .IX Subsection "avpreset files" .PP avpreset files are specified with the \f(CW\*(C`pre\*(C'\fR option. They work similar to ffpreset files, but they only allow encoder\- specific options. Therefore, an \&\fIoption\fR=\fIvalue\fR pair specifying an encoder cannot be used. .PP When the \f(CW\*(C`pre\*(C'\fR option is specified, ffmpeg will look for files with the suffix .avpreset in the directories \fI\f(CI$AVCONV_DATADIR\fI\fR (if set), and \&\fI\f(CI$HOME\fI/.avconv\fR, and in the datadir defined at configuration time (usually \&\fIPREFIX/share/ffmpeg\fR), in that order. .PP First ffmpeg searches for a file named \fIcodec_name\fR\-\fIarg\fR.avpreset in the above-mentioned directories, where \fIcodec_name\fR is the name of the codec to which the preset file options will be applied. For example, if you select the video codec with \f(CW\*(C`\-vcodec libvpx\*(C'\fR and use \f(CW\*(C`\-pre 1080p\*(C'\fR, then it will search for the file \fIlibvpx\-1080p.avpreset\fR. .PP If no such file is found, then ffmpeg will search for a file named \&\fIarg\fR.avpreset in the same directories. .SS "vstats file format" .IX Subsection "vstats file format" The \f(CW\*(C`\-vstats\*(C'\fR and \f(CW\*(C`\-vstats_file\*(C'\fR options enable generation of a file containing statistics about the generated video outputs. .PP The \f(CW\*(C`\-vstats_version\*(C'\fR option controls the format version of the generated file. .PP With version \f(CW1\fR the format is: .PP .Vb 1 \& frame= q= PSNR= f_size= s_size= kB time= br= kbits/s avg_br= kbits/s .Ve .PP With version \f(CW2\fR the format is: .PP .Vb 1 \& out= st= frame= q= f PSNR= f_size= s_size= kB time= br= kbits/s avg_br= kbits/s .Ve .PP The value corresponding to each key is described below: .IP "\fBavg_br\fR" 4 .IX Item "avg_br" average bitrate expressed in Kbits/s .IP "\fBbr\fR" 4 .IX Item "br" bitrate expressed in Kbits/s .IP "\fBframe\fR" 4 .IX Item "frame" number of encoded frame .IP "\fBout\fR" 4 .IX Item "out" out file index .IP "\fB\s-1PSNR\s0\fR" 4 .IX Item "PSNR" Peak Signal to Noise Ratio .IP "\fBq\fR" 4 .IX Item "q" quality of the frame .IP "\fBf_size\fR" 4 .IX Item "f_size" encoded packet size expressed as number of bytes .IP "\fBs_size\fR" 4 .IX Item "s_size" stream size expressed in KiB .IP "\fBst\fR" 4 .IX Item "st" out file stream index .IP "\fBtime\fR" 4 .IX Item "time" time of the packet .IP "\fBtype\fR" 4 .IX Item "type" picture type .PP See also the \fB\-stats_enc options\fR for an alternative way to show encoding statistics. .SH "EXAMPLES" .IX Header "EXAMPLES" .SS "Video and Audio grabbing" .IX Subsection "Video and Audio grabbing" If you specify the input format and device then ffmpeg can grab video and audio directly. .PP .Vb 1 \& ffmpeg \-f oss \-i /dev/dsp \-f video4linux2 \-i /dev/video0 /tmp/out.mpg .Ve .PP Or with an \s-1ALSA\s0 audio source (mono input, card id 1) instead of \s-1OSS:\s0 .PP .Vb 1 \& ffmpeg \-f alsa \-ac 1 \-i hw:1 \-f video4linux2 \-i /dev/video0 /tmp/out.mpg .Ve .PP Note that you must activate the right video source and channel before launching ffmpeg with any \s-1TV\s0 viewer such as <\fBhttp://linux.bytesex.org/xawtv/\fR> by Gerd Knorr. You also have to set the audio recording levels correctly with a standard mixer. .SS "X11 grabbing" .IX Subsection "X11 grabbing" Grab the X11 display with ffmpeg via .PP .Vb 1 \& ffmpeg \-f x11grab \-video_size cif \-framerate 25 \-i :0.0 /tmp/out.mpg .Ve .PP 0.0 is display.screen number of your X11 server, same as the \s-1DISPLAY\s0 environment variable. .PP .Vb 1 \& ffmpeg \-f x11grab \-video_size cif \-framerate 25 \-i :0.0+10,20 /tmp/out.mpg .Ve .PP 0.0 is display.screen number of your X11 server, same as the \s-1DISPLAY\s0 environment variable. 10 is the x\-offset and 20 the y\-offset for the grabbing. .SS "Video and Audio file format conversion" .IX Subsection "Video and Audio file format conversion" Any supported file format and protocol can serve as input to ffmpeg: .PP Examples: .IP "\(bu" 4 You can use \s-1YUV\s0 files as input: .Sp .Vb 1 \& ffmpeg \-i /tmp/test%d.Y /tmp/out.mpg .Ve .Sp It will use the files: .Sp .Vb 2 \& /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V, \& /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc... .Ve .Sp The Y files use twice the resolution of the U and V files. They are raw files, without header. They can be generated by all decent video decoders. You must specify the size of the image with the \fB\-s\fR option if ffmpeg cannot guess it. .IP "\(bu" 4 You can input from a raw \s-1YUV420P\s0 file: .Sp .Vb 1 \& ffmpeg \-i /tmp/test.yuv /tmp/out.avi .Ve .Sp test.yuv is a file containing raw \s-1YUV\s0 planar data. Each frame is composed of the Y plane followed by the U and V planes at half vertical and horizontal resolution. .IP "\(bu" 4 You can output to a raw \s-1YUV420P\s0 file: .Sp .Vb 1 \& ffmpeg \-i mydivx.avi hugefile.yuv .Ve .IP "\(bu" 4 You can set several input files and output files: .Sp .Vb 1 \& ffmpeg \-i /tmp/a.wav \-s 640x480 \-i /tmp/a.yuv /tmp/a.mpg .Ve .Sp Converts the audio file a.wav and the raw \s-1YUV\s0 video file a.yuv to \s-1MPEG\s0 file a.mpg. .IP "\(bu" 4 You can also do audio and video conversions at the same time: .Sp .Vb 1 \& ffmpeg \-i /tmp/a.wav \-ar 22050 /tmp/a.mp2 .Ve .Sp Converts a.wav to \s-1MPEG\s0 audio at 22050 Hz sample rate. .IP "\(bu" 4 You can encode to several formats at the same time and define a mapping from input stream to output streams: .Sp .Vb 1 \& ffmpeg \-i /tmp/a.wav \-map 0:a \-b:a 64k /tmp/a.mp2 \-map 0:a \-b:a 128k /tmp/b.mp2 .Ve .Sp Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '\-map file:index' specifies which input stream is used for each output stream, in the order of the definition of output streams. .IP "\(bu" 4 You can transcode decrypted VOBs: .Sp .Vb 1 \& ffmpeg \-i snatch_1.vob \-f avi \-c:v mpeg4 \-b:v 800k \-g 300 \-bf 2 \-c:a libmp3lame \-b:a 128k snatch.avi .Ve .Sp This is a typical \s-1DVD\s0 ripping example; the input is a \s-1VOB\s0 file, the output an \s-1AVI\s0 file with \s-1MPEG\-4\s0 video and \s-1MP3\s0 audio. Note that in this command we use B\-frames so the \s-1MPEG\-4\s0 stream is DivX5 compatible, and \&\s-1GOP\s0 size is 300 which means one intra frame every 10 seconds for 29.97fps input video. Furthermore, the audio stream is MP3\-encoded so you need to enable \s-1LAME\s0 support by passing \f(CW\*(C`\-\-enable\-libmp3lame\*(C'\fR to configure. The mapping is particularly useful for \s-1DVD\s0 transcoding to get the desired audio language. .Sp \&\s-1NOTE:\s0 To see the supported input formats, use \f(CW\*(C`ffmpeg \-demuxers\*(C'\fR. .IP "\(bu" 4 You can extract images from a video, or create a video from many images: .Sp For extracting images from a video: .Sp .Vb 1 \& ffmpeg \-i foo.avi \-r 1 \-s WxH \-f image2 foo\-%03d.jpeg .Ve .Sp This will extract one video frame per second from the video and will output them in files named \fIfoo\-001.jpeg\fR, \fIfoo\-002.jpeg\fR, etc. Images will be rescaled to fit the new WxH values. .Sp If you want to extract just a limited number of frames, you can use the above command in combination with the \f(CW\*(C`\-frames:v\*(C'\fR or \f(CW\*(C`\-t\*(C'\fR option, or in combination with \-ss to start extracting from a certain point in time. .Sp For creating a video from many images: .Sp .Vb 1 \& ffmpeg \-f image2 \-framerate 12 \-i foo\-%03d.jpeg \-s WxH foo.avi .Ve .Sp The syntax \f(CW\*(C`foo\-%03d.jpeg\*(C'\fR specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable. .Sp When importing an image sequence, \-i also supports expanding shell-like wildcard patterns (globbing) internally, by selecting the image2\-specific \f(CW\*(C`\-pattern_type glob\*(C'\fR option. .Sp For example, for creating a video from filenames matching the glob pattern \&\f(CW\*(C`foo\-*.jpeg\*(C'\fR: .Sp .Vb 1 \& ffmpeg \-f image2 \-pattern_type glob \-framerate 12 \-i \*(Aqfoo\-*.jpeg\*(Aq \-s WxH foo.avi .Ve .IP "\(bu" 4 You can put many streams of the same type in the output: .Sp .Vb 1 \& ffmpeg \-i test1.avi \-i test2.avi \-map 1:1 \-map 1:0 \-map 0:1 \-map 0:0 \-c copy \-y test12.nut .Ve .Sp The resulting output file \fItest12.nut\fR will contain the first four streams from the input files in reverse order. .IP "\(bu" 4 To force \s-1CBR\s0 video output: .Sp .Vb 1 \& ffmpeg \-i myfile.avi \-b 4000k \-minrate 4000k \-maxrate 4000k \-bufsize 1835k out.m2v .Ve .IP "\(bu" 4 The four options lmin, lmax, mblmin and mblmax use 'lambda' units, but you may use the \s-1QP2LAMBDA\s0 constant to easily convert from 'q' units: .Sp .Vb 1 \& ffmpeg \-i src.ext \-lmax 21*QP2LAMBDA dst.ext .Ve .SH "SYNTAX" .IX Header "SYNTAX" This section documents the syntax and formats employed by the FFmpeg libraries and tools. .SS "Quoting and escaping" .IX Subsection "Quoting and escaping" FFmpeg adopts the following quoting and escaping mechanism, unless explicitly specified. The following rules are applied: .IP "\(bu" 4 \&\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 \& [\-]+[....][s|ms|us] .Ve .PP \&\fIS\fR expresses the number of seconds, with the optional decimal part \&\fIm\fR. The optional literal suffixes \fBs\fR, \fBms\fR or \fBus\fR indicate to interpret the value as seconds, milliseconds or microseconds, respectively. .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 "\fB0.2\fR" 4 .IX Item "0.2" 0.2 seconds .IP "\fB200ms\fR" 4 .IX Item "200ms" 200 milliseconds, that's 0.2s .IP "\fB200000us\fR" 4 .IX Item "200000us" 200000 microseconds, that's 0.2s .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 "\fB3.1.2\fR" 4 .IX Item "3.1.2" \&\s-1FL+FR+FC+LFE+TFL+TFR\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 "\fB5.1.2\fR" 4 .IX Item "5.1.2" \&\s-1FL+FR+FC+LFE+BL+BR+TFL+TFR\s0 .IP "\fBoctagonal\fR" 4 .IX Item "octagonal" \&\s-1FL+FR+FC+BL+BR+BC+SL+SR\s0 .IP "\fBcube\fR" 4 .IX Item "cube" \&\s-1FL+FR+BL+BR+TFL+TFR+TBL+TBR\s0 .IP "\fB5.1.4\fR" 4 .IX Item "5.1.4" \&\s-1FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR\s0 .IP "\fB7.1.2\fR" 4 .IX Item "7.1.2" \&\s-1FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR\s0 .IP "\fB7.1.4\fR" 4 .IX Item "7.1.4" \&\s-1FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR\s0 .IP "\fB7.2.3\fR" 4 .IX Item "7.2.3" \&\s-1FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2\s0 .IP "\fB9.1.4\fR" 4 .IX Item "9.1.4" \&\s-1FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR\s0 .IP "\fBhexadecagonal\fR" 4 .IX Item "hexadecagonal" \&\s-1FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR\s0 .IP "\fBdownmix\fR" 4 .IX Item "downmix" \&\s-1DL+DR\s0 .IP "\fB22.2\fR" 4 .IX Item "22.2" \&\s-1FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR\s0 .PP A custom channel layout can be specified as a sequence of terms, separated by '+'. Each term can be: .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.), each optionally containing a custom name after a '@', (e.g. \fBFL@Left\fR, \&\fBFR@Right\fR, \fBFC@Center\fR, \fBLFE@Low_Frequency\fR, etc.) .PP A standard channel layout can be specified by the following: .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 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 a number of channels, in decimal, followed by 'c', yielding the default channel layout for that number of channels (see the function \&\f(CW\*(C`av_channel_layout_default\*(C'\fR). Note that not all channel counts have a default layout. .IP "\(bu" 4 a number of channels, in decimal, followed by 'C', yielding an unknown channel layout with the specified number of channels. Note that not all channel layout specification strings support unknown channel layouts. .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 Before libavutil version 53 the trailing character \*(L"c\*(R" to specify a number of channels was optional, but now it is required, while a channel layout mask can also be specified as a decimal number (if and only if not followed by \*(L"c\*(R" or \*(L"C\*(R"). .PP See also the function \f(CW\*(C`av_channel_layout_from_string\*(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 "\fBatan2(y, x)\fR" 4 .IX Item "atan2(y, x)" Compute principal value of the arc tangent of \fIy\fR/\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 "\fBlerp(x, y, z)\fR" 4 .IX Item "lerp(x, y, z)" Return linear interpolation between \fIx\fR and \fIy\fR by amount of \fIz\fR. .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(idx)\fR" 4 .IX Item "random(idx)" Return a pseudo random value between 0.0 and 1.0. \fIidx\fR is the index of the internal variable which will be used to save the seed/state. .IP "\fBrandomi(idx, min, max)\fR" 4 .IX Item "randomi(idx, min, max)" Return a pseudo random value in the interval between \fImin\fR and \&\fImax\fR. \fIidx\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\f(BIld\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\f(BIld\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 "\fBround(expr)\fR" 4 .IX Item "round(expr)" Round the value of expression \fIexpr\fR to the nearest integer. For example, \*(L"round(1.5)\*(R" is \*(L"2.0\*(R". .IP "\fBsgn(x)\fR" 4 .IX Item "sgn(x)" Compute sign of \fIx\fR. .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\fBtime\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" \&\fBexp\fR\|(1) (Euler's number), approximately 2.718 .IP "\fB\s-1PHI\s0\fR" 4 .IX Item "PHI" golden ratio (1+\fBsqrt\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^50 .IP "\fBE\fR" 4 .IX Item "E" 10^18 / 2^60 .IP "\fBZ\fR" 4 .IX Item "Z" 10^21 / 2^70 .IP "\fBY\fR" 4 .IX Item "Y" 10^24 / 2^80 .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 "\fBpass1\fR" 4 .IX Item "pass1" 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 "\fBpsnr\fR" 4 .IX Item "psnr" Set error[?] variables during encoding. .IP "\fBtruncated\fR" 4 .IX Item "truncated" Input bitstream might be randomly truncated. .IP "\fBdrop_changed\fR" 4 .IX Item "drop_changed" Don't output frames whose parameters differ from first decoded frame in stream. Error \s-1AVERROR_INPUT_CHANGED\s0 is returned when a frame is dropped. .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 "\fBilme\fR" 4 .IX Item "ilme" Apply interlaced motion estimation. .IP "\fBcgop\fR" 4 .IX Item "cgop" Use closed gop. .IP "\fBoutput_corrupt\fR" 4 .IX Item "output_corrupt" Output even potentially corrupted frames. .RE .RS 4 .RE .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. (Supported only by selected encoders, see their respective documentation sections.) .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 "\fBcodec_tag\fR \fIinteger\fR" 4 .IX Item "codec_tag integer" .PD 0 .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 "\fBxvid_ilace\fR" 4 .IX Item "xvid_ilace" .PD 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 "\fBqpel_chroma\fR" 4 .IX Item "qpel_chroma" .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 "\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 "\fBrc_override_count\fR \fIinteger\fR" 4 .IX Item "rc_override_count integer" .IP "\fBmaxrate\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "maxrate integer (encoding,audio,video)" .PD 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 "\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 "\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 "\fBxvid\fR" 4 .IX Item "xvid" .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 "\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 "\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 "\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 "\fBbuffers\fR" 4 .IX Item "buffers" .PD 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 "\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. .RS 4 .IP "\fB(1024, \s-1INT_MAX\s0)\fR" 4 .IX Item "(1024, INT_MAX)" full motion estimation(slowest) .IP "\fB(768, 1024]\fR" 4 .IX Item "(768, 1024]" umh motion estimation .IP "\fB(512, 768]\fR" 4 .IX Item "(512, 768]" hex motion estimation .IP "\fB(256, 512]\fR" 4 .IX Item "(256, 512]" l2s diamond motion estimation .IP "\fB[2,256]\fR" 4 .IX Item "[2,256]" var diamond motion estimation .IP "\fB(\-1, 2)\fR" 4 .IX Item "(-1, 2)" small diamond motion estimation .IP "\fB\-1\fR" 4 .IX Item "-1" funny diamond motion estimation .IP "\fB(\s-1INT_MIN,\s0 \-1)\fR" 4 .IX Item "(INT_MIN, -1)" sab diamond motion estimation .RE .RS 4 .RE .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 "\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 "\fBme_range\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "me_range integer (encoding,video)" Set limit motion vectors range (1023 for DivX player). .IP "\fBglobal_quality\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "global_quality integer (encoding,audio,video)" .PD 0 .IP "\fBslice_flags\fR \fIinteger\fR" 4 .IX Item "slice_flags 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 "\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,subtitles\fR\fB)\fR" 4 .IX Item "flags2 flags (decoding/encoding,audio,video,subtitles)" Possible values: .RS 4 .IP "\fBfast\fR" 4 .IX Item "fast" Allow non spec compliant speedup tricks. .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 "\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. .IP "\fBskip_manual\fR" 4 .IX Item "skip_manual" Do not skip samples and export skip information as frame side data. .IP "\fBass_ro_flush_noop\fR" 4 .IX Item "ass_ro_flush_noop" Do not reset \s-1ASS\s0 ReadOrder field on flush. .IP "\fBicc_profiles\fR" 4 .IX Item "icc_profiles" Generate/parse embedded \s-1ICC\s0 profiles from/to colorimetry tags. .RE .RS 4 .RE .IP "\fBexport_side_data\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video,subtitles\fR\fB)\fR" 4 .IX Item "export_side_data flags (decoding/encoding,audio,video,subtitles)" Possible values: .RS 4 .IP "\fBmvs\fR" 4 .IX Item "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. .IP "\fBprft\fR" 4 .IX Item "prft" Export encoder Producer Reference Time into packet side-data (see \f(CW\*(C`AV_PKT_DATA_PRFT\*(C'\fR) for codecs that support it. .IP "\fBvenc_params\fR" 4 .IX Item "venc_params" Export video encoding parameters through frame side data (see \f(CW\*(C`AV_FRAME_DATA_VIDEO_ENC_PARAMS\*(C'\fR) for codecs that support it. At present, those are H.264 and \s-1VP9.\s0 .IP "\fBfilm_grain\fR" 4 .IX Item "film_grain" Export film grain parameters through frame side data (see \f(CW\*(C`AV_FRAME_DATA_FILM_GRAIN_PARAMS\*(C'\fR). Supported at present by \s-1AV1\s0 decoders. .RE .RS 4 .RE .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 "\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)" Set encoder codec profile. Default value is \fBunknown\fR. Encoder specific profiles are documented in the relevant encoder documentation. .IP "\fBlevel\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "level integer (encoding,audio,video)" Set the encoder level. This level depends on the specific codec, and might correspond to the profile level. It is set by default to \&\fBunknown\fR. .Sp 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 "\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 "\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 "\fBnointra\fR" 4 .IX Item "nointra" Discard all frames except I frames. .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 "\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 "\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 "\fBmv0_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mv0_threshold integer (encoding,video)" .PD 0 .IP "\fBcompression_level\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "compression_level integer (encoding,audio,video)" .IP "\fBbits_per_raw_sample\fR \fIinteger\fR" 4 .IX Item "bits_per_raw_sample integer" .IP "\fBchannel_layout\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4 .IX Item "channel_layout integer (decoding/encoding,audio)" .PD See \fBthe Channel Layout section in the \fBffmpeg\-utils\fB\|(1) manual\fR for the required syntax. .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 "\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\fR" 4 .IX Item "smpte428" .PD 0 .IP "\fBsmpte428_1\fR" 4 .IX Item "smpte428_1" .PD \&\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 .IP "\fBjedec\-p22\fR" 4 .IX Item "jedec-p22" \&\s-1JEDEC P22\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" .PD 0 .IP "\fBlog100\fR" 4 .IX Item "log100" .PD Log .IP "\fBlog_sqrt\fR" 4 .IX Item "log_sqrt" .PD 0 .IP "\fBlog316\fR" 4 .IX Item "log316" .PD Log square root .IP "\fBiec61966_2_4\fR" 4 .IX Item "iec61966_2_4" .PD 0 .IP "\fBiec61966\-2\-4\fR" 4 .IX Item "iec61966-2-4" .PD \&\s-1IEC 61966\-2\-4\s0 .IP "\fBbt1361\fR" 4 .IX Item "bt1361" .PD 0 .IP "\fBbt1361e\fR" 4 .IX Item "bt1361e" .PD \&\s-1BT.1361\s0 .IP "\fBiec61966_2_1\fR" 4 .IX Item "iec61966_2_1" .PD 0 .IP "\fBiec61966\-2\-1\fR" 4 .IX Item "iec61966-2-1" .PD \&\s-1IEC 61966\-2\-1\s0 .IP "\fBbt2020_10\fR" 4 .IX Item "bt2020_10" .PD 0 .IP "\fBbt2020_10bit\fR" 4 .IX Item "bt2020_10bit" .PD \&\s-1BT.2020\s0 \- 10 bit .IP "\fBbt2020_12\fR" 4 .IX Item "bt2020_12" .PD 0 .IP "\fBbt2020_12bit\fR" 4 .IX Item "bt2020_12bit" .PD \&\s-1BT.2020\s0 \- 12 bit .IP "\fBsmpte2084\fR" 4 .IX Item "smpte2084" \&\s-1SMPTE ST 2084\s0 .IP "\fBsmpte428\fR" 4 .IX Item "smpte428" .PD 0 .IP "\fBsmpte428_1\fR" 4 .IX Item "smpte428_1" .PD \&\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 "\fBbt2020nc\fR" 4 .IX Item "bt2020nc" .PD 0 .IP "\fBbt2020_ncl\fR" 4 .IX Item "bt2020_ncl" .PD \&\s-1BT.2020 NCL\s0 .IP "\fBbt2020c\fR" 4 .IX Item "bt2020c" .PD 0 .IP "\fBbt2020_cl\fR" 4 .IX Item "bt2020_cl" .PD \&\s-1BT.2020 CL\s0 .IP "\fBsmpte2085\fR" 4 .IX Item "smpte2085" \&\s-1SMPTE 2085\s0 .IP "\fBchroma-derived-nc\fR" 4 .IX Item "chroma-derived-nc" Chroma-derived \s-1NCL\s0 .IP "\fBchroma-derived-c\fR" 4 .IX Item "chroma-derived-c" Chroma-derived \s-1CL\s0 .IP "\fBictcp\fR" 4 .IX Item "ictcp" ICtCp .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. Possible values: .RS 4 .IP "\fBtv\fR" 4 .IX Item "tv" .PD 0 .IP "\fBmpeg\fR" 4 .IX Item "mpeg" .IP "\fBlimited\fR" 4 .IX Item "limited" .PD \&\s-1MPEG\s0 (219*2^(n\-8)) .IP "\fBpc\fR" 4 .IX Item "pc" .PD 0 .IP "\fBjpeg\fR" 4 .IX Item "jpeg" .IP "\fBfull\fR" 4 .IX Item "full" .PD \&\s-1JPEG\s0 (2^n\-1) .RE .RS 4 .RE .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)" Possible values: .RS 4 .IP "\fBleft\fR" 4 .IX Item "left" .PD 0 .IP "\fBcenter\fR" 4 .IX Item "center" .IP "\fBtopleft\fR" 4 .IX Item "topleft" .IP "\fBtop\fR" 4 .IX Item "top" .IP "\fBbottomleft\fR" 4 .IX Item "bottomleft" .IP "\fBbottom\fR" 4 .IX Item "bottom" .RE .RS 4 .RE .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 \fIbool\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "skip_alpha bool (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 indentation: .Sp .Vb 2 \& ffprobe \-dump_separator " \& " \-i ~/videos/matrixbench_mpeg2.mpg .Ve .IP "\fBmax_pixels\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4 .IX Item "max_pixels integer (decoding/encoding,video)" Maximum number of pixels per image. This value can be used to avoid out of memory failures due to large images. .IP "\fBapply_cropping\fR \fIbool\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "apply_cropping bool (decoding,video)" Enable cropping if cropping parameters are multiples of the required alignment for the left and top parameters. If the alignment is not met the cropping will be partially applied to maintain alignment. Default is 1 (enabled). Note: The required alignment depends on if \f(CW\*(C`AV_CODEC_FLAG_UNALIGNED\*(C'\fR is set and the \&\s-1CPU.\s0 \f(CW\*(C`AV_CODEC_FLAG_UNALIGNED\*(C'\fR cannot be changed from the command line. Also hardware decoders will not apply left/top Cropping. .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 "av1" .IX Subsection "av1" AOMedia Video 1 (\s-1AV1\s0) decoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBoperating_point\fR" 4 .IX Item "operating_point" Select an operating point of a scalable \s-1AV1\s0 bitstream (0 \- 31). Default is 0. .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 .SS "libdav1d" .IX Subsection "libdav1d" dav1d \s-1AV1\s0 decoder. .PP libdav1d allows libavcodec to decode the AOMedia Video 1 (\s-1AV1\s0) codec. Requires the presence of the libdav1d headers and library during configuration. You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libdav1d\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The following options are supported by the libdav1d wrapper. .IP "\fBframethreads\fR" 4 .IX Item "framethreads" Set amount of frame threads to use during decoding. The default value is 0 (autodetect). This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the option \f(CW\*(C`max_frame_delay\*(C'\fR and the global option \f(CW\*(C`threads\*(C'\fR instead. .IP "\fBtilethreads\fR" 4 .IX Item "tilethreads" Set amount of tile threads to use during decoding. The default value is 0 (autodetect). This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the global option \f(CW\*(C`threads\*(C'\fR instead. .IP "\fBmax_frame_delay\fR" 4 .IX Item "max_frame_delay" Set max amount of frames the decoder may buffer internally. The default value is 0 (autodetect). .IP "\fBfilmgrain\fR" 4 .IX Item "filmgrain" Apply film grain to the decoded video if present in the bitstream. Defaults to the internal default of the library. This option is deprecated and will be removed in the future. See the global option \&\f(CW\*(C`export_side_data\*(C'\fR to export Film Grain parameters instead of applying it. .IP "\fBoppoint\fR" 4 .IX Item "oppoint" Select an operating point of a scalable \s-1AV1\s0 bitstream (0 \- 31). Defaults to the internal default of the library. .IP "\fBalllayers\fR" 4 .IX Item "alllayers" Output all spatial layers of a scalable \s-1AV1\s0 bitstream. The default value is false. .SS "libdavs2" .IX Subsection "libdavs2" \&\s-1AVS2\-P2/IEEE1857.4\s0 video decoder wrapper. .PP This decoder allows libavcodec to decode \s-1AVS2\s0 streams with davs2 library. .SS "libuavs3d" .IX Subsection "libuavs3d" \&\s-1AVS3\-P2/IEEE1857.10\s0 video decoder. .PP libuavs3d allows libavcodec to decode \s-1AVS3\s0 streams. Requires the presence of the libuavs3d headers and library during configuration. You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libuavs3d\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The following option is supported by the libuavs3d wrapper. .IP "\fBframe_threads\fR" 4 .IX Item "frame_threads" Set amount of frame threads to use during decoding. The default value is 0 (autodetect). .SS "libxevd" .IX Subsection "libxevd" eXtra-fast Essential Video Decoder (\s-1XEVD\s0) \s-1MPEG\-5 EVC\s0 decoder wrapper. .PP This decoder requires the presence of the libxevd headers and library during configuration. You need to explicitly configure the build with \&\fB\-\-enable\-libxevd\fR. .PP The xevd project website is at <\fBhttps://github.com/mpeg5/xevd\fR>. .PP \fIOptions\fR .IX Subsection "Options" .PP The following options are supported by the libxevd wrapper. The xevd-equivalent options or values are listed in parentheses for easy migration. .PP To get a more accurate and extensive documentation of the libxevd options, invoke the command \f(CW\*(C`xevd_app \-\-help\*(C'\fR or consult the libxevd documentation. .IP "\fBthreads (\fR\fIthreads\fR\fB)\fR" 4 .IX Item "threads (threads)" Force to use a specific number of threads .SS "\s-1QSV\s0 Decoders" .IX Subsection "QSV Decoders" The family of Intel QuickSync Video decoders (\s-1VC1, MPEG\-2, H.264, HEVC, JPEG/MJPEG, VP8, VP9, AV1\s0). .PP \fICommon Options\fR .IX Subsection "Common Options" .PP The following options are supported by all qsv decoders. .IP "\fIasync_depth\fR" 4 .IX Item "async_depth" Internal parallelization depth, the higher the value the higher the latency. .IP "\fIgpu_copy\fR" 4 .IX Item "gpu_copy" A GPU-accelerated copy between video and system memory .RS 4 .IP "\fBdefault\fR" 4 .IX Item "default" .PD 0 .IP "\fBon\fR" 4 .IX Item "on" .IP "\fBoff\fR" 4 .IX Item "off" .RE .RS 4 .RE .PD .PP \fI\s-1HEVC\s0 Options\fR .IX Subsection "HEVC Options" .PP Extra options for hevc_qsv. .IP "\fIload_plugin\fR" 4 .IX Item "load_plugin" A user plugin to load in an internal session .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" .PD 0 .IP "\fBhevc_sw\fR" 4 .IX Item "hevc_sw" .IP "\fBhevc_hw\fR" 4 .IX Item "hevc_hw" .RE .RS 4 .RE .IP "\fIload_plugins\fR" 4 .IX Item "load_plugins" .PD A :\-separate list of hexadecimal plugin UIDs to load in an internal session .SS "v210" .IX Subsection "v210" Uncompressed 4:2:2 10\-bit decoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBcustom_stride\fR" 4 .IX Item "custom_stride" Set the line size of the v210 data in bytes. The default value is 0 (autodetect). You can use the special \-1 value for a strideless v210 as seen in \&\s-1BOXX\s0 files. .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. The default value is 1. 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 synthesizer. .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 "libaribb24" .IX Subsection "libaribb24" \&\s-1ARIB STD\-B24\s0 caption decoder. .PP Implements profiles A and C of the \s-1ARIB STD\-B24\s0 standard. .PP \fIlibaribb24 Decoder Options\fR .IX Subsection "libaribb24 Decoder Options" .IP "\fB\-aribb24\-base\-path\fR \fIpath\fR" 4 .IX Item "-aribb24-base-path path" Sets the base path for the libaribb24 library. This is utilized for reading of configuration files (for custom unicode conversions), and for dumping of non-text symbols as images under that location. .Sp Unset by default. .IP "\fB\-aribb24\-skip\-ruby\-text\fR \fIboolean\fR" 4 .IX Item "-aribb24-skip-ruby-text boolean" Tells the decoder wrapper to skip text blocks that contain half-height ruby text. .Sp Enabled by default. .SS "libaribcaption" .IX Subsection "libaribcaption" Yet another \s-1ARIB STD\-B24\s0 caption decoder using external \fIlibaribcaption\fR library. .PP Implements profiles A and C of the Japanse \s-1ARIB STD\-B24\s0 standard, Brazilian \s-1ABNT NBR 15606\-1,\s0 and Philippines version of ISDB-T. .PP Requires the presence of the libaribcaption headers and library (<\fBhttps://github.com/xqq/libaribcaption\fR>) during configuration. You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libaribcaption\*(C'\fR. If both \fIlibaribb24\fR and \fIlibaribcaption\fR are enabled, \fIlibaribcaption\fR decoder precedes. .PP \fIlibaribcaption Decoder Options\fR .IX Subsection "libaribcaption Decoder Options" .IP "\fB\-sub_type\fR \fIsubtitle_type\fR" 4 .IX Item "-sub_type subtitle_type" Specifies the format of the decoded subtitles. .RS 4 .IP "\fBbitmap\fR" 4 .IX Item "bitmap" Graphical image. .IP "\fBass\fR" 4 .IX Item "ass" \&\s-1ASS\s0 formatted text. .IP "\fBtext\fR" 4 .IX Item "text" Simple text based output without formatting. .RE .RS 4 .Sp The default is \fIass\fR as same as \fIlibaribb24\fR decoder. Some present players (e.g., \fImpv\fR) expect \s-1ASS\s0 format for \s-1ARIB\s0 caption. .RE .IP "\fB\-caption_encoding\fR \fIencoding_scheme\fR" 4 .IX Item "-caption_encoding encoding_scheme" Specifies the encoding scheme of input subtitle text. .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" Automatically detect text encoding (default). .IP "\fBjis\fR" 4 .IX Item "jis" 8bit\-char \s-1JIS\s0 encoding defined in \s-1ARIB STD B24.\s0 This encoding used in Japan for \s-1ISDB\s0 captions. .IP "\fButf8\fR" 4 .IX Item "utf8" \&\s-1UTF\-8\s0 encoding defined in \s-1ARIB STD B24.\s0 This encoding is used in Philippines for ISDB-T captions. .IP "\fBlatin\fR" 4 .IX Item "latin" Latin character encoding defined in \s-1ABNT NBR 15606\-1.\s0 This encoding is used in South America for \s-1SBTVD /\s0 ISDB-Tb captions. .RE .RS 4 .RE .IP "\fB\-font\fR \fIfont_name[,font_name2,...]\fR" 4 .IX Item "-font font_name[,font_name2,...]" Specify comma-separated list of font family names to be used for \fIbitmap\fR or \fIass\fR type subtitle rendering. Only first font name is used for \fIass\fR type subtitle. .Sp If not specified, use internaly defined default font family. .IP "\fB\-ass_single_rect\fR \fIboolean\fR" 4 .IX Item "-ass_single_rect boolean" \&\s-1ARIB STD\-B24\s0 specifies that some captions may be displayed at different positions at a time (multi-rectangle subtitle). Since some players (e.g., old \fImpv\fR) can't handle multiple \s-1ASS\s0 rectangles in a single AVSubtitle, or multiple \s-1ASS\s0 rectangles of indeterminate duration with the same start timestamp, this option can change the behavior so that all the texts are displayed in a single \s-1ASS\s0 rectangle. .Sp The default is \fIfalse\fR. .Sp If your player cannot handle AVSubtitles with multiple \s-1ASS\s0 rectangles properly, set this option to \fItrue\fR or define \fBASS_SINGLE_RECT=1\fR to change default behavior at compilation. .IP "\fB\-force_outline_text\fR \fIboolean\fR" 4 .IX Item "-force_outline_text boolean" Specify whether always render outline text for all characters regardless of the indication by charactor style. .Sp The default is \fIfalse\fR. .IP "\fB\-outline_width\fR \fInumber\fR \fB(0.0 \- 3.0)\fR" 4 .IX Item "-outline_width number (0.0 - 3.0)" Specify width for outline text, in dots (relative). .Sp The default is \fI1.5\fR. .IP "\fB\-ignore_background\fR \fIboolean\fR" 4 .IX Item "-ignore_background boolean" Specify whether to ignore background color rendering. .Sp The default is \fIfalse\fR. .IP "\fB\-ignore_ruby\fR \fIboolean\fR" 4 .IX Item "-ignore_ruby boolean" Specify whether to ignore rendering for ruby-like (furigana) characters. .Sp The default is \fIfalse\fR. .IP "\fB\-replace_drcs\fR \fIboolean\fR" 4 .IX Item "-replace_drcs boolean" Specify whether to render replaced \s-1DRCS\s0 characters as Unicode characters. .Sp The default is \fItrue\fR. .IP "\fB\-replace_msz_ascii\fR \fIboolean\fR" 4 .IX Item "-replace_msz_ascii boolean" Specify whether to replace \s-1MSZ\s0 (Middle Size; half width) fullwidth alphanumerics with halfwidth alphanumerics. .Sp The default is \fItrue\fR. .IP "\fB\-replace_msz_japanese\fR \fIboolean\fR" 4 .IX Item "-replace_msz_japanese boolean" Specify whether to replace some \s-1MSZ\s0 (Middle Size; half width) fullwidth japanese special characters with halfwidth ones. .Sp The default is \fItrue\fR. .IP "\fB\-replace_msz_glyph\fR \fIboolean\fR" 4 .IX Item "-replace_msz_glyph boolean" Specify whether to replace \s-1MSZ\s0 (Middle Size; half width) characters with halfwidth glyphs if the fonts supports it. This option works under FreeType or DirectWrite renderer with Adobe\-Japan1 compliant fonts. e.g., \s-1IBM\s0 Plex Sans \s-1JP,\s0 Morisawa \s-1BIZ\s0 UDGothic, Morisawa \s-1BIZ\s0 UDMincho, Yu Gothic, Yu Mincho, and Meiryo. .Sp The default is \fItrue\fR. .IP "\fB\-canvas_size\fR \fIimage_size\fR" 4 .IX Item "-canvas_size image_size" Specify the resolution of the canvas to render subtitles to; usually, this should be frame size of input video. This only applies when \f(CW\*(C`\-subtitle_type\*(C'\fR is set to \fIbitmap\fR. .Sp The libaribcaption decoder assumes input frame size for bitmap rendering as below: .RS 4 .IP "1." 4 \&\s-1PROFILE_A : 1440\s0 x 1080 with \s-1SAR\s0 (\s-1PAR\s0) 4:3 .IP "2." 4 \&\s-1PROFILE_C : 320\s0 x 180 with \s-1SAR\s0 (\s-1PAR\s0) 1:1 .RE .RS 4 .Sp If actual frame size of input video does not match above assumption, the rendered captions may be distorted. To make the captions undistorted, add \f(CW\*(C`\-canvas_size\*(C'\fR option to specify actual input video size. .Sp Note that the \f(CW\*(C`\-canvas_size\*(C'\fR option is not required for video with different size but same aspect ratio. In such cases, the caption will be stretched or shrunk to actual video size if \f(CW\*(C`\-canvas_size\*(C'\fR option is not specified. If \f(CW\*(C`\-canvas_size\*(C'\fR option is specified with different size, the caption will be stretched or shrunk as specified size with calculated \s-1SAR.\s0 .RE .PP \fIlibaribcaption decoder usage examples\fR .IX Subsection "libaribcaption decoder usage examples" .PP Display MPEG-TS file with \s-1ARIB\s0 subtitle by \f(CW\*(C`ffplay\*(C'\fR tool: .PP .Vb 1 \& ffplay \-sub_type bitmap MPEG.TS .Ve .PP Display MPEG-TS file with input frame size 1920x1080 by \f(CW\*(C`ffplay\*(C'\fR tool: .PP .Vb 1 \& ffplay \-sub_type bitmap \-canvas_size 1920x1080 MPEG.TS .Ve .PP Embed \s-1ARIB\s0 subtitle in transcoded video: .PP .Vb 1 \& ffmpeg \-sub_type bitmap \-i src.m2t \-filter_complex "[0:v][0:s]overlay" \-vcodec h264 dest.mp4 .Ve .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\-2\fR" 4 .IX Item "-2" .PD Compute clut once if no matching \s-1CLUT\s0 is in the stream. .IP "\fB\-1\fR" 4 .IX Item "-1" 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 commas, 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. Pages that do not match the specified list are dropped. You may use the special \f(CW\*(C`*\*(C'\fR string to match all pages, or \f(CW\*(C`subtitle\*(C'\fR to match all subtitle pages. Default value is *. .IP "\fBtxt_default_region\fR" 4 .IX Item "txt_default_region" Set default character set used for decoding, a value between 0 and 87 (see \&\s-1ETS 300 706,\s0 Section 15, Table 32). Default value is \-1, which does not override the libzvbi default. This option is needed for some legacy level 1.0 transmissions which cannot signal the proper charset. .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. .RS 4 .IP "\fBbitmap\fR" 4 .IX Item "bitmap" The default format, you should use this for teletext pages, because certain graphics and colors cannot be expressed in simple text or even \s-1ASS.\s0 .IP "\fBtext\fR" 4 .IX Item "text" Simple text based output without formatting. .IP "\fBass\fR" 4 .IX Item "ass" Formatted \s-1ASS\s0 output, subtitle pages and teletext pages are returned in different styles, subtitle pages are stripped down to text, but an effort is made to keep the text alignment and the formatting. .RE .RS 4 .RE .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 characters. 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 \-1 which means infinity or until the next subtitle event comes. .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. .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. This is the default 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. .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 Uses a cheaper version of twoloop algorithm that doesn't try to do as many clever adjustments. Worse with low bitrates (less than 64kbps), but is better and much faster at higher bitrates. .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 beneficial. 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 imperceptible 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 \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. .IP "\fBcutoff\fR \fIfrequency\fR" 4 .IX Item "cutoff frequency" Set lowpass cutoff frequency. If unspecified, the encoder selects a default determined by various other encoding parameters. .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. Valid values are from 0 to 12, 5 is the default. .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" Channels 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 "opus" .IX Subsection "opus" Opus encoder. .PP This is a native FFmpeg encoder for the Opus format. Currently, it's in development and only implements the \s-1CELT\s0 part of the codec. Its quality is usually worse and at best is equal to the libopus encoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBb\fR" 4 .IX Item "b" Set bit rate in bits/s. If unspecified it uses the number of channels and the layout to make a good guess. .IP "\fBopus_delay\fR" 4 .IX Item "opus_delay" Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly decrease quality. .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 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 "\fBeld_v2\fR" 4 .IX Item "eld_v2" Enable ELDv2 (LD-MPS extension for \s-1ELD\s0 stereo signals) for ELDv2 if set to 1, disabled if set to 0. .Sp Note that option is available when fdk-aac version (\s-1AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2\s0) > (4.0.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 .IP "\fBframe_length\fR" 4 .IX Item "frame_length" Set the audio frame length in samples. Default value is the internal default of the library. Refer to the library's documentation for information about supported values. .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 "\fBcutoff (\fR\fI\-\-lowpass\fR\fB)\fR" 4 .IX Item "cutoff (--lowpass)" Set lowpass cutoff frequency. If unspecified, the encoder dynamically adjusts the cutoff. .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. .IP "\fBcopyright (\fR\fI\-c\fR\fB)\fR" 4 .IX Item "copyright (-c)" Set \s-1MPEG\s0 audio copyright flag when set to 1. The default value is 0 (disabled). .IP "\fBoriginal (\fR\fI\-o\fR\fB)\fR" 4 .IX Item "original (-o)" Set \s-1MPEG\s0 audio original flag when set to 1. The default value is 1 (enabled). .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 "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 "\fBfec (\fR\fIn/a\fR\fB)\fR" 4 .IX Item "fec (n/a)" Enable inband forward error correction. \fBpacket_loss\fR must be non-zero to take advantage \- frequency of \s-1FEC\s0 'side\-data' is proportional to expected packet loss. Default is disabled. .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 by disabling voice-optimized 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). Note that libopus forces a wideband cutoff for bitrates < 15 kbps, unless CELT-only (\fBapplication\fR set to \fBlowdelay\fR) mode is used. .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. .IP "\fBapply_phase_inv (N.A.) (requires libopus >= 1.2)\fR" 4 .IX Item "apply_phase_inv (N.A.) (requires libopus >= 1.2)" If set to 0, disables the use of phase inversion for intensity stereo, improving the quality of mono downmixes, but slightly reducing normal stereo quality. The default is 1 (phase inversion enabled). .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 "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 \fBoggenc\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 "mjpeg" .IX Subsection "mjpeg" Motion \s-1JPEG\s0 encoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBhuffman\fR" 4 .IX Item "huffman" Set the huffman encoding strategy. Possible values: .RS 4 .IP "\fBdefault\fR" 4 .IX Item "default" Use the default huffman tables. This is the default strategy. .IP "\fBoptimal\fR" 4 .IX Item "optimal" Compute and use optimal huffman tables. .RE .RS 4 .RE .SS "wavpack" .IX Subsection "wavpack" WavPack lossless audio encoder. .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)" .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 "a64_multi, a64_multi5" .IX Subsection "a64_multi, a64_multi5" A64 / Commodore 64 multicolor charset encoder. \f(CW\*(C`a64_multi5\*(C'\fR is extended with 5th color (colram). .SS "Cinepak" .IX Subsection "Cinepak" Cinepak aka \s-1CVID\s0 encoder. Compatible with Windows 3.1 and vintage MacOS. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBg\fR \fIinteger\fR" 4 .IX Item "g integer" Keyframe interval. A keyframe is inserted at least every \f(CW\*(C`\-g\*(C'\fR frames, sometimes sooner. .IP "\fBq:v\fR \fIinteger\fR" 4 .IX Item "q:v integer" Quality factor. Lower is better. Higher gives lower bitrate. The following table lists bitrates when encoding akiyo_cif.y4m for various values of \f(CW\*(C`\-q:v\*(C'\fR with \f(CW\*(C`\-g 100\*(C'\fR: .RS 4 .ie n .IP "\fB\f(CB""\-q:v 1""\fB 1918 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 1\fB 1918 kb/s\fR" 4 .IX Item "-q:v 1 1918 kb/s" .PD 0 .ie n .IP "\fB\f(CB""\-q:v 2""\fB 1735 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 2\fB 1735 kb/s\fR" 4 .IX Item "-q:v 2 1735 kb/s" .ie n .IP "\fB\f(CB""\-q:v 4""\fB 1500 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 4\fB 1500 kb/s\fR" 4 .IX Item "-q:v 4 1500 kb/s" .ie n .IP "\fB\f(CB""\-q:v 10""\fB 1041 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 10\fB 1041 kb/s\fR" 4 .IX Item "-q:v 10 1041 kb/s" .ie n .IP "\fB\f(CB""\-q:v 20""\fB 826 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 20\fB 826 kb/s\fR" 4 .IX Item "-q:v 20 826 kb/s" .ie n .IP "\fB\f(CB""\-q:v 40""\fB 553 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 40\fB 553 kb/s\fR" 4 .IX Item "-q:v 40 553 kb/s" .ie n .IP "\fB\f(CB""\-q:v 100""\fB 394 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 100\fB 394 kb/s\fR" 4 .IX Item "-q:v 100 394 kb/s" .ie n .IP "\fB\f(CB""\-q:v 200""\fB 312 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 200\fB 312 kb/s\fR" 4 .IX Item "-q:v 200 312 kb/s" .ie n .IP "\fB\f(CB""\-q:v 400""\fB 266 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 400\fB 266 kb/s\fR" 4 .IX Item "-q:v 400 266 kb/s" .ie n .IP "\fB\f(CB""\-q:v 1000""\fB 237 kb/s\fR" 4 .el .IP "\fB\f(CB\-q:v 1000\fB 237 kb/s\fR" 4 .IX Item "-q:v 1000 237 kb/s" .RE .RS 4 .RE .IP "\fBmax_extra_cb_iterations\fR \fIinteger\fR" 4 .IX Item "max_extra_cb_iterations integer" .PD Max extra codebook recalculation passes, more is better and slower. .IP "\fBskip_empty_cb\fR \fIboolean\fR" 4 .IX Item "skip_empty_cb boolean" Avoid wasting bytes, ignore vintage MacOS decoder. .IP "\fBmax_strips\fR \fIinteger\fR" 4 .IX Item "max_strips integer" .PD 0 .IP "\fBmin_strips\fR \fIinteger\fR" 4 .IX Item "min_strips integer" .PD The minimum and maximum number of strips to use. Wider range sometimes improves quality. More strips is generally better quality but costs more bits. Fewer strips tend to yield more keyframes. Vintage compatible is 1..3. .IP "\fBstrip_number_adaptivity\fR \fIinteger\fR" 4 .IX Item "strip_number_adaptivity integer" How much number of strips is allowed to change between frames. Higher is better but slower. .SS "\s-1GIF\s0" .IX Subsection "GIF" \&\s-1GIF\s0 image/animation encoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBgifflags\fR \fIinteger\fR" 4 .IX Item "gifflags integer" Sets the flags used for \s-1GIF\s0 encoding. .RS 4 .IP "\fBoffsetting\fR" 4 .IX Item "offsetting" Enables picture offsetting. .Sp Default is enabled. .IP "\fBtransdiff\fR" 4 .IX Item "transdiff" Enables transparency detection between frames. .Sp Default is enabled. .RE .RS 4 .RE .IP "\fBgifimage\fR \fIinteger\fR" 4 .IX Item "gifimage integer" Enables encoding one full \s-1GIF\s0 image per frame, rather than an animated \s-1GIF.\s0 .Sp Default value is \fB0\fR. .IP "\fBglobal_palette\fR \fIinteger\fR" 4 .IX Item "global_palette integer" Writes a palette to the global \s-1GIF\s0 header where feasible. .Sp If disabled, every frame will always have a palette written, even if there is a global palette supplied. .Sp Default value is \fB1\fR. .SS "Hap" .IX Subsection "Hap" Vidvox Hap video encoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBformat\fR \fIinteger\fR" 4 .IX Item "format integer" Specifies the Hap format to encode. .RS 4 .IP "\fBhap\fR" 4 .IX Item "hap" .PD 0 .IP "\fBhap_alpha\fR" 4 .IX Item "hap_alpha" .IP "\fBhap_q\fR" 4 .IX Item "hap_q" .RE .RS 4 .PD .Sp Default value is \fBhap\fR. .RE .IP "\fBchunks\fR \fIinteger\fR" 4 .IX Item "chunks integer" Specifies the number of chunks to split frames into, between 1 and 64. This permits multithreaded decoding of large frames, potentially at the cost of data-rate. The encoder may modify this value to divide frames evenly. .Sp Default value is \fI1\fR. .IP "\fBcompressor\fR \fIinteger\fR" 4 .IX Item "compressor integer" Specifies the second-stage compressor to use. If set to \fBnone\fR, \&\fBchunks\fR will be limited to 1, as chunked uncompressed frames offer no benefit. .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" .PD 0 .IP "\fBsnappy\fR" 4 .IX Item "snappy" .RE .RS 4 .PD .Sp Default value is \fBsnappy\fR. .RE .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 \fIinteger\fR" 4 .IX Item "format integer" 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. .IP "\fBtile_width\fR \fIinteger\fR" 4 .IX Item "tile_width integer" Sets tile width. Range is 1 to 1073741824. Default is 256. .IP "\fBtile_height\fR \fIinteger\fR" 4 .IX Item "tile_height integer" Sets tile height. Range is 1 to 1073741824. Default is 256. .IP "\fBpred\fR \fIinteger\fR" 4 .IX Item "pred integer" Allows setting the discrete wavelet transform (\s-1DWT\s0) type .RS 4 .IP "\fBdwt97int (Lossy)\fR" 4 .IX Item "dwt97int (Lossy)" .PD 0 .IP "\fBdwt53 (Lossless)\fR" 4 .IX Item "dwt53 (Lossless)" .RE .RS 4 .PD .Sp Default is \f(CW\*(C`dwt97int\*(C'\fR .RE .IP "\fBsop\fR \fIboolean\fR" 4 .IX Item "sop boolean" Enable this to add \s-1SOP\s0 marker at the start of each packet. Disabled by default. .IP "\fBeph\fR \fIboolean\fR" 4 .IX Item "eph boolean" Enable this to add \s-1EPH\s0 marker at the end of each packet header. Disabled by default. .IP "\fBprog\fR \fIinteger\fR" 4 .IX Item "prog integer" Sets the progression order to be used by the encoder. Possible values are: .RS 4 .IP "\fBlrcp\fR" 4 .IX Item "lrcp" .PD 0 .IP "\fBrlcp\fR" 4 .IX Item "rlcp" .IP "\fBrpcl\fR" 4 .IX Item "rpcl" .IP "\fBpcrl\fR" 4 .IX Item "pcrl" .IP "\fBcprl\fR" 4 .IX Item "cprl" .RE .RS 4 .PD .Sp Set to \f(CW\*(C`lrcp\*(C'\fR by default. .RE .IP "\fBlayer_rates\fR \fIstring\fR" 4 .IX Item "layer_rates string" By default, when this option is not used, compression is done using the quality metric. This option allows for compression using compression ratio. The compression ratio for each level could be specified. The compression ratio of a layer \f(CW\*(C`l\*(C'\fR species the what ratio of total file size is contained in the first \f(CW\*(C`l\*(C'\fR layers. .Sp Example usage: .Sp .Vb 1 \& ffmpeg \-i input.bmp \-c:v jpeg2000 \-layer_rates "100,10,1" output.j2k .Ve .Sp This would compress the image to contain 3 layers, where the data contained in the first layer would be compressed by 1000 times, compressed by 100 in the first two layers, and shall contain all data while using all 3 layers. .SS "librav1e" .IX Subsection "librav1e" rav1e \s-1AV1\s0 encoder wrapper. .PP Requires the presence of the rav1e headers and library during configuration. You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-librav1e\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBqmax\fR" 4 .IX Item "qmax" Sets the maximum quantizer to use when using bitrate mode. .IP "\fBqmin\fR" 4 .IX Item "qmin" Sets the minimum quantizer to use when using bitrate mode. .IP "\fBqp\fR" 4 .IX Item "qp" Uses quantizer mode to encode at the given quantizer (0\-255). .IP "\fBspeed\fR" 4 .IX Item "speed" Selects the speed preset (0\-10) to encode with. .IP "\fBtiles\fR" 4 .IX Item "tiles" Selects how many tiles to encode with. .IP "\fBtile-rows\fR" 4 .IX Item "tile-rows" Selects how many rows of tiles to encode with. .IP "\fBtile-columns\fR" 4 .IX Item "tile-columns" Selects how many columns of tiles to encode with. .IP "\fBrav1e\-params\fR" 4 .IX Item "rav1e-params" Set rav1e options using a list of \fIkey\fR=\fIvalue\fR pairs separated by \*(L":\*(R". See \fBrav1e \-\-help\fR for a list of options. .Sp For example to specify librav1e encoding options with \fB\-rav1e\-params\fR: .Sp .Vb 1 \& ffmpeg \-i input \-c:v librav1e \-b:v 500K \-rav1e\-params speed=5:low_latency=true output.mp4 .Ve .SS "libaom\-av1" .IX Subsection "libaom-av1" libaom \s-1AV1\s0 encoder wrapper. .PP Requires the presence of the libaom headers and library during configuration. You need to explicitly configure the build with \&\f(CW\*(C`\-\-enable\-libaom\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The wrapper supports the following standard libavcodec options: .IP "\fBb\fR" 4 .IX Item "b" Set bitrate target in bits/second. By default this will use variable-bitrate mode. If \fBmaxrate\fR and \fBminrate\fR are also set to the same value then it will use constant-bitrate mode, otherwise if \fBcrf\fR is set as well then it will use constrained-quality mode. .IP "\fBg keyint_min\fR" 4 .IX Item "g keyint_min" Set key frame placement. The \s-1GOP\s0 size sets the maximum distance between key frames; if zero the output stream will be intra-only. The minimum distance is ignored unless it is the same as the \s-1GOP\s0 size, in which case key frames will always appear at a fixed interval. Not set by default, so without this option the library has completely free choice about where to place key frames. .IP "\fBqmin qmax\fR" 4 .IX Item "qmin qmax" Set minimum/maximum quantisation values. Valid range is from 0 to 63 (warning: this does not match the quantiser values actually used by \s-1AV1\s0 \&\- divide by four to map real quantiser values to this range). Defaults to min/max (no constraint). .IP "\fBminrate maxrate bufsize rc_init_occupancy\fR" 4 .IX Item "minrate maxrate bufsize rc_init_occupancy" Set rate control buffering parameters. Not used if not set \- defaults to unconstrained variable bitrate. .IP "\fBthreads\fR" 4 .IX Item "threads" Set the number of threads to use while encoding. This may require the \&\fBtiles\fR or \fBrow-mt\fR options to also be set to actually use the specified number of threads fully. Defaults to the number of hardware threads supported by the host machine. .IP "\fBprofile\fR" 4 .IX Item "profile" Set the encoding profile. Defaults to using the profile which matches the bit depth and chroma subsampling of the input. .PP The wrapper also has some specific options: .IP "\fBcpu-used\fR" 4 .IX Item "cpu-used" Set the quality/encoding speed tradeoff. Valid range is from 0 to 8, higher numbers indicating greater speed and lower quality. The default value is 1, which will be slow and high quality. .IP "\fBauto-alt-ref\fR" 4 .IX Item "auto-alt-ref" Enable use of alternate reference frames. Defaults to the internal default of the library. .IP "\fBarnr-max-frames (\fR\fIframes\fR\fB)\fR" 4 .IX Item "arnr-max-frames (frames)" Set altref noise reduction max frame count. Default is \-1. .IP "\fBarnr-strength (\fR\fIstrength\fR\fB)\fR" 4 .IX Item "arnr-strength (strength)" Set altref noise reduction filter strength. Range is \-1 to 6. Default is \-1. .IP "\fBaq-mode (\fR\fIaq-mode\fR\fB)\fR" 4 .IX Item "aq-mode (aq-mode)" Set adaptive quantization mode. 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-based. .IP "\fBcomplexity (\fR\fI2\fR\fB)\fR" 4 .IX Item "complexity (2)" Complexity-based. .IP "\fBcyclic (\fR\fI3\fR\fB)\fR" 4 .IX Item "cyclic (3)" Cyclic refresh. .RE .RS 4 .RE .IP "\fBtune (\fR\fItune\fR\fB)\fR" 4 .IX Item "tune (tune)" Set the distortion metric the encoder is tuned with. Default is \f(CW\*(C`psnr\*(C'\fR. .RS 4 .IP "\fBpsnr (\fR\fI0\fR\fB)\fR" 4 .IX Item "psnr (0)" .PD 0 .IP "\fBssim (\fR\fI1\fR\fB)\fR" 4 .IX Item "ssim (1)" .RE .RS 4 .RE .IP "\fBlag-in-frames\fR" 4 .IX Item "lag-in-frames" .PD Set the maximum number of frames which the encoder may keep in flight at any one time for lookahead purposes. Defaults to the internal default of the library. .IP "\fBerror-resilience\fR" 4 .IX Item "error-resilience" Enable error resilience features: .RS 4 .IP "\fBdefault\fR" 4 .IX Item "default" Improve resilience against losses of whole frames. .RE .RS 4 .Sp Not enabled by default. .RE .IP "\fBcrf\fR" 4 .IX Item "crf" Set the quality/size tradeoff for constant-quality (no bitrate target) and constrained-quality (with maximum bitrate target) modes. Valid range is 0 to 63, higher numbers indicating lower quality and smaller output size. Only used if set; by default only the bitrate target is used. .IP "\fBstatic-thresh\fR" 4 .IX Item "static-thresh" Set a change threshold on blocks below which they will be skipped by the encoder. Defined in arbitrary units as a nonnegative integer, defaulting to zero (no blocks are skipped). .IP "\fBdrop-threshold\fR" 4 .IX Item "drop-threshold" Set a threshold for dropping frames when close to rate control bounds. Defined as a percentage of the target buffer \- when the rate control buffer falls below this percentage, frames will be dropped until it has refilled above the threshold. Defaults to zero (no frames are dropped). .IP "\fBdenoise-noise-level (\fR\fIlevel\fR\fB)\fR" 4 .IX Item "denoise-noise-level (level)" Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if this option is not set or set to 0. .IP "\fBdenoise-block-size (\fR\fIpixels\fR\fB)\fR" 4 .IX Item "denoise-block-size (pixels)" Block size used for denoising for grain synthesis. If not set, \s-1AV1\s0 codec uses the default value of 32. .IP "\fBundershoot-pct (\fR\fIpct\fR\fB)\fR" 4 .IX Item "undershoot-pct (pct)" Set datarate undershoot (min) percentage of the target bitrate. Range is \-1 to 100. Default is \-1. .IP "\fBovershoot-pct (\fR\fIpct\fR\fB)\fR" 4 .IX Item "overshoot-pct (pct)" Set datarate overshoot (max) percentage of the target bitrate. Range is \-1 to 1000. Default is \-1. .IP "\fBminsection-pct (\fR\fIpct\fR\fB)\fR" 4 .IX Item "minsection-pct (pct)" Minimum percentage variation of the \s-1GOP\s0 bitrate from the target bitrate. If minsection-pct is not set, the libaomenc wrapper computes it as follows: \f(CW\*(C`(minrate * 100 / bitrate)\*(C'\fR. Range is \-1 to 100. Default is \-1 (unset). .IP "\fBmaxsection-pct (\fR\fIpct\fR\fB)\fR" 4 .IX Item "maxsection-pct (pct)" Maximum percentage variation of the \s-1GOP\s0 bitrate from the target bitrate. If maxsection-pct is not set, the libaomenc wrapper computes it as follows: \f(CW\*(C`(maxrate * 100 / bitrate)\*(C'\fR. Range is \-1 to 5000. Default is \-1 (unset). .IP "\fBframe-parallel (\fR\fIboolean\fR\fB)\fR" 4 .IX Item "frame-parallel (boolean)" Enable frame parallel decodability features. Default is true. .IP "\fBtiles\fR" 4 .IX Item "tiles" Set the number of tiles to encode the input video with, as columns x rows. Larger numbers allow greater parallelism in both encoding and decoding, but may decrease coding efficiency. Defaults to the minimum number of tiles required by the size of the input video (this is 1x1 (that is, a single tile) for sizes up to and including 4K). .IP "\fBtile-columns tile-rows\fR" 4 .IX Item "tile-columns tile-rows" Set the number of tiles as log2 of the number of tile rows and columns. Provided for compatibility with libvpx/VP9. .IP "\fBrow-mt (Requires libaom >= 1.0.0\-759\-g90a15f4f2)\fR" 4 .IX Item "row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)" Enable row based multi-threading. Disabled by default. .IP "\fBenable-cdef (\fR\fIboolean\fR\fB)\fR" 4 .IX Item "enable-cdef (boolean)" Enable Constrained Directional Enhancement Filter. The libaom\-av1 encoder enables \s-1CDEF\s0 by default. .IP "\fBenable-restoration (\fR\fIboolean\fR\fB)\fR" 4 .IX Item "enable-restoration (boolean)" Enable Loop Restoration Filter. Default is true for libaom\-av1. .IP "\fBenable-global-motion (\fR\fIboolean\fR\fB)\fR" 4 .IX Item "enable-global-motion (boolean)" Enable the use of global motion for block prediction. Default is true. .IP "\fBenable-intrabc (\fR\fIboolean\fR\fB)\fR" 4 .IX Item "enable-intrabc (boolean)" Enable block copy mode for intra block prediction. This mode is useful for screen content. Default is true. .IP "\fBenable-rect-partitions (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-rect-partitions (boolean) (Requires libaom >= v2.0.0)" Enable rectangular partitions. Default is true. .IP "\fBenable\-1to4\-partitions (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-1to4-partitions (boolean) (Requires libaom >= v2.0.0)" Enable 1:4/4:1 partitions. Default is true. .IP "\fBenable-ab-partitions (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-ab-partitions (boolean) (Requires libaom >= v2.0.0)" Enable \s-1AB\s0 shape partitions. Default is true. .IP "\fBenable-angle-delta (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-angle-delta (boolean) (Requires libaom >= v2.0.0)" Enable angle delta intra prediction. Default is true. .IP "\fBenable-cfl-intra (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-cfl-intra (boolean) (Requires libaom >= v2.0.0)" Enable chroma predicted from luma intra prediction. Default is true. .IP "\fBenable-filter-intra (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-filter-intra (boolean) (Requires libaom >= v2.0.0)" Enable filter intra predictor. Default is true. .IP "\fBenable-intra-edge-filter (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-intra-edge-filter (boolean) (Requires libaom >= v2.0.0)" Enable intra edge filter. Default is true. .IP "\fBenable-smooth-intra (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-smooth-intra (boolean) (Requires libaom >= v2.0.0)" Enable smooth intra prediction mode. Default is true. .IP "\fBenable-paeth-intra (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-paeth-intra (boolean) (Requires libaom >= v2.0.0)" Enable paeth predictor in intra prediction. Default is true. .IP "\fBenable-palette (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-palette (boolean) (Requires libaom >= v2.0.0)" Enable palette prediction mode. Default is true. .IP "\fBenable-flip-idtx (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-flip-idtx (boolean) (Requires libaom >= v2.0.0)" Enable extended transform type, including \s-1FLIPADST_DCT, DCT_FLIPADST, FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, V_ADST, H_ADST, V_FLIPADST, H_FLIPADST.\s0 Default is true. .IP "\fBenable\-tx64 (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-tx64 (boolean) (Requires libaom >= v2.0.0)" Enable 64\-pt transform. Default is true. .IP "\fBreduced-tx-type-set (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "reduced-tx-type-set (boolean) (Requires libaom >= v2.0.0)" Use reduced set of transform types. Default is false. .IP "\fBuse-intra-dct-only (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "use-intra-dct-only (boolean) (Requires libaom >= v2.0.0)" Use \s-1DCT\s0 only for \s-1INTRA\s0 modes. Default is false. .IP "\fBuse-inter-dct-only (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "use-inter-dct-only (boolean) (Requires libaom >= v2.0.0)" Use \s-1DCT\s0 only for \s-1INTER\s0 modes. Default is false. .IP "\fBuse-intra-default-tx-only (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "use-intra-default-tx-only (boolean) (Requires libaom >= v2.0.0)" Use Default-transform only for \s-1INTRA\s0 modes. Default is false. .IP "\fBenable-ref-frame-mvs (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-ref-frame-mvs (boolean) (Requires libaom >= v2.0.0)" Enable temporal mv prediction. Default is true. .IP "\fBenable-reduced-reference-set (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-reduced-reference-set (boolean) (Requires libaom >= v2.0.0)" Use reduced set of single and compound references. Default is false. .IP "\fBenable-obmc (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-obmc (boolean) (Requires libaom >= v2.0.0)" Enable obmc. Default is true. .IP "\fBenable-dual-filter (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-dual-filter (boolean) (Requires libaom >= v2.0.0)" Enable dual filter. Default is true. .IP "\fBenable-diff-wtd-comp (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-diff-wtd-comp (boolean) (Requires libaom >= v2.0.0)" Enable difference-weighted compound. Default is true. .IP "\fBenable-dist-wtd-comp (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-dist-wtd-comp (boolean) (Requires libaom >= v2.0.0)" Enable distance-weighted compound. Default is true. .IP "\fBenable-onesided-comp (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-onesided-comp (boolean) (Requires libaom >= v2.0.0)" Enable one sided compound. Default is true. .IP "\fBenable-interinter-wedge (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-interinter-wedge (boolean) (Requires libaom >= v2.0.0)" Enable interinter wedge compound. Default is true. .IP "\fBenable-interintra-wedge (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-interintra-wedge (boolean) (Requires libaom >= v2.0.0)" Enable interintra wedge compound. Default is true. .IP "\fBenable-masked-comp (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-masked-comp (boolean) (Requires libaom >= v2.0.0)" Enable masked compound. Default is true. .IP "\fBenable-interintra-comp (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-interintra-comp (boolean) (Requires libaom >= v2.0.0)" Enable interintra compound. Default is true. .IP "\fBenable-smooth-interintra (\fR\fIboolean\fR\fB) (Requires libaom >= v2.0.0)\fR" 4 .IX Item "enable-smooth-interintra (boolean) (Requires libaom >= v2.0.0)" Enable smooth interintra mode. Default is true. .IP "\fBaom-params\fR" 4 .IX Item "aom-params" Set libaom options using a list of \fIkey\fR=\fIvalue\fR pairs separated by \*(L":\*(R". For a list of supported options, see \fBaomenc \-\-help\fR under the section \*(L"\s-1AV1\s0 Specific Options\*(R". .Sp For example to specify libaom encoding options with \fB\-aom\-params\fR: .Sp .Vb 1 \& ffmpeg \-i input \-c:v libaom\-av1 \-b:v 500K \-aom\-params tune=psnr:enable\-tpl\-model=1 output.mp4 .Ve .SS "libsvtav1" .IX Subsection "libsvtav1" \&\s-1SVT\-AV1\s0 encoder wrapper. .PP Requires the presence of the \s-1SVT\-AV1\s0 headers and library during configuration. You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libsvtav1\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBprofile\fR" 4 .IX Item "profile" Set the encoding profile. .RS 4 .IP "\fBmain\fR" 4 .IX Item "main" .PD 0 .IP "\fBhigh\fR" 4 .IX Item "high" .IP "\fBprofessional\fR" 4 .IX Item "professional" .RE .RS 4 .RE .IP "\fBlevel\fR" 4 .IX Item "level" .PD Set the operating point level. For example: '4.0' .IP "\fBhielevel\fR" 4 .IX Item "hielevel" Set the Hierarchical prediction levels. .RS 4 .IP "\fB3level\fR" 4 .IX Item "3level" .PD 0 .IP "\fB4level\fR" 4 .IX Item "4level" .PD This is the default. .RE .RS 4 .RE .IP "\fBtier\fR" 4 .IX Item "tier" Set the operating point tier. .RS 4 .IP "\fBmain\fR" 4 .IX Item "main" This is the default. .IP "\fBhigh\fR" 4 .IX Item "high" .RE .RS 4 .RE .PD 0 .IP "\fBqmax\fR" 4 .IX Item "qmax" .PD Set the maximum quantizer to use when using a bitrate mode. .IP "\fBqmin\fR" 4 .IX Item "qmin" Set the minimum quantizer to use when using a bitrate mode. .IP "\fBcrf\fR" 4 .IX Item "crf" Constant rate factor value used in crf rate control mode (0\-63). .IP "\fBqp\fR" 4 .IX Item "qp" Set the quantizer used in cqp rate control mode (0\-63). .IP "\fBsc_detection\fR" 4 .IX Item "sc_detection" Enable scene change detection. .IP "\fBla_depth\fR" 4 .IX Item "la_depth" Set number of frames to look ahead (0\-120). .IP "\fBpreset\fR" 4 .IX Item "preset" Set the quality-speed tradeoff, in the range 0 to 13. Higher values are faster but lower quality. .IP "\fBtile_rows\fR" 4 .IX Item "tile_rows" Set log2 of the number of rows of tiles to use (0\-6). .IP "\fBtile_columns\fR" 4 .IX Item "tile_columns" Set log2 of the number of columns of tiles to use (0\-4). .IP "\fBsvtav1\-params\fR" 4 .IX Item "svtav1-params" Set \s-1SVT\-AV1\s0 options using a list of \fIkey\fR=\fIvalue\fR pairs separated by \*(L":\*(R". See the \s-1SVT\-AV1\s0 encoder user guide for a list of accepted parameters. .SS "libjxl" .IX Subsection "libjxl" libjxl \s-1JPEG XL\s0 encoder wrapper. .PP Requires the presence of the libjxl headers and library during configuration. You need to explicitly configure the build with \&\f(CW\*(C`\-\-enable\-libjxl\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The libjxl wrapper supports the following options: .IP "\fBdistance\fR" 4 .IX Item "distance" Set the target Butteraugli distance. This is a quality setting: lower distance yields higher quality, with distance=1.0 roughly comparable to libjpeg Quality 90 for photographic content. Setting distance=0.0 yields true lossless encoding. Valid values range between 0.0 and 15.0, and sane values rarely exceed 5.0. Setting distance=0.1 usually attains transparency for most input. The default is 1.0. .IP "\fBeffort\fR" 4 .IX Item "effort" Set the encoding effort used. Higher effort values produce more consistent quality and usually produces a better quality/bpp curve, at the cost of more \s-1CPU\s0 time required. Valid values range from 1 to 9, and the default is 7. .IP "\fBmodular\fR" 4 .IX Item "modular" Force the encoder to use Modular mode instead of choosing automatically. The default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT is generally superior to Modular for lossy encoding but does not support lossless encoding. .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 "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 "\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 "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)" .PD Minimum (Best Quality) Quantizer. .IP "\fBqmax (\fR\fImax-q\fR\fB)\fR" 4 .IX Item "qmax (max-q)" Maximum (Worst Quality) Quantizer. Can be changed per-frame. .IP "\fBbufsize (\fR\fIbuf-sz\fR\fB,\fR \fIbuf-optimal-sz\fR\fB)\fR" 4 .IX Item "bufsize (buf-sz, buf-optimal-sz)" 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). Values greater than 1 enable multi-layer alternate reference frames (\s-1VP9\s0 only). .IP "\fBarnr-maxframes\fR" 4 .IX Item "arnr-maxframes" 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. .IP "\fBmin-gf-interval\fR" 4 .IX Item "min-gf-interval" Set minimum golden/alternate reference frame interval (\s-1VP9\s0 only). .RE .RS 4 .RE .IP "\fBerror-resilient\fR" 4 .IX Item "error-resilient" Enable error resiliency features. .IP "\fBsharpness\fR \fIinteger\fR" 4 .IX Item "sharpness integer" Increase sharpness at the expense of lower \s-1PSNR.\s0 The valid range is [0, 7]. .IP "\fBts-parameters\fR" 4 .IX Item "ts-parameters" Sets the temporal scalability configuration using a :\-separated list of key=value pairs. For example, to specify temporal scalability parameters with \f(CW\*(C`ffmpeg\*(C'\fR: .Sp .Vb 3 \& ffmpeg \-i INPUT \-c:v libvpx \-ts\-parameters ts_number_layers=3:\e \& ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\e \& ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT .Ve .Sp Below is a brief explanation of each of the parameters, please refer to \f(CW\*(C`struct vpx_codec_enc_cfg\*(C'\fR in \f(CW\*(C`vpx/vpx_encoder.h\*(C'\fR for more details. .RS 4 .IP "\fBts_number_layers\fR" 4 .IX Item "ts_number_layers" Number of temporal coding layers. .IP "\fBts_target_bitrate\fR" 4 .IX Item "ts_target_bitrate" Target bitrate for each temporal layer (in kbps). (bitrate should be inclusive of the lower temporal layer). .IP "\fBts_rate_decimator\fR" 4 .IX Item "ts_rate_decimator" Frame rate decimation factor for each temporal layer. .IP "\fBts_periodicity\fR" 4 .IX Item "ts_periodicity" Length of the sequence defining frame temporal layer membership. .IP "\fBts_layer_id\fR" 4 .IX Item "ts_layer_id" Template defining the membership of frames to temporal layers. .IP "\fBts_layering_mode\fR" 4 .IX Item "ts_layering_mode" (optional) Selecting the temporal structure from a set of pre-defined temporal layering modes. Currently supports the following options. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" No temporal layering flags are provided internally, relies on flags being passed in using \f(CW\*(C`metadata\*(C'\fR field in \f(CW\*(C`AVFrame\*(C'\fR with following keys. .RS 4 .IP "\fBvp8\-flags\fR" 4 .IX Item "vp8-flags" Sets the flags passed into the encoder to indicate the referencing scheme for the current frame. Refer to function \f(CW\*(C`vpx_codec_encode\*(C'\fR in \f(CW\*(C`vpx/vpx_encoder.h\*(C'\fR for more details. .IP "\fBtemporal_id\fR" 4 .IX Item "temporal_id" Explicitly sets the temporal id of the current frame to encode. .RE .RS 4 .RE .IP "\fB2\fR" 4 .IX Item "2" Two temporal layers. 0\-1... .IP "\fB3\fR" 4 .IX Item "3" Three temporal layers. 0\-2\-1\-2...; with single reference frame. .IP "\fB4\fR" 4 .IX Item "4" Same as option \*(L"3\*(R", except there is a dependency between the two temporal layer 2 frames within the temporal period. .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fBVP8\-specific options\fR" 4 .IX Item "VP8-specific options" .RS 4 .PD 0 .IP "\fBscreen-content-mode\fR" 4 .IX Item "screen-content-mode" .PD Screen content mode, one of: 0 (off), 1 (screen), 2 (screen with more aggressive rate control). .RE .RS 4 .RE .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, 4: equator360). .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 .IP "\fBrow-mt\fR \fIboolean\fR" 4 .IX Item "row-mt boolean" .PD Enable row based multi-threading. .IP "\fBtune-content\fR" 4 .IX Item "tune-content" Set content type: default (0), screen (1), film (2). .IP "\fBcorpus-complexity\fR" 4 .IX Item "corpus-complexity" Corpus \s-1VBR\s0 mode is a variant of standard \s-1VBR\s0 where the complexity distribution midpoint is passed in rather than calculated for a specific clip or chunk. .Sp The valid range is [0, 10000]. 0 (default) uses standard \s-1VBR.\s0 .IP "\fBenable-tpl\fR \fIboolean\fR" 4 .IX Item "enable-tpl boolean" Enable temporal dependency model. .IP "\fBref-frame-config\fR" 4 .IX Item "ref-frame-config" Using per-frame metadata, set members of the structure \f(CW\*(C`vpx_svc_ref_frame_config_t\*(C'\fR in \f(CW\*(C`vpx/vp8cx.h\*(C'\fR to fine-control referencing schemes and frame buffer management. Use a :\-separated list of key=value pairs. For example, .Sp .Vb 2 \& av_dict_set(&av_frame\->metadata, "ref\-frame\-config", \e \& "rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0"); .Ve .RS 4 .IP "\fBrfc_update_buffer_slot\fR" 4 .IX Item "rfc_update_buffer_slot" Indicates the buffer slot number to update .IP "\fBrfc_update_last\fR" 4 .IX Item "rfc_update_last" Indicates whether to update the \s-1LAST\s0 frame .IP "\fBrfc_update_golden\fR" 4 .IX Item "rfc_update_golden" Indicates whether to update \s-1GOLDEN\s0 frame .IP "\fBrfc_update_alt_ref\fR" 4 .IX Item "rfc_update_alt_ref" Indicates whether to update \s-1ALT_REF\s0 frame .IP "\fBrfc_lst_fb_idx\fR" 4 .IX Item "rfc_lst_fb_idx" \&\s-1LAST\s0 frame buffer index .IP "\fBrfc_gld_fb_idx\fR" 4 .IX Item "rfc_gld_fb_idx" \&\s-1GOLDEN\s0 frame buffer index .IP "\fBrfc_alt_fb_idx\fR" 4 .IX Item "rfc_alt_fb_idx" \&\s-1ALT_REF\s0 frame buffer index .IP "\fBrfc_reference_last\fR" 4 .IX Item "rfc_reference_last" Indicates whether to reference \s-1LAST\s0 frame .IP "\fBrfc_reference_golden\fR" 4 .IX Item "rfc_reference_golden" Indicates whether to reference \s-1GOLDEN\s0 frame .IP "\fBrfc_reference_alt_ref\fR" 4 .IX Item "rfc_reference_alt_ref" Indicates whether to reference \s-1ALT_REF\s0 frame .IP "\fBrfc_reference_duration\fR" 4 .IX Item "rfc_reference_duration" Indicates frame duration .RE .RS 4 .RE .RE .RS 4 .RE .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\-quality\fR \fIfloat\fR" 4 .IX Item "-quality float" For lossy encoding, this controls image quality. For lossless encoding, this controls the effort and time spent in compression. Range is 0 to 100. Default is 75. .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. .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 \-\-fullhelp\fR or consult the libx264 documentation. .PP In the list below, note that the \fBx264\fR option name is shown in parentheses after the libavcodec corresponding name, in case there is a direct mapping. .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)" Number of B\-frames between I and P\-frames .IP "\fBg (\fR\fIkeyint\fR\fB)\fR" 4 .IX Item "g (keyint)" Maximum \s-1GOP\s0 size .IP "\fBqmin (\fR\fIqpmin\fR\fB)\fR" 4 .IX Item "qmin (qpmin)" 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 \fI0\-16\fR. .IP "\fBlevel (\fR\fIlevel\fR\fB)\fR" 4 .IX Item "level (level)" Set the \f(CW\*(C`x264_param_t.i_level_idc\*(C'\fR value in case the value is positive, it is ignored otherwise. .Sp This value can be set using the \f(CW\*(C`AVCodecContext\*(C'\fR \s-1API\s0 (e.g. by setting the \f(CW\*(C`AVCodecContext\*(C'\fR value directly), and is specified as an integer mapped on a corresponding level (e.g. the value 31 maps to H.264 level \s-1IDC \*(L"3.1\*(R",\s0 as defined in the \f(CW\*(C`x264_levels\*(C'\fR table). It is ignored when set to a non positive value. .Sp Alternatively it can be set as a private option, overriding the value set in \f(CW\*(C`AVCodecContext\*(C'\fR, and in this case must be specified as the level \s-1IDC\s0 identifier (e.g. \*(L"3.1\*(R"), as defined by H.264 Annex A. .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)" Noise reduction .IP "\fBme_range (\fR\fImerange\fR\fB)\fR" 4 .IX Item "me_range (merange)" 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 "\fBforced-idr\fR" 4 .IX Item "forced-idr" Normally, when forcing a I\-frame type, the encoder can select any type of I\-frame. This option forces it to choose an IDR-frame. .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)" Initial \s-1VBV\s0 buffer occupancy .IP "\fBpreset (\fR\fIpreset\fR\fB)\fR" 4 .IX Item "preset (preset)" 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 values. 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\fR \fIopts\fR" 4 .IX Item "x264opts opts" .PD 0 .IP "\fBx264\-params\fR \fIopts\fR" 4 .IX Item "x264-params opts" .PD Override the x264 configuration using a :\-separated list of key=value options. .Sp The argument for both options is a list of \fIkey\fR=\fIvalue\fR couples separated by \*(L":\*(R". With \fBx264opts\fR the value can be omitted, and the value \f(CW1\fR is assumed in that case. .Sp For \fIfilter\fR and \fIpsy-rd\fR options values 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, the options might be provided as: .Sp .Vb 1 \& level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv\-maxrate=768:vbv\-bufsize=2000:analyse=all:me=umh:no\-fast\-pskip=1:subq=6:8x8dct=0:trellis=0 .Ve .Sp For example to specify libx264 encoding options with \fBffmpeg\fR: .Sp .Vb 1 \& ffmpeg \-i foo.mpg \-c:v libx264 \-x264opts keyint=123:min\-keyint=20 \-an out.mkv .Ve .Sp To get the complete list of the libx264 options, invoke the command \&\fBx264 \-\-fullhelp\fR or consult the libx264 documentation. .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 "\fBudu_sei\fR \fIboolean\fR" 4 .IX Item "udu_sei boolean" Import user data unregistered \s-1SEI\s0 if available into output. Default is 0 (off). .IP "\fBmb_info\fR \fIboolean\fR" 4 .IX Item "mb_info boolean" Set mb_info data through AVFrameSideData, only useful when used from the \&\s-1API.\s0 Default is 0 (off). .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 "\fBb\fR" 4 .IX Item "b" Sets target video bitrate. .IP "\fBbf\fR" 4 .IX Item "bf" .PD 0 .IP "\fBg\fR" 4 .IX Item "g" .PD Set the \s-1GOP\s0 size. .IP "\fBkeyint_min\fR" 4 .IX Item "keyint_min" Minimum \s-1GOP\s0 size. .IP "\fBrefs\fR" 4 .IX Item "refs" Number of reference frames each P\-frame can use. The range is from \fI1\-16\fR. .IP "\fBpreset\fR" 4 .IX Item "preset" Set the x265 preset. .IP "\fBtune\fR" 4 .IX Item "tune" Set the x265 tune parameter. .IP "\fBprofile\fR" 4 .IX Item "profile" Set profile restrictions. .IP "\fBcrf\fR" 4 .IX Item "crf" Set the quality for constant quality mode. .IP "\fBqp\fR" 4 .IX Item "qp" Set constant quantization rate control method parameter. .IP "\fBqmin\fR" 4 .IX Item "qmin" Minimum quantizer scale. .IP "\fBqmax\fR" 4 .IX Item "qmax" Maximum quantizer scale. .IP "\fBqdiff\fR" 4 .IX Item "qdiff" Maximum difference between quantizer scales. .IP "\fBqblur\fR" 4 .IX Item "qblur" Quantizer curve blur .IP "\fBqcomp\fR" 4 .IX Item "qcomp" Quantizer curve compression factor .IP "\fBi_qfactor\fR" 4 .IX Item "i_qfactor" .PD 0 .IP "\fBb_qfactor\fR" 4 .IX Item "b_qfactor" .IP "\fBforced-idr\fR" 4 .IX Item "forced-idr" .PD Normally, when forcing a I\-frame type, the encoder can select any type of I\-frame. This option forces it to choose an IDR-frame. .IP "\fBudu_sei\fR \fIboolean\fR" 4 .IX Item "udu_sei boolean" Import user data unregistered \s-1SEI\s0 if available into output. Default is 0 (off). .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 "libxavs2" .IX Subsection "libxavs2" xavs2 \s-1AVS2\-P2/IEEE1857.4\s0 encoder wrapper. .PP This encoder requires the presence of the libxavs2 headers and library during configuration. You need to explicitly configure the build with \&\fB\-\-enable\-libxavs2\fR. .PP The following standard libavcodec options are used: .IP "\(bu" 4 \&\fBb\fR / \fBbit_rate\fR .IP "\(bu" 4 \&\fBg\fR / \fBgop_size\fR .IP "\(bu" 4 \&\fBbf\fR / \fBmax_b_frames\fR .PP The encoder also has its own specific options: .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBlcu_row_threads\fR" 4 .IX Item "lcu_row_threads" Set the number of parallel threads for rows from 1 to 8 (default 5). .IP "\fBinitial_qp\fR" 4 .IX Item "initial_qp" Set the xavs2 quantization parameter from 1 to 63 (default 34). This is used to set the initial qp for the first frame. .IP "\fBqp\fR" 4 .IX Item "qp" Set the xavs2 quantization parameter from 1 to 63 (default 34). This is used to set the qp value under constant-QP mode. .IP "\fBmax_qp\fR" 4 .IX Item "max_qp" Set the max qp for rate control from 1 to 63 (default 55). .IP "\fBmin_qp\fR" 4 .IX Item "min_qp" Set the min qp for rate control from 1 to 63 (default 20). .IP "\fBspeed_level\fR" 4 .IX Item "speed_level" Set the Speed level from 0 to 9 (default 0). Higher is better but slower. .IP "\fBlog_level\fR" 4 .IX Item "log_level" Set the log level from \-1 to 3 (default 0). \-1: none, 0: error, 1: warning, 2: info, 3: debug. .IP "\fBxavs2\-params\fR" 4 .IX Item "xavs2-params" Set xavs2 options using a list of \fIkey\fR=\fIvalue\fR couples separated by \*(L":\*(R". .Sp For example to specify libxavs2 encoding options with \fB\-xavs2\-params\fR: .Sp .Vb 1 \& ffmpeg \-i input \-c:v libxavs2 \-xavs2\-params RdoqLevel=0 output.avs2 .Ve .SS "libxeve" .IX Subsection "libxeve" eXtra-fast Essential Video Encoder (\s-1XEVE\s0) \s-1MPEG\-5 EVC\s0 encoder wrapper. The xeve-equivalent options or values are listed in parentheses for easy migration. .PP This encoder requires the presence of the libxeve headers and library during configuration. You need to explicitly configure the build with \&\fB\-\-enable\-libxeve\fR. .Sp .RS 4 Many libxeve encoder options are mapped to FFmpeg global codec options, while unique encoder options are provided through private options. Additionally the xeve-params private options allows one to pass a list of key=value tuples as accepted by the libxeve \f(CW\*(C`parse_xeve_params\*(C'\fR function. .RE .PP The xeve project website is at <\fBhttps://github.com/mpeg5/xeve\fR>. .PP \fIOptions\fR .IX Subsection "Options" .PP The following options are supported by the libxeve wrapper. The xeve-equivalent options or values are listed in parentheses for easy migration. .Sp .RS 4 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. .RE .Sp .RS 4 To get a more accurate and extensive documentation of the libxeve options, invoke the command \f(CW\*(C`xeve_app \-\-help\*(C'\fR or consult the libxeve documentation. .RE .IP "\fBb (\fR\fIbitrate\fR\fB)\fR" 4 .IX Item "b (bitrate)" Set target video bitrate in bits/s. Note that FFmpeg's b option is expressed in bits/s, while xeve's bitrate is in kilobits/s. .IP "\fBbf (\fR\fIbframes\fR\fB)\fR" 4 .IX Item "bf (bframes)" Set the maximum number of B frames (1,3,7,15). .IP "\fBg (\fR\fIkeyint\fR\fB)\fR" 4 .IX Item "g (keyint)" Set the \s-1GOP\s0 size (I\-picture period). .IP "\fBpreset (\fR\fIpreset\fR\fB)\fR" 4 .IX Item "preset (preset)" Set the xeve preset. Set the encoder preset value to determine encoding speed [fast, medium, slow, placebo] .IP "\fBtune (\fR\fItune\fR\fB)\fR" 4 .IX Item "tune (tune)" Set the encoder tune parameter [psnr, zerolatency] .IP "\fBprofile (\fR\fIprofile\fR\fB)\fR" 4 .IX Item "profile (profile)" Set the encoder profile [0: baseline; 1: main] .IP "\fBcrf (\fR\fIcrf\fR\fB)\fR" 4 .IX Item "crf (crf)" Set the quality for constant quality mode. Constant rate factor <10..49> [default: 32] .IP "\fBqp (\fR\fIqp\fR\fB)\fR" 4 .IX Item "qp (qp)" Set constant quantization rate control method parameter. Quantization parameter qp <0..51> [default: 32] .IP "\fBthreads (\fR\fIthreads\fR\fB)\fR" 4 .IX Item "threads (threads)" Force to use a specific number of threads .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 "\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 "\fBgmc\fR" 4 .IX Item "gmc" Enable the use of global motion compensation (\s-1GMC\s0). Default is 0 (disabled). .IP "\fBme_quality\fR" 4 .IX Item "me_quality" Set motion estimation quality level. Possible values in decreasing order of speed and increasing order of quality: .RS 4 .IP "\fB0\fR" 4 .IX Item "0" Use no motion estimation (default). .IP "\fB1, 2\fR" 4 .IX Item "1, 2" Enable advanced diamond zonal search for 16x16 blocks and half-pixel refinement for 16x16 blocks. .IP "\fB3, 4\fR" 4 .IX Item "3, 4" Enable all of the things described above, plus advanced diamond zonal search for 8x8 blocks and half-pixel refinement for 8x8 blocks, also enable motion estimation on chroma planes for P and B\-frames. .IP "\fB5, 6\fR" 4 .IX Item "5, 6" 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 "\fBtrellis\fR" 4 .IX Item "trellis" Set rate-distortion optimal quantization. .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 "MediaFoundation" .IX Subsection "MediaFoundation" This provides wrappers to encoders (both audio and video) in the MediaFoundation framework. It can access both \s-1SW\s0 and \s-1HW\s0 encoders. Video encoders can take input in either of nv12 or yuv420p form (some encoders support both, some support only either \- in practice, nv12 is the safer choice, especially among \s-1HW\s0 encoders). .SS "Microsoft \s-1RLE\s0" .IX Subsection "Microsoft RLE" Microsoft \s-1RLE\s0 aka \s-1MSRLE\s0 encoder. Only 8\-bit palette mode supported. Compatible with Windows 3.1 and Windows 95. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBg\fR \fIinteger\fR" 4 .IX Item "g integer" Keyframe interval. A keyframe is inserted at least every \f(CW\*(C`\-g\*(C'\fR frames, sometimes sooner. .SS "mpeg2" .IX Subsection "mpeg2" \&\s-1MPEG\-2\s0 video encoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBprofile\fR" 4 .IX Item "profile" Select the mpeg2 profile to encode: .RS 4 .IP "\fB422\fR" 4 .IX Item "422" .PD 0 .IP "\fBhigh\fR" 4 .IX Item "high" .IP "\fBss\fR" 4 .IX Item "ss" .PD Spatially Scalable .IP "\fBsnr\fR" 4 .IX Item "snr" \&\s-1SNR\s0 Scalable .IP "\fBmain\fR" 4 .IX Item "main" .PD 0 .IP "\fBsimple\fR" 4 .IX Item "simple" .RE .RS 4 .RE .IP "\fBlevel\fR" 4 .IX Item "level" .PD Select the mpeg2 level to encode: .RS 4 .IP "\fBhigh\fR" 4 .IX Item "high" .PD 0 .IP "\fBhigh1440\fR" 4 .IX Item "high1440" .IP "\fBmain\fR" 4 .IX Item "main" .IP "\fBlow\fR" 4 .IX Item "low" .RE .RS 4 .RE .IP "\fBseq_disp_ext\fR \fIinteger\fR" 4 .IX Item "seq_disp_ext integer" .PD 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 .IP "\fBvideo_format\fR \fIinteger\fR" 4 .IX Item "video_format integer" Specifies the video_format written into the sequence display extension indicating the source of the video pictures. The default is \fBunspecified\fR, can be \fBcomponent\fR, \fBpal\fR, \fBntsc\fR, \fBsecam\fR or \fBmac\fR. For maximum compatibility, use \fBcomponent\fR. .IP "\fBa53cc\fR \fIboolean\fR" 4 .IX Item "a53cc boolean" Import closed captions (which must be \s-1ATSC\s0 compatible format) into output. Default is 1 (on). .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" .IP "\fB4444xq\fR" 4 .IX Item "4444xq" .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 "\s-1QSV\s0 Encoders" .IX Subsection "QSV Encoders" The family of Intel QuickSync Video encoders (\s-1MPEG\-2, H.264, HEVC, JPEG/MJPEG, VP9, AV1\s0) .PP \fIRatecontrol Method\fR .IX Subsection "Ratecontrol Method" .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. For the \s-1ICQ\s0 modes, global quality range is 1 to 51, with 1 being the best quality. .RE .RS 4 .RE .IP "\(bu" 4 Otherwise when the desired average bitrate is specified with the \fBb\fR option, a bitrate-based mode is used. .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, both \&\fBavbr_accuracy\fR and \fBavbr_convergence\fR are set to non-zero. This mode is available for H264 and \s-1HEVC\s0 on Windows. .RE .RS 4 .RE .IP "\(bu" 4 Otherwise the default ratecontrol method \fI\s-1CQP\s0\fR is used. .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 \fIGlobal Options \-> \s-1MSDK\s0 Options\fR .IX Subsection "Global Options -> MSDK Options" .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 .PP \fICommon Options\fR .IX Subsection "Common Options" .PP Following options are used by all qsv encoders. .IP "\fIasync_depth\fR" 4 .IX Item "async_depth" Specifies how many asynchronous operations an application performs before the application explicitly synchronizes the result. If zero, the value is not specified. .IP "\fIpreset\fR" 4 .IX Item "preset" This option itemizes a range of choices from veryfast (best speed) to veryslow (best quality). .RS 4 .IP "\fBveryfast\fR" 4 .IX Item "veryfast" .PD 0 .IP "\fBfaster\fR" 4 .IX Item "faster" .IP "\fBfast\fR" 4 .IX Item "fast" .IP "\fBmedium\fR" 4 .IX Item "medium" .IP "\fBslow\fR" 4 .IX Item "slow" .IP "\fBslower\fR" 4 .IX Item "slower" .IP "\fBveryslow\fR" 4 .IX Item "veryslow" .RE .RS 4 .RE .IP "\fIforced_idr\fR" 4 .IX Item "forced_idr" .PD Forcing I frames as \s-1IDR\s0 frames. .IP "\fIlow_power\fR" 4 .IX Item "low_power" For encoders set this flag to \s-1ON\s0 to reduce power consumption and \s-1GPU\s0 usage. .PP \fIRuntime Options\fR .IX Subsection "Runtime Options" .PP Following options can be used durning qsv encoding. .IP "\fIglobal_quality\fR" 4 .IX Item "global_quality" .PD 0 .IP "\fIi_quant_factor\fR" 4 .IX Item "i_quant_factor" .IP "\fIi_quant_offset\fR" 4 .IX Item "i_quant_offset" .IP "\fIb_quant_factor\fR" 4 .IX Item "b_quant_factor" .IP "\fIb_quant_offset\fR" 4 .IX Item "b_quant_offset" .PD Supported in h264_qsv and hevc_qsv. Change these value to reset qsv codec's qp configuration. .IP "\fImax_frame_size\fR" 4 .IX Item "max_frame_size" Supported in h264_qsv and hevc_qsv. Change this value to reset qsv codec's MaxFrameSize configuration. .IP "\fIgop_size\fR" 4 .IX Item "gop_size" Change this value to reset qsv codec's gop configuration. .IP "\fIint_ref_type\fR" 4 .IX Item "int_ref_type" .PD 0 .IP "\fIint_ref_cycle_size\fR" 4 .IX Item "int_ref_cycle_size" .IP "\fIint_ref_qp_delta\fR" 4 .IX Item "int_ref_qp_delta" .IP "\fIint_ref_cycle_dist\fR" 4 .IX Item "int_ref_cycle_dist" .PD Supported in h264_qsv and hevc_qsv. Change these value to reset qsv codec's Intra Refresh configuration. .IP "\fIqmax\fR" 4 .IX Item "qmax" .PD 0 .IP "\fIqmin\fR" 4 .IX Item "qmin" .IP "\fImax_qp_i\fR" 4 .IX Item "max_qp_i" .IP "\fImin_qp_i\fR" 4 .IX Item "min_qp_i" .IP "\fImax_qp_p\fR" 4 .IX Item "max_qp_p" .IP "\fImin_qp_p\fR" 4 .IX Item "min_qp_p" .IP "\fImax_qp_b\fR" 4 .IX Item "max_qp_b" .IP "\fImin_qp_b\fR" 4 .IX Item "min_qp_b" .PD Supported in h264_qsv. Change these value to reset qsv codec's max/min qp configuration. .IP "\fIlow_delay_brc\fR" 4 .IX Item "low_delay_brc" Supported in h264_qsv, hevc_qsv and av1_qsv. Change this value to reset qsv codec's low_delay_brc configuration. .IP "\fIframerate\fR" 4 .IX Item "framerate" Change this value to reset qsv codec's framerate configuration. .IP "\fIbit_rate\fR" 4 .IX Item "bit_rate" .PD 0 .IP "\fIrc_buffer_size\fR" 4 .IX Item "rc_buffer_size" .IP "\fIrc_initial_buffer_occupancy\fR" 4 .IX Item "rc_initial_buffer_occupancy" .IP "\fIrc_max_rate\fR" 4 .IX Item "rc_max_rate" .PD Change these value to reset qsv codec's bitrate control configuration. .IP "\fIpic_timing_sei\fR" 4 .IX Item "pic_timing_sei" Supported in h264_qsv and hevc_qsv. Change this value to reset qsv codec's pic_timing_sei configuration. .PP \fIH264 options\fR .IX Subsection "H264 options" .PP These options are used by h264_qsv .IP "\fIextbrc\fR" 4 .IX Item "extbrc" Extended bitrate control. .IP "\fIrecovery_point_sei\fR" 4 .IX Item "recovery_point_sei" Set this flag to insert the recovery point \s-1SEI\s0 message at the beginning of every intra refresh cycle. .IP "\fIrdo\fR" 4 .IX Item "rdo" Enable rate distortion optimization. .IP "\fImax_frame_size\fR" 4 .IX Item "max_frame_size" Maximum encoded frame size in bytes. .IP "\fImax_frame_size_i\fR" 4 .IX Item "max_frame_size_i" Maximum encoded frame size for I frames in bytes. If this value is set as larger than zero, then for I frames the value set by max_frame_size is ignored. .IP "\fImax_frame_size_p\fR" 4 .IX Item "max_frame_size_p" Maximum encoded frame size for P frames in bytes. If this value is set as larger than zero, then for P frames the value set by max_frame_size is ignored. .IP "\fImax_slice_size\fR" 4 .IX Item "max_slice_size" Maximum encoded slice size in bytes. .IP "\fIbitrate_limit\fR" 4 .IX Item "bitrate_limit" Toggle bitrate limitations. Modifies bitrate to be in the range imposed by the \s-1QSV\s0 encoder. Setting this flag off may lead to violation of \s-1HRD\s0 conformance. Mind that specifying bitrate below the \s-1QSV\s0 encoder range might significantly affect quality. If on this option takes effect in non \s-1CQP\s0 modes: if bitrate is not in the range imposed by the \s-1QSV\s0 encoder, it will be changed to be in the range. .IP "\fImbbrc\fR" 4 .IX Item "mbbrc" Setting this flag enables macroblock level bitrate control that generally improves subjective visual quality. Enabling this flag may have negative impact on performance and objective visual quality metric. .IP "\fIlow_delay_brc\fR" 4 .IX Item "low_delay_brc" Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides more accurate bitrate control to minimize the variance of bitstream size frame by frame. Value: \-1\-default 0\-off 1\-on .IP "\fIadaptive_i\fR" 4 .IX Item "adaptive_i" This flag controls insertion of I frames by the \s-1QSV\s0 encoder. Turn \s-1ON\s0 this flag to allow changing of frame type from P and B to I. .IP "\fIadaptive_b\fR" 4 .IX Item "adaptive_b" This flag controls changing of frame type from B to P. .IP "\fIp_strategy\fR" 4 .IX Item "p_strategy" Enable P\-pyramid: 0\-default 1\-simple 2\-pyramid(bf need to be set to 0). .IP "\fIb_strategy\fR" 4 .IX Item "b_strategy" This option controls usage of B frames as reference. .IP "\fIdblk_idc\fR" 4 .IX Item "dblk_idc" This option disable deblocking. It has value in range 0~2. .IP "\fIcavlc\fR" 4 .IX Item "cavlc" If set, \s-1CAVLC\s0 is used; if unset, \s-1CABAC\s0 is used for encoding. .IP "\fIvcm\fR" 4 .IX Item "vcm" Video conferencing mode, please see ratecontrol method. .IP "\fIidr_interval\fR" 4 .IX Item "idr_interval" Distance (in I\-frames) between \s-1IDR\s0 frames. .IP "\fIpic_timing_sei\fR" 4 .IX Item "pic_timing_sei" Insert picture timing \s-1SEI\s0 with pic_struct_syntax element. .IP "\fIsingle_sei_nal_unit\fR" 4 .IX Item "single_sei_nal_unit" Put all the \s-1SEI\s0 messages into one \s-1NALU.\s0 .IP "\fImax_dec_frame_buffering\fR" 4 .IX Item "max_dec_frame_buffering" Maximum number of frames buffered in the \s-1DPB.\s0 .IP "\fIlook_ahead\fR" 4 .IX Item "look_ahead" Use \s-1VBR\s0 algorithm with look ahead. .IP "\fIlook_ahead_depth\fR" 4 .IX Item "look_ahead_depth" Depth of look ahead in number frames. .IP "\fIlook_ahead_downsampling\fR" 4 .IX Item "look_ahead_downsampling" Downscaling factor for the frames saved for the lookahead analysis. .RS 4 .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBauto\fR" 4 .IX Item "auto" .IP "\fBoff\fR" 4 .IX Item "off" .IP "\fB2x\fR" 4 .IX Item "2x" .IP "\fB4x\fR" 4 .IX Item "4x" .RE .RS 4 .RE .IP "\fIint_ref_type\fR" 4 .IX Item "int_ref_type" .PD Specifies intra refresh type. The major goal of intra refresh is improvement of error resilience without significant impact on encoded bitstream size caused by I frames. The \s-1SDK\s0 encoder achieves this by encoding part of each frame in refresh cycle using intra MBs. \fInone\fR means no refresh. \fIvertical\fR means vertical refresh, by column of MBs. \fIhorizontal\fR means horizontal refresh, by rows of MBs. \fIslice\fR means horizontal refresh by slices without overlapping. In case of \fIslice\fR, in_ref_cycle_size is ignored. To enable intra refresh, B frame should be set to 0. .IP "\fIint_ref_cycle_size\fR" 4 .IX Item "int_ref_cycle_size" Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are invalid values. .IP "\fIint_ref_qp_delta\fR" 4 .IX Item "int_ref_qp_delta" Specifies \s-1QP\s0 difference for inserted intra MBs. This is signed value in [\-51, 51] range if target encoding bit-depth for luma samples is 8 and this range is [\-63, 63] for 10 bit-depth or [\-75, 75] for 12 bit-depth respectively. .IP "\fIint_ref_cycle_dist\fR" 4 .IX Item "int_ref_cycle_dist" Distance between the beginnings of the intra-refresh cycles in frames. .IP "\fIprofile\fR" 4 .IX Item "profile" .RS 4 .PD 0 .IP "\fBunknown\fR" 4 .IX Item "unknown" .IP "\fBbaseline\fR" 4 .IX Item "baseline" .IP "\fBmain\fR" 4 .IX Item "main" .IP "\fBhigh\fR" 4 .IX Item "high" .RE .RS 4 .RE .IP "\fIa53cc\fR" 4 .IX Item "a53cc" .PD Use A53 Closed Captions (if available). .IP "\fIaud\fR" 4 .IX Item "aud" Insert the Access Unit Delimiter \s-1NAL.\s0 .IP "\fImfmode\fR" 4 .IX Item "mfmode" Multi-Frame Mode. .RS 4 .IP "\fBoff\fR" 4 .IX Item "off" .PD 0 .IP "\fBauto\fR" 4 .IX Item "auto" .RE .RS 4 .RE .IP "\fIrepeat_pps\fR" 4 .IX Item "repeat_pps" .PD Repeat pps for every frame. .IP "\fImax_qp_i\fR" 4 .IX Item "max_qp_i" Maximum video quantizer scale for I frame. .IP "\fImin_qp_i\fR" 4 .IX Item "min_qp_i" Minimum video quantizer scale for I frame. .IP "\fImax_qp_p\fR" 4 .IX Item "max_qp_p" Maximum video quantizer scale for P frame. .IP "\fImin_qp_p\fR" 4 .IX Item "min_qp_p" Minimum video quantizer scale for P frame. .IP "\fImax_qp_b\fR" 4 .IX Item "max_qp_b" Maximum video quantizer scale for B frame. .IP "\fImin_qp_b\fR" 4 .IX Item "min_qp_b" Minimum video quantizer scale for B frame. .IP "\fIscenario\fR" 4 .IX Item "scenario" Provides a hint to encoder about the scenario for the encoding session. .RS 4 .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBdisplayremoting\fR" 4 .IX Item "displayremoting" .IP "\fBvideoconference\fR" 4 .IX Item "videoconference" .IP "\fBarchive\fR" 4 .IX Item "archive" .IP "\fBlivestreaming\fR" 4 .IX Item "livestreaming" .IP "\fBcameracapture\fR" 4 .IX Item "cameracapture" .IP "\fBvideosurveillance\fR" 4 .IX Item "videosurveillance" .IP "\fBgamestreaming\fR" 4 .IX Item "gamestreaming" .IP "\fBremotegaming\fR" 4 .IX Item "remotegaming" .RE .RS 4 .RE .IP "\fIavbr_accuracy\fR" 4 .IX Item "avbr_accuracy" .PD Accuracy of the \s-1AVBR\s0 ratecontrol (unit of tenth of percent). .IP "\fIavbr_convergence\fR" 4 .IX Item "avbr_convergence" Convergence of the \s-1AVBR\s0 ratecontrol (unit of 100 frames) .Sp The parameters \fIavbr_accuracy\fR and \fIavbr_convergence\fR are for the average variable bitrate control (\s-1AVBR\s0) algorithm. The algorithm focuses on overall encoding quality while meeting the specified bitrate, \fItarget_bitrate\fR, within the accuracy range \fIavbr_accuracy\fR, after a \fIavbr_Convergence\fR period. This method does not follow \s-1HRD\s0 and the instant bitrate is not capped or padded. .IP "\fIskip_frame\fR" 4 .IX Item "skip_frame" Use per-frame metadata \*(L"qsv_skip_frame\*(R" to skip frame when encoding. This option defines the usage of this metadata. .RS 4 .IP "\fBno_skip\fR" 4 .IX Item "no_skip" Frame skipping is disabled. .IP "\fBinsert_dummy\fR" 4 .IX Item "insert_dummy" Encoder inserts into bitstream frame where all macroblocks are encoded as skipped. .IP "\fBinsert_nothing\fR" 4 .IX Item "insert_nothing" Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped frames are still used in brc. For example, gop still include skipped frames, and the frames after skipped frames will be larger in size. .IP "\fBbrc_only\fR" 4 .IX Item "brc_only" skip_frame metadata indicates the number of missed frames before the current frame. .RE .RS 4 .RE .PP \fI\s-1HEVC\s0 Options\fR .IX Subsection "HEVC Options" .PP These options are used by hevc_qsv .IP "\fIextbrc\fR" 4 .IX Item "extbrc" Extended bitrate control. .IP "\fIrecovery_point_sei\fR" 4 .IX Item "recovery_point_sei" Set this flag to insert the recovery point \s-1SEI\s0 message at the beginning of every intra refresh cycle. .IP "\fIrdo\fR" 4 .IX Item "rdo" Enable rate distortion optimization. .IP "\fImax_frame_size\fR" 4 .IX Item "max_frame_size" Maximum encoded frame size in bytes. .IP "\fImax_frame_size_i\fR" 4 .IX Item "max_frame_size_i" Maximum encoded frame size for I frames in bytes. If this value is set as larger than zero, then for I frames the value set by max_frame_size is ignored. .IP "\fImax_frame_size_p\fR" 4 .IX Item "max_frame_size_p" Maximum encoded frame size for P frames in bytes. If this value is set as larger than zero, then for P frames the value set by max_frame_size is ignored. .IP "\fImax_slice_size\fR" 4 .IX Item "max_slice_size" Maximum encoded slice size in bytes. .IP "\fImbbrc\fR" 4 .IX Item "mbbrc" Setting this flag enables macroblock level bitrate control that generally improves subjective visual quality. Enabling this flag may have negative impact on performance and objective visual quality metric. .IP "\fIlow_delay_brc\fR" 4 .IX Item "low_delay_brc" Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides more accurate bitrate control to minimize the variance of bitstream size frame by frame. Value: \-1\-default 0\-off 1\-on .IP "\fIadaptive_i\fR" 4 .IX Item "adaptive_i" This flag controls insertion of I frames by the \s-1QSV\s0 encoder. Turn \s-1ON\s0 this flag to allow changing of frame type from P and B to I. .IP "\fIadaptive_b\fR" 4 .IX Item "adaptive_b" This flag controls changing of frame type from B to P. .IP "\fIp_strategy\fR" 4 .IX Item "p_strategy" Enable P\-pyramid: 0\-default 1\-simple 2\-pyramid(bf need to be set to 0). .IP "\fIb_strategy\fR" 4 .IX Item "b_strategy" This option controls usage of B frames as reference. .IP "\fIdblk_idc\fR" 4 .IX Item "dblk_idc" This option disable deblocking. It has value in range 0~2. .IP "\fIidr_interval\fR" 4 .IX Item "idr_interval" Distance (in I\-frames) between \s-1IDR\s0 frames. .RS 4 .IP "\fBbegin_only\fR" 4 .IX Item "begin_only" Output an IDR-frame only at the beginning of the stream. .RE .RS 4 .RE .IP "\fIload_plugin\fR" 4 .IX Item "load_plugin" A user plugin to load in an internal session. .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" .PD 0 .IP "\fBhevc_sw\fR" 4 .IX Item "hevc_sw" .IP "\fBhevc_hw\fR" 4 .IX Item "hevc_hw" .RE .RS 4 .RE .IP "\fIload_plugins\fR" 4 .IX Item "load_plugins" .PD A :\-separate list of hexadecimal plugin UIDs to load in an internal session. .IP "\fIlook_ahead_depth\fR" 4 .IX Item "look_ahead_depth" Depth of look ahead in number frames, available when extbrc option is enabled. .IP "\fIprofile\fR" 4 .IX Item "profile" Set the encoding profile (scc requires libmfx >= 1.32). .RS 4 .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBmain\fR" 4 .IX Item "main" .IP "\fBmain10\fR" 4 .IX Item "main10" .IP "\fBmainsp\fR" 4 .IX Item "mainsp" .IP "\fBrext\fR" 4 .IX Item "rext" .IP "\fBscc\fR" 4 .IX Item "scc" .RE .RS 4 .RE .IP "\fItier\fR" 4 .IX Item "tier" .PD Set the encoding tier (only level >= 4 can support high tier). This option only takes effect when the level option is specified. .RS 4 .IP "\fBmain\fR" 4 .IX Item "main" .PD 0 .IP "\fBhigh\fR" 4 .IX Item "high" .RE .RS 4 .RE .IP "\fIgpb\fR" 4 .IX Item "gpb" .PD 1: \s-1GPB\s0 (generalized P/B frame) .Sp 0: regular P frame. .IP "\fItile_cols\fR" 4 .IX Item "tile_cols" Number of columns for tiled encoding. .IP "\fItile_rows\fR" 4 .IX Item "tile_rows" Number of rows for tiled encoding. .IP "\fIaud\fR" 4 .IX Item "aud" Insert the Access Unit Delimiter \s-1NAL.\s0 .IP "\fIpic_timing_sei\fR" 4 .IX Item "pic_timing_sei" Insert picture timing \s-1SEI\s0 with pic_struct_syntax element. .IP "\fItransform_skip\fR" 4 .IX Item "transform_skip" Turn this option \s-1ON\s0 to enable transformskip. It is supported on platform equal or newer than \s-1ICL.\s0 .IP "\fIint_ref_type\fR" 4 .IX Item "int_ref_type" Specifies intra refresh type. The major goal of intra refresh is improvement of error resilience without significant impact on encoded bitstream size caused by I frames. The \s-1SDK\s0 encoder achieves this by encoding part of each frame in refresh cycle using intra MBs. \fInone\fR means no refresh. \fIvertical\fR means vertical refresh, by column of MBs. \fIhorizontal\fR means horizontal refresh, by rows of MBs. \fIslice\fR means horizontal refresh by slices without overlapping. In case of \fIslice\fR, in_ref_cycle_size is ignored. To enable intra refresh, B frame should be set to 0. .IP "\fIint_ref_cycle_size\fR" 4 .IX Item "int_ref_cycle_size" Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are invalid values. .IP "\fIint_ref_qp_delta\fR" 4 .IX Item "int_ref_qp_delta" Specifies \s-1QP\s0 difference for inserted intra MBs. This is signed value in [\-51, 51] range if target encoding bit-depth for luma samples is 8 and this range is [\-63, 63] for 10 bit-depth or [\-75, 75] for 12 bit-depth respectively. .IP "\fIint_ref_cycle_dist\fR" 4 .IX Item "int_ref_cycle_dist" Distance between the beginnings of the intra-refresh cycles in frames. .IP "\fImax_qp_i\fR" 4 .IX Item "max_qp_i" Maximum video quantizer scale for I frame. .IP "\fImin_qp_i\fR" 4 .IX Item "min_qp_i" Minimum video quantizer scale for I frame. .IP "\fImax_qp_p\fR" 4 .IX Item "max_qp_p" Maximum video quantizer scale for P frame. .IP "\fImin_qp_p\fR" 4 .IX Item "min_qp_p" Minimum video quantizer scale for P frame. .IP "\fImax_qp_b\fR" 4 .IX Item "max_qp_b" Maximum video quantizer scale for B frame. .IP "\fImin_qp_b\fR" 4 .IX Item "min_qp_b" Minimum video quantizer scale for B frame. .IP "\fIscenario\fR" 4 .IX Item "scenario" Provides a hint to encoder about the scenario for the encoding session. .RS 4 .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBdisplayremoting\fR" 4 .IX Item "displayremoting" .IP "\fBvideoconference\fR" 4 .IX Item "videoconference" .IP "\fBarchive\fR" 4 .IX Item "archive" .IP "\fBlivestreaming\fR" 4 .IX Item "livestreaming" .IP "\fBcameracapture\fR" 4 .IX Item "cameracapture" .IP "\fBvideosurveillance\fR" 4 .IX Item "videosurveillance" .IP "\fBgamestreaming\fR" 4 .IX Item "gamestreaming" .IP "\fBremotegaming\fR" 4 .IX Item "remotegaming" .RE .RS 4 .RE .IP "\fIavbr_accuracy\fR" 4 .IX Item "avbr_accuracy" .PD Accuracy of the \s-1AVBR\s0 ratecontrol (unit of tenth of percent). .IP "\fIavbr_convergence\fR" 4 .IX Item "avbr_convergence" Convergence of the \s-1AVBR\s0 ratecontrol (unit of 100 frames) .Sp The parameters \fIavbr_accuracy\fR and \fIavbr_convergence\fR are for the average variable bitrate control (\s-1AVBR\s0) algorithm. The algorithm focuses on overall encoding quality while meeting the specified bitrate, \fItarget_bitrate\fR, within the accuracy range \fIavbr_accuracy\fR, after a \fIavbr_Convergence\fR period. This method does not follow \s-1HRD\s0 and the instant bitrate is not capped or padded. .IP "\fIskip_frame\fR" 4 .IX Item "skip_frame" Use per-frame metadata \*(L"qsv_skip_frame\*(R" to skip frame when encoding. This option defines the usage of this metadata. .RS 4 .IP "\fBno_skip\fR" 4 .IX Item "no_skip" Frame skipping is disabled. .IP "\fBinsert_dummy\fR" 4 .IX Item "insert_dummy" Encoder inserts into bitstream frame where all macroblocks are encoded as skipped. .IP "\fBinsert_nothing\fR" 4 .IX Item "insert_nothing" Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped frames are still used in brc. For example, gop still include skipped frames, and the frames after skipped frames will be larger in size. .IP "\fBbrc_only\fR" 4 .IX Item "brc_only" skip_frame metadata indicates the number of missed frames before the current frame. .RE .RS 4 .RE .PP \fI\s-1MPEG2\s0 Options\fR .IX Subsection "MPEG2 Options" .PP These options are used by mpeg2_qsv .IP "\fIprofile\fR" 4 .IX Item "profile" .RS 4 .PD 0 .IP "\fBunknown\fR" 4 .IX Item "unknown" .IP "\fBsimple\fR" 4 .IX Item "simple" .IP "\fBmain\fR" 4 .IX Item "main" .IP "\fBhigh\fR" 4 .IX Item "high" .RE .RS 4 .RE .PD .PP \fI\s-1VP9\s0 Options\fR .IX Subsection "VP9 Options" .PP These options are used by vp9_qsv .IP "\fIprofile\fR" 4 .IX Item "profile" .RS 4 .PD 0 .IP "\fBunknown\fR" 4 .IX Item "unknown" .IP "\fBprofile0\fR" 4 .IX Item "profile0" .IP "\fBprofile1\fR" 4 .IX Item "profile1" .IP "\fBprofile2\fR" 4 .IX Item "profile2" .IP "\fBprofile3\fR" 4 .IX Item "profile3" .RE .RS 4 .RE .IP "\fItile_cols\fR" 4 .IX Item "tile_cols" .PD Number of columns for tiled encoding (requires libmfx >= 1.29). .IP "\fItile_rows\fR" 4 .IX Item "tile_rows" Number of rows for tiled encoding (requires libmfx >= 1.29). .PP \fI\s-1AV1\s0 Options\fR .IX Subsection "AV1 Options" .PP These options are used by av1_qsv (requires libvpl). .IP "\fIprofile\fR" 4 .IX Item "profile" .RS 4 .PD 0 .IP "\fBunknown\fR" 4 .IX Item "unknown" .IP "\fBmain\fR" 4 .IX Item "main" .RE .RS 4 .RE .IP "\fItile_cols\fR" 4 .IX Item "tile_cols" .PD Number of columns for tiled encoding. .IP "\fItile_rows\fR" 4 .IX Item "tile_rows" Number of rows for tiled encoding. .IP "\fIadaptive_i\fR" 4 .IX Item "adaptive_i" This flag controls insertion of I frames by the \s-1QSV\s0 encoder. Turn \s-1ON\s0 this flag to allow changing of frame type from P and B to I. .IP "\fIadaptive_b\fR" 4 .IX Item "adaptive_b" This flag controls changing of frame type from B to P. .IP "\fIb_strategy\fR" 4 .IX Item "b_strategy" This option controls usage of B frames as reference. .IP "\fIextbrc\fR" 4 .IX Item "extbrc" Extended bitrate control. .IP "\fIlook_ahead_depth\fR" 4 .IX Item "look_ahead_depth" Depth of look ahead in number frames, available when extbrc option is enabled. .IP "\fIlow_delay_brc\fR" 4 .IX Item "low_delay_brc" Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides more accurate bitrate control to minimize the variance of bitstream size frame by frame. Value: \-1\-default 0\-off 1\-on .IP "\fBmax_frame_size\fR" 4 .IX Item "max_frame_size" Set the allowed max size in bytes for each frame. If the frame size exceeds the limitation, encoder will adjust the \s-1QP\s0 value to control the frame size. Invalid in \s-1CQP\s0 rate control mode. .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 "\s-1VAAPI\s0 encoders" .IX Subsection "VAAPI encoders" Wrappers for hardware encoders accessible via \s-1VAAPI.\s0 .PP These encoders only accept input in \s-1VAAPI\s0 hardware surfaces. If you have input in software frames, use the \fBhwupload\fR filter to upload them to the \s-1GPU.\s0 .PP The following standard libavcodec options are used: .IP "\(bu" 4 \&\fBg\fR / \fBgop_size\fR .IP "\(bu" 4 \&\fBbf\fR / \fBmax_b_frames\fR .IP "\(bu" 4 \&\fBprofile\fR .Sp If not set, this will be determined automatically from the format of the input frames and the profiles supported by the driver. .IP "\(bu" 4 \&\fBlevel\fR .IP "\(bu" 4 \&\fBb\fR / \fBbit_rate\fR .IP "\(bu" 4 \&\fBmaxrate\fR / \fBrc_max_rate\fR .IP "\(bu" 4 \&\fBbufsize\fR / \fBrc_buffer_size\fR .IP "\(bu" 4 \&\fBrc_init_occupancy\fR / \fBrc_initial_buffer_occupancy\fR .IP "\(bu" 4 \&\fBcompression_level\fR .Sp Speed / quality tradeoff: higher values are faster / worse quality. .IP "\(bu" 4 \&\fBq\fR / \fBglobal_quality\fR .Sp Size / quality tradeoff: higher values are smaller / worse quality. .IP "\(bu" 4 \&\fBqmin\fR .IP "\(bu" 4 \&\fBqmax\fR .IP "\(bu" 4 \&\fBi_qfactor\fR / \fBi_quant_factor\fR .IP "\(bu" 4 \&\fBi_qoffset\fR / \fBi_quant_offset\fR .IP "\(bu" 4 \&\fBb_qfactor\fR / \fBb_quant_factor\fR .IP "\(bu" 4 \&\fBb_qoffset\fR / \fBb_quant_offset\fR .IP "\(bu" 4 \&\fBslices\fR .PP All encoders support the following options: .IP "\fBlow_power\fR" 4 .IX Item "low_power" Some drivers/platforms offer a second encoder for some codecs intended to use less power than the default encoder; setting this option will attempt to use that encoder. Note that it may support a reduced feature set, so some other options may not be available in this mode. .IP "\fBidr_interval\fR" 4 .IX Item "idr_interval" Set the number of normal intra frames between full-refresh (\s-1IDR\s0) frames in open-GOP mode. The intra frames are still IRAPs, but will not include global headers and may have non-decodable leading pictures. .IP "\fBb_depth\fR" 4 .IX Item "b_depth" Set the B\-frame reference depth. When set to one (the default), all B\-frames will refer only to P\- or I\-frames. When set to greater values multiple layers of B\-frames will be present, frames in each layer only referring to frames in higher layers. .IP "\fBasync_depth\fR" 4 .IX Item "async_depth" Maximum processing parallelism. Increase this to improve single channel performance. This option doesn't work if driver doesn't implement vaSyncBuffer function. Please make sure there are enough hw_frames allocated if a large number of async_depth is used. .IP "\fBmax_frame_size\fR" 4 .IX Item "max_frame_size" Set the allowed max size in bytes for each frame. If the frame size exceeds the limitation, encoder will adjust the \s-1QP\s0 value to control the frame size. Invalid in \s-1CQP\s0 rate control mode. .IP "\fBrc_mode\fR" 4 .IX Item "rc_mode" Set the rate control mode to use. A given driver may only support a subset of modes. .Sp Possible modes: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" Choose the mode automatically based on driver support and the other options. This is the default. .IP "\fB\s-1CQP\s0\fR" 4 .IX Item "CQP" Constant-quality. .IP "\fB\s-1CBR\s0\fR" 4 .IX Item "CBR" Constant-bitrate. .IP "\fB\s-1VBR\s0\fR" 4 .IX Item "VBR" Variable-bitrate. .IP "\fB\s-1ICQ\s0\fR" 4 .IX Item "ICQ" Intelligent constant-quality. .IP "\fB\s-1QVBR\s0\fR" 4 .IX Item "QVBR" Quality-defined variable-bitrate. .IP "\fB\s-1AVBR\s0\fR" 4 .IX Item "AVBR" Average variable bitrate. .RE .RS 4 .RE .IP "\fBblbrc\fR" 4 .IX Item "blbrc" Enable block level rate control, which assigns different bitrate block by block. Invalid for \s-1CQP\s0 mode. .PP Each encoder also has its own specific options: .IP "\fBav1_vaapi\fR" 4 .IX Item "av1_vaapi" \&\fBprofile\fR sets the value of \fIseq_profile\fR. \&\fBtier\fR sets the value of \fIseq_tier\fR. \&\fBlevel\fR sets the value of \fIseq_level_idx\fR. .RS 4 .IP "\fBtiles\fR" 4 .IX Item "tiles" Set the number of tiles to encode the input video with, as columns x rows. (default is auto, which means use minimal tile column/row number). .IP "\fBtile_groups\fR" 4 .IX Item "tile_groups" Set tile groups number. All the tiles will be distributed as evenly as possible to each tile group. (default is 1). .RE .RS 4 .RE .IP "\fBh264_vaapi\fR" 4 .IX Item "h264_vaapi" \&\fBprofile\fR sets the value of \fIprofile_idc\fR and the \fIconstraint_set*_flag\fRs. \&\fBlevel\fR sets the value of \fIlevel_idc\fR. .RS 4 .IP "\fBcoder\fR" 4 .IX Item "coder" Set entropy encoder (default is \fIcabac\fR). Possible values: .RS 4 .IP "\fBac\fR" 4 .IX Item "ac" .PD 0 .IP "\fBcabac\fR" 4 .IX Item "cabac" .PD Use \s-1CABAC.\s0 .IP "\fBvlc\fR" 4 .IX Item "vlc" .PD 0 .IP "\fBcavlc\fR" 4 .IX Item "cavlc" .PD Use \s-1CAVLC.\s0 .RE .RS 4 .RE .IP "\fBaud\fR" 4 .IX Item "aud" Include access unit delimiters in the stream (not included by default). .IP "\fBsei\fR" 4 .IX Item "sei" Set \s-1SEI\s0 message types to include. Some combination of the following values: .RS 4 .IP "\fBidentifier\fR" 4 .IX Item "identifier" Include a \fIuser_data_unregistered\fR message containing information about the encoder. .IP "\fBtiming\fR" 4 .IX Item "timing" Include picture timing parameters (\fIbuffering_period\fR and \&\fIpic_timing\fR messages). .IP "\fBrecovery_point\fR" 4 .IX Item "recovery_point" Include recovery points where appropriate (\fIrecovery_point\fR messages). .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fBhevc_vaapi\fR" 4 .IX Item "hevc_vaapi" \&\fBprofile\fR and \fBlevel\fR set the values of \&\fIgeneral_profile_idc\fR and \fIgeneral_level_idc\fR respectively. .RS 4 .IP "\fBaud\fR" 4 .IX Item "aud" Include access unit delimiters in the stream (not included by default). .IP "\fBtier\fR" 4 .IX Item "tier" Set \fIgeneral_tier_flag\fR. This may affect the level chosen for the stream if it is not explicitly specified. .IP "\fBsei\fR" 4 .IX Item "sei" Set \s-1SEI\s0 message types to include. Some combination of the following values: .RS 4 .IP "\fBhdr\fR" 4 .IX Item "hdr" Include \s-1HDR\s0 metadata if the input frames have it (\fImastering_display_colour_volume\fR and \fIcontent_light_level\fR messages). .RE .RS 4 .RE .IP "\fBtiles\fR" 4 .IX Item "tiles" Set the number of tiles to encode the input video with, as columns x rows. Larger numbers allow greater parallelism in both encoding and decoding, but may decrease coding efficiency. .RE .RS 4 .RE .IP "\fBmjpeg_vaapi\fR" 4 .IX Item "mjpeg_vaapi" Only baseline \s-1DCT\s0 encoding is supported. The encoder always uses the standard quantisation and huffman tables \- \fBglobal_quality\fR scales the standard quantisation table (range 1\-100). .Sp For \s-1YUV, 4:2:0, 4:2:2\s0 and 4:4:4 subsampling modes are supported. \s-1RGB\s0 is also supported, and will create an \s-1RGB JPEG.\s0 .RS 4 .IP "\fBjfif\fR" 4 .IX Item "jfif" Include \s-1JFIF\s0 header in each frame (not included by default). .IP "\fBhuffman\fR" 4 .IX Item "huffman" Include standard huffman tables (on by default). Turning this off will save a few hundred bytes in each output frame, but may lose compatibility with some \&\s-1JPEG\s0 decoders which don't fully handle \s-1MJPEG.\s0 .RE .RS 4 .RE .IP "\fBmpeg2_vaapi\fR" 4 .IX Item "mpeg2_vaapi" \&\fBprofile\fR and \fBlevel\fR set the value of \fIprofile_and_level_indication\fR. .IP "\fBvp8_vaapi\fR" 4 .IX Item "vp8_vaapi" B\-frames are not supported. .Sp \&\fBglobal_quality\fR sets the \fIq_idx\fR used for non-key frames (range 0\-127). .RS 4 .IP "\fBloop_filter_level\fR" 4 .IX Item "loop_filter_level" .PD 0 .IP "\fBloop_filter_sharpness\fR" 4 .IX Item "loop_filter_sharpness" .PD Manually set the loop filter parameters. .RE .RS 4 .RE .IP "\fBvp9_vaapi\fR" 4 .IX Item "vp9_vaapi" \&\fBglobal_quality\fR sets the \fIq_idx\fR used for P\-frames (range 0\-255). .RS 4 .IP "\fBloop_filter_level\fR" 4 .IX Item "loop_filter_level" .PD 0 .IP "\fBloop_filter_sharpness\fR" 4 .IX Item "loop_filter_sharpness" .PD Manually set the loop filter parameters. .RE .RS 4 .Sp B\-frames are supported, but the output stream is always in encode order rather than display order. If B\-frames are enabled, it may be necessary to use the \fBvp9_raw_reorder\fR bitstream filter to modify the output stream to display frames in the correct order. .Sp Only normal frames are produced \- the \fBvp9_superframe\fR bitstream filter may be required to produce a stream usable with all decoders. .RE .SS "vbn" .IX Subsection "vbn" Vizrt Binary Image encoder. .PP This format is used by the broadcast vendor Vizrt for quick texture streaming. Advanced features of the format such as \s-1LZW\s0 compression of texture data or generation of mipmaps are not supported. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBformat\fR \fIstring\fR" 4 .IX Item "format string" Sets the texture compression used by the \s-1VBN\s0 file. Can be \fIdxt1\fR, \&\fIdxt5\fR or \fIraw\fR. Default is \fIdxt5\fR. .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 "\fBpalette\fR" 4 .IX Item "palette" Specify the global palette used by the bitmaps. .Sp The format for this option is a string containing 16 24\-bits hexadecimal numbers (without 0x prefix) separated by commas, for example \f(CW\*(C`0d00ee, ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b\*(C'\fR. .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 an \s-1MPEG\-4\s0 Audio Specific Configuration bitstream. .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 filter is required for example when copying an \s-1AAC\s0 stream from a raw \s-1ADTS AAC\s0 or an MPEG-TS container to \s-1MP4A\-LATM,\s0 to an \s-1FLV\s0 file, or to \s-1MOV/MP4\s0 files and related formats such as 3GP or M4A. Please note that it is auto-inserted for \s-1MP4A\-LATM\s0 and \s-1MOV/MP4\s0 and related formats. .SS "av1_metadata" .IX Subsection "av1_metadata" Modify metadata embedded in an \s-1AV1\s0 stream. .IP "\fBtd\fR" 4 .IX Item "td" Insert or remove temporal delimiter OBUs in all temporal units of the stream. .RS 4 .IP "\fBinsert\fR" 4 .IX Item "insert" Insert a \s-1TD\s0 at the beginning of every \s-1TU\s0 which does not already have one. .IP "\fBremove\fR" 4 .IX Item "remove" Remove the \s-1TD\s0 from the beginning of every \s-1TU\s0 which has one. .RE .RS 4 .RE .IP "\fBcolor_primaries\fR" 4 .IX Item "color_primaries" .PD 0 .IP "\fBtransfer_characteristics\fR" 4 .IX Item "transfer_characteristics" .IP "\fBmatrix_coefficients\fR" 4 .IX Item "matrix_coefficients" .PD Set the color description fields in the stream (see \s-1AV1\s0 section 6.4.2). .IP "\fBcolor_range\fR" 4 .IX Item "color_range" Set the color range in the stream (see \s-1AV1\s0 section 6.4.2; note that this cannot be set for streams using \s-1BT.709\s0 primaries, sRGB transfer characteristic and identity (\s-1RGB\s0) matrix coefficients). .RS 4 .IP "\fBtv\fR" 4 .IX Item "tv" Limited range. .IP "\fBpc\fR" 4 .IX Item "pc" Full range. .RE .RS 4 .RE .IP "\fBchroma_sample_position\fR" 4 .IX Item "chroma_sample_position" Set the chroma sample location in the stream (see \s-1AV1\s0 section 6.4.2). This can only be set for 4:2:0 streams. .RS 4 .IP "\fBvertical\fR" 4 .IX Item "vertical" Left position (matching the default in \s-1MPEG\-2\s0 and H.264). .IP "\fBcolocated\fR" 4 .IX Item "colocated" Top-left position. .RE .RS 4 .RE .IP "\fBtick_rate\fR" 4 .IX Item "tick_rate" Set the tick rate (\fItime_scale / num_units_in_display_tick\fR) in the timing info in the sequence header. .IP "\fBnum_ticks_per_picture\fR" 4 .IX Item "num_ticks_per_picture" Set the number of ticks in each picture, to indicate that the stream has a fixed framerate. Ignored if \fBtick_rate\fR is not also set. .IP "\fBdelete_padding\fR" 4 .IX Item "delete_padding" Deletes Padding OBUs. .SS "chomp" .IX Subsection "chomp" Remove zero padding at the end of a packet. .SS "dca_core" .IX Subsection "dca_core" Extract the core from a \s-1DCA/DTS\s0 stream, dropping extensions such as DTS-HD. .SS "dump_extra" .IX Subsection "dump_extra" Add extradata to the beginning of the filtered packets except when said packets already exactly begin with the extradata that is intended to be added. .IP "\fBfreq\fR" 4 .IX Item "freq" The additional argument specifies which packets should be filtered. It accepts the values: .RS 4 .IP "\fBk\fR" 4 .IX Item "k" .PD 0 .IP "\fBkeyframe\fR" 4 .IX Item "keyframe" .PD add extradata to all key packets .IP "\fBe\fR" 4 .IX Item "e" .PD 0 .IP "\fBall\fR" 4 .IX Item "all" .PD add extradata to all packets .RE .RS 4 .RE .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 "dv_error_marker" .IX Subsection "dv_error_marker" Blocks in \s-1DV\s0 which are marked as damaged are replaced by blocks of the specified color. .IP "\fBcolor\fR" 4 .IX Item "color" The color to replace damaged blocks by .IP "\fBsta\fR" 4 .IX Item "sta" A 16 bit mask which specifies which of the 16 possible error status values are to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 error status values. .RS 4 .IP "\fBok\fR" 4 .IX Item "ok" No error, no concealment .IP "\fBerr\fR" 4 .IX Item "err" Error, No concealment .IP "\fBres\fR" 4 .IX Item "res" Reserved .IP "\fBnotok\fR" 4 .IX Item "notok" Error or concealment .IP "\fBnotres\fR" 4 .IX Item "notres" Not reserved .IP "\fBAa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru\fR" 4 .IX Item "Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru" The specific error status code .RE .RS 4 .Sp see page 44\-46 or section 5.5 of <\fBhttp://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf\fR> .RE .SS "eac3_core" .IX Subsection "eac3_core" Extract the core from a E\-AC\-3 stream, dropping extra channels. .SS "extract_extradata" .IX Subsection "extract_extradata" Extract the in-band extradata. .PP Certain codecs allow the long-term headers (e.g. \s-1MPEG\-2\s0 sequence headers, or H.264/HEVC (\s-1VPS/\s0)SPS/PPS) to be transmitted either \*(L"in-band\*(R" (i.e. as a part of the bitstream containing the coded frames) or \*(L"out of band\*(R" (e.g. on the container level). This latter form is called \*(L"extradata\*(R" in FFmpeg terminology. .PP This bitstream filter detects the in-band headers and makes them available as extradata. .IP "\fBremove\fR" 4 .IX Item "remove" When this option is enabled, the long-term headers are removed from the bitstream after extraction. .SS "filter_units" .IX Subsection "filter_units" Remove units with types in or not in a given set from the stream. .IP "\fBpass_types\fR" 4 .IX Item "pass_types" List of unit types or ranges of unit types to pass through while removing all others. This is specified as a '|'\-separated list of unit type values or ranges of values with '\-'. .IP "\fBremove_types\fR" 4 .IX Item "remove_types" Identical to \fBpass_types\fR, except the units in the given set removed and all others passed through. .PP The types used by pass_types and remove_types correspond to \s-1NAL\s0 unit types (nal_unit_type) in H.264, \s-1HEVC\s0 and H.266 (see Table 7\-1 in the H.264 and \s-1HEVC\s0 specifications or Table 5 in the H.266 specification), to marker values for \s-1JPEG\s0 (without 0xFF prefix) and to start codes without start code prefix (i.e. the byte following the 0x000001) for \s-1MPEG\-2.\s0 For \s-1VP8\s0 and \s-1VP9,\s0 every unit has type zero. .PP Extradata is unchanged by this transformation, but note that if the stream contains inline parameter sets then the output may be unusable if they are removed. .PP For example, to remove all non-VCL \s-1NAL\s0 units from an H.264 stream: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v copy \-bsf:v \*(Aqfilter_units=pass_types=1\-5\*(Aq OUTPUT .Ve .PP To remove all AUDs, \s-1SEI\s0 and filler from an H.265 stream: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v copy \-bsf:v \*(Aqfilter_units=remove_types=35|38\-40\*(Aq OUTPUT .Ve .PP To remove all user data from a \s-1MPEG\-2\s0 stream, including Closed Captions: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v copy \-bsf:v \*(Aqfilter_units=remove_types=178\*(Aq OUTPUT .Ve .PP To remove all \s-1SEI\s0 from a H264 stream, including Closed Captions: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v copy \-bsf:v \*(Aqfilter_units=remove_types=6\*(Aq OUTPUT .Ve .PP To remove all prefix and suffix \s-1SEI\s0 from a \s-1HEVC\s0 stream, including Closed Captions and dynamic \s-1HDR:\s0 .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v copy \-bsf:v \*(Aqfilter_units=remove_types=39|40\*(Aq OUTPUT .Ve .SS "hapqa_extract" .IX Subsection "hapqa_extract" Extract Rgb or Alpha part of an \s-1HAPQA\s0 file, without recompression, in order to create an \s-1HAPQ\s0 or an HAPAlphaOnly file. .IP "\fBtexture\fR" 4 .IX Item "texture" Specifies the texture to keep. .RS 4 .IP "\fBcolor\fR" 4 .IX Item "color" .PD 0 .IP "\fBalpha\fR" 4 .IX Item "alpha" .RE .RS 4 .RE .PD .PP Convert \s-1HAPQA\s0 to \s-1HAPQ\s0 .PP .Vb 1 \& ffmpeg \-i hapqa_inputfile.mov \-c copy \-bsf:v hapqa_extract=texture=color \-tag:v HapY \-metadata:s:v:0 encoder="HAPQ" hapq_file.mov .Ve .PP Convert \s-1HAPQA\s0 to HAPAlphaOnly .PP .Vb 1 \& ffmpeg \-i hapqa_inputfile.mov \-c copy \-bsf:v hapqa_extract=texture=alpha \-tag:v HapA \-metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov .Ve .SS "h264_metadata" .IX Subsection "h264_metadata" Modify metadata embedded in an H.264 stream. .IP "\fBaud\fR" 4 .IX Item "aud" Insert or remove \s-1AUD NAL\s0 units in all access units of the stream. .RS 4 .IP "\fBpass\fR" 4 .IX Item "pass" .PD 0 .IP "\fBinsert\fR" 4 .IX Item "insert" .IP "\fBremove\fR" 4 .IX Item "remove" .RE .RS 4 .PD .Sp Default is pass. .RE .IP "\fBsample_aspect_ratio\fR" 4 .IX Item "sample_aspect_ratio" Set the sample aspect ratio of the stream in the \s-1VUI\s0 parameters. See H.264 table E\-1. .IP "\fBoverscan_appropriate_flag\fR" 4 .IX Item "overscan_appropriate_flag" Set whether the stream is suitable for display using overscan or not (see H.264 section E.2.1). .IP "\fBvideo_format\fR" 4 .IX Item "video_format" .PD 0 .IP "\fBvideo_full_range_flag\fR" 4 .IX Item "video_full_range_flag" .PD Set the video format in the stream (see H.264 section E.2.1 and table E\-2). .IP "\fBcolour_primaries\fR" 4 .IX Item "colour_primaries" .PD 0 .IP "\fBtransfer_characteristics\fR" 4 .IX Item "transfer_characteristics" .IP "\fBmatrix_coefficients\fR" 4 .IX Item "matrix_coefficients" .PD Set the colour description in the stream (see H.264 section E.2.1 and tables E\-3, E\-4 and E\-5). .IP "\fBchroma_sample_loc_type\fR" 4 .IX Item "chroma_sample_loc_type" Set the chroma sample location in the stream (see H.264 section E.2.1 and figure E\-1). .IP "\fBtick_rate\fR" 4 .IX Item "tick_rate" Set the tick rate (time_scale / num_units_in_tick) in the \s-1VUI\s0 parameters. This is the smallest time unit representable in the stream, and in many cases represents the field rate of the stream (double the frame rate). .IP "\fBfixed_frame_rate_flag\fR" 4 .IX Item "fixed_frame_rate_flag" Set whether the stream has fixed framerate \- typically this indicates that the framerate is exactly half the tick rate, but the exact meaning is dependent on interlacing and the picture structure (see H.264 section E.2.1 and table E\-6). .IP "\fBzero_new_constraint_set_flags\fR" 4 .IX Item "zero_new_constraint_set_flags" Zero constraint_set4_flag and constraint_set5_flag in the \s-1SPS.\s0 These bits were reserved in a previous version of the H.264 spec, and thus some hardware decoders require these to be zero. The result of zeroing this is still a valid bitstream. .IP "\fBcrop_left\fR" 4 .IX Item "crop_left" .PD 0 .IP "\fBcrop_right\fR" 4 .IX Item "crop_right" .IP "\fBcrop_top\fR" 4 .IX Item "crop_top" .IP "\fBcrop_bottom\fR" 4 .IX Item "crop_bottom" .PD Set the frame cropping offsets in the \s-1SPS.\s0 These values will replace the current ones if the stream is already cropped. .Sp These fields are set in pixels. Note that some sizes may not be representable if the chroma is subsampled or the stream is interlaced (see H.264 section 7.4.2.1.1). .IP "\fBsei_user_data\fR" 4 .IX Item "sei_user_data" Insert a string as \s-1SEI\s0 unregistered user data. The argument must be of the form \fIUUID+string\fR, where the \s-1UUID\s0 is as hex digits possibly separated by hyphens, and the string can be anything. .Sp For example, \fB086f3693\-b7b3\-4f2c\-9653\-21492feee5b8+hello\fR will insert the string ``hello'' associated with the given \s-1UUID.\s0 .IP "\fBdelete_filler\fR" 4 .IX Item "delete_filler" Deletes both filler \s-1NAL\s0 units and filler \s-1SEI\s0 messages. .IP "\fBdisplay_orientation\fR" 4 .IX Item "display_orientation" Insert, extract or remove Display orientation \s-1SEI\s0 messages. See H.264 section D.1.27 and D.2.27 for syntax and semantics. .RS 4 .IP "\fBpass\fR" 4 .IX Item "pass" .PD 0 .IP "\fBinsert\fR" 4 .IX Item "insert" .IP "\fBremove\fR" 4 .IX Item "remove" .IP "\fBextract\fR" 4 .IX Item "extract" .RE .RS 4 .PD .Sp Default is pass. .Sp Insert mode works in conjunction with \f(CW\*(C`rotate\*(C'\fR and \f(CW\*(C`flip\*(C'\fR options. Any pre-existing Display orientation messages will be removed in insert or remove mode. Extract mode attaches the display matrix to the packet as side data. .RE .IP "\fBrotate\fR" 4 .IX Item "rotate" Set rotation in display orientation \s-1SEI\s0 (anticlockwise angle in degrees). Range is \-360 to +360. Default is NaN. .IP "\fBflip\fR" 4 .IX Item "flip" Set flip in display orientation \s-1SEI.\s0 .RS 4 .IP "\fBhorizontal\fR" 4 .IX Item "horizontal" .PD 0 .IP "\fBvertical\fR" 4 .IX Item "vertical" .RE .RS 4 .PD .Sp Default is unset. .RE .IP "\fBlevel\fR" 4 .IX Item "level" Set the level in the \s-1SPS.\s0 Refer to H.264 section A.3 and tables A\-1 to A\-5. .Sp The argument must be the name of a level (for example, \fB4.2\fR), a level_idc value (for example, \fB42\fR), or the special name \fBauto\fR indicating that the filter should attempt to guess the level from the input stream properties. .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 (muxer \f(CW\*(C`mpegts\*(C'\fR). .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 .PP Please note that this filter is auto-inserted for MPEG-TS (muxer \&\f(CW\*(C`mpegts\*(C'\fR) and raw H.264 (muxer \f(CW\*(C`h264\*(C'\fR) output formats. .SS "h264_redundant_pps" .IX Subsection "h264_redundant_pps" This applies a specific fixup to some Blu-ray streams which contain redundant PPSs modifying irrelevant parameters of the stream which confuse other transformations which require correct extradata. .SS "hevc_metadata" .IX Subsection "hevc_metadata" Modify metadata embedded in an \s-1HEVC\s0 stream. .IP "\fBaud\fR" 4 .IX Item "aud" Insert or remove \s-1AUD NAL\s0 units in all access units of the stream. .RS 4 .IP "\fBinsert\fR" 4 .IX Item "insert" .PD 0 .IP "\fBremove\fR" 4 .IX Item "remove" .RE .RS 4 .RE .IP "\fBsample_aspect_ratio\fR" 4 .IX Item "sample_aspect_ratio" .PD Set the sample aspect ratio in the stream in the \s-1VUI\s0 parameters. .IP "\fBvideo_format\fR" 4 .IX Item "video_format" .PD 0 .IP "\fBvideo_full_range_flag\fR" 4 .IX Item "video_full_range_flag" .PD Set the video format in the stream (see H.265 section E.3.1 and table E.2). .IP "\fBcolour_primaries\fR" 4 .IX Item "colour_primaries" .PD 0 .IP "\fBtransfer_characteristics\fR" 4 .IX Item "transfer_characteristics" .IP "\fBmatrix_coefficients\fR" 4 .IX Item "matrix_coefficients" .PD Set the colour description in the stream (see H.265 section E.3.1 and tables E.3, E.4 and E.5). .IP "\fBchroma_sample_loc_type\fR" 4 .IX Item "chroma_sample_loc_type" Set the chroma sample location in the stream (see H.265 section E.3.1 and figure E.1). .IP "\fBtick_rate\fR" 4 .IX Item "tick_rate" Set the tick rate in the \s-1VPS\s0 and \s-1VUI\s0 parameters (time_scale / num_units_in_tick). Combined with \fBnum_ticks_poc_diff_one\fR, this can set a constant framerate in the stream. Note that it is likely to be overridden by container parameters when the stream is in a container. .IP "\fBnum_ticks_poc_diff_one\fR" 4 .IX Item "num_ticks_poc_diff_one" Set poc_proportional_to_timing_flag in \s-1VPS\s0 and \s-1VUI\s0 and use this value to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and E.3.1). Ignored if \fBtick_rate\fR is not also set. .IP "\fBcrop_left\fR" 4 .IX Item "crop_left" .PD 0 .IP "\fBcrop_right\fR" 4 .IX Item "crop_right" .IP "\fBcrop_top\fR" 4 .IX Item "crop_top" .IP "\fBcrop_bottom\fR" 4 .IX Item "crop_bottom" .PD Set the conformance window cropping offsets in the \s-1SPS.\s0 These values will replace the current ones if the stream is already cropped. .Sp These fields are set in pixels. Note that some sizes may not be representable if the chroma is subsampled (H.265 section 7.4.3.2.1). .IP "\fBlevel\fR" 4 .IX Item "level" Set the level in the \s-1VPS\s0 and \s-1SPS.\s0 See H.265 section A.4 and tables A.6 and A.7. .Sp The argument must be the name of a level (for example, \fB5.1\fR), a \&\fIgeneral_level_idc\fR value (for example, \fB153\fR for level 5.1), or the special name \fBauto\fR indicating that the filter should attempt to guess the level from the input stream properties. .SS "hevc_mp4toannexb" .IX Subsection "hevc_mp4toannexb" Convert an \s-1HEVC/H.265\s0 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.265 specification). .PP This is required by some streaming formats, typically the \s-1MPEG\-2\s0 transport stream format (muxer \f(CW\*(C`mpegts\*(C'\fR). .PP For example to remux an \s-1MP4\s0 file containing an \s-1HEVC\s0 stream to mpegts format with \fBffmpeg\fR, you can use the command: .PP .Vb 1 \& ffmpeg \-i INPUT.mp4 \-codec copy \-bsf:v hevc_mp4toannexb OUTPUT.ts .Ve .PP Please note that this filter is auto-inserted for MPEG-TS (muxer \&\f(CW\*(C`mpegts\*(C'\fR) and raw \s-1HEVC/H.265\s0 (muxer \f(CW\*(C`h265\*(C'\fR or \&\f(CW\*(C`hevc\*(C'\fR) output formats. .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 "mjpegadump" .IX Subsection "mjpegadump" Add an \s-1MJPEG A\s0 header to the bitstream, to enable decoding by Quicktime. .SS "mov2textsub" .IX Subsection "mov2textsub" Extract a representable text file from \s-1MOV\s0 subtitles, stripping the metadata header from each subtitle packet. .PP See also the \fBtext2movsub\fR filter. .SS "mpeg2_metadata" .IX Subsection "mpeg2_metadata" Modify metadata embedded in an \s-1MPEG\-2\s0 stream. .IP "\fBdisplay_aspect_ratio\fR" 4 .IX Item "display_aspect_ratio" Set the display aspect ratio in the stream. .Sp The following fixed values are supported: .RS 4 .IP "\fB4/3\fR" 4 .IX Item "4/3" .PD 0 .IP "\fB16/9\fR" 4 .IX Item "16/9" .IP "\fB221/100\fR" 4 .IX Item "221/100" .RE .RS 4 .PD .Sp Any other value will result in square pixels being signalled instead (see H.262 section 6.3.3 and table 6\-3). .RE .IP "\fBframe_rate\fR" 4 .IX Item "frame_rate" Set the frame rate in the stream. This is constructed from a table of known values combined with a small multiplier and divisor \- if the supplied value is not exactly representable, the nearest representable value will be used instead (see H.262 section 6.3.3 and table 6\-4). .IP "\fBvideo_format\fR" 4 .IX Item "video_format" Set the video format in the stream (see H.262 section 6.3.6 and table 6\-6). .IP "\fBcolour_primaries\fR" 4 .IX Item "colour_primaries" .PD 0 .IP "\fBtransfer_characteristics\fR" 4 .IX Item "transfer_characteristics" .IP "\fBmatrix_coefficients\fR" 4 .IX Item "matrix_coefficients" .PD Set the colour description in the stream (see H.262 section 6.3.6 and tables 6\-7, 6\-8 and 6\-9). .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 or simply drops them without damaging the container. Can be used for fuzzing or testing error resilience/concealment. .PP Parameters: .IP "\fBamount\fR" 4 .IX Item "amount" Accepts an expression whose evaluation per-packet determines how often bytes in that packet will be modified. A value below 0 will result in a variable frequency. Default is 0 which results in no modification. However, if neither amount nor drop is specified, amount will be set to \fI\-1\fR. See below for accepted variables. .IP "\fBdrop\fR" 4 .IX Item "drop" Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude of the value. Default is 0 which results in no drops. See below for accepted variables. .IP "\fBdropamount\fR" 4 .IX Item "dropamount" Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards compatibility and is equivalent to setting drop to a negative value with the same magnitude i.e. \f(CW\*(C`dropamount=4\*(C'\fR is the same as \f(CW\*(C`drop=\-4\*(C'\fR. Ignored if drop is also specified. .PP Both \f(CW\*(C`amount\*(C'\fR and \f(CW\*(C`drop\*(C'\fR accept expressions containing the following variables: .IP "\fBn\fR" 4 .IX Item "n" The index of the packet, starting from zero. .IP "\fBtb\fR" 4 .IX Item "tb" The timebase for packet timestamps. .IP "\fBpts\fR" 4 .IX Item "pts" Packet presentation timestamp. .IP "\fBdts\fR" 4 .IX Item "dts" Packet decoding timestamp. .IP "\fBnopts\fR" 4 .IX Item "nopts" Constant representing \s-1AV_NOPTS_VALUE.\s0 .IP "\fBstartpts\fR" 4 .IX Item "startpts" First non\-AV_NOPTS_VALUE \s-1PTS\s0 seen in the stream. .IP "\fBstartdts\fR" 4 .IX Item "startdts" First non\-AV_NOPTS_VALUE \s-1DTS\s0 seen in the stream. .IP "\fBduration\fR" 4 .IX Item "duration" .PD 0 .IP "\fBd\fR" 4 .IX Item "d" .PD Packet duration, in timebase units. .IP "\fBpos\fR" 4 .IX Item "pos" Packet position in input; may be \-1 when unknown or not set. .IP "\fBsize\fR" 4 .IX Item "size" Packet size, in bytes. .IP "\fBkey\fR" 4 .IX Item "key" Whether packet is marked as a keyframe. .IP "\fBstate\fR" 4 .IX Item "state" A pseudo random integer, primarily derived from the content of packet payload. .PP \fIExamples\fR .IX Subsection "Examples" .PP Apply modification to every byte but don't drop any packets. .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf noise=1 output.mkv .Ve .PP Drop every video packet not marked as a keyframe after timestamp 30s but do not modify any of the remaining packets. .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf:v noise=drop=\*(Aqgt(t\e,30)*not(key)\*(Aq output.mkv .Ve .PP Drop one second of audio every 10 seconds and add some random noise to the rest. .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf:a noise=amount=\-1:drop=\*(Aqbetween(mod(t\e,10)\e,9\e,10)\*(Aq output.mkv .Ve .SS "null" .IX Subsection "null" This bitstream filter passes the packets through unchanged. .SS "pcm_rechunk" .IX Subsection "pcm_rechunk" Repacketize \s-1PCM\s0 audio to a fixed number of samples per packet or a fixed packet rate per second. This is similar to the \fBasetnsamples audio filter\fR but works on audio packets instead of audio frames. .IP "\fBnb_out_samples, n\fR" 4 .IX Item "nb_out_samples, n" Set the number of samples per each output audio packet. 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 packet with silence, so that it will contain the same number of samples (or roughly the same number of samples, see \fBframe_rate\fR) as the previous ones. Default value is 1. .IP "\fBframe_rate, r\fR" 4 .IX Item "frame_rate, r" This option makes the filter output a fixed number of packets per second instead of a fixed number of samples per packet. If the audio sample rate is not divisible by the frame rate then the number of samples will not be constant but will vary slightly so that each packet will start as close to the frame boundary as possible. Using this option has precedence over \fBnb_out_samples\fR. .PP You can generate the well known 1602\-1601\-1602\-1601\-1602 pattern of 48kHz audio for \s-1NTSC\s0 frame rate using the \fBframe_rate\fR option. .PP .Vb 1 \& ffmpeg \-f lavfi \-i sine=r=48000:d=1 \-c pcm_s16le \-bsf pcm_rechunk=r=30000/1001 \-f framecrc \- .Ve .SS "pgs_frame_merge" .IX Subsection "pgs_frame_merge" Merge a sequence of \s-1PGS\s0 Subtitle segments ending with an \*(L"end of display set\*(R" segment into a single packet. .PP This is required by some containers that support \s-1PGS\s0 subtitles (muxer \f(CW\*(C`matroska\*(C'\fR). .SS "prores_metadata" .IX Subsection "prores_metadata" Modify color property metadata embedded in prores stream. .IP "\fBcolor_primaries\fR" 4 .IX Item "color_primaries" Set the color primaries. Available values are: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" Keep the same color primaries property (default). .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBbt709\fR" 4 .IX Item "bt709" .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" .PD \&\s-1BT601 625\s0 .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" \&\s-1BT601 525\s0 .IP "\fBbt2020\fR" 4 .IX Item "bt2020" .PD 0 .IP "\fBsmpte431\fR" 4 .IX Item "smpte431" .PD \&\s-1DCI P3\s0 .IP "\fBsmpte432\fR" 4 .IX Item "smpte432" P3 D65 .RE .RS 4 .RE .IP "\fBtransfer_characteristics\fR" 4 .IX Item "transfer_characteristics" Set the color transfer. Available values are: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" Keep the same transfer characteristics property (default). .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBbt709\fR" 4 .IX Item "bt709" .PD \&\s-1BT 601, BT 709, BT 2020\s0 .IP "\fBsmpte2084\fR" 4 .IX Item "smpte2084" \&\s-1SMPTE ST 2084\s0 .IP "\fBarib\-std\-b67\fR" 4 .IX Item "arib-std-b67" \&\s-1ARIB STD\-B67\s0 .RE .RS 4 .RE .IP "\fBmatrix_coefficients\fR" 4 .IX Item "matrix_coefficients" Set the matrix coefficient. Available values are: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" Keep the same colorspace property (default). .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBbt709\fR" 4 .IX Item "bt709" .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" .PD \&\s-1BT 601\s0 .IP "\fBbt2020nc\fR" 4 .IX Item "bt2020nc" .RE .RS 4 .RE .PP Set Rec709 colorspace for each frame of the file .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov .Ve .PP Set Hybrid Log-Gamma parameters for each frame of the file .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib\-std\-b67:colorspace=bt2020nc output.mov .Ve .SS "remove_extra" .IX Subsection "remove_extra" Remove extradata from packets. .PP It accepts the following parameter: .IP "\fBfreq\fR" 4 .IX Item "freq" Set which frame types to remove extradata from. .RS 4 .IP "\fBk\fR" 4 .IX Item "k" Remove extradata from non-keyframes only. .IP "\fBkeyframe\fR" 4 .IX Item "keyframe" Remove extradata from keyframes only. .IP "\fBe, all\fR" 4 .IX Item "e, all" Remove extradata from all frames. .RE .RS 4 .RE .SS "setts" .IX Subsection "setts" Set \s-1PTS\s0 and \s-1DTS\s0 in packets. .PP It accepts the following parameters: .IP "\fBts\fR" 4 .IX Item "ts" .PD 0 .IP "\fBpts\fR" 4 .IX Item "pts" .IP "\fBdts\fR" 4 .IX Item "dts" .PD Set expressions for \s-1PTS, DTS\s0 or both. .IP "\fBduration\fR" 4 .IX Item "duration" Set expression for duration. .IP "\fBtime_base\fR" 4 .IX Item "time_base" Set output time base. .PP The expressions are evaluated through the eval \s-1API\s0 and can contain the following constants: .IP "\fBN\fR" 4 .IX Item "N" The count of the input packet. Starting from 0. .IP "\fB\s-1TS\s0\fR" 4 .IX Item "TS" The demux timestamp in input in case of \f(CW\*(C`ts\*(C'\fR or \f(CW\*(C`dts\*(C'\fR option or presentation timestamp in case of \f(CW\*(C`pts\*(C'\fR option. .IP "\fB\s-1POS\s0\fR" 4 .IX Item "POS" The original position in the file of the packet, or undefined if undefined for the current packet .IP "\fB\s-1DTS\s0\fR" 4 .IX Item "DTS" The demux timestamp in input. .IP "\fB\s-1PTS\s0\fR" 4 .IX Item "PTS" The presentation timestamp in input. .IP "\fB\s-1DURATION\s0\fR" 4 .IX Item "DURATION" The duration in input. .IP "\fB\s-1STARTDTS\s0\fR" 4 .IX Item "STARTDTS" The \s-1DTS\s0 of the first packet. .IP "\fB\s-1STARTPTS\s0\fR" 4 .IX Item "STARTPTS" The \s-1PTS\s0 of the first packet. .IP "\fB\s-1PREV_INDTS\s0\fR" 4 .IX Item "PREV_INDTS" The previous input \s-1DTS.\s0 .IP "\fB\s-1PREV_INPTS\s0\fR" 4 .IX Item "PREV_INPTS" The previous input \s-1PTS.\s0 .IP "\fB\s-1PREV_INDURATION\s0\fR" 4 .IX Item "PREV_INDURATION" The previous input duration. .IP "\fB\s-1PREV_OUTDTS\s0\fR" 4 .IX Item "PREV_OUTDTS" The previous output \s-1DTS.\s0 .IP "\fB\s-1PREV_OUTPTS\s0\fR" 4 .IX Item "PREV_OUTPTS" The previous output \s-1PTS.\s0 .IP "\fB\s-1PREV_OUTDURATION\s0\fR" 4 .IX Item "PREV_OUTDURATION" The previous output duration. .IP "\fB\s-1NEXT_DTS\s0\fR" 4 .IX Item "NEXT_DTS" The next input \s-1DTS.\s0 .IP "\fB\s-1NEXT_PTS\s0\fR" 4 .IX Item "NEXT_PTS" The next input \s-1PTS.\s0 .IP "\fB\s-1NEXT_DURATION\s0\fR" 4 .IX Item "NEXT_DURATION" The next input duration. .IP "\fB\s-1TB\s0\fR" 4 .IX Item "TB" The timebase of stream packet belongs. .IP "\fB\s-1TB_OUT\s0\fR" 4 .IX Item "TB_OUT" The output timebase. .IP "\fB\s-1SR\s0\fR" 4 .IX Item "SR" The sample rate of stream packet belongs. .IP "\fB\s-1NOPTS\s0\fR" 4 .IX Item "NOPTS" The \s-1AV_NOPTS_VALUE\s0 constant. .PP For example, to set \s-1PTS\s0 equal to \s-1DTS\s0 (not recommended if B\-frames are involved): .PP .Vb 1 \& ffmpeg \-i INPUT \-c:a copy \-bsf:a setts=pts=DTS out.mkv .Ve .SS "showinfo" .IX Subsection "showinfo" Log basic packet information. Mainly useful for testing, debugging, and development. .SS "text2movsub" .IX Subsection "text2movsub" Convert text subtitles to \s-1MOV\s0 subtitles (as used by the \f(CW\*(C`mov_text\*(C'\fR codec) with metadata headers. .PP See also the \fBmov2textsub\fR filter. .SS "trace_headers" .IX Subsection "trace_headers" Log trace output containing all syntax elements in the coded stream headers (everything above the level of individual coded blocks). This can be useful for debugging low-level stream issues. .PP Supports \s-1AV1, H.264, H.265,\s0 (M)JPEG, \s-1MPEG\-2\s0 and \s-1VP9,\s0 but depending on the build only a subset of these may be available. .SS "truehd_core" .IX Subsection "truehd_core" Extract the core from a TrueHD stream, dropping \s-1ATMOS\s0 data. .SS "vp9_metadata" .IX Subsection "vp9_metadata" Modify metadata embedded in a \s-1VP9\s0 stream. .IP "\fBcolor_space\fR" 4 .IX Item "color_space" Set the color space value in the frame header. Note that any frame set to \s-1RGB\s0 will be implicitly set to \s-1PC\s0 range and that \s-1RGB\s0 is incompatible with profiles 0 and 2. .RS 4 .IP "\fBunknown\fR" 4 .IX Item "unknown" .PD 0 .IP "\fBbt601\fR" 4 .IX Item "bt601" .IP "\fBbt709\fR" 4 .IX Item "bt709" .IP "\fBsmpte170\fR" 4 .IX Item "smpte170" .IP "\fBsmpte240\fR" 4 .IX Item "smpte240" .IP "\fBbt2020\fR" 4 .IX Item "bt2020" .IP "\fBrgb\fR" 4 .IX Item "rgb" .RE .RS 4 .RE .IP "\fBcolor_range\fR" 4 .IX Item "color_range" .PD Set the color range value in the frame header. Note that any value imposed by the color space will take precedence over this value. .RS 4 .IP "\fBtv\fR" 4 .IX Item "tv" .PD 0 .IP "\fBpc\fR" 4 .IX Item "pc" .RE .RS 4 .RE .PD .SS "vp9_superframe" .IX Subsection "vp9_superframe" Merge \s-1VP9\s0 invisible (alt-ref) frames back into \s-1VP9\s0 superframes. This fixes merging of split/segmented \s-1VP9\s0 streams where the alt-ref frame was split from its visible counterpart. .SS "vp9_superframe_split" .IX Subsection "vp9_superframe_split" Split \s-1VP9\s0 superframes into single frames. .SS "vp9_raw_reorder" .IX Subsection "vp9_raw_reorder" Given a \s-1VP9\s0 stream with correct timestamps but possibly out of order, insert additional show-existing-frame packets to correct the ordering. .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 "\fBmax_probe_packets\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "max_probe_packets integer (input)" Set the maximum number of buffered packets when probing a codec. Default is 2500 packets. .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" 4 .IX Item "fflags flags" Set format flags. Some are implemented for a limited number of formats. .Sp Possible values for input files: .RS 4 .IP "\fBdiscardcorrupt\fR" 4 .IX Item "discardcorrupt" Discard corrupted packets. .IP "\fBfastseek\fR" 4 .IX Item "fastseek" Enable fast, but inaccurate seeks for some formats. .IP "\fBgenpts\fR" 4 .IX Item "genpts" Generate missing \s-1PTS\s0 if \s-1DTS\s0 is present. .IP "\fBigndts\fR" 4 .IX Item "igndts" Ignore \s-1DTS\s0 if \s-1PTS\s0 is also set. In case the \s-1PTS\s0 is set, the \s-1DTS\s0 value is set to \s-1NOPTS.\s0 This is ignored when the \f(CW\*(C`nofillin\*(C'\fR flag is set. .IP "\fBignidx\fR" 4 .IX Item "ignidx" Ignore index. .IP "\fBnobuffer\fR" 4 .IX Item "nobuffer" Reduce the latency introduced by buffering during initial input streams analysis. .IP "\fBnofillin\fR" 4 .IX Item "nofillin" Do not fill in missing values in packet fields that can be exactly calculated. .IP "\fBnoparse\fR" 4 .IX Item "noparse" Disable AVParsers, this needs \f(CW\*(C`+nofillin\*(C'\fR too. .IP "\fBsortdts\fR" 4 .IX Item "sortdts" Try to interleave output packets by \s-1DTS.\s0 At present, available only for AVIs with an index. .RE .RS 4 .Sp Possible values for output files: .IP "\fBautobsf\fR" 4 .IX Item "autobsf" Automatically apply bitstream filters as required by the output format. Enabled by default. .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 "\fBflush_packets\fR" 4 .IX Item "flush_packets" Write out packets immediately. .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 10000000 (10 seconds). .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 is \-1 (auto), which means that the underlying protocol will decide, 1 enables it, and has the effect of reducing the latency, 0 disables it and may increase \s-1IO\s0 throughput 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 \fBffmpeg\-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 indentation: .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. .IP "\fBskip_estimate_duration_from_pts\fR \fIbool\fR \fB(\fR\fIinput\fR\fB)\fR" 4 .IX Item "skip_estimate_duration_from_pts bool (input)" Skip estimation of input duration when calculated using \s-1PTS.\s0 At present, applicable for MPEG-PS and MPEG-TS. .IP "\fBstrict, f_strict\fR \fIinteger\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "strict, f_strict integer (input/output)" Specify how strictly to follow the standards. \f(CW\*(C`f_strict\*(C'\fR is deprecated and should be used only via the \fBffmpeg\fR tool. .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 .SS "Format stream specifiers" .IX Subsection "Format stream specifiers" Format stream specifiers allow selection of one or more streams that match specific properties. .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 and documented in the \&\fBStream specifiers section in the \fBffmpeg\fB\|(1) manual\fR. .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`\-demuxers\*(C'\fR of the ff* tools will display the list of enabled demuxers. Use \f(CW\*(C`\-formats\*(C'\fR to view a combined list of enabled demuxers and muxers. .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 "aac" .IX Subsection "aac" Raw Audio Data Transport Stream \s-1AAC\s0 demuxer. .PP This demuxer is used to demux an \s-1ADTS\s0 input containing a single \s-1AAC\s0 stream alongwith any ID3v1/2 or \s-1APE\s0 tags in it. .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. Default is enabled. .IP "\fB\-max_fps\fR \fIint\fR" 4 .IX Item "-max_fps int" Maximum framerate in frames per second. Default of 0 imposes 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). Default is 15. .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\f(CB""file \f(CBpath\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\f(CB""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. .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\f(CB""duration \f(CBdur\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\f(CB""inpoint \f(CBtimestamp\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\f(CB""outpoint \f(CBtimestamp\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\f(CB""file_packet_metadata \f(CBkey=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. This directive is deprecated, use \f(CW\*(C`file_packet_meta\*(C'\fR instead. .ie n .IP "\fB\f(CB""file_packet_meta \f(CBkey\f(CB \f(CBvalue\f(CB""\fB\fR" 4 .el .IP "\fB\f(CBfile_packet_meta \f(CBkey\f(CB \f(CBvalue\f(CB\fB\fR" 4 .IX Item "file_packet_meta 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\f(CB""option \f(CBkey\f(CB \f(CBvalue\f(CB""\fB\fR" 4 .el .IP "\fB\f(CBoption \f(CBkey\f(CB \f(CBvalue\f(CB\fB\fR" 4 .IX Item "option key value" Option to access, open and probe the file. Can be present multiple times. .ie n .IP "\fB\f(CB""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\f(CB""exact_stream_id \f(CBid\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. .ie n .IP "\fB\f(CB""stream_meta \f(CBkey\f(CB \f(CBvalue\f(CB""\fB\fR" 4 .el .IP "\fB\f(CBstream_meta \f(CBkey\f(CB \f(CBvalue\f(CB\fB\fR" 4 .IX Item "stream_meta key value" Metadata for the stream. Can be present multiple times. .ie n .IP "\fB\f(CB""stream_codec \f(CBvalue\f(CB""\fB\fR" 4 .el .IP "\fB\f(CBstream_codec \f(CBvalue\f(CB\fB\fR" 4 .IX Item "stream_codec value" Codec for the stream. .ie n .IP "\fB\f(CB""stream_extradata \f(CBhex_string\f(CB""\fB\fR" 4 .el .IP "\fB\f(CBstream_extradata \f(CBhex_string\f(CB\fB\fR" 4 .IX Item "stream_extradata hex_string" Extradata for the string, encoded in hexadecimal. .ie n .IP "\fB\f(CB""chapter \f(CBid\f(CB \f(CBstart\f(CB \f(CBend\f(CB""\fB\fR" 4 .el .IP "\fB\f(CBchapter \f(CBid\f(CB \f(CBstart\f(CB \f(CBend\f(CB\fB\fR" 4 .IX Item "chapter id start end" Add a chapter. \fIid\fR is an unique identifier, possibly small and consecutive. .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 and directives. 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. .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 "dash" .IX Subsection "dash" Dynamic Adaptive Streaming over \s-1HTTP\s0 demuxer. .PP This demuxer presents all AVStreams found in the manifest. By setting the discard flags on AVStreams the caller can decide which streams to actually receive. Each stream mirrors the \f(CW\*(C`id\*(C'\fR and \f(CW\*(C`bandwidth\*(C'\fR properties from the \&\f(CW\*(C`\*(C'\fR as metadata keys named \*(L"id\*(R" and \*(L"variant_bitrate\*(R" respectively. .PP \fIOptions\fR .IX Subsection "Options" .PP This demuxer accepts the following option: .IP "\fBcenc_decryption_key\fR" 4 .IX Item "cenc_decryption_key" 16\-byte key, in hex, to decrypt files encrypted using \s-1ISO\s0 Common Encryption (\s-1CENC/AES\-128 CTR\s0; \s-1ISO/IEC 23001\-7\s0). .SS "dvdvideo" .IX Subsection "dvdvideo" DVD-Video demuxer, powered by libdvdnav and libdvdread. .PP Can directly ingest \s-1DVD\s0 titles, specifically sequential PGCs, into a conversion pipeline. Menu assets, such as background video or audio, can also be demuxed given the menu's coordinates (at best effort). Seeking is not supported at this time. .PP Block devices (\s-1DVD\s0 drives), \s-1ISO\s0 files, and directory structures are accepted. Activate with \f(CW\*(C`\-f dvdvideo\*(C'\fR in front of one of these inputs. .PP This demuxer does \s-1NOT\s0 have decryption code of any kind. You are on your own working with encrypted DVDs, and should not expect support on the matter. .PP Underlying playback is handled by libdvdnav, and structure parsing by libdvdread. FFmpeg must be built with \s-1GPL\s0 library support available as well as the configure switches \f(CW\*(C`\-\-enable\-libdvdnav\*(C'\fR and \f(CW\*(C`\-\-enable\-libdvdread\*(C'\fR. .PP You will need to provide either the desired \*(L"title number\*(R" or exact \s-1PGC/PG\s0 coordinates. Many open-source \s-1DVD\s0 players and tools can aid in providing this information. If not specified, the demuxer will default to title 1 which works for many discs. However, due to the flexibility of the format, it is recommended to check manually. There are many discs that are authored strangely or with invalid headers. .PP If the input is a real \s-1DVD\s0 drive, please note that there are some drives which may silently fail on reading bad sectors from the disc, returning random bits instead which is effectively corrupt data. This is especially prominent on aging or rotting discs. A second pass and integrity checks would be needed to detect the corruption. This is not an FFmpeg issue. .PP \fIBackground\fR .IX Subsection "Background" .PP DVD-Video is not a directly accessible, linear container format in the traditional sense. Instead, it allows for complex and programmatic playback of carefully muxed MPEG-PS streams that are stored in headerless \s-1VOB\s0 files. To the end-user, these streams are known simply as \*(L"titles\*(R", but the actual logical playback sequence is defined by one or more \*(L"PGCs\*(R", or Program Group Chains, within the title. The \s-1PGC\s0 is in turn comprised of multiple \*(L"PGs\*(R", or Programs", which are the actual video segments (and for a typical video feature, sequentially ordered). The \s-1PGC\s0 structure, along with stream layout and metadata, are stored in \&\s-1IFO\s0 files that need to be parsed. PGCs can be thought of as playlists in easier terms. .PP An actual \s-1DVD\s0 player relies on user \s-1GUI\s0 interaction via menus and an internal \s-1VM\s0 to drive the direction of demuxing. Generally, the user would either navigate (via menus) or automatically be redirected to the \s-1PGC\s0 of their choice. During this process and the subsequent playback, the \s-1DVD\s0 player's internal \s-1VM\s0 also maintains a state and executes instructions that can create jumps to different sectors during playback. This is why libdvdnav is involved, as a linear read of the MPEG-PS blobs on the disc (VOBs) is not enough to produce the right sequence in many cases. .PP There are many other \s-1DVD\s0 structures (a long subject) that will not be discussed here. \&\s-1NAV\s0 packets, in particular, are handled by this demuxer to build accurate timing but not emitted as a stream. For a good high-level understanding, refer to: <\fBhttps://code.videolan.org/videolan/libdvdnav/\-/blob/master/doc/dvd_structures\fR> .PP \fIOptions\fR .IX Subsection "Options" .PP This demuxer accepts the following options: .IP "\fBtitle\fR \fIint\fR" 4 .IX Item "title int" The title number to play. Must be set if \fBpgc\fR and \fBpg\fR are not set. Not applicable to menus. Default is 0 (auto), which currently only selects the first available title (title 1) and notifies the user about the implications. .IP "\fBchapter_start\fR \fIint\fR" 4 .IX Item "chapter_start int" The chapter, or \s-1PTT\s0 (part-of-title), number to start at. Not applicable to menus. Default is 1. .IP "\fBchapter_end\fR \fIint\fR" 4 .IX Item "chapter_end int" The chapter, or \s-1PTT\s0 (part-of-title), number to end at. Not applicable to menus. Default is 0, which is a special value to signal end at the last possible chapter. .IP "\fBangle\fR \fIint\fR" 4 .IX Item "angle int" The video angle number, referring to what is essentially an additional video stream that is composed from alternate frames interleaved in the VOBs. Not applicable to menus. Default is 1. .IP "\fBregion\fR \fIint\fR" 4 .IX Item "region int" The region code to use for playback. Some discs may use this to default playback at a particular angle in different regions. This option will not affect the region code of a real \s-1DVD\s0 drive, if used as an input. Not applicable to menus. Default is 0, \*(L"world\*(R". .IP "\fBmenu\fR \fIbool\fR" 4 .IX Item "menu bool" Demux menu assets instead of navigating a title. Requires exact coordinates of the menu (\fBmenu_lu\fR, \fBmenu_vts\fR, \fBpgc\fR, \fBpg\fR). Default is false. .IP "\fBmenu_lu\fR \fIint\fR" 4 .IX Item "menu_lu int" The menu language to demux. In \s-1DVD,\s0 menus are grouped by language. Default is 0, the first language unit. .IP "\fBmenu_vts\fR \fIint\fR" 4 .IX Item "menu_vts int" The \s-1VTS\s0 where the menu lives, or 0 if it is a \s-1VMG\s0 menu (root-level). Default is 0, \s-1VMG\s0 menu. .IP "\fBpgc\fR \fIint\fR" 4 .IX Item "pgc int" The entry \s-1PGC\s0 to start playback, in conjunction with \fBpg\fR. Alternative to setting \fBtitle\fR. Chapter markers are not supported at this time. Must be explicitly set for menus. Default is 0, automatically resolve from value of \fBtitle\fR. .IP "\fBpg\fR \fIint\fR" 4 .IX Item "pg int" The entry \s-1PG\s0 to start playback, in conjunction with \fBpgc\fR. Alternative to setting \fBtitle\fR. Chapter markers are not supported at this time. Default is 0, automatically resolve from value of \fBtitle\fR, or start from the beginning (\s-1PG 1\s0) of the menu. .IP "\fBpreindex\fR \fIbool\fR" 4 .IX Item "preindex bool" Enable this to have accurate chapter (\s-1PTT\s0) markers and duration measurement, which requires a slow second pass read in order to index the chapter marker timestamps from \s-1NAV\s0 packets. This is non-ideal extra work for real optical drives. It is recommended and faster to use this option with a backup of the \s-1DVD\s0 structure stored on a hard drive. Not compatible with \fBpgc\fR and \fBpg\fR. Not applicable to menus. Default is 0, false. .IP "\fBtrim\fR \fIbool\fR" 4 .IX Item "trim bool" Skip padding cells (i.e. cells shorter than 1 second) from the beginning. There exist many discs with filler segments at the beginning of the \s-1PGC,\s0 often with junk data intended for controlling a real \s-1DVD\s0 player's buffering speed and with no other material data value. Not applicable to menus. Default is 1, true. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Open title 3 from a given \s-1DVD\s0 structure: .Sp .Vb 1 \& ffmpeg \-f dvdvideo \-title 3 \-i ... .Ve .IP "\(bu" 4 Open chapters 3\-6 from title 1 from a given \s-1DVD\s0 structure: .Sp .Vb 1 \& ffmpeg \-f dvdvideo \-chapter_start 3 \-chapter_end 6 \-title 1 \-i ... .Ve .IP "\(bu" 4 Open only chapter 5 from title 1 from a given \s-1DVD\s0 structure: .Sp .Vb 1 \& ffmpeg \-f dvdvideo \-chapter_start 5 \-chapter_end 5 \-title 1 \-i ... .Ve .IP "\(bu" 4 Demux menu with language 1 from \s-1VTS 1, PGC 1,\s0 starting at \s-1PG 1:\s0 .Sp .Vb 1 \& ffmpeg \-f dvdvideo \-menu 1 \-menu_lu 1 \-menu_vts 1 \-pgc 1 \-pg 1 \-i ... .Ve .SS "ea" .IX Subsection "ea" Electronic Arts Multimedia format demuxer. .PP This format is used by various Electronic Arts games. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBmerge_alpha\fR \fIbool\fR" 4 .IX Item "merge_alpha bool" Normally the \s-1VP6\s0 alpha channel (if exists) is returned as a secondary video stream, by setting this option you can make the demuxer return a single video stream which contains the alpha channel in addition to the ordinary video. .SS "imf" .IX Subsection "imf" Interoperable Master Format demuxer. .PP This demuxer presents audio and video streams found in an \s-1IMF\s0 Composition, as specified in <\fBhttps://doi.org/10.5594/SMPTE.ST2067\-2.2020\fR>. .PP .Vb 1 \& ffmpeg [\-assetmaps ,,...] \-i ... .Ve .PP If \f(CW\*(C`\-assetmaps\*(C'\fR is not specified, the demuxer looks for a file called \&\fI\s-1ASSETMAP\s0.xml\fR in the same directory as the \s-1CPL.\s0 .SS "flv, live_flv, kux" .IX Subsection "flv, live_flv, kux" Adobe Flash Video Format demuxer. .PP This demuxer is used to demux \s-1FLV\s0 files and \s-1RTMP\s0 network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. \&\s-1KUX\s0 is a flv variant used on the Youku platform. .PP .Vb 2 \& ffmpeg \-f flv \-i myfile.flv ... \& ffmpeg \-f live_flv \-i rtmp:///anything/key .... .Ve .IP "\fB\-flv_metadata\fR \fIbool\fR" 4 .IX Item "-flv_metadata bool" Allocate the streams according to the onMetaData array content. .IP "\fB\-flv_ignore_prevtag\fR \fIbool\fR" 4 .IX Item "-flv_ignore_prevtag bool" Ignore the size of previous tag value. .IP "\fB\-flv_full_metadata\fR \fIbool\fR" 4 .IX Item "-flv_full_metadata bool" Output all context of the onMetadata. .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 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". .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 "\fBprefer_x_start\fR" 4 .IX Item "prefer_x_start" prefer to use #EXT\-X\-START if it's in playlist instead of live_start_index. .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. .IP "\fBm3u8_hold_counters\fR" 4 .IX Item "m3u8_hold_counters" The maximum number of times to load m3u8 when it refreshes without new segments. Default value is 1000. .IP "\fBhttp_persistent\fR" 4 .IX Item "http_persistent" Use persistent \s-1HTTP\s0 connections. Applicable only for \s-1HTTP\s0 streams. Enabled by default. .IP "\fBhttp_multiple\fR" 4 .IX Item "http_multiple" Use multiple \s-1HTTP\s0 connections for downloading \s-1HTTP\s0 segments. Enabled by default for \s-1HTTP/1.1\s0 servers. .IP "\fBhttp_seekable\fR" 4 .IX Item "http_seekable" Use \s-1HTTP\s0 partial requests for downloading \s-1HTTP\s0 segments. 0 = disable, 1 = enable, \-1 = auto, Default is auto. .IP "\fBseg_format_options\fR" 4 .IX Item "seg_format_options" Set options for the demuxer of media segments using a list of key=value pairs separated by \f(CW\*(C`:\*(C'\fR. .IP "\fBseg_max_retry\fR" 4 .IX Item "seg_max_retry" Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. Default value is 0. .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. .IP "\fBexport_path_metadata\fR" 4 .IX Item "export_path_metadata" If set to 1, will add two extra fields to the metadata found in input, making them also available for other filters (see \fIdrawtext\fR filter for examples). Default value is 0. The extra fields are described below: .RS 4 .IP "\fBlavf.image2dec.source_path\fR" 4 .IX Item "lavf.image2dec.source_path" Corresponds to the full path to the input file being read. .IP "\fBlavf.image2dec.source_basename\fR" 4 .IX Item "lavf.image2dec.source_basename" Corresponds to the name of the file being read. .RE .RS 4 .RE .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 <\fBhttps://bitbucket.org/mpyne/game\-music\-emu/overview\fR> for more information. .PP It accepts the following options: .IP "\fBtrack_index\fR" 4 .IX Item "track_index" Set the index of which track to demux. The demuxer can only export one track. Track indexes start at 0. Default is to pick the first track. Number of tracks is exported as \fItracks\fR metadata entry. .IP "\fBsample_rate\fR" 4 .IX Item "sample_rate" Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100. .IP "\fBmax_size\fR \fI(bytes)\fR" 4 .IX Item "max_size (bytes)" The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, which in turn, acts as a ceiling for the size of files that can be read. Default is 50 MiB. .SS "libmodplug" .IX Subsection "libmodplug" ModPlug based module demuxer .PP See <\fBhttps://github.com/Konstanty/libmodplug\fR> .PP It will export one 2\-channel 16\-bit 44.1 kHz audio stream. Optionally, a \f(CW\*(C`pal8\*(C'\fR 16\-color video stream can be exported with or without printed metadata. .PP It accepts the following options: .IP "\fBnoise_reduction\fR" 4 .IX Item "noise_reduction" Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0. .IP "\fBreverb_depth\fR" 4 .IX Item "reverb_depth" Set amount of reverb. Range 0\-100. Default is 0. .IP "\fBreverb_delay\fR" 4 .IX Item "reverb_delay" Set delay in ms, clamped to 40\-250 ms. Default is 0. .IP "\fBbass_amount\fR" 4 .IX Item "bass_amount" Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0. .IP "\fBbass_range\fR" 4 .IX Item "bass_range" Set cutoff i.e. upper-bound for bass frequencies. Range is 10\-100 Hz. Default is 0. .IP "\fBsurround_depth\fR" 4 .IX Item "surround_depth" Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0. .IP "\fBsurround_delay\fR" 4 .IX Item "surround_delay" Set surround delay in ms, clamped to 5\-40 ms. Default is 0. .IP "\fBmax_size\fR" 4 .IX Item "max_size" The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB. 0 removes buffer size limit (not recommended). Default is 5 MiB. .IP "\fBvideo_stream_expr\fR" 4 .IX Item "video_stream_expr" String which is evaluated using the eval \s-1API\s0 to assign colors to the generated video stream. Variables which can be used are \f(CW\*(C`x\*(C'\fR, \f(CW\*(C`y\*(C'\fR, \f(CW\*(C`w\*(C'\fR, \f(CW\*(C`h\*(C'\fR, \f(CW\*(C`t\*(C'\fR, \f(CW\*(C`speed\*(C'\fR, \&\f(CW\*(C`tempo\*(C'\fR, \f(CW\*(C`order\*(C'\fR, \f(CW\*(C`pattern\*(C'\fR and \f(CW\*(C`row\*(C'\fR. .IP "\fBvideo_stream\fR" 4 .IX Item "video_stream" Generate video stream. Can be 1 (on) or 0 (off). Default is 0. .IP "\fBvideo_stream_w\fR" 4 .IX Item "video_stream_w" Set video frame width in 'chars' where one char indicates 8 pixels. Range is 20\-512. Default is 30. .IP "\fBvideo_stream_h\fR" 4 .IX Item "video_stream_h" Set video frame height in 'chars' where one char indicates 8 pixels. Range is 20\-512. Default is 30. .IP "\fBvideo_stream_ptxt\fR" 4 .IX Item "video_stream_ptxt" Print metadata on video stream. Includes \f(CW\*(C`speed\*(C'\fR, \f(CW\*(C`tempo\*(C'\fR, \f(CW\*(C`order\*(C'\fR, \f(CW\*(C`pattern\*(C'\fR, \&\f(CW\*(C`row\*(C'\fR and \f(CW\*(C`ts\*(C'\fR (time in ms). Can be 1 (on) or 0 (off). Default is 1. .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" .IX Subsection "mov/mp4/3gp" Demuxer for Quicktime File Format & \s-1ISO/IEC\s0 Base Media File Format (\s-1ISO/IEC 14496\-12\s0 or \s-1MPEG\-4\s0 Part 12, \s-1ISO/IEC 15444\-12\s0 or \s-1JPEG 2000\s0 Part 12). .PP Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v .PP \fIOptions\fR .IX Subsection "Options" .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. .IP "\fBseek_streams_individually\fR" 4 .IX Item "seek_streams_individually" When seeking, identify the closest point in each stream individually and demux packets in that stream from identified point. This can lead to a different sequence of packets compared to demuxing linearly from the beginning. Default is true. .IP "\fBignore_editlist\fR" 4 .IX Item "ignore_editlist" Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the timeline described by the edit list. Default is false. .IP "\fBadvanced_editlist\fR" 4 .IX Item "advanced_editlist" Modify the stream index to reflect the timeline described by the edit list. \f(CW\*(C`ignore_editlist\*(C'\fR must be set to false for this option to be effective. If both \f(CW\*(C`ignore_editlist\*(C'\fR and this option are set to false, then only the start of the stream index is modified to reflect initial dwell time or starting timestamp described by the edit list. Default is true. .IP "\fBignore_chapters\fR" 4 .IX Item "ignore_chapters" Don't parse chapters. This includes GoPro 'HiLight' tags/moments. Note that chapters are only parsed when input is seekable. Default is false. .IP "\fBuse_mfra_for\fR" 4 .IX Item "use_mfra_for" For seekable fragmented input, set fragment's starting timestamp from media fragment random access box, if present. .Sp Following options are available: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" Auto-detect whether to set mfra timestamps as \s-1PTS\s0 or \s-1DTS\s0 \fI(default)\fR .IP "\fBdts\fR" 4 .IX Item "dts" Set mfra timestamps as \s-1DTS\s0 .IP "\fBpts\fR" 4 .IX Item "pts" Set mfra timestamps as \s-1PTS\s0 .IP "\fB0\fR" 4 .IX Item "0" Don't use mfra box to set timestamps .RE .RS 4 .RE .IP "\fBuse_tfdt\fR" 4 .IX Item "use_tfdt" For fragmented input, set fragment's starting timestamp to \f(CW\*(C`baseMediaDecodeTime\*(C'\fR from the \f(CW\*(C`tfdt\*(C'\fR box. Default is enabled, which will prefer to use the \f(CW\*(C`tfdt\*(C'\fR box to set \s-1DTS.\s0 Disable to use the \f(CW\*(C`earliest_presentation_time\*(C'\fR from the \f(CW\*(C`sidx\*(C'\fR box. In either case, the timestamp from the \f(CW\*(C`mfra\*(C'\fR box will be used if it's available and \f(CW\*(C`use_mfra_for\*(C'\fR is set to pts or dts. .IP "\fBexport_all\fR" 4 .IX Item "export_all" Export unrecognized boxes within the \fIudta\fR box as metadata entries. The first four characters of the box type are set as the key. Default is false. .IP "\fBexport_xmp\fR" 4 .IX Item "export_xmp" Export entire contents of \fI\s-1XMP_\s0\fR box and \fIuuid\fR box as a string with key \f(CW\*(C`xmp\*(C'\fR. Note that if \f(CW\*(C`export_all\*(C'\fR is set and this option isn't, the contents of \fI\s-1XMP_\s0\fR box are still exported but with key \f(CW\*(C`XMP_\*(C'\fR. Default is false. .IP "\fBactivation_bytes\fR" 4 .IX Item "activation_bytes" 4\-byte key required to decrypt Audible \s-1AAX\s0 and \s-1AAX+\s0 files. See Audible \s-1AAX\s0 subsection below. .IP "\fBaudible_fixed_key\fR" 4 .IX Item "audible_fixed_key" Fixed key used for handling Audible \s-1AAX/AAX+\s0 files. It has been pre-set so should not be necessary to specify. .IP "\fBdecryption_key\fR" 4 .IX Item "decryption_key" 16\-byte key, in hex, to decrypt files encrypted using \s-1ISO\s0 Common Encryption (\s-1CENC/AES\-128 CTR\s0; \s-1ISO/IEC 23001\-7\s0). .IP "\fBmax_stts_delta\fR" 4 .IX Item "max_stts_delta" Very high sample deltas written in a trak's stts box may occasionally be intended but usually they are written in error or used to store a negative value for dts correction when treated as signed 32\-bit integers. This option lets the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when cast to int32 are used to adjust onward dts. .Sp Unit is the track time scale. Range is 0 to \s-1UINT_MAX.\s0 Default is \f(CW\*(C`UINT_MAX \- 48000*10\*(C'\fR which allows up to a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of \f(CW\*(C`uint32\*(C'\fR range. .IP "\fBinterleaved_read\fR" 4 .IX Item "interleaved_read" Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues caused by large gaps between packets in different tracks, as \s-1MOV/MP4\s0 do not have packet placement requirements. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling it may prevent I/O issues, at the expense of playback. .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 "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 "\fBskip_unknown_pmt\fR" 4 .IX Item "skip_unknown_pmt" Skip PMTs for programs not defined in the \s-1PAT.\s0 Default value is 0. .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. .IP "\fBmerge_pmt_versions\fR" 4 .IX Item "merge_pmt_versions" Re-use existing streams when a \s-1PMT\s0's version is updated and elementary streams move to different PIDs. Default value is 0. .IP "\fBmax_packet_size\fR" 4 .IX Item "max_packet_size" Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size are split across multiple packets. Range is 1 to \s-1INT_MAX/2.\s0 Default is 204800 bytes. .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 .SS "vapoursynth" .IX Subsection "vapoursynth" Vapoursynth wrapper. .PP Due to security concerns, Vapoursynth scripts will not be autodetected so the input format has to be forced. For ff* \s-1CLI\s0 tools, add \f(CW\*(C`\-f vapoursynth\*(C'\fR before the input \f(CW\*(C`\-i yourscript.vpy\*(C'\fR. .PP This demuxer accepts the following option: .IP "\fBmax_script_size\fR" 4 .IX Item "max_script_size" The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size, which in turn, acts as a ceiling for the size of scripts that can be read. Default is 1 MiB. .SS "w64" .IX Subsection "w64" Sony Wave64 Audio demuxer. .PP This demuxer accepts the following options: .IP "\fBmax_size\fR" 4 .IX Item "max_size" See the same option for the \fBwav\fR demuxer. .SS "wav" .IX Subsection "wav" \&\s-1RIFF\s0 Wave Audio demuxer. .PP This demuxer accepts the following options: .IP "\fBmax_size\fR" 4 .IX Item "max_size" Specify the maximum packet size in bytes for the demuxed packets. By default this is set to 0, which means that a sensible value is chosen based on the input format. .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`\-muxers\*(C'\fR of the ff* tools will display the list of enabled muxers. Use \f(CW\*(C`\-formats\*(C'\fR to view a combined list of enabled demuxers and muxers. .PP A description of some of the currently available muxers follows. .SS "Raw muxers" .IX Subsection "Raw muxers" This section covers raw muxers. They accept a single stream matching the designated codec. They do not store timestamps or metadata. The recognized extension is the same as the muxer name unless indicated otherwise. .PP It comprises the following muxers. The media type and the eventual extensions used to automatically selects the muxer from the output extensions are also shown. .IP "\fBac3\fR \fIaudio\fR" 4 .IX Item "ac3 audio" Dolby Digital, also known as \s-1AC\-3.\s0 .IP "\fBadx\fR \fIaudio\fR" 4 .IX Item "adx audio" \&\s-1CRI\s0 Middleware \s-1ADX\s0 audio. .Sp This muxer will write out the total sample count near the start of the first packet when the output is seekable and the count can be stored in 32 bits. .IP "\fBaptx\fR \fIaudio\fR" 4 .IX Item "aptx audio" aptX (Audio Processing Technology for Bluetooth) .IP "\fBaptx_hd\fR \fIaudio\fR \fB(aptxdh)\fR" 4 .IX Item "aptx_hd audio (aptxdh)" aptX \s-1HD\s0 (Audio Processing Technology for Bluetooth) audio .IP "\fBavs2\fR \fIvideo\fR \fB(avs, avs2)\fR" 4 .IX Item "avs2 video (avs, avs2)" \&\s-1AVS2\-P2\s0 (Audio Video Standard \- Second generation \- Part 2) / \&\s-1IEEE 1857.4\s0 video .IP "\fBavs3\fR \fIvideo\fR \fB(avs3)\fR" 4 .IX Item "avs3 video (avs3)" \&\s-1AVS3\-P2\s0 (Audio Video Standard \- Third generation \- Part 2) / \&\s-1IEEE 1857.10\s0 video .IP "\fBcavsvideo\fR \fIvideo\fR \fB(cavs)\fR" 4 .IX Item "cavsvideo video (cavs)" Chinese \s-1AVS\s0 (Audio Video Standard \- First generation) .IP "\fBcodec2raw\fR \fIaudio\fR" 4 .IX Item "codec2raw audio" Codec 2 audio. .Sp No extension is registered so format name has to be supplied e.g. with the ffmpeg \s-1CLI\s0 tool \f(CW\*(C`\-f codec2raw\*(C'\fR. .IP "\fBdata\fR \fIany\fR" 4 .IX Item "data any" Generic data muxer. .Sp This muxer accepts a single stream with any codec of any type. The input stream has to be selected using the \f(CW\*(C`\-map\*(C'\fR option with the \&\fBffmpeg\fR \s-1CLI\s0 tool. .Sp No extension is registered so format name has to be supplied e.g. with the \fBffmpeg\fR \s-1CLI\s0 tool \f(CW\*(C`\-f data\*(C'\fR. .IP "\fBdfpwm\fR \fIaudio\fR \fB(dfpwm)\fR" 4 .IX Item "dfpwm audio (dfpwm)" Raw DFPWM1a (Dynamic Filter Pulse With Modulation) audio muxer. .IP "\fBdirac\fR \fIvideo\fR \fB(drc, vc2)\fR" 4 .IX Item "dirac video (drc, vc2)" \&\s-1BBC\s0 Dirac video. .Sp The Dirac Pro codec is a subset and is standardized as \s-1SMPTE VC\-2.\s0 .IP "\fBdnxhd\fR \fIvideo\fR \fB(dnxhd, dnxhr)\fR" 4 .IX Item "dnxhd video (dnxhd, dnxhr)" Avid DNxHD video. .Sp It is standardized as \s-1SMPTE VC\-3.\s0 Accepts DNxHR streams. .IP "\fBdts\fR \fIaudio\fR" 4 .IX Item "dts audio" \&\s-1DTS\s0 Coherent Acoustics (\s-1DCA\s0) audio .IP "\fBeac3\fR \fIaudio\fR" 4 .IX Item "eac3 audio" Dolby Digital Plus, also known as Enhanced \s-1AC\-3\s0 .IP "\fBevc\fR \fIvideo\fR \fB(evc)\fR" 4 .IX Item "evc video (evc)" \&\s-1MPEG\-5\s0 Essential Video Coding (\s-1EVC\s0) / \s-1EVC / MPEG\-5\s0 Part 1 \s-1EVC\s0 video .IP "\fBg722\fR \fIaudio\fR" 4 .IX Item "g722 audio" ITU-T G.722 audio .IP "\fBg723_1\fR \fIaudio\fR \fB(tco, rco)\fR" 4 .IX Item "g723_1 audio (tco, rco)" ITU-T G.723.1 audio .IP "\fBg726\fR \fIaudio\fR" 4 .IX Item "g726 audio" ITU-T G.726 big-endian (\*(L"left-justified\*(R") audio. .Sp No extension is registered so format name has to be supplied e.g. with the \fBffmpeg\fR \s-1CLI\s0 tool \f(CW\*(C`\-f g726\*(C'\fR. .IP "\fBg726le\fR \fIaudio\fR" 4 .IX Item "g726le audio" ITU-T G.726 little-endian (\*(L"right-justified\*(R") audio. .Sp No extension is registered so format name has to be supplied e.g. with the \fBffmpeg\fR \s-1CLI\s0 tool \f(CW\*(C`\-f g726le\*(C'\fR. .IP "\fBgsm\fR \fIaudio\fR" 4 .IX Item "gsm audio" Global System for Mobile Communications audio .IP "\fBh261\fR \fIvideo\fR" 4 .IX Item "h261 video" ITU-T H.261 video .IP "\fBh263\fR \fIvideo\fR" 4 .IX Item "h263 video" ITU-T H.263 / H.263\-1996, H.263+ / H.263\-1998 / H.263 version 2 video .IP "\fBh264\fR \fIvideo\fR \fB(h264, 264)\fR" 4 .IX Item "h264 video (h264, 264)" ITU-T H.264 / \s-1MPEG\-4\s0 Part 10 \s-1AVC\s0 video. Bitstream shall be converted to Annex B syntax if it's in length-prefixed mode. .IP "\fBhevc\fR \fIvideo\fR \fB(hevc, h265, 265)\fR" 4 .IX Item "hevc video (hevc, h265, 265)" ITU-T H.265 / MPEG-H Part 2 \s-1HEVC\s0 video. Bitstream shall be converted to Annex B syntax if it's in length-prefixed mode. .IP "\fBm4v\fR \fIvideo\fR" 4 .IX Item "m4v video" \&\s-1MPEG\-4\s0 Part 2 video .IP "\fBmjpeg\fR \fIvideo\fR \fB(mjpg, mjpeg)\fR" 4 .IX Item "mjpeg video (mjpg, mjpeg)" Motion \s-1JPEG\s0 video .IP "\fBmlp\fR \fIaudio\fR" 4 .IX Item "mlp audio" Meridian Lossless Packing, also known as Packed \s-1PCM\s0 .IP "\fBmp2\fR \fIaudio\fR \fB(mp2, m2a, mpa)\fR" 4 .IX Item "mp2 audio (mp2, m2a, mpa)" \&\s-1MPEG\-1\s0 Audio Layer \s-1II\s0 audio .IP "\fBmpeg1video\fR \fIvideo\fR \fB(mpg, mpeg, m1v)\fR" 4 .IX Item "mpeg1video video (mpg, mpeg, m1v)" \&\s-1MPEG\-1\s0 Part 2 video. .IP "\fBmpeg2video\fR \fIvideo\fR \fB(m2v)\fR" 4 .IX Item "mpeg2video video (m2v)" ITU-T H.262 / \s-1MPEG\-2\s0 Part 2 video .IP "\fBobu\fR \fIvideo\fR" 4 .IX Item "obu video" \&\s-1AV1\s0 low overhead Open Bitstream Units muxer. .Sp Temporal delimiter OBUs will be inserted in all temporal units of the stream. .IP "\fBrawvideo\fR \fIvideo\fR \fB(yuv, rgb)\fR" 4 .IX Item "rawvideo video (yuv, rgb)" Raw uncompressed video. .IP "\fBsbc\fR \fIaudio\fR \fB(sbc, msbc)\fR" 4 .IX Item "sbc audio (sbc, msbc)" Bluetooth \s-1SIG\s0 low-complexity subband codec audio .IP "\fBtruehd\fR \fIaudio\fR \fB(thd)\fR" 4 .IX Item "truehd audio (thd)" Dolby TrueHD audio .IP "\fBvc1\fR \fIvideo\fR" 4 .IX Item "vc1 video" \&\s-1SMPTE 421M / VC\-1\s0 video .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Store raw video frames with the \fBrawvideo\fR muxer using \fBffmpeg\fR: .Sp .Vb 1 \& ffmpeg \-f lavfi \-i testsrc \-t 10 \-s hd1080p testsrc.yuv .Ve .Sp Since the rawvideo muxer do not store the information related to size and format, this information must be provided when demuxing the file: .Sp .Vb 1 \& ffplay \-video_size 1920x1080 \-pixel_format rgb24 \-f rawvideo testsrc.rgb .Ve .SS "Raw \s-1PCM\s0 muxers" .IX Subsection "Raw PCM muxers" This section covers raw \s-1PCM\s0 (Pulse-Code Modulation) audio muxers. .PP They accept a single stream matching the designated codec. They do not store timestamps or metadata. The recognized extension is the same as the muxer name. .PP It comprises the following muxers. The optional additional extension used to automatically select the muxer from the output extension is also shown in parentheses. .IP "\fBalaw (al)\fR" 4 .IX Item "alaw (al)" \&\s-1PCM\s0 A\-law .IP "\fBf32be\fR" 4 .IX Item "f32be" \&\s-1PCM\s0 32\-bit floating-point big-endian .IP "\fBf32le\fR" 4 .IX Item "f32le" \&\s-1PCM\s0 32\-bit floating-point little-endian .IP "\fBf64be\fR" 4 .IX Item "f64be" \&\s-1PCM\s0 64\-bit floating-point big-endian .IP "\fBf64le\fR" 4 .IX Item "f64le" \&\s-1PCM\s0 64\-bit floating-point little-endian .IP "\fBmulaw (ul)\fR" 4 .IX Item "mulaw (ul)" \&\s-1PCM\s0 mu-law .IP "\fBs16be\fR" 4 .IX Item "s16be" \&\s-1PCM\s0 signed 16\-bit big-endian .IP "\fBs16le\fR" 4 .IX Item "s16le" \&\s-1PCM\s0 signed 16\-bit little-endian .IP "\fBs24be\fR" 4 .IX Item "s24be" \&\s-1PCM\s0 signed 24\-bit big-endian .IP "\fBs24le\fR" 4 .IX Item "s24le" \&\s-1PCM\s0 signed 24\-bit little-endian .IP "\fBs32be\fR" 4 .IX Item "s32be" \&\s-1PCM\s0 signed 32\-bit big-endian .IP "\fBs32le\fR" 4 .IX Item "s32le" \&\s-1PCM\s0 signed 32\-bit little-endian .IP "\fBs8 (sb)\fR" 4 .IX Item "s8 (sb)" \&\s-1PCM\s0 signed 8\-bit .IP "\fBu16be\fR" 4 .IX Item "u16be" \&\s-1PCM\s0 unsigned 16\-bit big-endian .IP "\fBu16le\fR" 4 .IX Item "u16le" \&\s-1PCM\s0 unsigned 16\-bit little-endian .IP "\fBu24be\fR" 4 .IX Item "u24be" \&\s-1PCM\s0 unsigned 24\-bit big-endian .IP "\fBu24le\fR" 4 .IX Item "u24le" \&\s-1PCM\s0 unsigned 24\-bit little-endian .IP "\fBu32be\fR" 4 .IX Item "u32be" \&\s-1PCM\s0 unsigned 32\-bit big-endian .IP "\fBu32le\fR" 4 .IX Item "u32le" \&\s-1PCM\s0 unsigned 32\-bit little-endian .IP "\fBu8 (ub)\fR" 4 .IX Item "u8 (ub)" \&\s-1PCM\s0 unsigned 8\-bit .IP "\fBvidc\fR" 4 .IX Item "vidc" \&\s-1PCM\s0 Archimedes \s-1VIDC\s0 .SS "\s-1MPEG\-1/MPEG\-2\s0 program stream muxers" .IX Subsection "MPEG-1/MPEG-2 program stream muxers" This section covers formats belonging to the \s-1MPEG\-1\s0 and \s-1MPEG\-2\s0 Systems family. .PP The \s-1MPEG\-1\s0 Systems format (also known as \s-1ISO/IEEC 11172\-1\s0 or \s-1MPEG\-1\s0 program stream) has been adopted for the format of media track stored in \s-1VCD\s0 (Video Compact Disc). .PP The \s-1MPEG\-2\s0 Systems standard (also known as \s-1ISO/IEEC 13818\-1\s0) covers two containers formats, one known as transport stream and one known as program stream; only the latter is covered here. .PP The \s-1MPEG\-2\s0 program stream format (also known as \s-1VOB\s0 due to the corresponding file extension) is an extension of \s-1MPEG\-1\s0 program stream: in addition to support different codecs for the audio and video streams, it also stores subtitles and navigation metadata. \&\s-1MPEG\-2\s0 program stream has been adopted for storing media streams in \&\s-1SVCD\s0 and \s-1DVD\s0 storage devices. .PP This section comprises the following muxers. .IP "\fBmpeg (mpg,mpeg)\fR" 4 .IX Item "mpeg (mpg,mpeg)" \&\s-1MPEG\-1\s0 Systems / \s-1MPEG\-1\s0 program stream muxer. .IP "\fBvcd\fR" 4 .IX Item "vcd" \&\s-1MPEG\-1\s0 Systems / \s-1MPEG\-1\s0 program stream (\s-1VCD\s0) muxer. .Sp This muxer can be used to generate tracks in the format accepted by the \s-1VCD\s0 (Video Compact Disc) storage devices. .Sp It is the same as the \fBmpeg\fR muxer with a few differences. .IP "\fBvob\fR" 4 .IX Item "vob" \&\s-1MPEG\-2\s0 program stream (\s-1VOB\s0) muxer. .IP "\fBdvd\fR" 4 .IX Item "dvd" \&\s-1MPEG\-2\s0 program stream (\s-1DVD VOB\s0) muxer. .Sp This muxer can be used to generate tracks in the format accepted by the \s-1DVD\s0 (Digital Versatile Disc) storage devices. .Sp This is the same as the \fBvob\fR muxer with a few differences. .IP "\fBsvcd (vob)\fR" 4 .IX Item "svcd (vob)" \&\s-1MPEG\-2\s0 program stream (\s-1SVCD VOB\s0) muxer. .Sp This muxer can be used to generate tracks in the format accepted by the \s-1SVCD\s0 (Super Video Compact Disc) storage devices. .Sp This is the same as the \fBvob\fR muxer with a few differences. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBmuxrate\fR \fIrate\fR" 4 .IX Item "muxrate rate" Set user-defined mux rate expressed as a number of bits/s. If not specied the automatically computed mux rate is employed. Default value is \f(CW0\fR. .IP "\fBpreload\fR \fIdelay\fR" 4 .IX Item "preload delay" Set initial demux-decode delay in microseconds. Default value is \&\f(CW500000\fR. .SS "\s-1MOV/MPEG\-4/ISOMBFF\s0 muxers" .IX Subsection "MOV/MPEG-4/ISOMBFF muxers" This section covers formats belonging to the QuickTime / \s-1MOV\s0 family, including the \s-1MPEG\-4\s0 Part 14 format and \s-1ISO\s0 base media file format (\s-1ISOBMFF\s0). These formats share a common structure based on the \s-1ISO\s0 base media file format (\s-1ISOBMFF\s0). .PP The \s-1MOV\s0 format was originally developed for use with Apple QuickTime. It was later used as the basis for the \s-1MPEG\-4\s0 Part 1 (later Part 14) format, also known as \s-1ISO/IEC 14496\-1.\s0 That format was then generalized into \s-1ISOBMFF,\s0 also named \s-1MPEG\-4\s0 Part 12 format, \s-1ISO/IEC 14496\-12,\s0 or \s-1ISO/IEC 15444\-12.\s0 .PP It comprises the following muxers. .IP "\fB3gp\fR" 4 .IX Item "3gp" Third Generation Partnership Project (3GPP) format for 3G \s-1UMTS\s0 multimedia services .IP "\fB3g2\fR" 4 .IX Item "3g2" Third Generation Partnership Project 2 (3GP2 or 3GPP2) format for 3G \&\s-1CDMA2000\s0 multimedia services, similar to \fB3gp\fR with extensions and limitations .IP "\fBf4v\fR" 4 .IX Item "f4v" Adobe Flash Video format .IP "\fBipod\fR" 4 .IX Item "ipod" \&\s-1MPEG\-4\s0 audio file format, as \s-1MOV/MP4\s0 but limited to contain only audio streams, typically played with the Apple ipod device .IP "\fBismv\fR" 4 .IX Item "ismv" Microsoft \s-1IIS\s0 (Internet Information Services) Smooth Streaming Audio/Video (\s-1ISMV\s0 or \s-1ISMA\s0) format. This is based on \s-1MPEG\-4\s0 Part 14 format with a few incompatible variants, used to stream media files for the Microsoft \s-1IIS\s0 server. .IP "\fBmov\fR" 4 .IX Item "mov" QuickTime player format identified by the \f(CW\*(C`.mov\*(C'\fR extension .IP "\fBmp4\fR" 4 .IX Item "mp4" \&\s-1MP4\s0 or \s-1MPEG\-4\s0 Part 14 format .IP "\fBpsp\fR" 4 .IX Item "psp" PlayStation Portable \s-1MP4/MPEG\-4\s0 Part 14 format variant. This is based on \s-1MPEG\-4\s0 Part 14 format with a few incompatible variants, used to play files on PlayStation devices. .PP \fIFragmentation\fR .IX Subsection "Fragmentation" .PP The \fBmov\fR, \fBmp4\fR, and \fBismv\fR muxers support fragmentation. Normally, a \s-1MOV/MP4\s0 file has all the metadata about all packets stored in one location. .PP This data is usually written at the end of the file, but it can be moved to the start for better playback by adding \f(CW\*(C`+faststart\*(C'\fR to the \f(CW\*(C`\-movflags\*(C'\fR, or using the \fBqt-faststart\fR tool). .PP A fragmented file consists of a number of fragments, where packets and metadata about these packets are stored together. Writing a fragmented file has the advantage that the file is decodable even if the writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if it is not properly finished), and it requires less memory when writing very long files (since writing normal \s-1MOV/MP4\s0 files stores info about every single packet in memory until the file is closed). The downside is that it is less compatible with other applications. .PP Fragmentation is enabled by setting one of the options that define how to cut the file into fragments: .IP "\fBfrag_duration\fR" 4 .IX Item "frag_duration" .PD 0 .IP "\fBfrag_size\fR" 4 .IX Item "frag_size" .IP "\fBmin_frag_duration\fR" 4 .IX Item "min_frag_duration" .IP "\fBmovflags +frag_keyframe\fR" 4 .IX Item "movflags +frag_keyframe" .IP "\fBmovflags +frag_custom\fR" 4 .IX Item "movflags +frag_custom" .PD .PP If more than one condition is specified, fragments are cut when one of the specified conditions is fulfilled. The exception to this is the option \fBmin_frag_duration\fR, which has to be fulfilled for any of the other conditions to apply. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBbrand\fR \fIbrand_string\fR" 4 .IX Item "brand brand_string" Override major brand. .IP "\fBempty_hdlr_name\fR \fIbool\fR" 4 .IX Item "empty_hdlr_name bool" Enable to skip writing the name inside a \f(CW\*(C`hdlr\*(C'\fR box. Default is \f(CW\*(C`false\*(C'\fR. .IP "\fBencryption_key\fR \fIkey\fR" 4 .IX Item "encryption_key key" set the media encryption key in hexadecimal format .IP "\fBencryption_kid\fR \fIkid\fR" 4 .IX Item "encryption_kid kid" set the media encryption key identifier in hexadecimal format .IP "\fBencryption_scheme\fR \fIscheme\fR" 4 .IX Item "encryption_scheme scheme" configure the encryption scheme, allowed values are \fBnone\fR, and \&\fBcenc-aes-ctr\fR .IP "\fBfrag_duration\fR \fIduration\fR" 4 .IX Item "frag_duration duration" Create fragments that are \fIduration\fR microseconds long. .IP "\fBfrag_interleave\fR \fInumber\fR" 4 .IX Item "frag_interleave number" Interleave samples within fragments (max number of consecutive samples, lower is tighter interleaving, but with more overhead. It is set to \f(CW0\fR by default. .IP "\fBfrag_size\fR \fIsize\fR" 4 .IX Item "frag_size size" create fragments that contain up to \fIsize\fR bytes of payload data .IP "\fBiods_audio_profile\fR \fIprofile\fR" 4 .IX Item "iods_audio_profile profile" specify iods number for the audio profile atom (from \-1 to 255), default is \f(CW\*(C`\-1\*(C'\fR .IP "\fBiods_video_profile\fR \fIprofile\fR" 4 .IX Item "iods_video_profile profile" specify iods number for the video profile atom (from \-1 to 255), default is \f(CW\*(C`\-1\*(C'\fR .IP "\fBism_lookahead\fR \fInum_entries\fR" 4 .IX Item "ism_lookahead num_entries" specify number of lookahead entries for \s-1ISM\s0 files (from 0 to 255), default is \f(CW0\fR .IP "\fBmin_frag_duration\fR \fIduration\fR" 4 .IX Item "min_frag_duration duration" do not create fragments that are shorter than \fIduration\fR microseconds long .IP "\fBmoov_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 "\fBmov_gamma\fR \fIgamma\fR" 4 .IX Item "mov_gamma gamma" specify gamma value for gama atom (as a decimal number from 0 to 10), default is \f(CW0.0\fR, must be set together with \f(CW\*(C`+ movflags\*(C'\fR .IP "\fBmovflags\fR \fIflags\fR" 4 .IX Item "movflags flags" Set various muxing switches. The following flags can be used: .RS 4 .IP "\fBcmaf\fR" 4 .IX Item "cmaf" write \s-1CMAF\s0 (Common Media Application Format) compatible fragmented \&\s-1MP4\s0 output .IP "\fBdash\fR" 4 .IX Item "dash" write \s-1DASH\s0 (Dynamic Adaptive Streaming over \s-1HTTP\s0) compatible fragmented \&\s-1MP4\s0 output .IP "\fBdefault_base_moof\fR" 4 .IX Item "default_base_moof" Similarly to the \fBomit_tfhd_offset\fR flag, 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 "\fBdelay_moov\fR" 4 .IX Item "delay_moov" delay writing the initial moov until the first fragment is cut, or until the first fragment flush .IP "\fBdisable_chpl\fR" 4 .IX Item "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 "\fBfaststart\fR" 4 .IX Item "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 "\fBfrag_custom\fR" 4 .IX Item "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 "\fBfrag_discont\fR" 4 .IX Item "frag_discont" signal that the next fragment is discontinuous from earlier ones .IP "\fBfrag_every_frame\fR" 4 .IX Item "frag_every_frame" fragment at every frame .IP "\fBfrag_keyframe\fR" 4 .IX Item "frag_keyframe" start a new fragment at each video keyframe .IP "\fBglobal_sidx\fR" 4 .IX Item "global_sidx" write a global sidx index at the start of the file .IP "\fBisml\fR" 4 .IX Item "isml" create a live smooth streaming feed (for pushing to a publishing point) .IP "\fBnegative_cts_offsets\fR" 4 .IX Item "negative_cts_offsets" Enables utilization of version 1 of the \s-1CTTS\s0 box, in which the \s-1CTS\s0 offsets can be negative. This enables the initial sample to have \s-1DTS/CTS\s0 of zero, and reduces the need for edit lists for some cases such as video tracks with B\-frames. Additionally, eases conformance with the DASH-IF interoperability guidelines. .Sp This option is implicitly set when writing \fBismv\fR (Smooth Streaming) files. .IP "\fBomit_tfhd_offset\fR" 4 .IX Item "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 "\fBprefer_icc\fR" 4 .IX Item "prefer_icc" If writing colr atom prioritise usage of \s-1ICC\s0 profile if it exists in stream packet side data. .IP "\fBrtphint\fR" 4 .IX Item "rtphint" add \s-1RTP\s0 hinting tracks to the output file .IP "\fBseparate_moof\fR" 4 .IX Item "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. .IP "\fBskip_sidx\fR" 4 .IX Item "skip_sidx" Skip writing of sidx atom. When bitrate overhead due to sidx atom is high, this option could be used for cases where sidx atom is not mandatory. When the \fBglobal_sidx\fR flag is enabled, this option is ignored. .IP "\fBskip_trailer\fR" 4 .IX Item "skip_trailer" skip writing the mfra/tfra/mfro trailer for fragmented files .IP "\fBuse_metadata_tags\fR" 4 .IX Item "use_metadata_tags" use mdta atom for metadata .IP "\fBwrite_colr\fR" 4 .IX Item "write_colr" write colr atom even if the color info is unspecified. This flag is experimental, may be renamed or changed, do not use from scripts. .IP "\fBwrite_gama\fR" 4 .IX Item "write_gama" write deprecated gama atom .RE .RS 4 .RE .IP "\fBmovie_timescale\fR \fIscale\fR" 4 .IX Item "movie_timescale scale" Set the timescale written in the movie header box (\f(CW\*(C`mvhd\*(C'\fR). Range is 1 to \s-1INT_MAX.\s0 Default is \f(CW1000\fR. .IP "\fBrtpflags\fR \fIflags\fR" 4 .IX Item "rtpflags flags" Add \s-1RTP\s0 hinting tracks to the output file. .Sp The following flags can be used: .RS 4 .IP "\fBh264_mode0\fR" 4 .IX Item "h264_mode0" use mode 0 for H.264 in \s-1RTP\s0 .IP "\fBlatm\fR" 4 .IX Item "latm" use \s-1MP4A\-LATM\s0 packetization instead of \s-1MPEG4\-GENERIC\s0 for \s-1AAC\s0 .IP "\fBrfc2190\fR" 4 .IX Item "rfc2190" use \s-1RFC 2190\s0 packetization instead of \s-1RFC 4629\s0 for H.263 .IP "\fBsend_bye\fR" 4 .IX Item "send_bye" send \s-1RTCP BYE\s0 packets when finishing .IP "\fBskip_rtcp\fR" 4 .IX Item "skip_rtcp" do not send \s-1RTCP\s0 sender reports .RE .RS 4 .RE .IP "\fBskip_iods\fR \fIbool\fR" 4 .IX Item "skip_iods bool" skip writing iods atom (default value is \f(CW\*(C`true\*(C'\fR) .IP "\fBuse_editlist\fR \fIbool\fR" 4 .IX Item "use_editlist bool" use edit list (default value is \f(CW\*(C`auto\*(C'\fR) .IP "\fBuse_stream_ids_as_track_ids\fR \fIbool\fR" 4 .IX Item "use_stream_ids_as_track_ids bool" use stream ids as track ids (default value is \f(CW\*(C`false\*(C'\fR) .IP "\fBvideo_track_timescale\fR \fIscale\fR" 4 .IX Item "video_track_timescale scale" Set the timescale used for video tracks. Range is \f(CW0\fR to \s-1INT_MAX.\s0 If set to \f(CW0\fR, the timescale is automatically set based on the native stream time base. Default is \f(CW0\fR. .IP "\fBwrite_btrt\fR \fIbool\fR" 4 .IX Item "write_btrt bool" Force or disable writing bitrate box inside stsd box of a track. The box contains decoding buffer size (in bytes), maximum bitrate and average bitrate for the track. The box will be skipped if none of these values can be computed. Default is \f(CW\*(C`\-1\*(C'\fR or \f(CW\*(C`auto\*(C'\fR, which will write the box only in \s-1MP4\s0 mode. .IP "\fBwrite_prft\fR \fIoption\fR" 4 .IX Item "write_prft option" Write producer time reference box (\s-1PRFT\s0) with a specified time source for the \&\s-1NTP\s0 field in the \s-1PRFT\s0 box. Set value as \fBwallclock\fR to specify timesource as wallclock time and \fBpts\fR to specify timesource as input packets' \s-1PTS\s0 values. .IP "\fBwrite_tmcd\fR \fIbool\fR" 4 .IX Item "write_tmcd bool" 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). .Sp Setting value to \fBpts\fR is applicable only for a live encoding use case, where \s-1PTS\s0 values are set as as wallclock time at the source. For example, an encoding use case with decklink capture source where \fBvideo_pts\fR and \&\fBaudio_pts\fR are set to \fBabs_wallclock\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Push Smooth Streaming content in real time to a publishing point on \&\s-1IIS\s0 with the \fBismv\fR muxer using \fBffmpeg\fR: .Sp .Vb 1 \& ffmpeg \-re <> \-movflags isml+frag_keyframe \-f ismv http://server/publishingpoint.isml/Streams(Encoder1) .Ve .SS "a64" .IX Subsection "a64" A64 Commodore 64 video muxer. .PP This muxer accepts a single \f(CW\*(C`a64_multi\*(C'\fR or \f(CW\*(C`a64_multi5\*(C'\fR codec video stream. .SS "ac4" .IX Subsection "ac4" Raw \s-1AC\-4\s0 audio muxer. .PP This muxer accepts a single \f(CW\*(C`ac4\*(C'\fR audio stream. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBwrite_crc\fR \fIbool\fR" 4 .IX Item "write_crc bool" when enabled, write a \s-1CRC\s0 checksum for each packet to the output, default is \f(CW\*(C`false\*(C'\fR .SS "adts" .IX Subsection "adts" Audio Data Transport Stream muxer. .PP It accepts a single \s-1AAC\s0 stream. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBwrite_id3v2\fR \fIbool\fR" 4 .IX Item "write_id3v2 bool" Enable to write ID3v2.4 tags at the start of the stream. Default is disabled. .IP "\fBwrite_apetag\fR \fIbool\fR" 4 .IX Item "write_apetag bool" Enable to write \s-1APE\s0 tags at the end of the stream. Default is disabled. .IP "\fBwrite_mpeg2\fR \fIbool\fR" 4 .IX Item "write_mpeg2 bool" Enable to set \s-1MPEG\s0 version bit in the \s-1ADTS\s0 frame header to 1 which indicates \s-1MPEG\-2.\s0 Default is 0, which indicates \s-1MPEG\-4.\s0 .SS "aea" .IX Subsection "aea" \&\s-1MD STUDIO\s0 audio muxer. .PP This muxer accepts a single \s-1ATRAC1\s0 audio stream with either one or two channels and a sample rate of 44100Hz. .PP As \s-1AEA\s0 supports storing the track title, this muxer will also write the title from stream's metadata to the container. .SS "aiff" .IX Subsection "aiff" Audio Interchange File Format muxer. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBwrite_id3v2\fR \fIbool\fR" 4 .IX Item "write_id3v2 bool" Enable ID3v2 tags writing when set to 1. Default is 0 (disabled). .IP "\fBid3v2_version\fR \fIbool\fR" 4 .IX Item "id3v2_version bool" 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 "alp" .IX Subsection "alp" High Voltage Software's Lego Racers game audio muxer. .PP It accepts a single \s-1ADPCM_IMA_ALP\s0 stream with no more than 2 channels and a sample rate not greater than 44100 Hz. .PP Extensions: \f(CW\*(C`tun\*(C'\fR, \f(CW\*(C`pcm\*(C'\fR .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBtype\fR \fItype\fR" 4 .IX Item "type type" Set file type. .Sp \&\fItype\fR accepts the following values: .RS 4 .IP "\fBtun\fR" 4 .IX Item "tun" Set file type as music. Must have a sample rate of 22050 Hz. .IP "\fBpcm\fR" 4 .IX Item "pcm" Set file type as sfx. .IP "\fBauto\fR" 4 .IX Item "auto" Set file type as per output file extension. \f(CW\*(C`.pcm\*(C'\fR results in type \f(CW\*(C`pcm\*(C'\fR else type \f(CW\*(C`tun\*(C'\fR is set. \fI(default)\fR .RE .RS 4 .RE .SS "amr" .IX Subsection "amr" 3GPP \s-1AMR\s0 (Adaptive Multi-Rate) audio muxer. .PP It accepts a single audio stream containing an \s-1AMR NB\s0 stream. .SS "amv" .IX Subsection "amv" \&\s-1AMV\s0 (Actions Media Video) format muxer. .SS "apm" .IX Subsection "apm" Ubisoft Rayman 2 \s-1APM\s0 audio muxer. .PP It accepts a single \s-1ADPCM IMA APM\s0 audio stream. .SS "apng" .IX Subsection "apng" Animated Portable Network Graphics muxer. .PP It accepts a single \s-1APNG\s0 video stream. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBfinal_delay\fR \fIdelay\fR" 4 .IX Item "final_delay delay" Force a delay expressed in seconds after the last frame of each repetition. Default value is \f(CW0.0\fR. .IP "\fBplays\fR \fIrepetitions\fR" 4 .IX Item "plays repetitions" specify how many times to play the content, \f(CW0\fR causes an infinte loop, with \f(CW1\fR there is no loop .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Use \fBffmpeg\fR to generate an \s-1APNG\s0 output with 2 repetitions, and with a delay of half a second after the first repetition: .Sp .Vb 1 \& ffmpeg \-i INPUT \-final_delay 0.5 \-plays 2 out.apng .Ve .SS "argo_asf" .IX Subsection "argo_asf" Argonaut Games \s-1ASF\s0 audio muxer. .PP It accepts a single \s-1ADPCM\s0 audio stream. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBversion_major\fR \fIversion\fR" 4 .IX Item "version_major version" override file major version, specified as an integer, default value is \&\f(CW2\fR .IP "\fBversion_minor\fR \fIversion\fR" 4 .IX Item "version_minor version" override file minor version, specified as an integer, default value is \&\f(CW1\fR .IP "\fBname\fR \fIname\fR" 4 .IX Item "name name" Embed file name into file, if not specified use the output file name. The name is truncated to 8 characters. .SS "argo_cvg" .IX Subsection "argo_cvg" Argonaut Games \s-1CVG\s0 audio muxer. .PP It accepts a single one-channel \s-1ADPCM\s0 22050Hz audio stream. .PP The \fBloop\fR and \fBreverb\fR options set the corresponding flags in the header which can be later retrieved to process the audio stream accordingly. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBskip_rate_check\fR \fIbool\fR" 4 .IX Item "skip_rate_check bool" skip sample rate check (default is \f(CW\*(C`false\*(C'\fR) .IP "\fBloop\fR \fIbool\fR" 4 .IX Item "loop bool" set loop flag (default is \f(CW\*(C`false\*(C'\fR) .IP "\fBreverb\fR \fIboolean\fR" 4 .IX Item "reverb boolean" set reverb flag (default is \f(CW\*(C`true\*(C'\fR) .SS "asf, asf_stream" .IX Subsection "asf, asf_stream" Advanced / Active Systems (or Streaming) Format audio muxer. .PP The \fBasf_stream\fR variant should be selected for streaming. .PP Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this muxer too. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBpacket_size\fR \fIsize\fR" 4 .IX Item "packet_size size" Set the muxer packet size as a number of bytes. By tuning this setting you may reduce data fragmentation or muxer overhead depending on your source. Default value is \f(CW3200\fR, minimum is \f(CW100\fR, maximum is \f(CW\*(C`64Ki\*(C'\fR. .SS "ass" .IX Subsection "ass" \&\s-1ASS/SSA\s0 (SubStation Alpha) subtitles muxer. .PP It accepts a single \s-1ASS\s0 subtitles stream. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBignore_readorder\fR \fIbool\fR" 4 .IX Item "ignore_readorder bool" Write dialogue events immediately, even if they are out-of-order, default is \f(CW\*(C`false\*(C'\fR, otherwise they are cached until the expected time event is found. .SS "ast" .IX Subsection "ast" \&\s-1AST\s0 (Audio Stream) muxer. .PP This format is used to play audio on some Nintendo Wii games. .PP It accepts a single audio stream. .PP The \fBloopstart\fR and \fBloopend\fR options can be used to define a section of the file to loop for players honoring such options. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBloopstart\fR \fIstart\fR" 4 .IX Item "loopstart start" Specify loop start position expressesd in milliseconds, from \f(CW\*(C`\-1\*(C'\fR to \f(CW\*(C`INT_MAX\*(C'\fR, in case \f(CW\*(C`\-1\*(C'\fR is set then no loop is specified (default \-1) and the \fBloopend\fR value is ignored. .IP "\fBloopend\fR \fIend\fR" 4 .IX Item "loopend end" Specify loop end position expressed in milliseconds, from \f(CW0\fR to \&\f(CW\*(C`INT_MAX\*(C'\fR, default is \f(CW0\fR, in case \f(CW0\fR is set it assumes the total stream duration. .SS "au" .IX Subsection "au" \&\s-1SUN AU\s0 audio muxer. .PP It accepts a single audio stream. .SS "avi" .IX Subsection "avi" Audio Video Interleaved muxer. .PP \&\s-1AVI\s0 is a proprietary format developed by Microsoft, and later formally specified through the Open \s-1DML\s0 specification. .PP Because of differences in players implementations, it might be required to set some options to make sure that the generated output can be correctly played by the target player. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBflipped_raw_rgb\fR \fIbool\fR" 4 .IX Item "flipped_raw_rgb bool" If set to \f(CW\*(C`true\*(C'\fR, store positive height for raw \s-1RGB\s0 bitmaps, which indicates bitmap is stored bottom-up. Note that this option does not flip the bitmap which has to be done manually beforehand, e.g. by using the \fBvflip\fR filter. Default is \f(CW\*(C`false\*(C'\fR and indicates bitmap is stored top down. .IP "\fBreserve_index_space\fR \fIsize\fR" 4 .IX Item "reserve_index_space size" Reserve the specified amount of bytes for the OpenDML master index of each stream within the file header. By default additional master indexes are embedded within the data packets if there is no space left in the first master index and are linked together as a chain of indexes. This index structure can cause problems for some use cases, e.g. third-party software strictly relying on the OpenDML index specification or when file seeking is slow. Reserving enough index space in the file header avoids these problems. .Sp The required index space depends on the output file size and should be about 16 bytes per gigabyte. When this option is omitted or set to zero the necessary index space is guessed. .Sp Default value is \f(CW0\fR. .IP "\fBwrite_channel_mask\fR \fIbool\fR" 4 .IX Item "write_channel_mask bool" Write the channel layout mask into the audio stream header. .Sp This option is enabled by default. Disabling the channel mask can be useful in specific scenarios, e.g. when merging multiple audio streams into one for compatibility with software that only supports a single audio stream in \s-1AVI\s0 (see \fBthe \*(L"amerge\*(R" section in the ffmpeg-filters manual\fR). .SS "avif" .IX Subsection "avif" \&\s-1AV1\s0 (Alliance for Open Media Video codec 1) image format muxer. .PP This muxers stores images encoded using the \s-1AV1\s0 codec. .PP It accepts one or two video streams. In case two video streams are provided, the second one shall contain a single plane storing the alpha mask. .PP In case more than one image is provided, the generated output is considered an animated \s-1AVIF\s0 and the number of loops can be specified with the \fBloop\fR option. .PP This is based on the specification by Alliance for Open Media at url <\fBhttps://aomediacodec.github.io/av1\-avif\fR>. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBloop\fR \fIcount\fR" 4 .IX Item "loop count" number of times to loop an animated \s-1AVIF,\s0 \f(CW0\fR specify an infinite loop, default is \f(CW0\fR .IP "\fBmovie_timescale\fR \fItimescale\fR" 4 .IX Item "movie_timescale timescale" Set the timescale written in the movie header box (\f(CW\*(C`mvhd\*(C'\fR). Range is 1 to \s-1INT_MAX.\s0 Default is \f(CW1000\fR. .SS "avm2" .IX Subsection "avm2" ShockWave Flash (\s-1SWF\s0) / ActionScript Virtual Machine 2 (\s-1AVM2\s0) format muxer. .PP It accepts one audio stream, one video stream, or both. .SS "bit" .IX Subsection "bit" G.729 (.bit) file format muxer. .PP It accepts a single G.729 audio stream. .SS "caf" .IX Subsection "caf" Apple \s-1CAF\s0 (Core Audio Format) muxer. .PP It accepts a single audio stream. .SS "codec2" .IX Subsection "codec2" Codec2 audio audio muxer. .PP It accepts a single codec2 audio stream. .SS "chromaprint" .IX Subsection "chromaprint" Chromaprint fingerprinter muxers. .PP To enable compilation of this filter you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-chromaprint\*(C'\fR. .PP This muxer feeds audio data to the Chromaprint library, which generates a fingerprint for the provided audio data. See: <\fBhttps://acoustid.org/chromaprint\fR> .PP It takes a single signed native-endian 16\-bit raw audio stream of at most 2 channels. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBalgorithm\fR \fIversion\fR" 4 .IX Item "algorithm version" Select version of algorithm to fingerprint with. Range is \f(CW0\fR to \&\f(CW4\fR. Version \f(CW3\fR enables silence detection. Default is \f(CW1\fR. .IP "\fBfp_format\fR \fIformat\fR" 4 .IX Item "fp_format format" Format to output the fingerprint as. Accepts the following options: .RS 4 .IP "\fBbase64\fR" 4 .IX Item "base64" Base64 compressed fingerprint \fI(default)\fR .IP "\fBcompressed\fR" 4 .IX Item "compressed" Binary compressed fingerprint .IP "\fBraw\fR" 4 .IX Item "raw" Binary raw fingerprint .RE .RS 4 .RE .IP "\fBsilence_threshold\fR \fIthreshold\fR" 4 .IX Item "silence_threshold threshold" Threshold for detecting silence. Range is from \f(CW\*(C`\-1\*(C'\fR to \&\f(CW32767\fR, where \f(CW\*(C`\-1\*(C'\fR disables silence detection. Silence detection can only be used with version \f(CW3\fR of the algorithm. .Sp Silence detection must be disabled for use with the AcoustID service. Default is \f(CW\*(C`\-1\*(C'\fR. .SS "crc" .IX Subsection "crc" \&\s-1CRC\s0 (Cyclic Redundancy Check) muxer. .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" .IP "\(bu" 4 Use \fBffmpeg\fR to compute the \s-1CRC\s0 of the input, and store it in the file \fIout.crc\fR: .Sp .Vb 1 \& ffmpeg \-i INPUT \-f crc out.crc .Ve .IP "\(bu" 4 Use \fBffmpeg\fR to print the \s-1CRC\s0 to stdout with the command: .Sp .Vb 1 \& ffmpeg \-i INPUT \-f crc \- .Ve .IP "\(bu" 4 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: .Sp .Vb 1 \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f crc \- .Ve .SS "dash" .IX Subsection "dash" Dynamic Adaptive Streaming over \s-1HTTP\s0 (\s-1DASH\s0) muxer. .PP This muxer creates segments and manifest files according to the MPEG-DASH standard \s-1ISO/IEC 23009\-1:2014\s0 and following standard updates. .PP For more information see: .IP "\(bu" 4 \&\s-1ISO DASH\s0 Specification: <\fBhttp://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009\-1_2014.zip\fR> .IP "\(bu" 4 WebM \s-1DASH\s0 Specification: <\fBhttps://sites.google.com/a/webmproject.org/wiki/adaptive\-streaming/webm\-dash\-specification\fR> .PP This muxer creates an \s-1MPD\s0 (Media Presentation Description) manifest file and segment files for each stream. Segment files are placed in the same directory of the \s-1MPD\s0 manifest file. .PP The segment filename might contain pre-defined identifiers used in the manifest \f(CW\*(C`SegmentTemplate\*(C'\fR section as defined in section 5.3.9.4.4 of the standard. .PP Available identifiers are \f(CW\*(C`$RepresentationID$\*(C'\fR, \f(CW\*(C`$Number$\*(C'\fR, \&\f(CW\*(C`$Bandwidth$\*(C'\fR, and \f(CW\*(C`$Time$\*(C'\fR. In addition to the standard identifiers, an ffmpeg-specific \f(CW\*(C`$ext$\*(C'\fR identifier is also supported. When specified, \fBffmpeg\fR will replace \f(CW\*(C`$ext$\*(C'\fR in the file name with muxing format's extensions such as \f(CW\*(C`mp4\*(C'\fR, \&\f(CW\*(C`webm\*(C'\fR etc. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBadaptation_sets\fR \fIadaptation_sets\fR" 4 .IX Item "adaptation_sets adaptation_sets" Assign streams to adaptation sets, specified in the \s-1MPD\s0 manifest \&\f(CW\*(C`AdaptationSets\*(C'\fR section. .Sp An adaptation set contains a set of one or more streams accessed as a single subset, e.g. corresponding streams encoded at different size selectable by the user depending on the available bandwidth, or to different audio streams with a different language. .Sp Each adaptation set is specified with the syntax: .Sp .Vb 1 \& id=,streams= .Ve .Sp where \fIindex\fR must be a numerical index, and \fIstreams\fR is a sequence of \f(CW\*(C`,\*(C'\fR\-separated stream indices. Multiple adaptation sets can be specified, separated by spaces. .Sp To map all video (or audio) streams to an adaptation set, \f(CW\*(C`v\*(C'\fR (or \&\f(CW\*(C`a\*(C'\fR) can be used as stream identifier instead of IDs. .Sp When no assignment is defined, this defaults to an adaptation set for each stream. .Sp The following optional fields can also be specified: .RS 4 .IP "\fBdescriptor\fR" 4 .IX Item "descriptor" Define the descriptor as defined by \s-1ISO/IEC\s0 23009\-1:2014/Amd.2:2015. .Sp For example: .Sp .Vb 1 \& .Ve .Sp The descriptor string should be a self-closing \s-1XML\s0 tag. .IP "\fBfrag_duration\fR" 4 .IX Item "frag_duration" Override the global fragment duration specified with the \&\fBfrag_duration\fR option. .IP "\fBfrag_type\fR" 4 .IX Item "frag_type" Override the global fragment type specified with the \&\fBfrag_type\fR option. .IP "\fBseg_duration\fR" 4 .IX Item "seg_duration" Override the global segment duration specified with the \&\fBseg_duration\fR option. .IP "\fBtrick_id\fR" 4 .IX Item "trick_id" Mark an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set. .RE .RS 4 .Sp A few examples of possible values for the \fBadaptation_sets\fR option follow: .Sp .Vb 1 \& id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a \& \& \& \& id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1 .Ve .RE .IP "\fBdash_segment_type\fR \fItype\fR" 4 .IX Item "dash_segment_type type" Set \s-1DASH\s0 segment files type. .Sp Possible values: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" The dash segment files format will be selected based on the stream codec. This is the default mode. .IP "\fBmp4\fR" 4 .IX Item "mp4" the dash segment files will be in \s-1ISOBMFF/MP4\s0 format .IP "\fBwebm\fR" 4 .IX Item "webm" the dash segment files will be in WebM format .RE .RS 4 .RE .IP "\fBextra_window_size\fR \fIsize\fR" 4 .IX Item "extra_window_size size" Set the maximum number of segments kept outside of the manifest before removing from disk. .IP "\fBformat_options\fR \fIoptions_list\fR" 4 .IX Item "format_options options_list" Set container format (mp4/webm) options using a \f(CW\*(C`:\*(C'\fR\-separated list of key=value parameters. Values containing \f(CW\*(C`:\*(C'\fR special characters must be escaped. .IP "\fBfrag_duration\fR \fIduration\fR" 4 .IX Item "frag_duration duration" Set the length in seconds of fragments within segments, fractional value can also be set. .IP "\fBfrag_type\fR \fItype\fR" 4 .IX Item "frag_type type" Set the type of interval for fragmentation. .Sp Possible values: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" set one fragment per segment .IP "\fBevery_frame\fR" 4 .IX Item "every_frame" fragment at every frame .IP "\fBduration\fR" 4 .IX Item "duration" fragment at specific time intervals .IP "\fBpframes\fR" 4 .IX Item "pframes" fragment at keyframes and following P\-Frame reordering (Video only, experimental) .RE .RS 4 .RE .IP "\fBglobal_sidx\fR \fIbool\fR" 4 .IX Item "global_sidx bool" Write global \f(CW\*(C`SIDX\*(C'\fR atom. Applicable only for single file, mp4 output, non-streaming mode. .IP "\fBhls_master_name\fR \fIfile_name\fR" 4 .IX Item "hls_master_name file_name" \&\s-1HLS\s0 master playlist name. Default is \fImaster.m3u8\fR. .IP "\fBhls_playlist\fR \fIbool\fR" 4 .IX Item "hls_playlist bool" Generate \s-1HLS\s0 playlist files. The master playlist is generated with filename specified by the \fBhls_master_name\fR option. One media playlist file is generated for each stream with filenames \&\fImedia_0.m3u8\fR, \fImedia_1.m3u8\fR, etc. .IP "\fBhttp_opts\fR \fIhttp_opts\fR" 4 .IX Item "http_opts http_opts" Specify a list of \f(CW\*(C`:\*(C'\fR\-separated key=value options to pass to the underlying \s-1HTTP\s0 protocol. Applicable only for \s-1HTTP\s0 output. .IP "\fBhttp_persistent\fR \fIbool\fR" 4 .IX Item "http_persistent bool" Use persistent \s-1HTTP\s0 connections. Applicable only for \s-1HTTP\s0 output. .IP "\fBhttp_user_agent\fR \fIuser_agent\fR" 4 .IX Item "http_user_agent user_agent" Override User-Agent field in \s-1HTTP\s0 header. Applicable only for \s-1HTTP\s0 output. .IP "\fBignore_io_errors\fR \fIbool\fR" 4 .IX Item "ignore_io_errors bool" Ignore \s-1IO\s0 errors during open and write. Useful for long-duration runs with network output. This is disabled by default. .IP "\fBindex_correction\fR \fIbool\fR" 4 .IX Item "index_correction bool" Enable or disable segment index correction logic. Applicable only when \&\fBuse_template\fR is enabled and \fBuse_timeline\fR is disabled. This is disabled by default. .Sp When enabled, the logic monitors the flow of segment indexes. If a streams's segment index value is not at the expected real time position, then the logic corrects that index value. .Sp Typically this logic is needed in live streaming use cases. The network bandwidth fluctuations are common during long run streaming. Each fluctuation can cause the segment indexes fall behind the expected real time position. .IP "\fBinit_seg_name\fR \fIinit_name\fR" 4 .IX Item "init_seg_name init_name" DASH-templated name to use for the initialization segment. Default is \&\f(CW\*(C`init\-stream$RepresentationID$.$ext$\*(C'\fR. \f(CW\*(C`$ext$\*(C'\fR is replaced with the file name extension specific for the segment format. .IP "\fBldash\fR \fIbool\fR" 4 .IX Item "ldash bool" Enable Low-latency Dash by constraining the presence and values of some elements. This is disabled by default. .IP "\fBlhls\fR \fIbool\fR" 4 .IX Item "lhls bool" Enable Low-latency \s-1HLS\s0 (\s-1LHLS\s0). Add \f(CW\*(C`#EXT\-X\-PREFETCH\*(C'\fR tag with current segment's \s-1URI.\s0 hls.js player folks are trying to standardize an open \s-1LHLS\s0 spec. The draft spec is available at <\fBhttps://github.com/video\-dev/hlsjs\-rfcs/blob/lhls\-spec/proposals/0001\-lhls.md\fR>. .Sp This option tries to comply with the above open spec. It enables \&\fBstreaming\fR and \fBhls_playlist\fR options automatically. This is an experimental feature. .Sp Note: This is not Apple's version \s-1LHLS.\s0 See <\fBhttps://datatracker.ietf.org/doc/html/draft\-pantos\-hls\-rfc8216bis\fR> .IP "\fBmaster_m3u8_publish_rate\fR \fIsegment_intervals_count\fR" 4 .IX Item "master_m3u8_publish_rate segment_intervals_count" Publish master playlist repeatedly every after specified number of segment intervals. .IP "\fBmax_playback_rate\fR \fIrate\fR" 4 .IX Item "max_playback_rate rate" Set the maximum playback rate indicated as appropriate for the purposes of automatically adjusting playback latency and buffer occupancy during normal playback by clients. .IP "\fBmedia_seg_name\fR \fIsegment_name\fR" 4 .IX Item "media_seg_name segment_name" DASH-templated name to use for the media segments. Default is \&\f(CW\*(C`chunk\-stream$RepresentationID$\-$Number%05d$.$ext$\*(C'\fR. \f(CW\*(C`$ext$\*(C'\fR is replaced with the file name extension specific for the segment format. .IP "\fBmethod\fR \fImethod\fR" 4 .IX Item "method method" Use the given \s-1HTTP\s0 method to create output files. Generally set to \f(CW\*(C`PUT\*(C'\fR or \f(CW\*(C`POST\*(C'\fR. .IP "\fBmin_playback_rate\fR \fIrate\fR" 4 .IX Item "min_playback_rate rate" Set the minimum playback rate indicated as appropriate for the purposes of automatically adjusting playback latency and buffer occupancy during normal playback by clients. .IP "\fBmpd_profile\fR \fIflags\fR" 4 .IX Item "mpd_profile flags" Set one or more \s-1MPD\s0 manifest profiles. .Sp Possible values: .RS 4 .IP "\fBdash\fR" 4 .IX Item "dash" MPEG-DASH \s-1ISO\s0 Base media file format live profile .IP "\fBdvb_dash\fR" 4 .IX Item "dvb_dash" DVB-DASH profile .RE .RS 4 .Sp Default value is \f(CW\*(C`dash\*(C'\fR. .RE .IP "\fBremove_at_exit\fR \fIbool\fR" 4 .IX Item "remove_at_exit bool" Enable or disable removal of all segments when finished. This is disabled by default. .IP "\fBseg_duration\fR \fIduration\fR" 4 .IX Item "seg_duration duration" Set the segment length in seconds (fractional value can be set). The value is treated as average segment duration when the \&\fBuse_template\fR option is enabled and the \fBuse_timeline\fR option is disabled and as minimum segment duration for all the other use cases. .Sp Default value is \f(CW5\fR. .IP "\fBsingle_file\fR \fIbool\fR" 4 .IX Item "single_file bool" Enable or disable storing all segments in one file, accessed using byte ranges. This is disabled by default. .Sp The name of the single file can be specified with the \&\fBsingle_file_name\fR option, if not specified assume the basename of the manifest file with the output format extension. .IP "\fBsingle_file_name\fR \fIfile_name\fR" 4 .IX Item "single_file_name file_name" DASH-templated name to use for the manifest \f(CW\*(C`baseURL\*(C'\fR element. Imply that the \fBsingle_file\fR option is set to \&\fItrue\fR. In the template, \f(CW\*(C`$ext$\*(C'\fR is replaced with the file name extension specific for the segment format. .IP "\fBstreaming\fR \fIbool\fR" 4 .IX Item "streaming bool" Enable or disable chunk streaming mode of output. In chunk streaming mode, each frame will be a \f(CW\*(C`moof\*(C'\fR fragment which forms a chunk. This is disabled by default. .IP "\fBtarget_latency\fR \fItarget_latency\fR" 4 .IX Item "target_latency target_latency" Set an intended target latency in seconds for serving (fractional value can be set). Applicable only when the \fBstreaming\fR and \&\fBwrite_prft\fR options are enabled. This is an informative fields clients can use to measure the latency of the service. .IP "\fBtimeout\fR \fItimeout\fR" 4 .IX Item "timeout timeout" Set timeout for socket I/O operations expressed in seconds (fractional value can be set). Applicable only for \s-1HTTP\s0 output. .IP "\fBupdate_period\fR \fIperiod\fR" 4 .IX Item "update_period period" Set the \s-1MPD\s0 update period, for dynamic content. The unit is second. If set to \f(CW0\fR, the period is automatically computed. .Sp Default value is \f(CW0\fR. .IP "\fBuse_template\fR \fIbool\fR" 4 .IX Item "use_template bool" Enable or disable use of \f(CW\*(C`SegmentTemplate\*(C'\fR instead of \&\f(CW\*(C`SegmentList\*(C'\fR in the manifest. This is enabled by default. .IP "\fBuse_timeline\fR \fIbool\fR" 4 .IX Item "use_timeline bool" Enable or disable use of \f(CW\*(C`SegmentTimeline\*(C'\fR within the \&\f(CW\*(C`SegmentTemplate\*(C'\fR manifest section. This is enabled by default. .IP "\fButc_timing_url\fR \fIurl\fR" 4 .IX Item "utc_timing_url url" \&\s-1URL\s0 of the page that will return the \s-1UTC\s0 timestamp in \s-1ISO\s0 format, for example \f(CW\*(C`https://time.akamai.com/?iso\*(C'\fR .IP "\fBwindow_size\fR \fIsize\fR" 4 .IX Item "window_size size" Set the maximum number of segments kept in the manifest, discard the oldest one. This is useful for live streaming. .Sp If the value is \f(CW0\fR, all segments are kept in the manifest. Default value is \f(CW0\fR. .IP "\fBwrite_prft\fR \fIwrite_prft\fR" 4 .IX Item "write_prft write_prft" Write Producer Reference Time elements on supported streams. This also enables writing prft boxes in the underlying muxer. Applicable only when the \fIutc_url\fR option is enabled. It is set to \fIauto\fR by default, in which case the muxer will attempt to enable it only in modes that require it. .PP \fIExample\fR .IX Subsection "Example" .PP Generate a \s-1DASH\s0 output reading from an input source in realtime using \&\fBffmpeg\fR. .PP Two multimedia streams are generated from the input file, both containing a video stream encoded through \fBlibx264\fR, and an audio stream encoded with \fBlibfdk_aac\fR. The first multimedia stream contains video with a bitrate of 800k and audio at the default rate, the second with video scaled to 320x170 pixels at 300k and audio resampled at 22005 Hz. .PP The \fBwindow_size\fR option keeps only the latest 5 segments with the default duration of 5 seconds. .PP .Vb 7 \& ffmpeg \-re \-i \-map 0 \-map 0 \-c:a libfdk_aac \-c:v libx264 \e \& \-b:v:0 800k \-profile:v:0 main \e \& \-b:v:1 300k \-s:v:1 320x170 \-profile:v:1 baseline \-ar:a:1 22050 \e \& \-bf 1 \-keyint_min 120 \-g 120 \-sc_threshold 0 \-b_strategy 0 \e \& \-use_timeline 1 \-use_template 1 \-window_size 5 \e \& \-adaptation_sets "id=0,streams=v id=1,streams=a" \e \& \-f dash /path/to/out.mpd .Ve .SS "daud" .IX Subsection "daud" D\-Cinema audio muxer. .PP It accepts a single 6\-channels audio stream resampled at 96000 Hz encoded with the \fBpcm_24daud\fR codec. .PP \fIExample\fR .IX Subsection "Example" .PP Use \fBffmpeg\fR to mux input audio to a \fB5.1\fR channel layout resampled at 96000Hz: .PP .Vb 1 \& ffmpeg \-i INPUT \-af aresample=96000,pan=5.1 slow.302 .Ve .PP For ffmpeg versions before 7.0 you might have to use the \fBasetnsamples\fR filter to limit the muxed packet size, because this format does not support muxing packets larger than 65535 bytes (3640 samples). For newer ffmpeg versions audio is automatically packetized to 36000 byte (2000 sample) packets. .SS "dv" .IX Subsection "dv" \&\s-1DV\s0 (Digital Video) muxer. .PP It accepts exactly one \fBdvvideo\fR video stream and at most two \&\fBpcm_s16\fR audio streams. More constraints are defined by the property of the video, which must correspond to a \s-1DV\s0 video supported profile, and on the framerate. .PP \fIExample\fR .IX Subsection "Example" .PP Use \fBffmpeg\fR to convert the input: .PP .Vb 1 \& ffmpeg \-i INPUT \-s:v 720x480 \-pix_fmt yuv411p \-r 29.97 \-ac 2 \-ar 48000 \-y out.dv .Ve .SS "ffmetadata" .IX Subsection "ffmetadata" FFmpeg metadata muxer. .PP This muxer writes the streams metadata in the \fBffmetadata\fR format. .PP See \fBthe Metadata chapter\fR for information about the format. .PP \fIExample\fR .IX Subsection "Example" .PP Use \fBffmpeg\fR to extract metadata from an input file to a \fImetadata.ffmeta\fR file in \fBffmetadata\fR format: .PP .Vb 1 \& ffmpeg \-i INPUT \-f ffmetadata metadata.ffmeta .Ve .SS "fifo" .IX Subsection "fifo" \&\s-1FIFO\s0 (First-In First-Out) muxer. .PP The \fBfifo\fR pseudo-muxer allows the separation of encoding and muxing by using a first-in-first-out queue and running the actual muxer in a separate thread. .PP 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 The target muxer is either selected from the output name or specified through the \fBfifo_format\fR option. .PP The behavior of the \fBfifo\fR muxer if the queue fills up or if the output fails (e.g. if a packet cannot be written to the output) 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 the \s-1FIFO\s0 queue fills up. .PP \&\s-1API\s0 users should be aware that callback functions (\f(CW\*(C`interrupt_callback\*(C'\fR, \f(CW\*(C`io_open\*(C'\fR and \f(CW\*(C`io_close\*(C'\fR) used within its \f(CW\*(C`AVFormatContext\*(C'\fR must be thread-safe. .PP \fIOptions\fR .IX Subsection "Options" .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 \&\f(CW\*(C`false\*(C'\fR. .IP "\fBdrop_pkts_on_overflow\fR \fIbool\fR" 4 .IX Item "drop_pkts_on_overflow bool" If set to \f(CW\*(C`true\*(C'\fR, 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 \f(CW\*(C`false\*(C'\fR, so in such cases the encoder will be blocked until the muxer processes some of the packets and none of them is lost. .IP "\fBfifo_format\fR \fIformat_name\fR" 4 .IX Item "fifo_format format_name" Specify the format name. Useful if it cannot be guessed from the output name suffix. .IP "\fBformat_opts\fR \fIoptions\fR" 4 .IX Item "format_opts options" Specify format options for the underlying muxer. Muxer options can be specified as a list of \fIkey\fR=\fIvalue\fR pairs separated by ':'. .IP "\fBmax_recovery_attempts\fR \fIcount\fR" 4 .IX Item "max_recovery_attempts count" Set maximum number of successive unsuccessful recovery attempts after which the output fails permanently. By default this option is set to \&\f(CW0\fR (unlimited). .IP "\fBqueue_size\fR \fIsize\fR" 4 .IX Item "queue_size size" Specify size of the queue as a number of packets. Default value is \&\f(CW60\fR. .IP "\fBrecover_any_error\fR \fIbool\fR" 4 .IX Item "recover_any_error bool" If set to \f(CW\*(C`true\*(C'\fR, recovery will be attempted regardless of type of the error causing the failure. By default this option is set to \&\f(CW\*(C`false\*(C'\fR and in case of certain (usually permanent) errors the recovery is not attempted even when the \fBattempt_recovery\fR option is set to \f(CW\*(C`true\*(C'\fR. .IP "\fBrecovery_wait_streamtime\fR \fIbool\fR" 4 .IX Item "recovery_wait_streamtime bool" If set to \f(CW\*(C`false\*(C'\fR, the real time is used when waiting for the recovery attempt (i.e. the recovery will be attempted after the time specified by the \fBrecovery_wait_time\fR option). .Sp If set to \f(CW\*(C`true\*(C'\fR, the time of the processed stream is taken into account instead (i.e. the recovery will be attempted after discarding the packets corresponding to the \fBrecovery_wait_time\fR option). .Sp By default this option is set to \f(CW\*(C`false\*(C'\fR. .IP "\fBrecovery_wait_time\fR \fIduration\fR" 4 .IX Item "recovery_wait_time duration" Specify waiting time in seconds before the next recovery attempt after previous unsuccessful recovery attempt. Default value is \f(CW5\fR. .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 \f(CW\*(C`false\*(C'\fR by default. .IP "\fBtimeshift\fR \fIduration\fR" 4 .IX Item "timeshift duration" Buffer the specified amount of packets and delay writing the output. Note that the value of the \fBqueue_size\fR option must be big enough to store the packets for timeshift. At the end of the input the fifo buffer is flushed at realtime speed. .PP \fIExample\fR .IX Subsection "Example" .PP Use \fBffmpeg\fR to stream to an \s-1RTMP\s0 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: .PP .Vb 3 \& ffmpeg \-re \-i ... \-c:v libx264 \-c:a aac \-f fifo \-fifo_format flv \e \& \-drop_pkts_on_overflow 1 \-attempt_recovery 1 \-recovery_wait_time 1 \e \& \-map 0:v \-map 0:a rtmp://example.com/live/stream_name .Ve .SS "film_cpk" .IX Subsection "film_cpk" Sega film (.cpk) muxer. .PP This format was used as internal format for several Sega games. .PP For more information regarding the Sega film file format, visit <\fBhttp://wiki.multimedia.cx/index.php?title=Sega_FILM\fR>. .PP It accepts at maximum one \fBcinepak\fR or raw video stream, and at maximum one audio stream. .SS "filmstrip" .IX Subsection "filmstrip" Adobe Filmstrip muxer. .PP This format is used by several Adobe tools to store a generated filmstrip export. It accepts a single raw video stream. .SS "fits" .IX Subsection "fits" Flexible Image Transport System (\s-1FITS\s0) muxer. .PP This image format is used to store astronomical data. .PP For more information regarding the format, visit <\fBhttps://fits.gsfc.nasa.gov\fR>. .SS "flac" .IX Subsection "flac" Raw \s-1FLAC\s0 audio muxer. .PP This muxer accepts exactly one \s-1FLAC\s0 audio stream. Additionally, it is possible to add images with disposition \fBattached_pic\fR. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBwrite_header\fR \fIbool\fR" 4 .IX Item "write_header bool" write the file header if set to \f(CW\*(C`true\*(C'\fR, default is \f(CW\*(C`true\*(C'\fR .PP \fIExample\fR .IX Subsection "Example" .PP Use \fBffmpeg\fR to store the audio stream from an input file, together with several pictures used with \fBattached_pic\fR disposition: .PP .Vb 1 \& ffmpeg \-i INPUT \-i pic1.png \-i pic2.jpg \-map 0:a \-map 1 \-map 2 \-disposition:v attached_pic OUTPUT .Ve .SS "flv" .IX Subsection "flv" Adobe Flash Video Format muxer. .PP \fIOptions\fR .IX Subsection "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. .IP "\fBno_metadata\fR" 4 .IX Item "no_metadata" Disable metadata tag. .IP "\fBno_duration_filesize\fR" 4 .IX Item "no_duration_filesize" Disable duration and filesize in metadata when they are equal to zero at the end of stream. (Be used to non-seekable living stream). .IP "\fBadd_keyframe_index\fR" 4 .IX Item "add_keyframe_index" Used to facilitate seeking; particularly for \s-1HTTP\s0 pseudo streaming. .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 Note that 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. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBloop\fR \fIbool\fR" 4 .IX Item "loop bool" 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 \fIdelay\fR" 4 .IX Item "final_delay 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 \fIExample\fR .IX Subsection "Example" .PP 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 .SS "gxf" .IX Subsection "gxf" General eXchange Format (\s-1GXF\s0) muxer. .PP \&\s-1GXF\s0 was developed by Grass Valley Group, then standardized by \s-1SMPTE\s0 as \s-1SMPTE 360M\s0 and was extended in \s-1SMPTE RDD 14\-2007\s0 to include high-definition video resolutions. .PP It accepts at most one video stream with codec \fBmjpeg\fR, or \&\fBmpeg1video\fR, or \fBmpeg2video\fR, or \fBdvvideo\fR with resolution \&\fB512x480\fR or \fB608x576\fR, and several audio streams with rate 48000Hz and codec \fBpcm16_le\fR. .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 "hds" .IX Subsection "hds" \&\s-1HTTP\s0 Dynamic Streaming (\s-1HDS\s0) muxer. .PP \&\s-1HTTP\s0 dynamic streaming, or \s-1HDS,\s0 is an adaptive bitrate streaming method developed by Adobe. \s-1HDS\s0 delivers \s-1MP4\s0 video content over \s-1HTTP\s0 connections. \s-1HDS\s0 can be used for on-demand streaming or live streaming. .PP This muxer creates an .f4m (Adobe Flash Media Manifest File) manifest, an .abst (Adobe Bootstrap File) for each stream, and segment files in a directory specified as the output. .PP These needs to be accessed by an \s-1HDS\s0 player throuhg \s-1HTTPS\s0 for it to be able to perform playback on the generated stream. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBextra_window_size\fR \fIint\fR" 4 .IX Item "extra_window_size int" number of fragments kept outside of the manifest before removing from disk .IP "\fBmin_frag_duration\fR \fImicroseconds\fR" 4 .IX Item "min_frag_duration microseconds" minimum fragment duration (in microseconds), default value is 1 second (\f(CW10000000\fR) .IP "\fBremove_at_exit\fR \fIbool\fR" 4 .IX Item "remove_at_exit bool" remove all fragments when finished when set to \f(CW\*(C`true\*(C'\fR .IP "\fBwindow_size\fR \fIint\fR" 4 .IX Item "window_size int" number of fragments kept in the manifest, if set to a value different from \&\f(CW0\fR. By default all segments are kept in the output directory. .PP \fIExample\fR .IX Subsection "Example" .PP Use \fBffmpeg\fR to generate \s-1HDS\s0 files to the \fIoutput.hds\fR directory in real-time rate: .PP .Vb 1 \& ffmpeg \-re \-i INPUT \-f hds \-b:v 200k output.hds .Ve .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 Make sure to require a closed \s-1GOP\s0 when encoding and to set the \s-1GOP\s0 size to fit your segment time constraint. .PP For example, to convert an input file with \fBffmpeg\fR: .PP .Vb 1 \& ffmpeg \-i in.mkv \-c:v h264 \-flags +cgop \-g 30 \-hls_time 1 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 \fIduration\fR" 4 .IX Item "hls_init_time duration" Set the initial target segment length. Default value is \fI0\fR. .Sp \&\fIduration\fR must be a time duration specification, see \fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .Sp 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 \fIduration\fR" 4 .IX Item "hls_time duration" Set the target segment length. Default value is 2. .Sp \&\fIduration\fR must be a time duration specification, see \fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. 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_delete_threshold\fR \fIsize\fR" 4 .IX Item "hls_delete_threshold size" Set the number of unreferenced segments to keep on disk before \f(CW\*(C`hls_flags delete_segments\*(C'\fR deletes them. Increase this to allow continue clients to download segments which were recently referenced in the playlist. Default value is 1, meaning segments older than \&\f(CW\*(C`hls_list_size+1\*(C'\fR will be deleted. .IP "\fBhls_start_number_source\fR" 4 .IX Item "hls_start_number_source" Start the playlist sequence number (\f(CW\*(C`#EXT\-X\-MEDIA\-SEQUENCE\*(C'\fR) according to the specified source. Unless \f(CW\*(C`hls_flags single_file\*(C'\fR is set, it also specifies source of starting sequence numbers of segment and subtitle filenames. In any case, if \f(CW\*(C`hls_flags append_list\*(C'\fR is set and read playlist sequence number is greater than the specified start sequence number, then that value will be used as start value. .Sp It accepts the following values: .RS 4 .IP "\fBgeneric (default)\fR" 4 .IX Item "generic (default)" Set the starting sequence numbers according to \fIstart_number\fR option value. .IP "\fBepoch\fR" 4 .IX Item "epoch" The start number will be the seconds since epoch (1970\-01\-01 00:00:00) .IP "\fBepoch_us\fR" 4 .IX Item "epoch_us" The start number will be the microseconds since epoch (1970\-01\-01 00:00:00) .IP "\fBdatetime\fR" 4 .IX Item "datetime" The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759. .RE .RS 4 .RE .IP "\fBstart_number\fR \fInumber\fR" 4 .IX Item "start_number number" Start the playlist sequence number (\f(CW\*(C`#EXT\-X\-MEDIA\-SEQUENCE\*(C'\fR) from the specified \fInumber\fR when \fIhls_start_number_source\fR value is \fIgeneric\fR. (This is the default case.) Unless \f(CW\*(C`hls_flags single_file\*(C'\fR is set, it also specifies starting sequence numbers of segment and subtitle filenames. 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\s0 (1) or \s-1MUST NOT\s0 (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. .Sp \&\fIfilename\fR may contain full path or relative path specification, but only the file name part without any path info will be contained in the m3u8 segment list. Should a relative path be specified, the path of the created segment files will be relative to the current working directory. When strftime_mkdir is set, the whole expanded value of \fIfilename\fR will be written into the m3u8 segment list. .Sp When \f(CW\*(C`var_stream_map\*(C'\fR is set with two or more variant streams, the \&\fIfilename\fR pattern must contain the string \*(L"%v\*(R", this string specifies the position of variant stream index in the generated segment file names. .Sp .Vb 3 \& ffmpeg \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \-b:a:1 32k \e \& \-map 0:v \-map 0:a \-map 0:v \-map 0:a \-f hls \-var_stream_map "v:0,a:0 v:1,a:1" \e \& \-hls_segment_filename \*(Aqfile_%v_%03d.ts\*(Aq out_%v.m3u8 .Ve .Sp This example will produce the playlists segment file sets: \&\fIfile_0_000.ts\fR, \fIfile_0_001.ts\fR, \fIfile_0_002.ts\fR, etc. and \&\fIfile_1_000.ts\fR, \fIfile_1_001.ts\fR, \fIfile_1_002.ts\fR, etc. .Sp The string \*(L"%v\*(R" may be present in the filename or in the last directory name containing the file, but only in one of them. (Additionally, \f(CW%v\fR may appear multiple times in the last sub-directory or filename.) If the string \f(CW%v\fR is present in the directory name, then sub-directories are created after expanding the directory name pattern. This enables creation of segments corresponding to different variant streams in subdirectories. .Sp .Vb 3 \& ffmpeg \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \-b:a:1 32k \e \& \-map 0:v \-map 0:a \-map 0:v \-map 0:a \-f hls \-var_stream_map "v:0,a:0 v:1,a:1" \e \& \-hls_segment_filename \*(Aqvs%v/file_%03d.ts\*(Aq vs%v/out.m3u8 .Ve .Sp This example will produce the playlists segment file sets: \&\fIvs0/file_000.ts\fR, \fIvs0/file_001.ts\fR, \fIvs0/file_002.ts\fR, etc. and \&\fIvs1/file_000.ts\fR, \fIvs1/file_001.ts\fR, \fIvs1/file_002.ts\fR, etc. .IP "\fBstrftime\fR" 4 .IX Item "strftime" Use \fBstrftime()\fR on \fIfilename\fR to expand the segment filename with localtime. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index hls_flag and %%d will be the specifier. .Sp .Vb 1 \& ffmpeg \-i in.nut \-strftime 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. Note: On some systems/environments, the \f(CW%s\fR specifier is not available. See \f(CW\*(C`strftime()\*(C'\fR documentation. .Sp .Vb 1 \& ffmpeg \-i in.nut \-strftime 1 \-hls_flags second_level_segment_index \-hls_segment_filename \*(Aqfile\-%Y%m%d\-%%04d.ts\*(Aq out.m3u8 .Ve .Sp This example will produce the playlist, \fIout.m3u8\fR, and segment files: \&\fIfile\-20160215\-0001.ts\fR, \fIfile\-20160215\-0002.ts\fR, etc. .IP "\fBstrftime_mkdir\fR" 4 .IX Item "strftime_mkdir" Used together with \-strftime_mkdir, it will create all subdirectories which is expanded in \fIfilename\fR. .Sp .Vb 1 \& ffmpeg \-i in.nut \-strftime 1 \-strftime_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: \&\fI20160215/file\-20160215\-1455569023.ts\fR, \fI20160215/file\-20160215\-1455569024.ts\fR, etc. .Sp .Vb 1 \& ffmpeg \-i in.nut \-strftime 1 \-strftime_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 hierarchy 2016/02/15 (if any of them do not exist), and then produce the playlist, \fIout.m3u8\fR, and segment files: \&\fI2016/02/15/file\-20160215\-1455569023.ts\fR, \fI2016/02/15/file\-20160215\-1455569024.ts\fR, etc. .IP "\fBhls_segment_options\fR \fIoptions_list\fR" 4 .IX Item "hls_segment_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_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 if \f(CW\*(C`hls_flags periodic_rekey\*(C'\fR is enabled. .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 "\fB\-hls_enc\fR \fIenc\fR" 4 .IX Item "-hls_enc enc" Enable (1) or disable (0) the \s-1AES128\s0 encryption. When enabled every segment generated is encrypted and the encryption key is saved as \fIplaylist name\fR.key. .IP "\fB\-hls_enc_key\fR \fIkey\fR" 4 .IX Item "-hls_enc_key key" 16\-octet key to encrypt the segments, by default it is randomly generated. .IP "\fB\-hls_enc_key_url\fR \fIkeyurl\fR" 4 .IX Item "-hls_enc_key_url keyurl" If set, \fIkeyurl\fR is prepended instead of \fIbaseurl\fR to the key filename in the playlist. .IP "\fB\-hls_enc_iv\fR \fIiv\fR" 4 .IX Item "-hls_enc_iv iv" 16\-octet initialization vector for every segment instead of the autogenerated ones. .IP "\fBhls_segment_type\fR \fIflags\fR" 4 .IX Item "hls_segment_type flags" Possible values: .RS 4 .IP "\fBmpegts\fR" 4 .IX Item "mpegts" Output segment files in \s-1MPEG\-2\s0 Transport Stream format. This is compatible with all \s-1HLS\s0 versions. .IP "\fBfmp4\fR" 4 .IX Item "fmp4" Output segment files in fragmented \s-1MP4\s0 format, similar to MPEG-DASH. fmp4 files may be used in \s-1HLS\s0 version 7 and above. .RE .RS 4 .RE .IP "\fBhls_fmp4_init_filename\fR \fIfilename\fR" 4 .IX Item "hls_fmp4_init_filename filename" Set filename to the fragment files header file, default filename is \fIinit.mp4\fR. .Sp Use \f(CW\*(C`\-strftime 1\*(C'\fR on \fIfilename\fR to expand the segment filename with localtime. .Sp .Vb 1 \& ffmpeg \-i in.nut \-hls_segment_type fmp4 \-strftime 1 \-hls_fmp4_init_filename "%s_init.mp4" out.m3u8 .Ve .Sp This will produce init like this \&\fI1602678741_init.mp4\fR .IP "\fBhls_fmp4_init_resend\fR" 4 .IX Item "hls_fmp4_init_resend" Resend init file after m3u8 file refresh every time, default is \fI0\fR. .Sp When \f(CW\*(C`var_stream_map\*(C'\fR is set with two or more variant streams, the \&\fIfilename\fR pattern must contain the string \*(L"%v\*(R", this string specifies the position of variant stream index in the generated init file names. The string \*(L"%v\*(R" may be present in the filename or in the last directory name containing the file. If the string is present in the directory name, then sub-directories are created after expanding the directory name pattern. This enables creation of init files corresponding to different variant streams in subdirectories. .IP "\fBhls_flags\fR \fIflags\fR" 4 .IX Item "hls_flags flags" Possible values: .RS 4 .IP "\fBsingle_file\fR" 4 .IX Item "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 "\fBdelete_segments\fR" 4 .IX Item "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 "\fBappend_list\fR" 4 .IX Item "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 "\fBround_durations\fR" 4 .IX Item "round_durations" Round the duration info in the playlist file segment info to integer values, instead of using floating point. If there are no other features requiring higher \s-1HLS\s0 versions be used, then this will allow ffmpeg to output a \s-1HLS\s0 version 2 m3u8. .IP "\fBdiscont_start\fR" 4 .IX Item "discont_start" Add the \f(CW\*(C`#EXT\-X\-DISCONTINUITY\*(C'\fR tag to the playlist, before the first segment's information. .IP "\fBomit_endlist\fR" 4 .IX Item "omit_endlist" Do not append the \f(CW\*(C`EXT\-X\-ENDLIST\*(C'\fR tag at the end of the playlist. .IP "\fBperiodic_rekey\fR" 4 .IX Item "periodic_rekey" The file specified by \f(CW\*(C`hls_key_info_file\*(C'\fR will be checked periodically and detect updates to the encryption info. Be sure to replace this file atomically, including the file containing the \s-1AES\s0 encryption key. .IP "\fBindependent_segments\fR" 4 .IX Item "independent_segments" Add the \f(CW\*(C`#EXT\-X\-INDEPENDENT\-SEGMENTS\*(C'\fR to playlists that has video segments and when all the segments of that playlist are guaranteed to start with a Key frame. .IP "\fBiframes_only\fR" 4 .IX Item "iframes_only" Add the \f(CW\*(C`#EXT\-X\-I\-FRAMES\-ONLY\*(C'\fR to playlists that has video segments and can play only I\-frames in the \f(CW\*(C`#EXT\-X\-BYTERANGE\*(C'\fR mode. .IP "\fBsplit_by_time\fR" 4 .IX Item "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 "\fBprogram_date_time\fR" 4 .IX Item "program_date_time" Generate \f(CW\*(C`EXT\-X\-PROGRAM\-DATE\-TIME\*(C'\fR tags. .IP "\fBsecond_level_segment_index\fR" 4 .IX Item "second_level_segment_index" Makes it possible to use segment indexes as %%d in hls_segment_filename expression besides date/time values when strftime is on. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width. .IP "\fBsecond_level_segment_size\fR" 4 .IX Item "second_level_segment_size" Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename expression besides date/time values when strftime is on. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width. .IP "\fBsecond_level_segment_duration\fR" 4 .IX Item "second_level_segment_duration" Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename expression besides date/time values when strftime is on. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width. .Sp .Vb 4 \& ffmpeg \-i sample.mpeg \e \& \-f hls \-hls_time 3 \-hls_list_size 5 \e \& \-hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \e \& \-strftime 1 \-strftime_mkdir 1 \-hls_segment_filename "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8 .Ve .Sp This will produce segments like this: \&\fIsegment_20170102194334_0003_00122200_0000003000000.ts\fR, \fIsegment_20170102194334_0004_00120072_0000003000000.ts\fR etc. .IP "\fBtemp_file\fR" 4 .IX Item "temp_file" Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled. But playlists with \f(CW\*(C`file\*(C'\fR protocol and with type (\f(CW\*(C`hls_playlist_type\*(C'\fR) other than \f(CW\*(C`vod\*(C'\fR are always written into temporary file regardless of this flag. Master playlist files (\f(CW\*(C`master_pl_name\*(C'\fR), if any, with \f(CW\*(C`file\*(C'\fR protocol, are always written into temporary file regardless of this flag if \f(CW\*(C`master_pl_publish_rate\*(C'\fR value is other than zero. .RE .RS 4 .RE .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. .IP "\fBhttp_user_agent\fR" 4 .IX Item "http_user_agent" Override User-Agent field in \s-1HTTP\s0 header. Applicable only for \s-1HTTP\s0 output. .IP "\fBvar_stream_map\fR" 4 .IX Item "var_stream_map" Map string which specifies how to group the audio, video and subtitle streams into different variant streams. The variant stream groups are separated by space. Expected string format is like this \*(L"a:0,v:0 a:1,v:1 ....\*(R". Here a:, v:, s: are the keys to specify audio, video and subtitle streams respectively. Allowed values are 0 to 9 (limited just based on practical usage). .Sp When there are two or more variant streams, the output filename pattern must contain the string \*(L"%v\*(R", this string specifies the position of variant stream index in the output media playlist filenames. The string \*(L"%v\*(R" may be present in the filename or in the last directory name containing the file. If the string is present in the directory name, then sub-directories are created after expanding the directory name pattern. This enables creation of variant streams in subdirectories. .Sp .Vb 3 \& ffmpeg \-re \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \-b:a:1 32k \e \& \-map 0:v \-map 0:a \-map 0:v \-map 0:a \-f hls \-var_stream_map "v:0,a:0 v:1,a:1" \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example creates two hls variant streams. The first variant stream will contain video stream of bitrate 1000k and audio stream of bitrate 64k and the second variant stream will contain video stream of bitrate 256k and audio stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and out_1.m3u8 will be created. If you want something meaningful text instead of indexes in result names, you may specify names for each or some of the variants as in the following example. .Sp .Vb 3 \& ffmpeg \-re \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \-b:a:1 32k \e \& \-map 0:v \-map 0:a \-map 0:v \-map 0:a \-f hls \-var_stream_map "v:0,a:0,name:my_hd v:1,a:1,name:my_sd" \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example creates two hls variant streams as in the previous one. But here, the two media playlist with file names out_my_hd.m3u8 and out_my_sd.m3u8 will be created. .Sp .Vb 3 \& ffmpeg \-re \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \e \& \-map 0:v \-map 0:a \-map 0:v \-f hls \-var_stream_map "v:0 a:0 v:1" \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example creates three hls variant streams. The first variant stream will be a video only stream with video bitrate 1000k, the second variant stream will be an audio only stream with bitrate 64k and the third variant stream will be a video only stream with bitrate 256k. Here, three media playlist with file names out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created. .Sp .Vb 3 \& ffmpeg \-re \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \-b:a:1 32k \e \& \-map 0:v \-map 0:a \-map 0:v \-map 0:a \-f hls \-var_stream_map "v:0,a:0 v:1,a:1" \e \& http://example.com/live/vs_%v/out.m3u8 .Ve .Sp This example creates the variant streams in subdirectories. Here, the first media playlist is created at \fIhttp://example.com/live/vs_0/out.m3u8\fR and the second one at \fIhttp://example.com/live/vs_1/out.m3u8\fR. .Sp .Vb 5 \& ffmpeg \-re \-i in.ts \-b:a:0 32k \-b:a:1 64k \-b:v:0 1000k \-b:v:1 3000k \e \& \-map 0:a \-map 0:a \-map 0:v \-map 0:v \-f hls \e \& \-var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high" \e \& \-master_pl_name master.m3u8 \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example creates two audio only and two video only variant streams. In addition to the #EXT\-X\-STREAM\-INF tag for each variant stream in the master playlist, #EXT\-X\-MEDIA tag is also added for the two audio only variant streams and they are mapped to the two video only variant streams with audio group names \&'aud_low' and 'aud_high'. .Sp By default, a single hls variant containing all the encoded streams is created. .Sp .Vb 5 \& ffmpeg \-re \-i in.ts \-b:a:0 32k \-b:a:1 64k \-b:v:0 1000k \e \& \-map 0:a \-map 0:a \-map 0:v \-f hls \e \& \-var_stream_map "a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low" \e \& \-master_pl_name master.m3u8 \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example creates two audio only and one video only variant streams. In addition to the #EXT\-X\-STREAM\-INF tag for each variant stream in the master playlist, #EXT\-X\-MEDIA tag is also added for the two audio only variant streams and they are mapped to the one video only variant streams with audio group name \&'aud_low', and the audio group have default stat is \s-1NO\s0 or \s-1YES.\s0 .Sp By default, a single hls variant containing all the encoded streams is created. .Sp .Vb 5 \& ffmpeg \-re \-i in.ts \-b:a:0 32k \-b:a:1 64k \-b:v:0 1000k \e \& \-map 0:a \-map 0:a \-map 0:v \-f hls \e \& \-var_stream_map "a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low" \e \& \-master_pl_name master.m3u8 \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example creates two audio only and one video only variant streams. In addition to the #EXT\-X\-STREAM\-INF tag for each variant stream in the master playlist, #EXT\-X\-MEDIA tag is also added for the two audio only variant streams and they are mapped to the one video only variant streams with audio group name \&'aud_low', and the audio group have default stat is \s-1NO\s0 or \s-1YES,\s0 and one audio have and language is named \s-1ENG,\s0 the other audio language is named \s-1CHN.\s0 .Sp By default, a single hls variant containing all the encoded streams is created. .Sp .Vb 8 \& ffmpeg \-y \-i input_with_subtitle.mkv \e \& \-b:v:0 5250k \-c:v h264 \-pix_fmt yuv420p \-profile:v main \-level 4.1 \e \& \-b:a:0 256k \e \& \-c:s webvtt \-c:a mp2 \-ar 48000 \-ac 2 \-map 0:v \-map 0:a:0 \-map 0:s:0 \e \& \-f hls \-var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \e \& \-master_pl_name master.m3u8 \-t 300 \-hls_time 10 \-hls_init_time 4 \-hls_list_size \e \& 10 \-master_pl_publish_rate 10 \-hls_flags \e \& delete_segments+discont_start+split_by_time ./tmp/video.m3u8 .Ve .Sp This example adds \f(CW\*(C`#EXT\-X\-MEDIA\*(C'\fR tag with \f(CW\*(C`TYPE=SUBTITLES\*(C'\fR in the master playlist with webvtt subtitle group name 'subtitle'. Please make sure the input file has one text subtitle stream at least. .IP "\fBcc_stream_map\fR" 4 .IX Item "cc_stream_map" Map string which specifies different closed captions groups and their attributes. The closed captions stream groups are separated by space. Expected string format is like this \&\*(L"ccgroup:,instreamid:<\s-1INSTREAM\-ID\s0>,language: ....\*(R". \&'ccgroup' and 'instreamid' are mandatory attributes. 'language' is an optional attribute. The closed captions groups configured using this option are mapped to different variant streams by providing the same 'ccgroup' name in the \&\f(CW\*(C`var_stream_map\*(C'\fR string. If \f(CW\*(C`var_stream_map\*(C'\fR is not set, then the first available ccgroup in \f(CW\*(C`cc_stream_map\*(C'\fR is mapped to the output variant stream. The examples for these two use cases are given below. .Sp .Vb 4 \& ffmpeg \-re \-i in.ts \-b:v 1000k \-b:a 64k \-a53cc 1 \-f hls \e \& \-cc_stream_map "ccgroup:cc,instreamid:CC1,language:en" \e \& \-master_pl_name master.m3u8 \e \& http://example.com/live/out.m3u8 .Ve .Sp This example adds \f(CW\*(C`#EXT\-X\-MEDIA\*(C'\fR tag with \f(CW\*(C`TYPE=CLOSED\-CAPTIONS\*(C'\fR in the master playlist with group name 'cc', language 'en' (english) and INSTREAM-ID '\s-1CC1\s0'. Also, it adds \f(CW\*(C`CLOSED\-CAPTIONS\*(C'\fR attribute with group name 'cc' for the output variant stream. .Sp .Vb 7 \& ffmpeg \-re \-i in.ts \-b:v:0 1000k \-b:v:1 256k \-b:a:0 64k \-b:a:1 32k \e \& \-a53cc:0 1 \-a53cc:1 1\e \& \-map 0:v \-map 0:a \-map 0:v \-map 0:a \-f hls \e \& \-cc_stream_map "ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp" \e \& \-var_stream_map "v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc" \e \& \-master_pl_name master.m3u8 \e \& http://example.com/live/out_%v.m3u8 .Ve .Sp This example adds two \f(CW\*(C`#EXT\-X\-MEDIA\*(C'\fR tags with \f(CW\*(C`TYPE=CLOSED\-CAPTIONS\*(C'\fR in the master playlist for the INSTREAM-IDs '\s-1CC1\s0' and '\s-1CC2\s0'. Also, it adds \&\f(CW\*(C`CLOSED\-CAPTIONS\*(C'\fR attribute with group name 'cc' for the two output variant streams. .IP "\fBmaster_pl_name\fR" 4 .IX Item "master_pl_name" Create \s-1HLS\s0 master playlist with the given name. .Sp .Vb 1 \& ffmpeg \-re \-i in.ts \-f hls \-master_pl_name master.m3u8 http://example.com/live/out.m3u8 .Ve .Sp This example creates \s-1HLS\s0 master playlist with name master.m3u8 and it is published at http://example.com/live/ .IP "\fBmaster_pl_publish_rate\fR" 4 .IX Item "master_pl_publish_rate" Publish master play list repeatedly every after specified number of segment intervals. .Sp .Vb 2 \& ffmpeg \-re \-i in.ts \-f hls \-master_pl_name master.m3u8 \e \& \-hls_time 2 \-master_pl_publish_rate 30 http://example.com/live/out.m3u8 .Ve .Sp This example creates \s-1HLS\s0 master playlist with name master.m3u8 and keep publishing it repeatedly every after 30 segments i.e. every after 60s. .IP "\fBhttp_persistent\fR" 4 .IX Item "http_persistent" Use persistent \s-1HTTP\s0 connections. Applicable only for \s-1HTTP\s0 output. .IP "\fBtimeout\fR" 4 .IX Item "timeout" Set timeout for socket I/O operations. Applicable only for \s-1HTTP\s0 output. .IP "\fBignore_io_errors\fR" 4 .IX Item "ignore_io_errors" Ignore \s-1IO\s0 errors during open, write and delete. Useful for long-duration runs with network output. .IP "\fBheaders\fR" 4 .IX Item "headers" Set custom \s-1HTTP\s0 headers, can override built in default headers. Applicable only for \s-1HTTP\s0 output. .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 The image muxer supports the .Y.U.V image file format. This format is special in 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. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBframe_pts\fR" 4 .IX Item "frame_pts" If set to 1, expand the filename with pts from pkt\->pts. Default value is 0. .IP "\fBstart_number\fR" 4 .IX Item "start_number" Start the sequence from the specified number. Default value is 1. .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. .IP "\fBatomic_writing\fR" 4 .IX Item "atomic_writing" Write output to a temporary file, which is renamed to target filename once writing is completed. Default is disabled. .IP "\fBprotocol_opts\fR \fIoptions_list\fR" 4 .IX Item "protocol_opts options_list" Set protocol options as a :\-separated list of key=value parameters. Values containing the \f(CW\*(C`:\*(C'\fR special character must be escaped. .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 cfr \-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 cfr \-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 start of 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 You can set the file name with current frame's \s-1PTS:\s0 .PP .Vb 1 \& ffmpeg \-f v4l2 \-r 1 \-i /dev/video0 \-copyts \-f image2 \-frame_pts true %d.jpg .Ve .PP A more complex example is to publish contents of your desktop directly to a WebDAV server every second: .PP .Vb 1 \& ffmpeg \-f x11grab \-framerate 1 \-i :0.0 \-q:v 6 \-update 1 \-protocol_opts method=PUT http://example.com/desktop.jpg .Ve .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. This gets mapped to the FileDescription element for a stream written as attachment. .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 reserved space does not suffice, no Cues will be written, the file will be finalized and writing the trailer will return an error. 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. .IP "\fBcues_to_front\fR" 4 .IX Item "cues_to_front" If set, the muxer will write the index at the beginning of the file by shifting the main data if necessary. This can be combined with reserve_index_space in which case the data is only shifted if the initially reserved space turns out to be insufficient. .Sp This option is ignored if the output is unseekable. .IP "\fBdefault_mode\fR" 4 .IX Item "default_mode" This option controls how the FlagDefault of the output tracks will be set. It influences which tracks players should play by default. The default mode is \fBpassthrough\fR. .RS 4 .IP "\fBinfer\fR" 4 .IX Item "infer" Every track with disposition default will have the FlagDefault set. Additionally, for each type of track (audio, video or subtitle), if no track with disposition default of this type exists, then the first track of this type will be marked as default (if existing). This ensures that the default flag is set in a sensible way even if the input originated from containers that lack the concept of default tracks. .IP "\fBinfer_no_subs\fR" 4 .IX Item "infer_no_subs" This mode is the same as infer except that if no subtitle track with disposition default exists, no subtitle track will be marked as default. .IP "\fBpassthrough\fR" 4 .IX Item "passthrough" In this mode the FlagDefault is set if and only if the \s-1AV_DISPOSITION_DEFAULT\s0 flag is set in the disposition of the corresponding stream. .RE .RS 4 .RE .IP "\fBflipped_raw_rgb\fR" 4 .IX Item "flipped_raw_rgb" If set to true, store positive height for raw \s-1RGB\s0 bitmaps, which indicates bitmap is stored bottom-up. Note that this option does not flip the bitmap which has to be done manually beforehand, e.g. by using the vflip filter. Default is \fIfalse\fR and indicates bitmap is stored top down. .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 "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 \fBFFmpeg\fR and the default for \&\f(CW\*(C`service_name\*(C'\fR is \fBService01\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The muxer options are: .IP "\fBmpegts_transport_stream_id\fR \fIinteger\fR" 4 .IX Item "mpegts_transport_stream_id integer" Set the \fBtransport_stream_id\fR. This identifies a transponder in \s-1DVB.\s0 Default is \f(CW0x0001\fR. .IP "\fBmpegts_original_network_id\fR \fIinteger\fR" 4 .IX Item "mpegts_original_network_id integer" Set the \fBoriginal_network_id\fR. 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 \fBOriginal_Network_ID, Transport_Stream_ID\fR. Default is \f(CW0x0001\fR. .IP "\fBmpegts_service_id\fR \fIinteger\fR" 4 .IX Item "mpegts_service_id integer" Set the \fBservice_id\fR, also known as program in \s-1DVB.\s0 Default is \&\f(CW0x0001\fR. .IP "\fBmpegts_service_type\fR \fIinteger\fR" 4 .IX Item "mpegts_service_type integer" Set the program \fBservice_type\fR. Default is \f(CW\*(C`digital_tv\*(C'\fR. Accepts the following options: .RS 4 .IP "\fBhex_value\fR" 4 .IX Item "hex_value" Any hexadecimal value between \f(CW0x01\fR and \f(CW0xff\fR 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. .RE .RS 4 .RE .IP "\fBmpegts_pmt_start_pid\fR \fIinteger\fR" 4 .IX Item "mpegts_pmt_start_pid integer" Set the first \s-1PID\s0 for PMTs. Default is \f(CW0x1000\fR, minimum is \f(CW0x0020\fR, maximum is \f(CW0x1ffa\fR. This option has no effect in m2ts mode where the \s-1PMT PID\s0 is fixed \f(CW0x0100\fR. .IP "\fBmpegts_start_pid\fR \fIinteger\fR" 4 .IX Item "mpegts_start_pid integer" Set the first \s-1PID\s0 for elementary streams. Default is \f(CW0x0100\fR, minimum is \&\f(CW0x0020\fR, maximum is \f(CW0x1ffa\fR. This option has no effect in m2ts mode where the elementary stream PIDs are fixed. .IP "\fBmpegts_m2ts_mode\fR \fIboolean\fR" 4 .IX Item "mpegts_m2ts_mode boolean" Enable m2ts mode if set to \f(CW1\fR. Default value is \f(CW\*(C`\-1\*(C'\fR which disables m2ts mode. .IP "\fBmuxrate\fR \fIinteger\fR" 4 .IX Item "muxrate integer" Set a constant muxrate. Default is \s-1VBR.\s0 .IP "\fBpes_payload_size\fR \fIinteger\fR" 4 .IX Item "pes_payload_size integer" Set minimum \s-1PES\s0 packet payload in bytes. Default is \f(CW2930\fR. .IP "\fBmpegts_flags\fR \fIflags\fR" 4 .IX Item "mpegts_flags flags" Set mpegts flags. Accepts the following options: .RS 4 .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). .IP "\fBinitial_discontinuity\fR" 4 .IX Item "initial_discontinuity" Mark the initial packet of each stream as discontinuity. .IP "\fBnit\fR" 4 .IX Item "nit" Emit \s-1NIT\s0 table. .IP "\fBomit_rai\fR" 4 .IX Item "omit_rai" Disable writing of random access indicator. .RE .RS 4 .RE .IP "\fBmpegts_copyts\fR \fIboolean\fR" 4 .IX Item "mpegts_copyts boolean" Preserve original timestamps, if value is set to \f(CW1\fR. Default value is \f(CW\*(C`\-1\*(C'\fR, which results in shifting timestamps so that they start from 0. .IP "\fBomit_video_pes_length\fR \fIboolean\fR" 4 .IX Item "omit_video_pes_length boolean" Omit the \s-1PES\s0 packet length for video packets. Default is \f(CW1\fR (true). .IP "\fBpcr_period\fR \fIinteger\fR" 4 .IX Item "pcr_period integer" Override the default \s-1PCR\s0 retransmission time in milliseconds. Default is \&\f(CW\*(C`\-1\*(C'\fR which means that the \s-1PCR\s0 interval will be determined automatically: 20 ms is used for \s-1CBR\s0 streams, the highest multiple of the frame duration which is less than 100 ms is used for \s-1VBR\s0 streams. .IP "\fBpat_period\fR \fIduration\fR" 4 .IX Item "pat_period duration" Maximum time in seconds between \s-1PAT/PMT\s0 tables. Default is \f(CW0.1\fR. .IP "\fBsdt_period\fR \fIduration\fR" 4 .IX Item "sdt_period duration" Maximum time in seconds between \s-1SDT\s0 tables. Default is \f(CW0.5\fR. .IP "\fBnit_period\fR \fIduration\fR" 4 .IX Item "nit_period duration" Maximum time in seconds between \s-1NIT\s0 tables. Default is \f(CW0.5\fR. .IP "\fBtables_version\fR \fIinteger\fR" 4 .IX Item "tables_version integer" Set \s-1PAT, PMT, SDT\s0 and \s-1NIT\s0 version (default \f(CW0\fR, 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 \f(CW\*(C`AVFormatContext\*(C'\fR (in case of \s-1API\s0 usage) or restart \fBffmpeg\fR instance, cyclically changing \&\fBtables_version\fR 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 \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 \& out.ts .Ve .SS "mxf, mxf_d10, mxf_opatom" .IX Subsection "mxf, mxf_d10, mxf_opatom" \&\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 and mxf_opatom 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 "rcwt" .IX Subsection "rcwt" Raw Captions With Time (\s-1RCWT\s0) is a format native to ccextractor, a commonly used open source tool for processing 608/708 closed caption (\s-1CC\s0) sources. It can be used to archive the original, raw \s-1CC\s0 bitstream and to produce a source file for later \s-1CC\s0 processing or conversion. As a result, it also allows for interopability with ccextractor for processing \s-1CC\s0 data extracted via ffmpeg. The format is simple to parse and can be used to retain all lines and variants of \s-1CC.\s0 .PP This muxer implements the specification as of 2024\-01\-05, which has been stable and unchanged for 10 years as of this writing. .PP This muxer will have some nuances from the way that ccextractor muxes \s-1RCWT.\s0 No compatibility issues when processing the output with ccextractor have been observed as a result of this so far, but mileage may vary and outputs will not be a bit-exact match. .PP A free specification of \s-1RCWT\s0 can be found here: <\fBhttps://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT\fR> .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 "\fBmin_seg_duration\fR \fItime\fR" 4 .IX Item "min_seg_duration time" Set minimum segment duration to \fItime\fR, the value must be a duration specification. This prevents the muxer ending segments at a duration below this value. Only effective with \f(CW\*(C`segment_time\*(C'\fR. Default value is \*(L"0\*(R". .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 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 beginning 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 Make sure to require a closed \s-1GOP\s0 when encoding and to set the \s-1GOP\s0 size to fit your segment time constraint. .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 hevc \-flags +cgop \-g 60 \-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 "streamhash" .IX Subsection "streamhash" Per stream hash testing format. .PP This muxer computes and prints a cryptographic hash of all the input frames, on a per-stream basis. 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 one line per stream of the form: \&\fIstreamindex\fR,\fIstreamtype\fR,\fIalgo\fR=\fIhash\fR, where \&\fIstreamindex\fR is the index of the mapped stream, \fIstreamtype\fR is a single character indicating the type of stream, \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 streamhash out.sha256 .Ve .PP To print an \s-1MD5\s0 hash to stdout use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f streamhash \-hash md5 \- .Ve .PP See also the \fBhash\fR and \fBframehash\fR muxers. .SS "tee" .IX Subsection "tee" The tee muxer can be used to write the same data to several outputs, such as files or streams. It can be used, for example, to stream a video over a 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. With the tee muxer, the audio and video data will be encoded only once. With conventional multiple outputs, multiple encoding operations in parallel are initiated, which can be a very expensive process. The tee muxer 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 Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select output streams. So all streams intended for output must be specified using \f(CW\*(C`\-map\*(C'\fR. See the examples below. .PP Some encoders may need different options depending on the output format; the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified. The main example is the \fBglobal_header\fR flag. .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, those must be escaped (see \fBthe \*(L"Quoting and escaping\*(R" section in the \fBffmpeg\-utils\fB\|(1) manual\fR). .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBuse_fifo\fR \fIbool\fR" 4 .IX Item "use_fifo bool" If set to 1, slave outputs will be processed in separate threads using the \fBfifo\fR muxer. This allows to compensate for different speed/latency/reliability of outputs and setup transparent recovery. By default this feature is turned off. .IP "\fBfifo_options\fR" 4 .IX Item "fifo_options" Options to pass to fifo pseudo-muxer instances. See \fBfifo\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. Required if it cannot be guessed from the output \s-1URL.\s0 .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). .Sp If the stream specifier is not specified, the bitstream filters will be applied to all streams in the output. This will cause that output operation to fail if the output contains streams to which the bitstream filter cannot be applied e.g. \f(CW\*(C`h264_mp4toannexb\*(C'\fR being applied to an output containing an audio stream. .Sp Options for a bitstream filter must be specified in the form of \f(CW\*(C`opt=value\*(C'\fR. .Sp Several bitstream filters can be specified, separated by \*(L",\*(R". .IP "\fBuse_fifo\fR \fIbool\fR" 4 .IX Item "use_fifo bool" This allows to override tee muxer use_fifo option for individual slave muxer. .IP "\fBfifo_options\fR" 4 .IX Item "fifo_options" This allows to override tee muxer fifo_options for individual slave muxer. See \fBfifo\fR. .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 mapped streams. This will cause that output operation to fail if the output format does not accept all mapped streams. .Sp 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 .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 \& \-f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac" .Ve .IP "\(bu" 4 As above, 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 \& \-f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\e\*(Aqa:1\e\*(Aq]out.aac" .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 .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 .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 nanoseconds. .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 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 "\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 "amqp" .IX Subsection "amqp" Advanced Message Queueing Protocol (\s-1AMQP\s0) version 0\-9\-1 is a broker based publish-subscribe communication protocol. .PP FFmpeg must be compiled with \-\-enable\-librabbitmq to support \s-1AMQP. A\s0 separate \&\s-1AMQP\s0 broker must also be run. An example open-source \s-1AMQP\s0 broker is RabbitMQ. .PP After starting the broker, an FFmpeg client may stream data to the broker using the command: .PP .Vb 1 \& ffmpeg \-re \-i input \-f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost] .Ve .PP Where hostname and port (default is 5672) is the address of the broker. The client may also set a user/password for authentication. The default for both fields is \*(L"guest\*(R". Name of virtual host on broker can be set with vhost. The default value is \*(L"/\*(R". .PP Muliple subscribers may stream from the broker using the command: .PP .Vb 1 \& ffplay amqp://[[user]:[password]@]hostname[:port][/vhost] .Ve .PP In RabbitMQ all data published to the broker flows through a specific exchange, and each subscribing client has an assigned queue/buffer. When a packet arrives at an exchange, it may be copied to a client's queue depending on the exchange and routing_key fields. .PP The following options are supported: .IP "\fBexchange\fR" 4 .IX Item "exchange" Sets the exchange to use on the broker. RabbitMQ has several predefined exchanges: \*(L"amq.direct\*(R" is the default exchange, where the publisher and subscriber must have a matching routing_key; \*(L"amq.fanout\*(R" is the same as a broadcast operation (i.e. the data is forwarded to all queues on the fanout exchange independent of the routing_key); and \*(L"amq.topic\*(R" is similar to \&\*(L"amq.direct\*(R", but allows for more complex pattern matching (refer to the RabbitMQ documentation). .IP "\fBrouting_key\fR" 4 .IX Item "routing_key" Sets the routing key. The default value is \*(L"amqp\*(R". The routing key is used on the \*(L"amq.direct\*(R" and \*(L"amq.topic\*(R" exchanges to decide whether packets are written to the queue of a subscriber. .IP "\fBpkt_size\fR" 4 .IX Item "pkt_size" Maximum size of each packet sent/received to the broker. Default is 131072. Minimum is 4096 and max is any large value (representable by an int). When receiving packets, this sets an internal buffer size in FFmpeg. It should be equal to or greater than the size of the published packets to the broker. Otherwise the received message may be truncated causing decoding errors. .IP "\fBconnection_timeout\fR" 4 .IX Item "connection_timeout" The timeout in seconds during the initial connection to the broker. The default value is rw_timeout, or 5 seconds if rw_timeout is not set. .IP "\fBdelivery_mode\fR \fImode\fR" 4 .IX Item "delivery_mode mode" Sets the delivery mode of each message sent to broker. The following values are accepted: .RS 4 .IP "\fBpersistent\fR" 4 .IX Item "persistent" Delivery mode set to \*(L"persistent\*(R" (2). This is the default value. Messages may be written to the broker's disk depending on its setup. .IP "\fBnon-persistent\fR" 4 .IX Item "non-persistent" Delivery mode set to \*(L"non-persistent\*(R" (1). Messages will stay in broker's memory unless the broker is under memory pressure. .RE .RS 4 .RE .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 The accepted options are: .IP "\fBread_ahead_limit\fR" 4 .IX Item "read_ahead_limit" Amount in bytes that may be read ahead when seeking isn't supported. Range is \-1 to \s-1INT_MAX.\s0 \&\-1 for unlimited. Default is 65536. .PP \&\s-1URL\s0 Syntax is .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 "concatf" .IX Subsection "concatf" Physical concatenation protocol using a line break delimited list of resources. .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 \& concatf: .Ve .PP where \fI\s-1URL\s0\fR is the url containing a line break delimited list of resources to be concatenated, each one possibly specifying a distinct protocol. Special characters must be escaped with backslash or single quotes. See \fBthe \*(L"Quoting and escaping\*(R" section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .PP For example to read a sequence of files \fIsplit1.mpeg\fR, \&\fIsplit2.mpeg\fR, \fIsplit3.mpeg\fR listed in separate lines within a file \fIsplit.txt\fR with \fBffplay\fR use the command: .PP .Vb 1 \& ffplay concatf:split.txt .Ve .PP Where \fIsplit.txt\fR contains the lines: .PP .Vb 3 \& split1.mpeg \& split2.mpeg \& split3.mpeg .Ve .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 "fd" .IX Subsection "fd" File descriptor access protocol. .PP The accepted syntax is: .PP .Vb 1 \& fd: \-fd .Ve .PP If \fBfd\fR is not specified, by default the stdout file descriptor will be used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has seek support if it corresponding to a regular file. fd protocol doesn't support pass file descriptor via \s-1URL\s0 for security. .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. .IP "\fBfd\fR" 4 .IX Item "fd" Set file descriptor. .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. .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). .IP "\fBseekable\fR" 4 .IX Item "seekable" Controls if seekability is advertised on the file. 0 means non-seekable, \-1 means auto (seekable for normal files, non-seekable for named pipes). .Sp Many demuxers handle seekable and non-seekable resources differently, overriding this might speed up opening certain files at the cost of losing some features (e.g. accurate seeking). .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-user\fR" 4 .IX Item "ftp-user" Set a user to be used for authenticating to the \s-1FTP\s0 server. This is overridden by the user in the \s-1FTP URL.\s0 .IP "\fBftp-password\fR" 4 .IX Item "ftp-password" Set a password to be used for authenticating to the \s-1FTP\s0 server. This is overridden by the password in the \s-1FTP URL,\s0 or by \fBftp-anonymous-password\fR if no user is set. .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. .SS "gopher" .IX Subsection "gopher" Gopher protocol. .SS "gophers" .IX Subsection "gophers" Gophers protocol. .PP The Gopher protocol with \s-1TLS\s0 encapsulation. .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 "\fBreferer\fR" 4 .IX Item "referer" Set the Referer header. Include 'Referer: \s-1URL\s0' header in \s-1HTTP\s0 request. .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 "\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_on_network_error\fR" 4 .IX Item "reconnect_on_network_error" Reconnect automatically in case of \s-1TCP/TLS\s0 errors during connect. .IP "\fBreconnect_on_http_error\fR" 4 .IX Item "reconnect_on_http_error" A comma separated list of \s-1HTTP\s0 status codes to reconnect on. The list can include specific status codes (e.g. '503') or the strings '4xx' / '5xx'. .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 "\fBhttp_version\fR" 4 .IX Item "http_version" Exports the \s-1HTTP\s0 response version number. Usually \*(L"1.0\*(R" or \*(L"1.1\*(R". .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 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 .IP "\fBsend_expect_100\fR" 4 .IX Item "send_expect_100" Send an Expect: 100\-continue header for \s-1POST.\s0 If set to 1 it will send, if set to 0 it won't, if set to \-1 it will try to send if it is applicable. Default value is \-1. .IP "\fBauth_type\fR" 4 .IX Item "auth_type" Set \s-1HTTP\s0 authentication type. No option for Digest, since this method requires getting nonce parameters from the server first and can't be used straight away like Basic. .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" Choose the \s-1HTTP\s0 authentication type automatically. This is the default. .IP "\fBbasic\fR" 4 .IX Item "basic" Choose the \s-1HTTP\s0 basic authentication. .Sp Basic authentication sends a Base64\-encoded string that contains a user name and password for the client. Base64 is not a form of encryption and should be considered the same as sending the user name and password in clear text (Base64 is a reversible encoding). If a resource needs to be protected, strongly consider using an authentication scheme other than basic authentication. \s-1HTTPS/TLS\s0 should be used with basic authentication. Without these additional security enhancements, basic authentication should not be used to protect sensitive or valuable information. .RE .RS 4 .RE .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. .IP "\fBtls\fR" 4 .IX Item "tls" Establish a \s-1TLS\s0 (\s-1HTTPS\s0) connection to Icecast. .PP .Vb 1 \& icecast://[[:]@]:/ .Ve .SS "ipfs" .IX Subsection "ipfs" InterPlanetary File System (\s-1IPFS\s0) protocol support. One can access files stored on the \s-1IPFS\s0 network through so-called gateways. These are http(s) endpoints. This protocol wraps the \s-1IPFS\s0 native protocols (ipfs:// and ipns://) to be sent to such a gateway. Users can (and should) host their own node which means this protocol will use one's local gateway to access files on the \s-1IPFS\s0 network. .PP This protocol accepts the following options: .IP "\fBgateway\fR" 4 .IX Item "gateway" Defines the gateway to use. When not set, the protocol will first try locating the local gateway by looking at \f(CW$IPFS_GATEWAY\fR, \f(CW$IPFS_PATH\fR and \f(CW\*(C`$HOME/.ipfs/\*(C'\fR, in that order. .PP One can use this protocol in 2 ways. Using \s-1IPFS:\s0 .PP .Vb 1 \& ffplay ipfs:// .Ve .PP Or the \s-1IPNS\s0 protocol (\s-1IPNS\s0 is mutable \s-1IPFS\s0): .PP .Vb 1 \& ffplay ipns:// .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 If \fBfd\fR isn't specified, \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. .IP "\fBfd\fR" 4 .IX Item "fd" Set file descriptor. .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 "prompeg" .IX Subsection "prompeg" Pro-MPEG Code of Practice #3 Release 2 \s-1FEC\s0 protocol. .PP The Pro-MPEG CoP#3 \s-1FEC\s0 is a 2D parity-check forward error correction mechanism for \s-1MPEG\-2\s0 Transport Streams sent over \s-1RTP.\s0 .PP This protocol must be used in conjunction with the \f(CW\*(C`rtp_mpegts\*(C'\fR muxer and the \f(CW\*(C`rtp\*(C'\fR protocol. .PP The required syntax is: .PP .Vb 1 \& \-f rtp_mpegts \-fec prompeg=