.\" 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 video 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 very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter. .PP \&\fBffmpeg\fR reads from an arbitrary number of input \*(L"files\*(R" (which can be regular files, pipes, network streams, grabbing devices, etc.), specified by the \&\f(CW\*(C`\-i\*(C'\fR option, and writes to an arbitrary number of output \*(L"files\*(R", which are specified by a plain output 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. .IP "\(bu" 4 To set the video bitrate of the output file to 64 kbit/s: .Sp .Vb 1 \& ffmpeg \-i input.avi \-b:v 64k \-bufsize 64k output.avi .Ve .IP "\(bu" 4 To force the frame rate of the output file to 24 fps: .Sp .Vb 1 \& ffmpeg \-i input.avi \-r 24 output.avi .Ve .IP "\(bu" 4 To force the frame rate of the input file (valid for raw formats only) to 1 fps and the frame rate of the output file to 24 fps: .Sp .Vb 1 \& ffmpeg \-r 1 \-i input.m2v \-r 24 output.avi .Ve .PP The format option may be needed for raw input files. .SH "DETAILED DESCRIPTION" .IX Header "DETAILED DESCRIPTION" The transcoding process in \fBffmpeg\fR for each output can be described by the following diagram: .PP .Vb 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. .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. .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 program \s-1ID\s0 is also specified. In this case it is based on the ordering of the streams in the 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 "\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 name \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 name \fIbitstream_filter_name\fR. Use the \fB\-bsfs\fR option to get a list of all bitstream filters. .RE .RS 4 .RE .IP "\fB\-version\fR" 4 .IX Item "-version" Show version. .IP "\fB\-formats\fR" 4 .IX Item "-formats" Show available formats (including devices). .IP "\fB\-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\-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 .PD .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\-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\-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 This option overrides the disposition copied from the input stream. It is also possible to delete the disposition by setting it to 0. .Sp The following dispositions are recognized: .RS 4 .IP "\fBdefault\fR" 4 .IX Item "default" .PD 0 .IP "\fBdub\fR" 4 .IX Item "dub" .IP "\fBoriginal\fR" 4 .IX Item "original" .IP "\fBcomment\fR" 4 .IX Item "comment" .IP "\fBlyrics\fR" 4 .IX Item "lyrics" .IP "\fBkaraoke\fR" 4 .IX Item "karaoke" .IP "\fBforced\fR" 4 .IX Item "forced" .IP "\fBhearing_impaired\fR" 4 .IX Item "hearing_impaired" .IP "\fBvisual_impaired\fR" 4 .IX Item "visual_impaired" .IP "\fBclean_effects\fR" 4 .IX Item "clean_effects" .IP "\fBattached_pic\fR" 4 .IX Item "attached_pic" .IP "\fBcaptions\fR" 4 .IX Item "captions" .IP "\fBdescriptions\fR" 4 .IX Item "descriptions" .IP "\fBdependent\fR" 4 .IX Item "dependent" .IP "\fBmetadata\fR" 4 .IX Item "metadata" .RE .RS 4 .PD .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 .RE .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\-target\fR \fItype\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-target type (output)" Specify target file type (\f(CW\*(C`vcd\*(C'\fR, \f(CW\*(C`svcd\*(C'\fR, \f(CW\*(C`dvd\*(C'\fR, \f(CW\*(C`dv\*(C'\fR, \&\f(CW\*(C`dv50\*(C'\fR). \fItype\fR may be prefixed with \f(CW\*(C`pal\-\*(C'\fR, \f(CW\*(C`ntsc\-\*(C'\fR or \&\f(CW\*(C`film\-\*(C'\fR to use the corresponding standard. All the format options (bitrate, codecs, buffer sizes) are then set automatically. You can just type: .Sp .Vb 1 \& ffmpeg \-i myfile.avi \-target vcd /tmp/vcd.mpg .Ve .Sp Nevertheless you can specify additional options as long as you know they do not conflict with the standard, as in: .Sp .Vb 1 \& ffmpeg \-i myfile.avi \-target vcd \-bf 2 /tmp/vcd.mpg .Ve .IP "\fB\-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\-filter_script[:\fR\fIstream_specifier\fR\fB]\fR \fIfilename\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-filter_script[:stream_specifier] filename (output,per-stream)" This option is similar to \fB\-filter\fR, the only difference is that its argument is the name of the file from which a filtergraph description is to be read. .IP "\fB\-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\-progress\fR \fIurl\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-progress url (global)" Send program-friendly progress information to \fIurl\fR. .Sp Progress information is written approximately every second and at the end of the encoding process. It is made of "\fIkey\fR=\fIvalue\fR" lines. \fIkey\fR consists of only alphanumeric characters. The last key of a sequence of progress information is always \*(L"progress\*(R". .IP "\fB\-stdin\fR" 4 .IX Item "-stdin" Enable interaction on standard input. On by default unless standard input is used as an input. To explicitly disable interaction you need to specify \&\f(CW\*(C`\-nostdin\*(C'\fR. .Sp Disabling interaction on standard input is useful, for example, if ffmpeg is in the background process group. Roughly the same result can be achieved with \f(CW\*(C`ffmpeg ... < /dev/null\*(C'\fR but it requires a shell. .IP "\fB\-debug_ts (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-debug_ts (global)" Print timestamp information. It is off by default. This option is mostly useful for testing and debugging purposes, and the output format may change from one version to another, so it should not be employed by portable scripts. .Sp See also the option \f(CW\*(C`\-fdebug ts\*(C'\fR. .IP "\fB\-attach\fR \fIfilename\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-attach filename (output)" Add an attachment to the output file. This is supported by a few formats like Matroska for e.g. fonts used in rendering subtitles. Attachments are implemented as a specific type of stream, so this option will add a new stream to the file. It is then possible to use per-stream options on this stream in the usual way. Attachment streams created with this option will be created after all the other streams (i.e. those created with \f(CW\*(C`\-map\*(C'\fR or automatic mappings). .Sp Note that for Matroska you also have to set the mimetype metadata tag: .Sp .Vb 1 \& ffmpeg \-i INPUT \-attach DejaVuSans.ttf \-metadata:s:2 mimetype=application/x\-truetype\-font out.mkv .Ve .Sp (assuming that the attachment stream will be third in the output file). .IP "\fB\-dump_attachment[:\fR\fIstream_specifier\fR\fB]\fR \fIfilename\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-dump_attachment[:stream_specifier] filename (input,per-stream)" Extract the matching attachment stream into a file named \fIfilename\fR. If \&\fIfilename\fR is empty, then the value of the \f(CW\*(C`filename\*(C'\fR metadata tag will be used. .Sp E.g. to extract the first attachment to a file named 'out.ttf': .Sp .Vb 1 \& ffmpeg \-dump_attachment:t:0 out.ttf \-i INPUT .Ve .Sp To extract all attachments to files determined by the \f(CW\*(C`filename\*(C'\fR tag: .Sp .Vb 1 \& ffmpeg \-dump_attachment:t "" \-i INPUT .Ve .Sp Technical note \*(-- attachments are implemented as codec extradata, so this option can actually be used to extract extradata from any stream, not just attachments. .IP "\fB\-noautorotate\fR" 4 .IX Item "-noautorotate" Disable automatically rotating video based on file metadata. .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, duplicate or drop input frames to achieve constant output frame rate \fIfps\fR. .IP "\fB\-s[:\fR\fIstream_specifier\fR\fB]\fR \fIsize\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-s[:stream_specifier] size (input/output,per-stream)" Set frame size. .Sp As an input option, this is a shortcut for the \fBvideo_size\fR private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable \*(-- e.g. raw video or video grabbers. .Sp As an output option, this inserts the \f(CW\*(C`scale\*(C'\fR video filter to the \&\fIend\fR of the corresponding filtergraph. Please use the \f(CW\*(C`scale\*(C'\fR filter directly to insert it at the beginning or some other place. .Sp The format is \fBwxh\fR (default \- same as source). .IP "\fB\-aspect[:\fR\fIstream_specifier\fR\fB]\fR \fIaspect\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-aspect[:stream_specifier] aspect (output,per-stream)" Set the video display aspect ratio specified by \fIaspect\fR. .Sp \&\fIaspect\fR can be a floating point number string, or a string of the form \fInum\fR:\fIden\fR, where \fInum\fR and \fIden\fR are the numerator and denominator of the aspect ratio. For example \*(L"4:3\*(R", \&\*(L"16:9\*(R", \*(L"1.3333\*(R", and \*(L"1.7777\*(R" are valid argument values. .Sp If used together with \fB\-vcodec copy\fR, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists. .IP "\fB\-vn (\fR\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. .SS "Advanced Video options" .IX Subsection "Advanced Video options" .IP "\fB\-pix_fmt[:\fR\fIstream_specifier\fR\fB]\fR \fIformat\fR \fB(\fR\fIinput/output,per\-stream\fR\fB)\fR" 4 .IX Item "-pix_fmt[:stream_specifier] format (input/output,per-stream)" Set pixel format. Use \f(CW\*(C`\-pix_fmts\*(C'\fR to show all the supported pixel formats. If the selected pixel format can not be selected, ffmpeg will print a warning and select the best pixel format supported by the encoder. If \fIpix_fmt\fR is prefixed by a \f(CW\*(C`+\*(C'\fR, ffmpeg will exit with an error if the requested pixel format can not be selected, and automatic conversions inside filtergraphs are disabled. If \fIpix_fmt\fR is a single \f(CW\*(C`+\*(C'\fR, ffmpeg selects the same pixel format as the input (or graph output) and automatic conversions are disabled. .IP "\fB\-sws_flags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 .IX Item "-sws_flags flags (input/output)" Set SwScaler flags. .IP "\fB\-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\-ilme\fR" 4 .IX Item "-ilme" Force interlacing support in encoder (\s-1MPEG\-2\s0 and \s-1MPEG\-4\s0 only). Use this option if your input file is interlaced and you want to keep the interlaced format for minimum losses. The alternative is to deinterlace the input stream with \&\fB\-deinterlace\fR, but deinterlacing introduces losses. .IP "\fB\-psnr\fR" 4 .IX Item "-psnr" Calculate \s-1PSNR\s0 of compressed frames. .IP "\fB\-vstats\fR" 4 .IX Item "-vstats" Dump video coding statistics to \fIvstats_HHMMSS.log\fR. .IP "\fB\-vstats_file\fR \fIfile\fR" 4 .IX Item "-vstats_file file" Dump video coding statistics to \fIfile\fR. .IP "\fB\-vstats_version\fR \fIfile\fR" 4 .IX Item "-vstats_version file" Specifies which version of the vstats format to use. Default is 2. .Sp version = 1 : .Sp \&\f(CW\*(C`frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s\*(C'\fR .Sp version > 1: .Sp \&\f(CW\*(C`out= %2d st= %2d frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s\*(C'\fR .IP "\fB\-top[:\fR\fIstream_specifier\fR\fB]\fR \fIn\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-top[:stream_specifier] n (output,per-stream)" top=1/bottom=0/auto=\-1 field first .IP "\fB\-dc\fR \fIprecision\fR" 4 .IX Item "-dc precision" Intra_dc_precision. .IP "\fB\-vtag\fR \fIfourcc/tag\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-vtag fourcc/tag (output)" Force video tag/fourcc. This is an alias for \f(CW\*(C`\-tag:v\*(C'\fR. .IP "\fB\-qphist (\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-qphist (global)" Show \s-1QP\s0 histogram .IP "\fB\-vbsf\fR \fIbitstream_filter\fR" 4 .IX Item "-vbsf bitstream_filter" Deprecated see \-bsf .IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB]\fR \fItime\fR\fB[,\fR\fItime\fR\fB...] (\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-force_key_frames[:stream_specifier] time[,time...] (output,per-stream)" .PD 0 .IP "\fB\-force_key_frames[:\fR\fIstream_specifier\fR\fB] expr:\fR\fIexpr\fR \fB(\fR\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-force_key_frames[:stream_specifier] expr:expr (output,per-stream)" .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. .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. .IP "\fBdxva2\fR" 4 .IX Item "dxva2" \&\fIdevice\fR is the number of the Direct3D 9 display adapter. .IP "\fBvaapi\fR" 4 .IX Item "vaapi" \&\fIdevice\fR is either an X11 display name or a \s-1DRM\s0 render node. 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). .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 \fBvaapi\fR) and then deriving a \&\s-1QSV\s0 device from that.) .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 "\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 methods supported in this build of ffmpeg. .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\-absf\fR \fIbitstream_filter\fR" 4 .IX Item "-absf bitstream_filter" Deprecated, see \-bsf .IP "\fB\-guess_layout_max\fR \fIchannels\fR \fB(\fR\fIinput,per\-stream\fR\fB)\fR" 4 .IX Item "-guess_layout_max channels (input,per-stream)" If some input channel layout is not known, try to guess only if it corresponds to at most the specified number of channels. For example, 2 tells to \fBffmpeg\fR to recognize 1 channel as mono and 2 channels as stereo but not 6 channels as 5.1. The default is to always try to guess. Use 0 to disable all guessing. .SS "Subtitle options" .IX Subsection "Subtitle options" .IP "\fB\-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. .IP "\fB\-sbsf\fR \fIbitstream_filter\fR" 4 .IX Item "-sbsf bitstream_filter" Deprecated, see \-bsf .SS "Advanced Subtitle options" .IX Subsection "Advanced Subtitle options" .IP "\fB\-fix_sub_duration\fR" 4 .IX Item "-fix_sub_duration" Fix subtitles durations. For each subtitle, wait for the next packet in the same stream and adjust the duration of the first to avoid overlap. This is necessary with some subtitles codecs, especially \s-1DVB\s0 subtitles, because the duration in the original packet is only a rough estimate and the end is actually marked by an empty subtitle frame. Failing to use this option when necessary can result in exaggerated durations or muxing failures due to non-monotonic timestamps. .Sp Note that this option will delay the output of all data until the next subtitle packet is decoded: it may increase memory consumption and latency a lot. .IP "\fB\-canvas_size\fR \fIsize\fR" 4 .IX Item "-canvas_size size" Set the size of the canvas used to render subtitles. .SS "Advanced options" .IX Subsection "Advanced options" .IP "\fB\-map [\-]\fR\fIinput_file_id\fR\fB[:\fR\fIstream_specifier\fR\fB][?][,\fR\fIsync_file_id\fR\fB[:\fR\fIstream_specifier\fR\fB]] |\fR \fI[linklabel]\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 .IX Item "-map [-]input_file_id[:stream_specifier][?][,sync_file_id[:stream_specifier]] | [linklabel] (output)" Designate one or more input streams as a source for the output file. Each input stream is identified by the input file index \fIinput_file_id\fR and the input stream index \fIinput_stream_id\fR within the input file. Both indices start at 0. If specified, \&\fIsync_file_id\fR:\fIstream_specifier\fR sets which input stream is used as a presentation sync reference. .Sp The first \f(CW\*(C`\-map\*(C'\fR option on the command line specifies the source for output stream 0, the second \f(CW\*(C`\-map\*(C'\fR option specifies the source for output stream 1, etc. .Sp A \f(CW\*(C`\-\*(C'\fR character before the stream identifier creates a \*(L"negative\*(R" mapping. It disables matching streams from already created mappings. .Sp 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 For example, to map \s-1ALL\s0 streams from the first input file to output .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0 output .Ve .Sp For example, if you have two audio streams in the first input file, these streams are identified by \*(L"0:0\*(R" and \*(L"0:1\*(R". You can use \&\f(CW\*(C`\-map\*(C'\fR to select which streams to place in an output file. For example: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:1 out.wav .Ve .Sp will map the input stream in \fI\s-1INPUT\s0\fR identified by \*(L"0:1\*(R" to the (single) output stream in \fIout.wav\fR. .Sp For example, to select the stream with index 2 from input file \&\fIa.mov\fR (specified by the identifier \*(L"0:2\*(R"), and stream with index 6 from input \fIb.mov\fR (specified by the identifier \*(L"1:6\*(R"), and copy them to the output file \fIout.mov\fR: .Sp .Vb 1 \& ffmpeg \-i a.mov \-i b.mov \-c copy \-map 0:2 \-map 1:6 out.mov .Ve .Sp To select all video and the third audio stream from an input file: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:v \-map 0:a:2 OUTPUT .Ve .Sp To map all the streams except the second audio, use negative mappings .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0 \-map \-0:a:1 OUTPUT .Ve .Sp 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 .Sp To pick the English audio stream: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map 0:m:language:eng OUTPUT .Ve .Sp Note that using this option disables the default mappings for this output file. .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_channel [\fR\fIinput_file_id\fR\fB.\fR\fIstream_specifier\fR\fB.\fR\fIchannel_id\fR\fB|\-1][?][:\fR\fIoutput_file_id\fR\fB.\fR\fIstream_specifier\fR\fB]\fR" 4 .IX Item "-map_channel [input_file_id.stream_specifier.channel_id|-1][?][:output_file_id.stream_specifier]" Map an audio channel from a given input to an output. If \&\fIoutput_file_id\fR.\fIstream_specifier\fR is not set, the audio channel will be mapped on all the audio streams. .Sp Using \*(L"\-1\*(R" instead of \&\fIinput_file_id\fR.\fIstream_specifier\fR.\fIchannel_id\fR will map a muted channel. .Sp A trailing \f(CW\*(C`?\*(C'\fR will allow the map_channel to be optional: if the map_channel matches no channel the map_channel will be ignored instead of failing. .Sp For example, assuming \fI\s-1INPUT\s0\fR is a stereo audio file, you can switch the two audio channels with the following command: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map_channel 0.0.1 \-map_channel 0.0.0 OUTPUT .Ve .Sp If you want to mute the first channel and keep the second: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map_channel \-1 \-map_channel 0.0.1 OUTPUT .Ve .Sp The order of the \*(L"\-map_channel\*(R" option specifies the order of the channels in the output stream. The output channel layout is guessed from the number of channels mapped (mono if one \*(L"\-map_channel\*(R", stereo if two, etc.). Using \*(L"\-ac\*(R" in combination of \*(L"\-map_channel\*(R" makes the channel gain levels to be updated if input and output channel layouts don't match (for instance two \*(L"\-map_channel\*(R" options and \*(L"\-ac 6\*(R"). .Sp You can also extract each channel of an input to specific outputs; the following command extracts two channels of the \fI\s-1INPUT\s0\fR audio stream (file 0, stream 0) to the respective \fI\s-1OUTPUT_CH0\s0\fR and \fI\s-1OUTPUT_CH1\s0\fR outputs: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map_channel 0.0.0 OUTPUT_CH0 \-map_channel 0.0.1 OUTPUT_CH1 .Ve .Sp The following example splits the channels of a stereo input into two separate streams, which are put into the same output file: .Sp .Vb 1 \& ffmpeg \-i stereo.wav \-map 0:0 \-map 0:0 \-map_channel 0.0.0:0.0 \-map_channel 0.0.1:0.1 \-y out.ogg .Ve .Sp Note that currently each output stream can only contain channels from a single input stream; you can't for example use \*(L"\-map_channel\*(R" to pick multiple input audio channels contained in different streams (from the same or different files) and merge them into a single output stream. It is therefore not currently possible, for example, to turn two separate mono streams into a single stereo stream. However splitting a stereo stream into two single channel mono streams is possible. .Sp If you need this feature, a possible workaround is to use the \fIamerge\fR filter. For example, if you need to merge a media (here \fIinput.mkv\fR) with 2 mono audio streams into one single stereo channel audio stream (and keep the video stream), you can use the following command: .Sp .Vb 1 \& ffmpeg \-i input.mkv \-filter_complex "[0:1] [0:2] amerge" \-c:a pcm_s16le \-c:v copy output.mkv .Ve .Sp To map the first two audio channels from the first input, and using the trailing \f(CW\*(C`?\*(C'\fR, ignore the audio channel mapping if the first input is mono instead of stereo: .Sp .Vb 1 \& ffmpeg \-i INPUT \-map_channel 0.0.0 \-map_channel 0.0.1? OUTPUT .Ve .IP "\fB\-map_metadata[:\fR\fImetadata_spec_out\fR\fB]\fR \fIinfile\fR\fB[:\fR\fImetadata_spec_in\fR\fB] (\fR\fIoutput,per\-metadata\fR\fB)\fR" 4 .IX Item "-map_metadata[:metadata_spec_out] infile[:metadata_spec_in] (output,per-metadata)" Set metadata information of the next output file from \fIinfile\fR. Note that those are file indices (zero-based), not filenames. Optional \fImetadata_spec_in/out\fR parameters specify, which metadata to copy. A metadata specifier can have the following forms: .RS 4 .IP "\fIg\fR" 4 .IX Item "g" global metadata, i.e. metadata that applies to the whole file .IP "\fIs\fR\fB[:\fR\fIstream_spec\fR\fB]\fR" 4 .IX Item "s[:stream_spec]" per-stream metadata. \fIstream_spec\fR is a stream specifier as described in the \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\-re (\fR\fIinput\fR\fB)\fR" 4 .IX Item "-re (input)" Read input at native frame rate. Mainly used to simulate a grab device, or live input stream (e.g. when reading from a file). Should not be used with actual grab devices or live input streams (where it can cause packet loss). By default \fBffmpeg\fR attempts to read the input(s) as fast as possible. This option will slow down the reading of the input(s) to the native frame rate of the input(s). It is useful for real-time output (e.g. live streaming). .IP "\fB\-vsync\fR \fIparameter\fR" 4 .IX Item "-vsync parameter" Video sync method. For compatibility reasons old values can be specified as numbers. Newly added values will have to be specified as strings always. .RS 4 .IP "\fB0, passthrough\fR" 4 .IX Item "0, passthrough" Each frame is passed with its timestamp from the demuxer to the muxer. .IP "\fB1, cfr\fR" 4 .IX Item "1, cfr" Frames will be duplicated and dropped to achieve exactly the requested constant frame rate. .IP "\fB2, vfr\fR" 4 .IX Item "2, vfr" Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp. .IP "\fBdrop\fR" 4 .IX Item "drop" As passthrough but destroys all timestamps, making the muxer generate fresh timestamps based on frame-rate. .IP "\fB\-1, auto\fR" 4 .IX Item "-1, auto" Chooses between 1 and 2 depending on muxer capabilities. This is the default method. .RE .RS 4 .Sp Note that the timestamps may be further modified by the muxer, after this. For example, in the case that the format option \fBavoid_negative_ts\fR is enabled. .Sp With \-map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one. .RE .IP "\fB\-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\-async\fR \fIsamples_per_second\fR" 4 .IX Item "-async samples_per_second" Audio sync method. \*(L"Stretches/squeezes\*(R" the audio stream to match the timestamps, the parameter is the maximum samples per second by which the audio is changed. \&\-async 1 is a special case where only the start of the audio stream is corrected without any later correction. .Sp Note that the timestamps may be further modified by the muxer, after this. For example, in the case that the format option \fBavoid_negative_ts\fR is enabled. .Sp This option has been deprecated. Use the \f(CW\*(C`aresample\*(C'\fR audio filter instead. .IP "\fB\-copyts\fR" 4 .IX Item "-copyts" Do not process input timestamps, but keep their values without trying to sanitize them. In particular, do not remove the initial start time offset value. .Sp Note that, depending on the \fBvsync\fR option or on specific muxer processing (e.g. in case the format option \fBavoid_negative_ts\fR is enabled) the output timestamps may mismatch with the input timestamps even when this option is selected. .IP "\fB\-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 is a floating point number, and 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 "\fB\-1\fR" 4 .IX Item "-1" Use the input stream timebase when possible. .Sp If an input stream is not available, the default timebase will be used. .IP "\fB>0\fR" 4 .IX Item ">0" 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 floating point 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 input stream ends. .IP "\fB\-dts_delta_threshold\fR" 4 .IX Item "-dts_delta_threshold" Timestamp discontinuity delta threshold. .IP "\fB\-dts_error_threshold\fR \fIseconds\fR" 4 .IX Item "-dts_error_threshold seconds" Timestamp error delta threshold. This threshold use to discard crazy/damaged timestamps and the default is 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\fIoutput,per\-stream\fR\fB)\fR" 4 .IX Item "-bsf[:stream_specifier] bitstream_filters (output,per-stream)" Set bitstream filters for matching streams. \fIbitstream_filters\fR is a comma-separated list of bitstream filters. Use the \f(CW\*(C`\-bsfs\*(C'\fR option to get the list of bitstream filters. .Sp .Vb 1 \& ffmpeg \-i h264.mp4 \-c:v copy \-bsf:v h264_mp4toannexb \-an out.h264 \& \& \& ffmpeg \-i file.mov \-an \-vn \-bsf:s mov2textsub \-c:s copy \-f rawvideo sub.txt .Ve .IP "\fB\-tag[:\fR\fIstream_specifier\fR\fB]\fR \fIcodec_tag\fR \fB(\fR\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 input streams using the \&\f(CW\*(C`[file_index:stream_specifier]\*(C'\fR syntax (i.e. the same as \fB\-map\fR uses). If \fIstream_specifier\fR matches multiple streams, the first one will be used. An unlabeled input will be connected to the first unused input stream of the matching type. .Sp Output link labels are referred to with \fB\-map\fR. Unlabeled outputs are added to the first output file. .Sp Note that with this option it is possible to use only lavfi sources without normal input files. .Sp For example, to overlay an image over video .Sp .Vb 2 \& ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aq[0:v][1:v]overlay[out]\*(Aq \-map \& \*(Aq[out]\*(Aq out.mkv .Ve .Sp Here \f(CW\*(C`[0:v]\*(C'\fR refers to the first video stream in the first input file, which is linked to the first (main) input of the overlay filter. Similarly the first video stream in the second input is linked to the second (overlay) input of overlay. .Sp Assuming there is only one video stream in each input file, we can omit input labels, so the above is equivalent to .Sp .Vb 2 \& ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aqoverlay[out]\*(Aq \-map \& \*(Aq[out]\*(Aq out.mkv .Ve .Sp Furthermore we can omit the output label and the single output from the filter graph will be added to the output file automatically, so we can simply write .Sp .Vb 1 \& ffmpeg \-i video.mkv \-i image.png \-filter_complex \*(Aqoverlay\*(Aq out.mkv .Ve .Sp To generate 5 seconds of pure red video using lavfi \f(CW\*(C`color\*(C'\fR source: .Sp .Vb 1 \& ffmpeg \-filter_complex \*(Aqcolor=c=red\*(Aq \-t 5 out.mkv .Ve .IP "\fB\-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\-filter_complex_script\fR \fIfilename\fR \fB(\fR\fIglobal\fR\fB)\fR" 4 .IX Item "-filter_complex_script filename (global)" This option is similar to \fB\-filter_complex\fR, the only difference is that its argument is the name of the file from which a complex filtergraph description is to be read. .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\fR\fB)\fR" 4 .IX Item "-thread_queue_size size (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; raising this value can avoid it. .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\-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. .PP As a special exception, you can use a bitmap subtitle stream as input: it will be converted into a video with the same size as the largest video in the file, or 720x576 if no video is present. Note that this is an experimental and temporary solution. It will be removed once libavfilter has proper support for subtitles. .PP For example, to hardcode subtitles on top of a DVB-T recording stored in MPEG-TS format, delaying the subtitles by 1 second: .PP .Vb 3 \& ffmpeg \-i input.ts \-filter_complex \e \& \*(Aq[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay\*(Aq \e \& \-sn \-map \*(Aq#0x2dc\*(Aq output.mkv .Ve .PP (0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video, audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too) .SS "Preset files" .IX Subsection "Preset files" A preset file contains a sequence of \fIoption\fR=\fIvalue\fR pairs, one for each line, specifying a sequence of options which would be awkward to specify on the command line. Lines starting with the hash ('#') character are ignored and are used to provide comments. Check the \fIpresets\fR directory in the FFmpeg source tree for examples. .PP 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. .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 \& [\-]+[....] .Ve .PP \&\fIS\fR expresses the number of seconds, with the optional decimal part \&\fIm\fR. .PP In both expressions, the optional \fB\-\fR indicates negative duration. .PP \fIExamples\fR .IX Subsection "Examples" .PP The following examples are all valid time duration: .IP "\fB55\fR" 4 .IX Item "55" 55 seconds .IP "\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 "\fBhexagonal\fR" 4 .IX Item "hexagonal" \&\s-1FL+FR+FC+BL+BR+BC\s0 .IP "\fB6.1\fR" 4 .IX Item "6.1" \&\s-1FL+FR+FC+LFE+BC+SL+SR\s0 .IP "\fB6.1\fR" 4 .IX Item "6.1" \&\s-1FL+FR+FC+LFE+BL+BR+BC\s0 .IP "\fB6.1(front)\fR" 4 .IX Item "6.1(front)" \&\s-1FL+FR+LFE+FLC+FRC+SL+SR\s0 .IP "\fB7.0\fR" 4 .IX Item "7.0" \&\s-1FL+FR+FC+BL+BR+SL+SR\s0 .IP "\fB7.0(front)\fR" 4 .IX Item "7.0(front)" \&\s-1FL+FR+FC+FLC+FRC+SL+SR\s0 .IP "\fB7.1\fR" 4 .IX Item "7.1" \&\s-1FL+FR+FC+LFE+BL+BR+SL+SR\s0 .IP "\fB7.1(wide)\fR" 4 .IX Item "7.1(wide)" \&\s-1FL+FR+FC+LFE+BL+BR+FLC+FRC\s0 .IP "\fB7.1(wide\-side)\fR" 4 .IX Item "7.1(wide-side)" \&\s-1FL+FR+FC+LFE+FLC+FRC+SL+SR\s0 .IP "\fBoctagonal\fR" 4 .IX Item "octagonal" \&\s-1FL+FR+FC+BL+BR+BC+SL+SR\s0 .IP "\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 .PP A custom channel layout can be specified as a sequence of terms, separated by \&'+' or '|'. Each term can be: .IP "\(bu" 4 the name of a standard channel layout (e.g. \fBmono\fR, \&\fBstereo\fR, \fB4.0\fR, \fBquad\fR, \fB5.0\fR, etc.) .IP "\(bu" 4 the name of a single channel (e.g. \fB\s-1FL\s0\fR, \fB\s-1FR\s0\fR, \fB\s-1FC\s0\fR, \fB\s-1LFE\s0\fR, etc.) .IP "\(bu" 4 a number of channels, in decimal, followed by 'c', yielding the default channel layout for that number of channels (see the function \&\f(CW\*(C`av_get_default_channel_layout\*(C'\fR). 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_get_channel_layout\*(C'\fR defined in \&\fIlibavutil/channel_layout.h\fR. .SH "EXPRESSION EVALUATION" .IX Header "EXPRESSION EVALUATION" When evaluating an arithmetic expression, FFmpeg uses an internal formula evaluator, implemented through the \fIlibavutil/eval.h\fR interface. .PP An expression may contain unary, binary operators, constants, and functions. .PP Two expressions \fIexpr1\fR and \fIexpr2\fR can be combined to form another expression "\fIexpr1\fR;\fIexpr2\fR". \&\fIexpr1\fR and \fIexpr2\fR are evaluated in turn, and the new expression evaluates to the value of \fIexpr2\fR. .PP The following binary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR, \&\f(CW\*(C`*\*(C'\fR, \f(CW\*(C`/\*(C'\fR, \f(CW\*(C`^\*(C'\fR. .PP The following unary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR. .PP The following functions are available: .IP "\fBabs(x)\fR" 4 .IX Item "abs(x)" Compute absolute value of \fIx\fR. .IP "\fBacos(x)\fR" 4 .IX Item "acos(x)" Compute arccosine of \fIx\fR. .IP "\fBasin(x)\fR" 4 .IX Item "asin(x)" Compute arcsine of \fIx\fR. .IP "\fBatan(x)\fR" 4 .IX Item "atan(x)" Compute arctangent of \fIx\fR. .IP "\fBatan2(x, y)\fR" 4 .IX Item "atan2(x, y)" 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(x)\fR" 4 .IX Item "random(x)" Return a pseudo random value between 0.0 and 1.0. \fIx\fR is the index of the internal variable which will be used to save the seed/state. .IP "\fBroot(expr, max)\fR" 4 .IX Item "root(expr, max)" Find an input value for which the function represented by \fIexpr\fR with argument \fI\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^40 .IP "\fBE\fR" 4 .IX Item "E" 10^18 / 2^50 .IP "\fBZ\fR" 4 .IX Item "Z" 10^21 / 2^60 .IP "\fBY\fR" 4 .IX Item "Y" 10^24 / 2^70 .SH "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 "\fBemu_edge\fR" 4 .IX Item "emu_edge" Do not draw edges. .IP "\fBpsnr\fR" 4 .IX Item "psnr" Set error[?] variables during encoding. .IP "\fBtruncated\fR" 4 .IX Item "truncated" 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 "\fBcbp\fR" 4 .IX Item "cbp" Deprecated, use mpegvideo private options instead. .IP "\fBqprd\fR" 4 .IX Item "qprd" Deprecated, use mpegvideo private options instead. .IP "\fBilme\fR" 4 .IX Item "ilme" Apply interlaced motion estimation. .IP "\fBcgop\fR" 4 .IX Item "cgop" Use closed gop. .IP "\fBoutput_corrupt\fR" 4 .IX Item "output_corrupt" Output even potentially corrupted frames. .RE .RS 4 .RE .IP "\fBme_method\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "me_method integer (encoding,video)" Set motion estimation method. .Sp Possible values: .RS 4 .IP "\fBzero\fR" 4 .IX Item "zero" zero motion estimation (fastest) .IP "\fBfull\fR" 4 .IX Item "full" full motion estimation (slowest) .IP "\fBepzs\fR" 4 .IX Item "epzs" \&\s-1EPZS\s0 motion estimation (default) .IP "\fBesa\fR" 4 .IX Item "esa" esa motion estimation (alias for full) .IP "\fBtesa\fR" 4 .IX Item "tesa" tesa motion estimation .IP "\fBdia\fR" 4 .IX Item "dia" dia motion estimation (alias for epzs) .IP "\fBlog\fR" 4 .IX Item "log" log motion estimation .IP "\fBphods\fR" 4 .IX Item "phods" phods motion estimation .IP "\fBx1\fR" 4 .IX Item "x1" X1 motion estimation .IP "\fBhex\fR" 4 .IX Item "hex" hex motion estimation .IP "\fBumh\fR" 4 .IX Item "umh" umh motion estimation .IP "\fBiter\fR" 4 .IX Item "iter" iter motion estimation .RE .RS 4 .RE .IP "\fBextradata_size\fR \fIinteger\fR" 4 .IX Item "extradata_size integer" Set extradata size. .IP "\fBtime_base\fR \fIrational number\fR" 4 .IX Item "time_base rational number" Set codec time base. .Sp It is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. For fixed-fps content, timebase should be \f(CW\*(C`1 / frame_rate\*(C'\fR and timestamp increments should be identically 1. .IP "\fBg\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "g integer (encoding,video)" Set the group of picture (\s-1GOP\s0) size. Default value is 12. .IP "\fBar\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4 .IX Item "ar integer (decoding/encoding,audio)" Set audio sampling rate (in Hz). .IP "\fBac\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4 .IX Item "ac integer (decoding/encoding,audio)" Set number of audio channels. .IP "\fBcutoff\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4 .IX Item "cutoff integer (encoding,audio)" Set cutoff bandwidth. (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 "\fBrc_strategy\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_strategy integer (encoding,video)" Set ratecontrol method. .IP "\fBb_strategy\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "b_strategy integer (encoding,video)" Set strategy to choose between I/P/B\-frames. .IP "\fBps\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "ps integer (encoding,video)" Set \s-1RTP\s0 payload size in bytes. .IP "\fBmv_bits\fR \fIinteger\fR" 4 .IX Item "mv_bits integer" .PD 0 .IP "\fBheader_bits\fR \fIinteger\fR" 4 .IX Item "header_bits integer" .IP "\fBi_tex_bits\fR \fIinteger\fR" 4 .IX Item "i_tex_bits integer" .IP "\fBp_tex_bits\fR \fIinteger\fR" 4 .IX Item "p_tex_bits integer" .IP "\fBi_count\fR \fIinteger\fR" 4 .IX Item "i_count integer" .IP "\fBp_count\fR \fIinteger\fR" 4 .IX Item "p_count integer" .IP "\fBskip_count\fR \fIinteger\fR" 4 .IX Item "skip_count integer" .IP "\fBmisc_bits\fR \fIinteger\fR" 4 .IX Item "misc_bits integer" .IP "\fBframe_bits\fR \fIinteger\fR" 4 .IX Item "frame_bits integer" .IP "\fBcodec_tag\fR \fIinteger\fR" 4 .IX Item "codec_tag integer" .IP "\fBbug\fR \fIflags\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "bug flags (decoding,video)" .PD Workaround not auto detected encoder bugs. .Sp Possible values: .RS 4 .IP "\fBautodetect\fR" 4 .IX Item "autodetect" .PD 0 .IP "\fBold_msmpeg4\fR" 4 .IX Item "old_msmpeg4" .PD some old lavc generated msmpeg4v3 files (no autodetection) .IP "\fBxvid_ilace\fR" 4 .IX Item "xvid_ilace" Xvid interlacing bug (autodetected if fourcc==XVIX) .IP "\fBump4\fR" 4 .IX Item "ump4" (autodetected if fourcc==UMP4) .IP "\fBno_padding\fR" 4 .IX Item "no_padding" padding bug (autodetected) .IP "\fBamv\fR" 4 .IX Item "amv" .PD 0 .IP "\fBac_vlc\fR" 4 .IX Item "ac_vlc" .PD illegal vlc bug (autodetected per fourcc) .IP "\fBqpel_chroma\fR" 4 .IX Item "qpel_chroma" .PD 0 .IP "\fBstd_qpel\fR" 4 .IX Item "std_qpel" .PD old standard qpel (autodetected per fourcc/version) .IP "\fBqpel_chroma2\fR" 4 .IX Item "qpel_chroma2" .PD 0 .IP "\fBdirect_blocksize\fR" 4 .IX Item "direct_blocksize" .PD direct-qpel-blocksize bug (autodetected per fourcc/version) .IP "\fBedge\fR" 4 .IX Item "edge" edge padding bug (autodetected per fourcc/version) .IP "\fBhpel_chroma\fR" 4 .IX Item "hpel_chroma" .PD 0 .IP "\fBdc_clip\fR" 4 .IX Item "dc_clip" .IP "\fBms\fR" 4 .IX Item "ms" .PD Workaround various bugs in microsoft broken decoders. .IP "\fBtrunc\fR" 4 .IX Item "trunc" trancated frames .RE .RS 4 .RE .IP "\fBlelim\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "lelim integer (encoding,video)" Set single coefficient elimination threshold for luminance (negative values also consider \s-1DC\s0 coefficient). .IP "\fBcelim\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "celim integer (encoding,video)" Set single coefficient elimination threshold for chrominance (negative values also consider dc coefficient) .IP "\fBstrict\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio,video\fR\fB)\fR" 4 .IX Item "strict integer (decoding/encoding,audio,video)" Specify how strictly to follow the standards. .Sp Possible values: .RS 4 .IP "\fBvery\fR" 4 .IX Item "very" strictly conform to an older more strict version of the spec or reference software .IP "\fBstrict\fR" 4 .IX Item "strict" strictly conform to all the things in the spec no matter what consequences .IP "\fBnormal\fR" 4 .IX Item "normal" .PD 0 .IP "\fBunofficial\fR" 4 .IX Item "unofficial" .PD allow unofficial extensions .IP "\fBexperimental\fR" 4 .IX Item "experimental" allow non standardized experimental things, experimental (unfinished/work in progress/not well tested) decoders and encoders. Note: experimental decoders can pose a security risk, do not use this for decoding untrusted input. .RE .RS 4 .RE .IP "\fBb_qoffset\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "b_qoffset float (encoding,video)" Set \s-1QP\s0 offset between P and B frames. .IP "\fBerr_detect\fR \fIflags\fR \fB(\fR\fIdecoding,audio,video\fR\fB)\fR" 4 .IX Item "err_detect flags (decoding,audio,video)" Set error detection flags. .Sp Possible values: .RS 4 .IP "\fBcrccheck\fR" 4 .IX Item "crccheck" verify embedded CRCs .IP "\fBbitstream\fR" 4 .IX Item "bitstream" detect bitstream specification deviations .IP "\fBbuffer\fR" 4 .IX Item "buffer" detect improper bitstream length .IP "\fBexplode\fR" 4 .IX Item "explode" abort decoding on minor error detection .IP "\fBignore_err\fR" 4 .IX Item "ignore_err" ignore decoding errors, and continue decoding. This is useful if you want to analyze the content of a video and thus want everything to be decoded no matter what. This option will not result in a video that is pleasing to watch in case of errors. .IP "\fBcareful\fR" 4 .IX Item "careful" consider things that violate the spec and have not been seen in the wild as errors .IP "\fBcompliant\fR" 4 .IX Item "compliant" consider all spec non compliancies as errors .IP "\fBaggressive\fR" 4 .IX Item "aggressive" consider things that a sane encoder should not do as an error .RE .RS 4 .RE .IP "\fBhas_b_frames\fR \fIinteger\fR" 4 .IX Item "has_b_frames integer" .PD 0 .IP "\fBblock_align\fR \fIinteger\fR" 4 .IX Item "block_align integer" .IP "\fBmpeg_quant\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mpeg_quant integer (encoding,video)" .PD Use \s-1MPEG\s0 quantizers instead of H.263. .IP "\fBqsquish\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "qsquish float (encoding,video)" How to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function). .IP "\fBrc_qmod_amp\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_qmod_amp float (encoding,video)" Set experimental quantizer modulation. .IP "\fBrc_qmod_freq\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_qmod_freq integer (encoding,video)" Set experimental quantizer modulation. .IP "\fBrc_override_count\fR \fIinteger\fR" 4 .IX Item "rc_override_count integer" .PD 0 .IP "\fBrc_eq\fR \fIstring\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_eq string (encoding,video)" .PD Set rate control equation. When computing the expression, besides the standard functions defined in the section 'Expression Evaluation', the following functions are available: bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex. .IP "\fBmaxrate\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "maxrate integer (encoding,audio,video)" Set max bitrate tolerance (in bits/s). Requires bufsize to be set. .IP "\fBminrate\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "minrate integer (encoding,audio,video)" Set min bitrate tolerance (in bits/s). Most useful in setting up a \s-1CBR\s0 encode. It is of little use elsewise. .IP "\fBbufsize\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "bufsize integer (encoding,audio,video)" Set ratecontrol buffer size (in bits). .IP "\fBrc_buf_aggressivity\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_buf_aggressivity float (encoding,video)" Currently useless. .IP "\fBi_qfactor\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "i_qfactor float (encoding,video)" Set \s-1QP\s0 factor between P and I frames. .IP "\fBi_qoffset\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "i_qoffset float (encoding,video)" Set \s-1QP\s0 offset between P and I frames. .IP "\fBrc_init_cplx\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_init_cplx float (encoding,video)" Set initial complexity for 1\-pass encoding. .IP "\fBdct\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "dct integer (encoding,video)" Set \s-1DCT\s0 algorithm. .Sp Possible values: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" autoselect a good one (default) .IP "\fBfastint\fR" 4 .IX Item "fastint" fast integer .IP "\fBint\fR" 4 .IX Item "int" accurate integer .IP "\fBmmx\fR" 4 .IX Item "mmx" .PD 0 .IP "\fBaltivec\fR" 4 .IX Item "altivec" .IP "\fBfaan\fR" 4 .IX Item "faan" .PD floating point \s-1AAN DCT\s0 .RE .RS 4 .RE .IP "\fBlumi_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "lumi_mask float (encoding,video)" Compress bright areas stronger than medium ones. .IP "\fBtcplx_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "tcplx_mask float (encoding,video)" Set temporal complexity masking. .IP "\fBscplx_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "scplx_mask float (encoding,video)" Set spatial complexity masking. .IP "\fBp_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "p_mask float (encoding,video)" Set inter masking. .IP "\fBdark_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "dark_mask float (encoding,video)" Compress dark areas stronger than medium ones. .IP "\fBidct\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4 .IX Item "idct integer (decoding/encoding,video)" Select \s-1IDCT\s0 implementation. .Sp Possible values: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" .PD 0 .IP "\fBint\fR" 4 .IX Item "int" .IP "\fBsimple\fR" 4 .IX Item "simple" .IP "\fBsimplemmx\fR" 4 .IX Item "simplemmx" .IP "\fBsimpleauto\fR" 4 .IX Item "simpleauto" .PD Automatically pick a \s-1IDCT\s0 compatible with the simple one .IP "\fBarm\fR" 4 .IX Item "arm" .PD 0 .IP "\fBaltivec\fR" 4 .IX Item "altivec" .IP "\fBsh4\fR" 4 .IX Item "sh4" .IP "\fBsimplearm\fR" 4 .IX Item "simplearm" .IP "\fBsimplearmv5te\fR" 4 .IX Item "simplearmv5te" .IP "\fBsimplearmv6\fR" 4 .IX Item "simplearmv6" .IP "\fBsimpleneon\fR" 4 .IX Item "simpleneon" .IP "\fBsimplealpha\fR" 4 .IX Item "simplealpha" .IP "\fBipp\fR" 4 .IX Item "ipp" .IP "\fBxvidmmx\fR" 4 .IX Item "xvidmmx" .IP "\fBfaani\fR" 4 .IX Item "faani" .PD floating point \s-1AAN IDCT\s0 .RE .RS 4 .RE .IP "\fBslice_count\fR \fIinteger\fR" 4 .IX Item "slice_count integer" .PD 0 .IP "\fBec\fR \fIflags\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "ec flags (decoding,video)" .PD Set error concealment strategy. .Sp Possible values: .RS 4 .IP "\fBguess_mvs\fR" 4 .IX Item "guess_mvs" iterative motion vector (\s-1MV\s0) search (slow) .IP "\fBdeblock\fR" 4 .IX Item "deblock" use strong deblock filter for damaged MBs .IP "\fBfavor_inter\fR" 4 .IX Item "favor_inter" favor predicting from the previous frame instead of the current .RE .RS 4 .RE .IP "\fBbits_per_coded_sample\fR \fIinteger\fR" 4 .IX Item "bits_per_coded_sample integer" .PD 0 .IP "\fBpred\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "pred integer (encoding,video)" .PD Set prediction method. .Sp Possible values: .RS 4 .IP "\fBleft\fR" 4 .IX Item "left" .PD 0 .IP "\fBplane\fR" 4 .IX Item "plane" .IP "\fBmedian\fR" 4 .IX Item "median" .RE .RS 4 .RE .IP "\fBaspect\fR \fIrational number\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "aspect rational number (encoding,video)" .PD Set sample aspect ratio. .IP "\fBsar\fR \fIrational number\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "sar rational number (encoding,video)" Set sample aspect ratio. Alias to \fIaspect\fR. .IP "\fBdebug\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video,subtitles\fR\fB)\fR" 4 .IX Item "debug flags (decoding/encoding,audio,video,subtitles)" Print specific debug info. .Sp Possible values: .RS 4 .IP "\fBpict\fR" 4 .IX Item "pict" picture info .IP "\fBrc\fR" 4 .IX Item "rc" rate control .IP "\fBbitstream\fR" 4 .IX Item "bitstream" .PD 0 .IP "\fBmb_type\fR" 4 .IX Item "mb_type" .PD macroblock (\s-1MB\s0) type .IP "\fBqp\fR" 4 .IX Item "qp" per-block quantization parameter (\s-1QP\s0) .IP "\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 "\fBpreme\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "preme integer (encoding,video)" Set pre motion estimation. .IP "\fBprecmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "precmp integer (encoding,video)" Set pre motion estimation compare function. .Sp Possible values: .RS 4 .IP "\fBsad\fR" 4 .IX Item "sad" sum of absolute differences, fast (default) .IP "\fBsse\fR" 4 .IX Item "sse" sum of squared errors .IP "\fBsatd\fR" 4 .IX Item "satd" sum of absolute Hadamard transformed differences .IP "\fBdct\fR" 4 .IX Item "dct" sum of absolute \s-1DCT\s0 transformed differences .IP "\fBpsnr\fR" 4 .IX Item "psnr" sum of squared quantization errors (avoid, low quality) .IP "\fBbit\fR" 4 .IX Item "bit" number of bits needed for the block .IP "\fBrd\fR" 4 .IX Item "rd" rate distortion optimal, slow .IP "\fBzero\fR" 4 .IX Item "zero" 0 .IP "\fBvsad\fR" 4 .IX Item "vsad" sum of absolute vertical differences .IP "\fBvsse\fR" 4 .IX Item "vsse" sum of squared vertical differences .IP "\fBnsse\fR" 4 .IX Item "nsse" noise preserving sum of squared differences .IP "\fBw53\fR" 4 .IX Item "w53" 5/3 wavelet, only used in snow .IP "\fBw97\fR" 4 .IX Item "w97" 9/7 wavelet, only used in snow .IP "\fBdctmax\fR" 4 .IX Item "dctmax" .PD 0 .IP "\fBchroma\fR" 4 .IX Item "chroma" .RE .RS 4 .RE .IP "\fBpre_dia_size\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "pre_dia_size integer (encoding,video)" .PD Set diamond type & size for motion estimation pre-pass. .IP "\fBsubq\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "subq integer (encoding,video)" Set sub pel motion estimation quality. .IP "\fBdtg_active_format\fR \fIinteger\fR" 4 .IX Item "dtg_active_format integer" .PD 0 .IP "\fBme_range\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "me_range integer (encoding,video)" .PD Set limit motion vectors range (1023 for DivX player). .IP "\fBibias\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "ibias integer (encoding,video)" Set intra quant bias. .IP "\fBpbias\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "pbias integer (encoding,video)" Set inter quant bias. .IP "\fBcolor_table_id\fR \fIinteger\fR" 4 .IX Item "color_table_id integer" .PD 0 .IP "\fBglobal_quality\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "global_quality integer (encoding,audio,video)" .IP "\fBcoder\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "coder integer (encoding,video)" .PD Possible values: .RS 4 .IP "\fBvlc\fR" 4 .IX Item "vlc" variable length coder / huffman coder .IP "\fBac\fR" 4 .IX Item "ac" arithmetic coder .IP "\fBraw\fR" 4 .IX Item "raw" raw (no encoding) .IP "\fBrle\fR" 4 .IX Item "rle" run-length coder .IP "\fBdeflate\fR" 4 .IX Item "deflate" deflate-based coder .RE .RS 4 .RE .IP "\fBcontext\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "context integer (encoding,video)" Set context model. .IP "\fBslice_flags\fR \fIinteger\fR" 4 .IX Item "slice_flags integer" .PD 0 .IP "\fBmbd\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mbd integer (encoding,video)" .PD Set macroblock decision algorithm (high quality mode). .Sp Possible values: .RS 4 .IP "\fBsimple\fR" 4 .IX Item "simple" use mbcmp (default) .IP "\fBbits\fR" 4 .IX Item "bits" use fewest bits .IP "\fBrd\fR" 4 .IX Item "rd" use best rate distortion .RE .RS 4 .RE .IP "\fBstream_codec_tag\fR \fIinteger\fR" 4 .IX Item "stream_codec_tag integer" .PD 0 .IP "\fBsc_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "sc_threshold integer (encoding,video)" .PD Set scene change threshold. .IP "\fBlmin\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "lmin integer (encoding,video)" Set min lagrange factor (\s-1VBR\s0). .IP "\fBlmax\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "lmax integer (encoding,video)" Set max lagrange factor (\s-1VBR\s0). .IP "\fBnr\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "nr integer (encoding,video)" Set noise reduction. .IP "\fBrc_init_occupancy\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_init_occupancy integer (encoding,video)" Set number of bits which should be loaded into the rc buffer before decoding starts. .IP "\fBflags2\fR \fIflags\fR \fB(\fR\fIdecoding/encoding,audio,video,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. .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. .RE .RS 4 .RE .IP "\fBerror\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "error integer (encoding,video)" .PD 0 .IP "\fBqns\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "qns integer (encoding,video)" .PD Deprecated, use mpegvideo private options instead. .IP "\fBthreads\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4 .IX Item "threads integer (decoding/encoding,video)" Set the number of threads to be used, in case the selected codec implementation supports multi-threading. .Sp Possible values: .RS 4 .IP "\fBauto, 0\fR" 4 .IX Item "auto, 0" automatically select the number of threads to set .RE .RS 4 .Sp Default value is \fBauto\fR. .RE .IP "\fBme_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "me_threshold integer (encoding,video)" Set motion estimation threshold. .IP "\fBmb_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mb_threshold integer (encoding,video)" Set macroblock threshold. .IP "\fBdc\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "dc integer (encoding,video)" Set intra_dc_precision. .IP "\fBnssew\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "nssew integer (encoding,video)" Set nsse weight. .IP "\fBskip_top\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "skip_top integer (decoding,video)" Set number of macroblock rows at the top which are skipped. .IP "\fBskip_bottom\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "skip_bottom integer (decoding,video)" Set number of macroblock rows at the bottom which are skipped. .IP "\fBprofile\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "profile integer (encoding,audio,video)" 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)" Possible values: .RS 4 .IP "\fBunknown\fR" 4 .IX Item "unknown" .RE .RS 4 .RE .PD 0 .IP "\fBlowres\fR \fIinteger\fR \fB(\fR\fIdecoding,audio,video\fR\fB)\fR" 4 .IX Item "lowres integer (decoding,audio,video)" .PD Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. .IP "\fBskip_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "skip_threshold integer (encoding,video)" Set frame skip threshold. .IP "\fBskip_factor\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "skip_factor integer (encoding,video)" Set frame skip factor. .IP "\fBskip_exp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "skip_exp integer (encoding,video)" Set frame skip exponent. Negative values behave identical to the corresponding positive ones, except that the score is normalized. Positive values exist primarily for compatibility reasons and are not so useful. .IP "\fBskipcmp\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "skipcmp integer (encoding,video)" Set frame skip compare function. .Sp Possible values: .RS 4 .IP "\fBsad\fR" 4 .IX Item "sad" sum of absolute differences, fast (default) .IP "\fBsse\fR" 4 .IX Item "sse" sum of squared errors .IP "\fBsatd\fR" 4 .IX Item "satd" sum of absolute Hadamard transformed differences .IP "\fBdct\fR" 4 .IX Item "dct" sum of absolute \s-1DCT\s0 transformed differences .IP "\fBpsnr\fR" 4 .IX Item "psnr" sum of squared quantization errors (avoid, low quality) .IP "\fBbit\fR" 4 .IX Item "bit" number of bits needed for the block .IP "\fBrd\fR" 4 .IX Item "rd" rate distortion optimal, slow .IP "\fBzero\fR" 4 .IX Item "zero" 0 .IP "\fBvsad\fR" 4 .IX Item "vsad" sum of absolute vertical differences .IP "\fBvsse\fR" 4 .IX Item "vsse" sum of squared vertical differences .IP "\fBnsse\fR" 4 .IX Item "nsse" noise preserving sum of squared differences .IP "\fBw53\fR" 4 .IX Item "w53" 5/3 wavelet, only used in snow .IP "\fBw97\fR" 4 .IX Item "w97" 9/7 wavelet, only used in snow .IP "\fBdctmax\fR" 4 .IX Item "dctmax" .PD 0 .IP "\fBchroma\fR" 4 .IX Item "chroma" .RE .RS 4 .RE .IP "\fBborder_mask\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "border_mask float (encoding,video)" .PD Increase the quantizer for macroblocks close to borders. .IP "\fBmblmin\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mblmin integer (encoding,video)" Set min macroblock lagrange factor (\s-1VBR\s0). .IP "\fBmblmax\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mblmax integer (encoding,video)" Set max macroblock lagrange factor (\s-1VBR\s0). .IP "\fBmepc\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mepc integer (encoding,video)" Set motion estimation bitrate penalty compensation (1.0 = 256). .IP "\fBskip_loop_filter\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "skip_loop_filter integer (decoding,video)" .PD 0 .IP "\fBskip_idct\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "skip_idct integer (decoding,video)" .IP "\fBskip_frame\fR \fIinteger\fR \fB(\fR\fIdecoding,video\fR\fB)\fR" 4 .IX Item "skip_frame integer (decoding,video)" .PD Make decoder discard processing depending on the frame type selected by the option value. .Sp \&\fBskip_loop_filter\fR skips frame loop filtering, \fBskip_idct\fR skips frame IDCT/dequantization, \fBskip_frame\fR skips decoding. .Sp Possible values: .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" Discard no frame. .IP "\fBdefault\fR" 4 .IX Item "default" Discard useless frames like 0\-sized frames. .IP "\fBnoref\fR" 4 .IX Item "noref" Discard all non-reference frames. .IP "\fBbidir\fR" 4 .IX Item "bidir" Discard all bidirectional frames. .IP "\fBnokey\fR" 4 .IX Item "nokey" Discard all frames excepts keyframes. .IP "\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 "\fBbrd_scale\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "brd_scale integer (encoding,video)" Downscale frames for dynamic B\-frame decision. .IP "\fBkeyint_min\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "keyint_min integer (encoding,video)" Set minimum interval between IDR-frames. .IP "\fBrefs\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "refs integer (encoding,video)" Set reference frames to consider for motion compensation. .IP "\fBchromaoffset\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "chromaoffset integer (encoding,video)" Set chroma qp offset from luma. .IP "\fBtrellis\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "trellis integer (encoding,audio,video)" Set rate-distortion optimal quantization. .IP "\fBmv0_threshold\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "mv0_threshold integer (encoding,video)" .PD 0 .IP "\fBb_sensitivity\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "b_sensitivity integer (encoding,video)" .PD Adjust sensitivity of b_frame_strategy 1. .IP "\fBcompression_level\fR \fIinteger\fR \fB(\fR\fIencoding,audio,video\fR\fB)\fR" 4 .IX Item "compression_level integer (encoding,audio,video)" .PD 0 .IP "\fBmin_prediction_order\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4 .IX Item "min_prediction_order integer (encoding,audio)" .IP "\fBmax_prediction_order\fR \fIinteger\fR \fB(\fR\fIencoding,audio\fR\fB)\fR" 4 .IX Item "max_prediction_order integer (encoding,audio)" .IP "\fBtimecode_frame_start\fR \fIinteger\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "timecode_frame_start integer (encoding,video)" .PD Set \s-1GOP\s0 timecode frame start number, in non drop frame format. .IP "\fBrequest_channels\fR \fIinteger\fR \fB(\fR\fIdecoding,audio\fR\fB)\fR" 4 .IX Item "request_channels integer (decoding,audio)" Set desired number of audio channels. .IP "\fBbits_per_raw_sample\fR \fIinteger\fR" 4 .IX Item "bits_per_raw_sample integer" .PD 0 .IP "\fBchannel_layout\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio\fR\fB)\fR" 4 .IX Item "channel_layout integer (decoding/encoding,audio)" .PD Possible values: .IP "\fBrequest_channel_layout\fR \fIinteger\fR \fB(\fR\fIdecoding,audio\fR\fB)\fR" 4 .IX Item "request_channel_layout integer (decoding,audio)" Possible values: .IP "\fBrc_max_vbv_use\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_max_vbv_use float (encoding,video)" .PD 0 .IP "\fBrc_min_vbv_use\fR \fIfloat\fR \fB(\fR\fIencoding,video\fR\fB)\fR" 4 .IX Item "rc_min_vbv_use float (encoding,video)" .IP "\fBticks_per_frame\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,audio,video\fR\fB)\fR" 4 .IX Item "ticks_per_frame integer (decoding/encoding,audio,video)" .IP "\fBcolor_primaries\fR \fIinteger\fR \fB(\fR\fIdecoding/encoding,video\fR\fB)\fR" 4 .IX Item "color_primaries integer (decoding/encoding,video)" .PD Possible values: .RS 4 .IP "\fBbt709\fR" 4 .IX Item "bt709" \&\s-1BT.709\s0 .IP "\fBbt470m\fR" 4 .IX Item "bt470m" \&\s-1BT.470 M\s0 .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" \&\s-1BT.470 BG\s0 .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" \&\s-1SMPTE 170 M\s0 .IP "\fBsmpte240m\fR" 4 .IX Item "smpte240m" \&\s-1SMPTE 240 M\s0 .IP "\fBfilm\fR" 4 .IX Item "film" Film .IP "\fBbt2020\fR" 4 .IX Item "bt2020" \&\s-1BT.2020\s0 .IP "\fBsmpte428\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 .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" .PD \&\s-1MPEG\s0 (219*2^(n\-8)) .IP "\fBpc\fR" 4 .IX Item "pc" .PD 0 .IP "\fBjpeg\fR" 4 .IX Item "jpeg" .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 "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). .IP "\fBtilethreads\fR" 4 .IX Item "tilethreads" Set amount of tile threads to use during decoding. 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. .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. .SH "AUDIO DECODERS" .IX Header "AUDIO DECODERS" A description of some of the currently available audio decoders follows. .SS "ac3" .IX Subsection "ac3" \&\s-1AC\-3\s0 audio decoder. .PP This decoder implements part of \s-1ATSC A/52:2010\s0 and \s-1ETSI TS 102 366,\s0 as well as the undocumented RealAudio 3 (a.k.a. dnet). .PP \fI\s-1AC\-3\s0 Decoder Options\fR .IX Subsection "AC-3 Decoder Options" .IP "\fB\-drc_scale\fR \fIvalue\fR" 4 .IX Item "-drc_scale value" Dynamic Range Scale Factor. The factor to apply to dynamic range values from the \s-1AC\-3\s0 stream. This factor is applied exponentially. There are 3 notable scale factor ranges: .RS 4 .IP "\fBdrc_scale == 0\fR" 4 .IX Item "drc_scale == 0" \&\s-1DRC\s0 disabled. Produces full range audio. .IP "\fB0 < drc_scale <= 1\fR" 4 .IX Item "0 < drc_scale <= 1" \&\s-1DRC\s0 enabled. Applies a fraction of the stream \s-1DRC\s0 value. Audio reproduction is between full range and full compression. .IP "\fBdrc_scale > 1\fR" 4 .IX Item "drc_scale > 1" \&\s-1DRC\s0 enabled. Applies drc_scale asymmetrically. Loud sounds are fully compressed. Soft sounds are enhanced. .RE .RS 4 .RE .SS "flac" .IX Subsection "flac" \&\s-1FLAC\s0 audio decoder. .PP This decoder aims to implement the complete \s-1FLAC\s0 specification from Xiph. .PP \fI\s-1FLAC\s0 Decoder options\fR .IX Subsection "FLAC Decoder options" .IP "\fB\-use_buggy_lpc\fR" 4 .IX Item "-use_buggy_lpc" The lavc \s-1FLAC\s0 encoder used to produce buggy streams with high lpc values (like the default value). This option makes it possible to decode such streams correctly by using lavc's old buggy lpc logic for decoding. .SS "ffwavesynth" .IX Subsection "ffwavesynth" Internal wave 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 "dvbsub" .IX Subsection "dvbsub" \fIOptions\fR .IX Subsection "Options" .IP "\fBcompute_clut\fR" 4 .IX Item "compute_clut" .RS 4 .PD 0 .IP "\fB\-1\fR" 4 .IX Item "-1" .PD Compute clut if no matching \s-1CLUT\s0 is in the stream. .IP "\fB0\fR" 4 .IX Item "0" Never compute \s-1CLUT\s0 .IP "\fB1\fR" 4 .IX Item "1" Always compute \s-1CLUT\s0 and override the one provided in the stream. .RE .RS 4 .RE .IP "\fBdvb_substream\fR" 4 .IX Item "dvb_substream" Selects the dvb substream, or all substreams if \-1 which is default. .SS "dvdsub" .IX Subsection "dvdsub" This codec decodes the bitmap subtitles used in DVDs; the same subtitles can also be found in VobSub file pairs and in some Matroska files. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBpalette\fR" 4 .IX Item "palette" Specify the global palette used by the bitmaps. When stored in VobSub, the palette is normally specified in the index file; in Matroska, the palette is stored in the codec extra-data in the same format as in VobSub. In DVDs, the palette is stored in the \s-1IFO\s0 file, and therefore not available when reading from dumped \s-1VOB\s0 files. .Sp The format for this option is a string containing 16 24\-bits hexadecimal numbers (without 0x prefix) separated by 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. .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. This is the default choice for a coder .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 floating-point encoder will generally produce better quality audio for a given bitrate. The \fIac3_fixed\fR encoder is not the default codec for any of the output formats, so it must be specified explicitly using the option \f(CW\*(C`\-acodec ac3_fixed\*(C'\fR in order to use it. .PP \fI\s-1AC\-3\s0 Metadata\fR .IX Subsection "AC-3 Metadata" .PP The \s-1AC\-3\s0 metadata options are used to set parameters that describe the audio, but in most cases do not affect the audio encoding itself. Some of the options do directly affect or influence the decoding and playback of the resulting bitstream, while others are just for informational purposes. A few of the options will add bits to the output stream that could otherwise be used for audio data, and will thus affect the quality of the output. Those will be indicated accordingly with a note in the option list below. .PP These parameters are described in detail in several publicly-available documents. .IP "*<<\fBhttp://www.atsc.org/cms/standards/a_52\-2010.pdf\fR>>" 4 .IX Item "*<>" .PD 0 .IP "*<<\fBhttp://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf\fR>>" 4 .IX Item "*<>" .IP "*<<\fBhttp://www.dolby.com/uploadedFiles/zz\-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf\fR>>" 4 .IX Item "*<>" .IP "*<<\fBhttp://www.dolby.com/uploadedFiles/zz\-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf\fR>>" 4 .IX Item "*<>" .PD .PP Metadata Control Options .IX Subsection "Metadata Control Options" .IP "\fB\-per_frame_metadata\fR \fIboolean\fR" 4 .IX Item "-per_frame_metadata boolean" Allow Per-Frame Metadata. Specifies if the encoder should check for changing metadata for each frame. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" The metadata values set at initialization will be used for every frame in the stream. (default) .IP "\fB1\fR" 4 .IX Item "1" Metadata values can be changed before encoding each frame. .RE .RS 4 .RE .PP Downmix Levels .IX Subsection "Downmix Levels" .IP "\fB\-center_mixlev\fR \fIlevel\fR" 4 .IX Item "-center_mixlev level" Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo. This field will only be written to the bitstream if a center channel is present. The value is specified as a scale factor. There are 3 valid values: .RS 4 .IP "\fB0.707\fR" 4 .IX Item "0.707" Apply \-3dB gain .IP "\fB0.595\fR" 4 .IX Item "0.595" Apply \-4.5dB gain (default) .IP "\fB0.500\fR" 4 .IX Item "0.500" Apply \-6dB gain .RE .RS 4 .RE .IP "\fB\-surround_mixlev\fR \fIlevel\fR" 4 .IX Item "-surround_mixlev level" Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo. This field will only be written to the bitstream if one or more surround channels are present. The value is specified as a scale factor. There are 3 valid values: .RS 4 .IP "\fB0.707\fR" 4 .IX Item "0.707" Apply \-3dB gain .IP "\fB0.500\fR" 4 .IX Item "0.500" Apply \-6dB gain (default) .IP "\fB0.000\fR" 4 .IX Item "0.000" Silence Surround Channel(s) .RE .RS 4 .RE .PP Audio Production Information .IX Subsection "Audio Production Information" .PP Audio Production Information is optional information describing the mixing environment. Either none or both of the fields are written to the bitstream. .IP "\fB\-mixing_level\fR \fInumber\fR" 4 .IX Item "-mixing_level number" Mixing Level. Specifies peak sound pressure level (\s-1SPL\s0) in the production environment when the mix was mastered. Valid values are 80 to 111, or \-1 for unknown or not indicated. The default value is \-1, but that value cannot be used if the Audio Production Information is written to the bitstream. Therefore, if the \f(CW\*(C`room_type\*(C'\fR option is not the default value, the \f(CW\*(C`mixing_level\*(C'\fR option must not be \-1. .IP "\fB\-room_type\fR \fItype\fR" 4 .IX Item "-room_type type" Room Type. Describes the equalization used during the final mixing session at the studio or on the dubbing stage. A large room is a dubbing stage with the industry standard X\-curve equalization; a small room has flat equalization. This field will not be written to the bitstream if both the \f(CW\*(C`mixing_level\*(C'\fR option and the \f(CW\*(C`room_type\*(C'\fR option have the default values. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBnotindicated\fR" 4 .IX Item "notindicated" .PD Not Indicated (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBlarge\fR" 4 .IX Item "large" .PD Large Room .IP "\fB2\fR" 4 .IX Item "2" .PD 0 .IP "\fBsmall\fR" 4 .IX Item "small" .PD Small Room .RE .RS 4 .RE .PP Other Metadata Options .IX Subsection "Other Metadata Options" .IP "\fB\-copyright\fR \fIboolean\fR" 4 .IX Item "-copyright boolean" Copyright Indicator. Specifies whether a copyright exists for this audio. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBoff\fR" 4 .IX Item "off" .PD No Copyright Exists (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBon\fR" 4 .IX Item "on" .PD Copyright Exists .RE .RS 4 .RE .IP "\fB\-dialnorm\fR \fIvalue\fR" 4 .IX Item "-dialnorm value" Dialogue Normalization. Indicates how far the average dialogue level of the program is below digital 100% full scale (0 dBFS). This parameter determines a level shift during audio reproduction that sets the average volume of the dialogue to a preset level. The goal is to match volume level between program sources. A value of \-31dB will result in no volume level change, relative to the source volume, during audio reproduction. Valid values are whole numbers in the range \-31 to \-1, with \-31 being the default. .IP "\fB\-dsur_mode\fR \fImode\fR" 4 .IX Item "-dsur_mode mode" Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround (Pro Logic). This field will only be written to the bitstream if the audio stream is stereo. Using this option does \fB\s-1NOT\s0\fR mean the encoder will actually apply Dolby Surround processing. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBnotindicated\fR" 4 .IX Item "notindicated" .PD Not Indicated (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBoff\fR" 4 .IX Item "off" .PD Not Dolby Surround Encoded .IP "\fB2\fR" 4 .IX Item "2" .PD 0 .IP "\fBon\fR" 4 .IX Item "on" .PD Dolby Surround Encoded .RE .RS 4 .RE .IP "\fB\-original\fR \fIboolean\fR" 4 .IX Item "-original boolean" Original Bit Stream Indicator. Specifies whether this audio is from the original source and not a copy. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBoff\fR" 4 .IX Item "off" .PD Not Original Source .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBon\fR" 4 .IX Item "on" .PD Original Source (default) .RE .RS 4 .RE .PP \fIExtended Bitstream Information\fR .IX Subsection "Extended Bitstream Information" .PP The extended bitstream options are part of the Alternate Bit Stream Syntax as specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts. If any one parameter in a group is specified, all values in that group will be written to the bitstream. Default values are used for those that are written but have not been specified. If the mixing levels are written, the decoder will use these values instead of the ones specified in the \f(CW\*(C`center_mixlev\*(C'\fR and \f(CW\*(C`surround_mixlev\*(C'\fR options if it supports the Alternate Bit Stream Syntax. .PP Extended Bitstream Information \- Part 1 .IX Subsection "Extended Bitstream Information - Part 1" .IP "\fB\-dmix_mode\fR \fImode\fR" 4 .IX Item "-dmix_mode mode" Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBnotindicated\fR" 4 .IX Item "notindicated" .PD Not Indicated (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBltrt\fR" 4 .IX Item "ltrt" .PD Lt/Rt Downmix Preferred .IP "\fB2\fR" 4 .IX Item "2" .PD 0 .IP "\fBloro\fR" 4 .IX Item "loro" .PD Lo/Ro Downmix Preferred .RE .RS 4 .RE .IP "\fB\-ltrt_cmixlev\fR \fIlevel\fR" 4 .IX Item "-ltrt_cmixlev level" Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo in Lt/Rt mode. .RS 4 .IP "\fB1.414\fR" 4 .IX Item "1.414" Apply +3dB gain .IP "\fB1.189\fR" 4 .IX Item "1.189" Apply +1.5dB gain .IP "\fB1.000\fR" 4 .IX Item "1.000" Apply 0dB gain .IP "\fB0.841\fR" 4 .IX Item "0.841" Apply \-1.5dB gain .IP "\fB0.707\fR" 4 .IX Item "0.707" Apply \-3.0dB gain .IP "\fB0.595\fR" 4 .IX Item "0.595" Apply \-4.5dB gain (default) .IP "\fB0.500\fR" 4 .IX Item "0.500" Apply \-6.0dB gain .IP "\fB0.000\fR" 4 .IX Item "0.000" Silence Center Channel .RE .RS 4 .RE .IP "\fB\-ltrt_surmixlev\fR \fIlevel\fR" 4 .IX Item "-ltrt_surmixlev level" Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo in Lt/Rt mode. .RS 4 .IP "\fB0.841\fR" 4 .IX Item "0.841" Apply \-1.5dB gain .IP "\fB0.707\fR" 4 .IX Item "0.707" Apply \-3.0dB gain .IP "\fB0.595\fR" 4 .IX Item "0.595" Apply \-4.5dB gain .IP "\fB0.500\fR" 4 .IX Item "0.500" Apply \-6.0dB gain (default) .IP "\fB0.000\fR" 4 .IX Item "0.000" Silence Surround Channel(s) .RE .RS 4 .RE .IP "\fB\-loro_cmixlev\fR \fIlevel\fR" 4 .IX Item "-loro_cmixlev level" Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo in Lo/Ro mode. .RS 4 .IP "\fB1.414\fR" 4 .IX Item "1.414" Apply +3dB gain .IP "\fB1.189\fR" 4 .IX Item "1.189" Apply +1.5dB gain .IP "\fB1.000\fR" 4 .IX Item "1.000" Apply 0dB gain .IP "\fB0.841\fR" 4 .IX Item "0.841" Apply \-1.5dB gain .IP "\fB0.707\fR" 4 .IX Item "0.707" Apply \-3.0dB gain .IP "\fB0.595\fR" 4 .IX Item "0.595" Apply \-4.5dB gain (default) .IP "\fB0.500\fR" 4 .IX Item "0.500" Apply \-6.0dB gain .IP "\fB0.000\fR" 4 .IX Item "0.000" Silence Center Channel .RE .RS 4 .RE .IP "\fB\-loro_surmixlev\fR \fIlevel\fR" 4 .IX Item "-loro_surmixlev level" Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo in Lo/Ro mode. .RS 4 .IP "\fB0.841\fR" 4 .IX Item "0.841" Apply \-1.5dB gain .IP "\fB0.707\fR" 4 .IX Item "0.707" Apply \-3.0dB gain .IP "\fB0.595\fR" 4 .IX Item "0.595" Apply \-4.5dB gain .IP "\fB0.500\fR" 4 .IX Item "0.500" Apply \-6.0dB gain (default) .IP "\fB0.000\fR" 4 .IX Item "0.000" Silence Surround Channel(s) .RE .RS 4 .RE .PP Extended Bitstream Information \- Part 2 .IX Subsection "Extended Bitstream Information - Part 2" .IP "\fB\-dsurex_mode\fR \fImode\fR" 4 .IX Item "-dsurex_mode mode" Dolby Surround \s-1EX\s0 Mode. Indicates whether the stream uses Dolby Surround \s-1EX\s0 (7.1 matrixed to 5.1). Using this option does \fB\s-1NOT\s0\fR mean the encoder will actually apply Dolby Surround \s-1EX\s0 processing. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBnotindicated\fR" 4 .IX Item "notindicated" .PD Not Indicated (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBon\fR" 4 .IX Item "on" .PD Dolby Surround \s-1EX\s0 Off .IP "\fB2\fR" 4 .IX Item "2" .PD 0 .IP "\fBoff\fR" 4 .IX Item "off" .PD Dolby Surround \s-1EX\s0 On .RE .RS 4 .RE .IP "\fB\-dheadphone_mode\fR \fImode\fR" 4 .IX Item "-dheadphone_mode mode" Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone encoding (multi-channel matrixed to 2.0 for use with headphones). Using this option does \fB\s-1NOT\s0\fR mean the encoder will actually apply Dolby Headphone processing. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBnotindicated\fR" 4 .IX Item "notindicated" .PD Not Indicated (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBon\fR" 4 .IX Item "on" .PD Dolby Headphone Off .IP "\fB2\fR" 4 .IX Item "2" .PD 0 .IP "\fBoff\fR" 4 .IX Item "off" .PD Dolby Headphone On .RE .RS 4 .RE .IP "\fB\-ad_conv_type\fR \fItype\fR" 4 .IX Item "-ad_conv_type type" A/D Converter Type. Indicates whether the audio has passed through \s-1HDCD A/D\s0 conversion. .RS 4 .IP "\fB0\fR" 4 .IX Item "0" .PD 0 .IP "\fBstandard\fR" 4 .IX Item "standard" .PD Standard A/D Converter (default) .IP "\fB1\fR" 4 .IX Item "1" .PD 0 .IP "\fBhdcd\fR" 4 .IX Item "hdcd" .PD \&\s-1HDCD A/D\s0 Converter .RE .RS 4 .RE .PP \fIOther \s-1AC\-3\s0 Encoding Options\fR .IX Subsection "Other AC-3 Encoding Options" .IP "\fB\-stereo_rematrixing\fR \fIboolean\fR" 4 .IX Item "-stereo_rematrixing boolean" Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This is an optional \s-1AC\-3\s0 feature that increases quality by selectively encoding the left/right channels as mid/side. This option is enabled by default, and it is highly recommended that it be left as enabled except for testing purposes. .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 its 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 .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. .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 "\fBapplication (N.A.)\fR" 4 .IX Item "application (N.A.)" Set intended application type. Valid options are listed below: .RS 4 .IP "\fBvoip\fR" 4 .IX Item "voip" Favor improved speech intelligibility. .IP "\fBaudio\fR" 4 .IX Item "audio" Favor faithfulness to the input (the default). .IP "\fBlowdelay\fR" 4 .IX Item "lowdelay" Restrict to only the lowest delay modes. .RE .RS 4 .RE .IP "\fBcutoff (N.A.)\fR" 4 .IX Item "cutoff (N.A.)" Set cutoff bandwidth in Hz. The argument must be exactly one of the following: 4000, 6000, 8000, 12000, or 20000, corresponding to narrowband, mediumband, wideband, super wideband, and fullband respectively. The default is 0 (cutoff disabled). .IP "\fBmapping_family (\fR\fImapping_family\fR\fB)\fR" 4 .IX Item "mapping_family (mapping_family)" Set channel mapping family to be used by the encoder. The default value of \-1 uses mapping family 0 for mono and stereo inputs, and mapping family 1 otherwise. The default also disables the surround masking and \s-1LFE\s0 bandwidth optimzations in libopus, and requires that the input contains 8 channels or fewer. .Sp Other values include 0 for mono and stereo, 1 for surround sound with masking and \s-1LFE\s0 bandwidth optimizations, and 255 for independent streams with an unspecified channel layout. .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 "libwavpack" .IX Subsection "libwavpack" A wrapper providing WavPack encoding through libwavpack. .PP Only lossless mode using 32\-bit integer samples is supported currently. .PP Requires the presence of the libwavpack headers and library during configuration. You need to explicitly configure the build with \&\f(CW\*(C`\-\-enable\-libwavpack\*(C'\fR. .PP Note that a libavcodec-native encoder for the WavPack codec exists so users can encode audios with this codec without using this encoder. See \fBwavpackenc\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP \&\fBwavpack\fR command line utility's corresponding options are listed in parentheses, if any. .IP "\fBframe_size (\fR\fI\-\-blocksize\fR\fB)\fR" 4 .IX Item "frame_size (--blocksize)" Default is 32768. .IP "\fBcompression_level\fR" 4 .IX Item "compression_level" Set speed vs. compression tradeoff. Acceptable arguments are listed below: .RS 4 .IP "\fB0 (\fR\fI\-f\fR\fB)\fR" 4 .IX Item "0 (-f)" Fast mode. .IP "\fB1\fR" 4 .IX Item "1" Normal (default) settings. .IP "\fB2 (\fR\fI\-h\fR\fB)\fR" 4 .IX Item "2 (-h)" High quality. .IP "\fB3 (\fR\fI\-hh\fR\fB)\fR" 4 .IX Item "3 (-hh)" Very high quality. .IP "\fB4\-8 (\fR\fI\-hh \-x\fR\fI\s-1EXTRAPROC\s0\fR\fB)\fR" 4 .IX Item "4-8 (-hh -xEXTRAPROC)" Same as \fB3\fR, but with extra processing enabled. .Sp \&\fB4\fR is the same as \fB\-x2\fR and \fB8\fR is the same as \fB\-x6\fR. .RE .RS 4 .RE .SS "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 This is a libavcodec-native WavPack encoder. There is also an encoder based on libwavpack, but there is virtually no reason to use that encoder. .PP See also \fBlibwavpack\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The equivalent options for \fBwavpack\fR command line utility are listed in parentheses. .PP Shared options .IX Subsection "Shared options" .PP The following shared options are effective for this encoder. Only special notes about this particular encoder will be documented here. For the general meaning of the options, see \fBthe Codec Options chapter\fR. .IP "\fBframe_size (\fR\fI\-\-blocksize\fR\fB)\fR" 4 .IX Item "frame_size (--blocksize)" For this encoder, the range for this option is between 128 and 131072. Default is automatically decided based on sample rate and number of channel. .Sp For the complete formula of calculating default, see \&\fIlibavcodec/wavpackenc.c\fR. .IP "\fBcompression_level (\fR\fI\-f\fR\fB,\fR \fI\-h\fR\fB,\fR \fI\-hh\fR\fB, and\fR \fI\-x\fR\fB)\fR" 4 .IX Item "compression_level (-f, -h, -hh, and -x)" This option's syntax is consistent with \fBlibwavpack\fR's. .PP Private options .IX Subsection "Private options" .IP "\fBjoint_stereo (\fR\fI\-j\fR\fB)\fR" 4 .IX Item "joint_stereo (-j)" Set whether to enable joint stereo. Valid values are: .RS 4 .IP "\fBon (\fR\fI1\fR\fB)\fR" 4 .IX Item "on (1)" Force mid/side audio encoding. .IP "\fBoff (\fR\fI0\fR\fB)\fR" 4 .IX Item "off (0)" Force left/right audio encoding. .IP "\fBauto\fR" 4 .IX Item "auto" Let the encoder decide automatically. .RE .RS 4 .RE .IP "\fBoptimize_mono\fR" 4 .IX Item "optimize_mono" Set whether to enable optimization for mono. This option is only effective for non-mono streams. Available values: .RS 4 .IP "\fBon\fR" 4 .IX Item "on" enabled .IP "\fBoff\fR" 4 .IX Item "off" disabled .RE .RS 4 .RE .SH "VIDEO ENCODERS" .IX Header "VIDEO ENCODERS" A description of some of the currently available video encoders follows. .SS "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" 4 .IX Item "format" Can be set to either \f(CW\*(C`j2k\*(C'\fR or \f(CW\*(C`jp2\*(C'\fR (the default) that makes it possible to store non-rgb pix_fmts. .SS "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. .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 "\fBslice_mode\fR" 4 .IX Item "slice_mode" Set slice mode. Can assume one of the following possible values: .RS 4 .IP "\fBfixed\fR" 4 .IX Item "fixed" a fixed number of slices .IP "\fBrowmb\fR" 4 .IX Item "rowmb" one slice per row of macroblocks .IP "\fBauto\fR" 4 .IX Item "auto" automatic number of slices according to number of threads .IP "\fBdyn\fR" 4 .IX Item "dyn" dynamic slicing .RE .RS 4 .Sp Default value is \fBauto\fR. .RE .IP "\fBloopfilter\fR" 4 .IX Item "loopfilter" Enable loop filter, if set to 1 (automatically enabled). To disable set a value of 0. .IP "\fBprofile\fR" 4 .IX Item "profile" Set profile restrictions. If set to the value of \fBmain\fR enable \&\s-1CABAC\s0 (set the \f(CW\*(C`SEncParamExt.iEntropyCodingModeFlag\*(C'\fR flag to 1). .IP "\fBmax_nal_size\fR" 4 .IX Item "max_nal_size" Set maximum \s-1NAL\s0 size in bytes. .IP "\fBallow_skip_frames\fR" 4 .IX Item "allow_skip_frames" Allow skipping frames to hit the target bitrate if set to 1. .SS "libtheora" .IX Subsection "libtheora" libtheora Theora encoder wrapper. .PP Requires the presence of the libtheora headers and library during configuration. You need to explicitly configure the build with \&\f(CW\*(C`\-\-enable\-libtheora\*(C'\fR. .PP For more information about the libtheora project see <\fBhttp://www.theora.org/\fR>. .PP \fIOptions\fR .IX Subsection "Options" .PP The following global options are mapped to internal libtheora options which affect the quality and the bitrate of the encoded stream. .IP "\fBb\fR" 4 .IX Item "b" Set the video bitrate in bit/s for \s-1CBR\s0 (Constant Bit Rate) mode. In case \s-1VBR\s0 (Variable Bit Rate) mode is enabled this option is ignored. .IP "\fBflags\fR" 4 .IX Item "flags" Used to enable constant quality mode (\s-1VBR\s0) encoding through the \&\fBqscale\fR flag, and to enable the \f(CW\*(C`pass1\*(C'\fR and \f(CW\*(C`pass2\*(C'\fR modes. .IP "\fBg\fR" 4 .IX Item "g" Set the \s-1GOP\s0 size. .IP "\fBglobal_quality\fR" 4 .IX Item "global_quality" Set the global quality as an integer in lambda units. .Sp Only relevant when \s-1VBR\s0 mode is enabled with \f(CW\*(C`flags +qscale\*(C'\fR. The value is converted to \s-1QP\s0 units by dividing it by \f(CW\*(C`FF_QP2LAMBDA\*(C'\fR, clipped in the [0 \- 10] range, and then multiplied by 6.3 to get a value in the native libtheora range [0\-63]. A higher value corresponds to a higher quality. .IP "\fBq\fR" 4 .IX Item "q" Enable \s-1VBR\s0 mode when set to a non-negative value, and set constant quality value as a double floating point value in \s-1QP\s0 units. .Sp The value is clipped in the [0\-10] range, and then multiplied by 6.3 to get a value in the native libtheora range [0\-63]. .Sp This option is valid only using the \fBffmpeg\fR command-line tool. For library interface users, use \fBglobal_quality\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Set maximum constant quality (\s-1VBR\s0) encoding with \fBffmpeg\fR: .Sp .Vb 1 \& ffmpeg \-i INPUT \-codec:v libtheora \-q:v 10 OUTPUT.ogg .Ve .IP "\(bu" 4 Use \fBffmpeg\fR to convert a \s-1CBR 1000\s0 kbps Theora video stream: .Sp .Vb 1 \& ffmpeg \-i INPUT \-codec:v libtheora \-b:v 1000k OUTPUT.ogg .Ve .SS "libvpx" .IX Subsection "libvpx" \&\s-1VP8/VP9\s0 format supported through libvpx. .PP Requires the presence of the libvpx headers and library during configuration. You need to explicitly configure the build with \f(CW\*(C`\-\-enable\-libvpx\*(C'\fR. .PP \fIOptions\fR .IX Subsection "Options" .PP The following options are supported by the libvpx wrapper. The \&\fBvpxenc\fR\-equivalent options or values are listed in parentheses for easy migration. .PP To reduce the duplication of documentation, only the private options and some others requiring special attention are documented here. For the documentation of the undocumented generic options, see \&\fBthe Codec Options chapter\fR. .PP To get more documentation of the libvpx options, invoke the command \&\fBffmpeg \-h encoder=libvpx\fR, \fBffmpeg \-h encoder=libvpx\-vp9\fR or \&\fBvpxenc \-\-help\fR. Further information is available in the libvpx \s-1API\s0 documentation. .IP "\fBb (\fR\fItarget-bitrate\fR\fB)\fR" 4 .IX Item "b (target-bitrate)" Set bitrate in bits/s. Note that FFmpeg's \fBb\fR option is expressed in bits/s, while \fBvpxenc\fR's \fBtarget-bitrate\fR is in kilobits/s. .IP "\fBg (\fR\fIkf-max-dist\fR\fB)\fR" 4 .IX Item "g (kf-max-dist)" .PD 0 .IP "\fBkeyint_min (\fR\fIkf-min-dist\fR\fB)\fR" 4 .IX Item "keyint_min (kf-min-dist)" .IP "\fBqmin (\fR\fImin-q\fR\fB)\fR" 4 .IX Item "qmin (min-q)" .IP "\fBqmax (\fR\fImax-q\fR\fB)\fR" 4 .IX Item "qmax (max-q)" .IP "\fBbufsize (\fR\fIbuf-sz\fR\fB,\fR \fIbuf-optimal-sz\fR\fB)\fR" 4 .IX Item "bufsize (buf-sz, buf-optimal-sz)" .PD Set ratecontrol buffer size (in bits). Note \fBvpxenc\fR's options are specified in milliseconds, the libvpx wrapper converts this value as follows: \&\f(CW\*(C`buf\-sz = bufsize * 1000 / bitrate\*(C'\fR, \&\f(CW\*(C`buf\-optimal\-sz = bufsize * 1000 / bitrate * 5 / 6\*(C'\fR. .IP "\fBrc_init_occupancy (\fR\fIbuf-initial-sz\fR\fB)\fR" 4 .IX Item "rc_init_occupancy (buf-initial-sz)" Set number of bits which should be loaded into the rc buffer before decoding starts. Note \fBvpxenc\fR's option is specified in milliseconds, the libvpx wrapper converts this value as follows: \&\f(CW\*(C`rc_init_occupancy * 1000 / bitrate\*(C'\fR. .IP "\fBundershoot-pct\fR" 4 .IX Item "undershoot-pct" Set datarate undershoot (min) percentage of the target bitrate. .IP "\fBovershoot-pct\fR" 4 .IX Item "overshoot-pct" Set datarate overshoot (max) percentage of the target bitrate. .IP "\fBskip_threshold (\fR\fIdrop-frame\fR\fB)\fR" 4 .IX Item "skip_threshold (drop-frame)" .PD 0 .IP "\fBqcomp (\fR\fIbias-pct\fR\fB)\fR" 4 .IX Item "qcomp (bias-pct)" .IP "\fBmaxrate (\fR\fImaxsection-pct\fR\fB)\fR" 4 .IX Item "maxrate (maxsection-pct)" .PD Set \s-1GOP\s0 max bitrate in bits/s. Note \fBvpxenc\fR's option is specified as a percentage of the target bitrate, the libvpx wrapper converts this value as follows: \f(CW\*(C`(maxrate * 100 / bitrate)\*(C'\fR. .IP "\fBminrate (\fR\fIminsection-pct\fR\fB)\fR" 4 .IX Item "minrate (minsection-pct)" Set \s-1GOP\s0 min bitrate in bits/s. Note \fBvpxenc\fR's option is specified as a percentage of the target bitrate, the libvpx wrapper converts this value as follows: \f(CW\*(C`(minrate * 100 / bitrate)\*(C'\fR. .IP "\fBminrate, maxrate, b\fR \fIend\-usage=cbr\fR" 4 .IX Item "minrate, maxrate, b end-usage=cbr" \&\f(CW\*(C`(minrate == maxrate == bitrate)\*(C'\fR. .IP "\fBcrf (\fR\fIend\-usage=cq\fR\fB,\fR \fIcq-level\fR\fB)\fR" 4 .IX Item "crf (end-usage=cq, cq-level)" .PD 0 .IP "\fBtune (\fR\fItune\fR\fB)\fR" 4 .IX Item "tune (tune)" .RS 4 .IP "\fBpsnr (\fR\fIpsnr\fR\fB)\fR" 4 .IX Item "psnr (psnr)" .IP "\fBssim (\fR\fIssim\fR\fB)\fR" 4 .IX Item "ssim (ssim)" .RE .RS 4 .RE .IP "\fBquality, deadline (\fR\fIdeadline\fR\fB)\fR" 4 .IX Item "quality, deadline (deadline)" .RS 4 .IP "\fBbest\fR" 4 .IX Item "best" .PD Use best quality deadline. Poorly named and quite slow, this option should be avoided as it may give worse quality output than good. .IP "\fBgood\fR" 4 .IX Item "good" Use good quality deadline. This is a good trade-off between speed and quality when used with the \fBcpu-used\fR option. .IP "\fBrealtime\fR" 4 .IX Item "realtime" Use realtime quality deadline. .RE .RS 4 .RE .IP "\fBspeed, cpu-used (\fR\fIcpu-used\fR\fB)\fR" 4 .IX Item "speed, cpu-used (cpu-used)" Set quality/speed ratio modifier. Higher values speed up the encode at the cost of quality. .IP "\fBnr (\fR\fInoise-sensitivity\fR\fB)\fR" 4 .IX Item "nr (noise-sensitivity)" .PD 0 .IP "\fBstatic-thresh\fR" 4 .IX Item "static-thresh" .PD Set a change threshold on blocks below which they will be skipped by the encoder. .IP "\fBslices (\fR\fItoken-parts\fR\fB)\fR" 4 .IX Item "slices (token-parts)" Note that FFmpeg's \fBslices\fR option gives the total number of partitions, while \fBvpxenc\fR's \fBtoken-parts\fR is given as \&\f(CW\*(C`log2(partitions)\*(C'\fR. .IP "\fBmax-intra-rate\fR" 4 .IX Item "max-intra-rate" Set maximum I\-frame bitrate as a percentage of the target bitrate. A value of 0 means unlimited. .IP "\fBforce_key_frames\fR" 4 .IX Item "force_key_frames" \&\f(CW\*(C`VPX_EFLAG_FORCE_KF\*(C'\fR .IP "\fBAlternate reference frame related\fR" 4 .IX Item "Alternate reference frame related" .RS 4 .PD 0 .IP "\fBauto-alt-ref\fR" 4 .IX Item "auto-alt-ref" .PD Enable use of alternate reference frames (2\-pass only). 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. .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 "\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. .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\-qscale\fR \fIfloat\fR" 4 .IX Item "-qscale float" For lossy encoding, this controls image quality, 0 to 100. For lossless encoding, this controls the effort and time spent at compressing more. The default value is 75. Note that for usage via libavcodec, this option is called \&\fIglobal_quality\fR and must be multiplied by \fI\s-1FF_QP2LAMBDA\s0\fR. .IP "\fB\-preset\fR \fItype\fR" 4 .IX Item "-preset type" Configuration preset. This does some automatic settings based on the general type of the image. .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" Do not use a preset. .IP "\fBdefault\fR" 4 .IX Item "default" Use the encoder default. .IP "\fBpicture\fR" 4 .IX Item "picture" Digital picture, like portrait, inner shot .IP "\fBphoto\fR" 4 .IX Item "photo" Outdoor photograph, with natural lighting .IP "\fBdrawing\fR" 4 .IX Item "drawing" Hand or line drawing, with high-contrast details .IP "\fBicon\fR" 4 .IX Item "icon" Small-sized colorful images .IP "\fBtext\fR" 4 .IX Item "text" Text-like .RE .RS 4 .RE .SS "libx264, libx264rgb" .IX Subsection "libx264, libx264rgb" x264 H.264/MPEG\-4 \s-1AVC\s0 encoder wrapper. .PP This encoder requires the presence of the libx264 headers and library during configuration. You need to explicitly configure the build with \&\f(CW\*(C`\-\-enable\-libx264\*(C'\fR. .PP libx264 supports an impressive number of features, including 8x8 and 4x4 adaptive spatial transform, adaptive B\-frame placement, \s-1CAVLC/CABAC\s0 entropy coding, interlacing (\s-1MBAFF\s0), lossless mode, psy optimizations for detail retention (adaptive quantization, psy-RD, psy-trellis). .PP Many libx264 encoder options are mapped to FFmpeg global codec options, while unique encoder options are provided through private options. Additionally the \fBx264opts\fR and \fBx264\-params\fR private options allows one to pass a list of key=value tuples as accepted by the libx264 \f(CW\*(C`x264_param_parse\*(C'\fR function. .PP The x264 project website is at <\fBhttp://www.videolan.org/developers/x264.html\fR>. .PP The libx264rgb encoder is the same as libx264, except it accepts packed \s-1RGB\s0 pixel formats as input instead of \s-1YUV.\s0 .PP \fISupported Pixel Formats\fR .IX Subsection "Supported Pixel Formats" .PP x264 supports 8\- to 10\-bit color spaces. The exact bit depth is controlled at x264's configure time. FFmpeg only supports one bit depth in one particular build. In other words, it is not possible to build one FFmpeg with multiple versions of x264 with different bit depths. .PP \fIOptions\fR .IX Subsection "Options" .PP The following options are supported by the libx264 wrapper. The \&\fBx264\fR\-equivalent options or values are listed in parentheses for easy migration. .PP To reduce the duplication of documentation, only the private options and some others requiring special attention are documented here. For the documentation of the undocumented generic options, see \&\fBthe Codec Options chapter\fR. .PP To get a more accurate and extensive documentation of the libx264 options, invoke the command \fBx264 \-\-fullhelp\fR or consult the libx264 documentation. .IP "\fBb (\fR\fIbitrate\fR\fB)\fR" 4 .IX Item "b (bitrate)" Set bitrate in bits/s. Note that FFmpeg's \fBb\fR option is expressed in bits/s, while \fBx264\fR's \fBbitrate\fR is in kilobits/s. .IP "\fBbf (\fR\fIbframes\fR\fB)\fR" 4 .IX Item "bf (bframes)" .PD 0 .IP "\fBg (\fR\fIkeyint\fR\fB)\fR" 4 .IX Item "g (keyint)" .IP "\fBqmin (\fR\fIqpmin\fR\fB)\fR" 4 .IX Item "qmin (qpmin)" .PD Minimum quantizer scale. .IP "\fBqmax (\fR\fIqpmax\fR\fB)\fR" 4 .IX Item "qmax (qpmax)" Maximum quantizer scale. .IP "\fBqdiff (\fR\fIqpstep\fR\fB)\fR" 4 .IX Item "qdiff (qpstep)" Maximum difference between quantizer scales. .IP "\fBqblur (\fR\fIqblur\fR\fB)\fR" 4 .IX Item "qblur (qblur)" Quantizer curve blur .IP "\fBqcomp (\fR\fIqcomp\fR\fB)\fR" 4 .IX Item "qcomp (qcomp)" Quantizer curve compression factor .IP "\fBrefs (\fR\fIref\fR\fB)\fR" 4 .IX Item "refs (ref)" Number of reference frames each P\-frame can use. The range is from \fI0\-16\fR. .IP "\fBsc_threshold (\fR\fIscenecut\fR\fB)\fR" 4 .IX Item "sc_threshold (scenecut)" Sets the threshold for the scene change detection. .IP "\fBtrellis (\fR\fItrellis\fR\fB)\fR" 4 .IX Item "trellis (trellis)" Performs Trellis quantization to increase efficiency. Enabled by default. .IP "\fBnr (\fR\fInr\fR\fB)\fR" 4 .IX Item "nr (nr)" .PD 0 .IP "\fBme_range (\fR\fImerange\fR\fB)\fR" 4 .IX Item "me_range (merange)" .PD Maximum range of the motion search in pixels. .IP "\fBme_method (\fR\fIme\fR\fB)\fR" 4 .IX Item "me_method (me)" Set motion estimation method. Possible values in the decreasing order of speed: .RS 4 .IP "\fBdia (\fR\fIdia\fR\fB)\fR" 4 .IX Item "dia (dia)" .PD 0 .IP "\fBepzs (\fR\fIdia\fR\fB)\fR" 4 .IX Item "epzs (dia)" .PD Diamond search with radius 1 (fastest). \fBepzs\fR is an alias for \&\fBdia\fR. .IP "\fBhex (\fR\fIhex\fR\fB)\fR" 4 .IX Item "hex (hex)" Hexagonal search with radius 2. .IP "\fBumh (\fR\fIumh\fR\fB)\fR" 4 .IX Item "umh (umh)" Uneven multi-hexagon search. .IP "\fBesa (\fR\fIesa\fR\fB)\fR" 4 .IX Item "esa (esa)" Exhaustive search. .IP "\fBtesa (\fR\fItesa\fR\fB)\fR" 4 .IX Item "tesa (tesa)" Hadamard exhaustive search (slowest). .RE .RS 4 .RE .IP "\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)" .PD 0 .IP "\fBpreset (\fR\fIpreset\fR\fB)\fR" 4 .IX Item "preset (preset)" .PD Set the encoding preset. .IP "\fBtune (\fR\fItune\fR\fB)\fR" 4 .IX Item "tune (tune)" Set tuning of the encoding params. .IP "\fBprofile (\fR\fIprofile\fR\fB)\fR" 4 .IX Item "profile (profile)" Set profile restrictions. .IP "\fBfastfirstpass\fR" 4 .IX Item "fastfirstpass" Enable fast settings when encoding first pass, when set to 1. When set to 0, it has the same effect of \fBx264\fR's \&\fB\-\-slow\-firstpass\fR option. .IP "\fBcrf (\fR\fIcrf\fR\fB)\fR" 4 .IX Item "crf (crf)" Set the quality for constant quality mode. .IP "\fBcrf_max (\fR\fIcrf-max\fR\fB)\fR" 4 .IX Item "crf_max (crf-max)" In \s-1CRF\s0 mode, prevents \s-1VBV\s0 from lowering quality beyond this point. .IP "\fBqp (\fR\fIqp\fR\fB)\fR" 4 .IX Item "qp (qp)" Set constant quantization rate control method parameter. .IP "\fBaq-mode (\fR\fIaq-mode\fR\fB)\fR" 4 .IX Item "aq-mode (aq-mode)" Set \s-1AQ\s0 method. Possible values: .RS 4 .IP "\fBnone (\fR\fI0\fR\fB)\fR" 4 .IX Item "none (0)" Disabled. .IP "\fBvariance (\fR\fI1\fR\fB)\fR" 4 .IX Item "variance (1)" Variance \s-1AQ\s0 (complexity mask). .IP "\fBautovariance (\fR\fI2\fR\fB)\fR" 4 .IX Item "autovariance (2)" Auto-variance \s-1AQ\s0 (experimental). .RE .RS 4 .RE .IP "\fBaq-strength (\fR\fIaq-strength\fR\fB)\fR" 4 .IX Item "aq-strength (aq-strength)" Set \s-1AQ\s0 strength, reduce blocking and blurring in flat and textured areas. .IP "\fBpsy\fR" 4 .IX Item "psy" Use psychovisual optimizations when set to 1. When set to 0, it has the same effect as \fBx264\fR's \fB\-\-no\-psy\fR option. .IP "\fBpsy-rd (\fR\fIpsy-rd\fR\fB)\fR" 4 .IX Item "psy-rd (psy-rd)" Set strength of psychovisual optimization, in \&\fIpsy-rd\fR:\fIpsy-trellis\fR format. .IP "\fBrc-lookahead (\fR\fIrc-lookahead\fR\fB)\fR" 4 .IX Item "rc-lookahead (rc-lookahead)" Set number of frames to look ahead for frametype and ratecontrol. .IP "\fBweightb\fR" 4 .IX Item "weightb" Enable weighted prediction for B\-frames when set to 1. When set to 0, it has the same effect as \fBx264\fR's \fB\-\-no\-weightb\fR option. .IP "\fBweightp (\fR\fIweightp\fR\fB)\fR" 4 .IX Item "weightp (weightp)" Set weighted prediction method for P\-frames. Possible values: .RS 4 .IP "\fBnone (\fR\fI0\fR\fB)\fR" 4 .IX Item "none (0)" Disabled .IP "\fBsimple (\fR\fI1\fR\fB)\fR" 4 .IX Item "simple (1)" Enable only weighted refs .IP "\fBsmart (\fR\fI2\fR\fB)\fR" 4 .IX Item "smart (2)" Enable both weighted refs and duplicates .RE .RS 4 .RE .IP "\fBssim (\fR\fIssim\fR\fB)\fR" 4 .IX Item "ssim (ssim)" Enable calculation and printing \s-1SSIM\s0 stats after the encoding. .IP "\fBintra-refresh (\fR\fIintra-refresh\fR\fB)\fR" 4 .IX Item "intra-refresh (intra-refresh)" Enable the use of Periodic Intra Refresh instead of \s-1IDR\s0 frames when set to 1. .IP "\fBavcintra-class (\fR\fIclass\fR\fB)\fR" 4 .IX Item "avcintra-class (class)" Configure the encoder to generate AVC-Intra. Valid values are 50,100 and 200 .IP "\fBbluray-compat (\fR\fIbluray-compat\fR\fB)\fR" 4 .IX Item "bluray-compat (bluray-compat)" Configure the encoder to be compatible with the bluray standard. It is a shorthand for setting \*(L"bluray\-compat=1 force\-cfr=1\*(R". .IP "\fBb\-bias (\fR\fIb\-bias\fR\fB)\fR" 4 .IX Item "b-bias (b-bias)" Set the influence on how often B\-frames are used. .IP "\fBb\-pyramid (\fR\fIb\-pyramid\fR\fB)\fR" 4 .IX Item "b-pyramid (b-pyramid)" Set method for keeping of some B\-frames as references. Possible values: .RS 4 .IP "\fBnone (\fR\fInone\fR\fB)\fR" 4 .IX Item "none (none)" Disabled. .IP "\fBstrict (\fR\fIstrict\fR\fB)\fR" 4 .IX Item "strict (strict)" Strictly hierarchical pyramid. .IP "\fBnormal (\fR\fInormal\fR\fB)\fR" 4 .IX Item "normal (normal)" Non-strict (not Blu-ray compatible). .RE .RS 4 .RE .IP "\fBmixed-refs\fR" 4 .IX Item "mixed-refs" Enable the use of one reference per partition, as opposed to one reference per macroblock when set to 1. When set to 0, it has the same effect as \fBx264\fR's \fB\-\-no\-mixed\-refs\fR option. .IP "\fB8x8dct\fR" 4 .IX Item "8x8dct" Enable adaptive spatial transform (high profile 8x8 transform) when set to 1. When set to 0, it has the same effect as \&\fBx264\fR's \fB\-\-no\-8x8dct\fR option. .IP "\fBfast-pskip\fR" 4 .IX Item "fast-pskip" Enable early \s-1SKIP\s0 detection on P\-frames when set to 1. When set to 0, it has the same effect as \fBx264\fR's \&\fB\-\-no\-fast\-pskip\fR option. .IP "\fBaud (\fR\fIaud\fR\fB)\fR" 4 .IX Item "aud (aud)" Enable use of access unit delimiters when set to 1. .IP "\fBmbtree\fR" 4 .IX Item "mbtree" Enable use macroblock tree ratecontrol when set to 1. When set to 0, it has the same effect as \fBx264\fR's \&\fB\-\-no\-mbtree\fR option. .IP "\fBdeblock (\fR\fIdeblock\fR\fB)\fR" 4 .IX Item "deblock (deblock)" Set loop filter parameters, in \fIalpha\fR:\fIbeta\fR form. .IP "\fBcplxblur (\fR\fIcplxblur\fR\fB)\fR" 4 .IX Item "cplxblur (cplxblur)" Set fluctuations reduction in \s-1QP\s0 (before curve compression). .IP "\fBpartitions (\fR\fIpartitions\fR\fB)\fR" 4 .IX Item "partitions (partitions)" Set partitions to consider as a comma-separated list of. Possible values in the list: .RS 4 .IP "\fBp8x8\fR" 4 .IX Item "p8x8" 8x8 P\-frame partition. .IP "\fBp4x4\fR" 4 .IX Item "p4x4" 4x4 P\-frame partition. .IP "\fBb8x8\fR" 4 .IX Item "b8x8" 4x4 B\-frame partition. .IP "\fBi8x8\fR" 4 .IX Item "i8x8" 8x8 I\-frame partition. .IP "\fBi4x4\fR" 4 .IX Item "i4x4" 4x4 I\-frame partition. (Enabling \fBp4x4\fR requires \fBp8x8\fR to be enabled. Enabling \&\fBi8x8\fR requires adaptive spatial transform (\fB8x8dct\fR option) to be enabled.) .IP "\fBnone (\fR\fInone\fR\fB)\fR" 4 .IX Item "none (none)" Do not consider any partitions. .IP "\fBall (\fR\fIall\fR\fB)\fR" 4 .IX Item "all (all)" Consider every partition. .RE .RS 4 .RE .IP "\fBdirect-pred (\fR\fIdirect\fR\fB)\fR" 4 .IX Item "direct-pred (direct)" Set direct \s-1MV\s0 prediction mode. Possible values: .RS 4 .IP "\fBnone (\fR\fInone\fR\fB)\fR" 4 .IX Item "none (none)" Disable \s-1MV\s0 prediction. .IP "\fBspatial (\fR\fIspatial\fR\fB)\fR" 4 .IX Item "spatial (spatial)" Enable spatial predicting. .IP "\fBtemporal (\fR\fItemporal\fR\fB)\fR" 4 .IX Item "temporal (temporal)" Enable temporal predicting. .IP "\fBauto (\fR\fIauto\fR\fB)\fR" 4 .IX Item "auto (auto)" Automatically decided. .RE .RS 4 .RE .IP "\fBslice-max-size (\fR\fIslice-max-size\fR\fB)\fR" 4 .IX Item "slice-max-size (slice-max-size)" Set the limit of the size of each slice in bytes. If not specified but \s-1RTP\s0 payload size (\fBps\fR) is specified, that is used. .IP "\fBstats (\fR\fIstats\fR\fB)\fR" 4 .IX Item "stats (stats)" Set the file name for multi-pass stats. .IP "\fBnal-hrd (\fR\fInal-hrd\fR\fB)\fR" 4 .IX Item "nal-hrd (nal-hrd)" Set signal \s-1HRD\s0 information (requires \fBvbv-bufsize\fR to be set). Possible values: .RS 4 .IP "\fBnone (\fR\fInone\fR\fB)\fR" 4 .IX Item "none (none)" Disable \s-1HRD\s0 information signaling. .IP "\fBvbr (\fR\fIvbr\fR\fB)\fR" 4 .IX Item "vbr (vbr)" Variable bit rate. .IP "\fBcbr (\fR\fIcbr\fR\fB)\fR" 4 .IX Item "cbr (cbr)" Constant bit rate (not allowed in \s-1MP4\s0 container). .RE .RS 4 .RE .IP "\fBx264opts (N.A.)\fR" 4 .IX Item "x264opts (N.A.)" Set any x264 option, see \fBx264 \-\-fullhelp\fR for a list. .Sp Argument is a list of \fIkey\fR=\fIvalue\fR couples separated by \&\*(L":\*(R". In \fIfilter\fR and \fIpsy-rd\fR options that use \*(L":\*(R" as a separator themselves, use \*(L",\*(R" instead. They accept it as well since long ago but this is kept undocumented for some reason. .Sp For example to specify libx264 encoding options with \fBffmpeg\fR: .Sp .Vb 1 \& ffmpeg \-i foo.mpg \-c:v libx264 \-x264opts keyint=123:min\-keyint=20 \-an out.mkv .Ve .IP "\fBa53cc\fR \fIboolean\fR" 4 .IX Item "a53cc boolean" Import closed captions (which must be \s-1ATSC\s0 compatible format) into output. Only the mpeg2 and h264 decoders provide these. Default is 1 (on). .IP "\fBx264\-params (N.A.)\fR" 4 .IX Item "x264-params (N.A.)" Override the x264 configuration using a :\-separated list of key=value parameters. .Sp This option is functionally the same as the \fBx264opts\fR, but is duplicated for compatibility with the Libav fork. .Sp For example to specify libx264 encoding options with \fBffmpeg\fR: .Sp .Vb 3 \& ffmpeg \-i INPUT \-c:v libx264 \-x264\-params level=30:bframes=0:weightp=0:\e \& cabac=0:ref=1:vbv\-maxrate=768:vbv\-bufsize=2000:analyse=all:me=umh:\e \& no\-fast\-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT .Ve .PP Encoding ffpresets for common usages are provided so they can be used with the general presets system (e.g. passing the \fBpre\fR option). .SS "libx265" .IX Subsection "libx265" x265 H.265/HEVC encoder wrapper. .PP This encoder requires the presence of the libx265 headers and library during configuration. You need to explicitly configure the build with \&\fB\-\-enable\-libx265\fR. .PP \fIOptions\fR .IX Subsection "Options" .IP "\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 "\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 "libxvid" .IX Subsection "libxvid" Xvid \s-1MPEG\-4\s0 Part 2 encoder wrapper. .PP This encoder requires the presence of the libxvidcore headers and library during configuration. You need to explicitly configure the build with \&\f(CW\*(C`\-\-enable\-libxvid \-\-enable\-gpl\*(C'\fR. .PP The native \f(CW\*(C`mpeg4\*(C'\fR encoder supports the \s-1MPEG\-4\s0 Part 2 format, so users can encode to this format without this library. .PP \fIOptions\fR .IX Subsection "Options" .PP The following options are supported by the libxvid wrapper. Some of the following options are listed but are not documented, and correspond to shared codec options. See \fBthe Codec Options chapter\fR for their documentation. The other shared options which are not listed have no effect for the libxvid encoder. .IP "\fBb\fR" 4 .IX Item "b" .PD 0 .IP "\fBg\fR" 4 .IX Item "g" .IP "\fBqmin\fR" 4 .IX Item "qmin" .IP "\fBqmax\fR" 4 .IX Item "qmax" .IP "\fBmpeg_quant\fR" 4 .IX Item "mpeg_quant" .IP "\fBthreads\fR" 4 .IX Item "threads" .IP "\fBbf\fR" 4 .IX Item "bf" .IP "\fBb_qfactor\fR" 4 .IX Item "b_qfactor" .IP "\fBb_qoffset\fR" 4 .IX Item "b_qoffset" .IP "\fBflags\fR" 4 .IX Item "flags" .PD Set specific encoding flags. Possible values: .RS 4 .IP "\fBmv4\fR" 4 .IX Item "mv4" Use four motion vector by macroblock. .IP "\fBaic\fR" 4 .IX Item "aic" Enable high quality \s-1AC\s0 prediction. .IP "\fBgray\fR" 4 .IX Item "gray" Only encode grayscale. .IP "\fBgmc\fR" 4 .IX Item "gmc" Enable the use of global motion compensation (\s-1GMC\s0). .IP "\fBqpel\fR" 4 .IX Item "qpel" Enable quarter-pixel motion compensation. .IP "\fBcgop\fR" 4 .IX Item "cgop" Enable closed \s-1GOP.\s0 .IP "\fBglobal_header\fR" 4 .IX Item "global_header" Place global headers in extradata instead of every keyframe. .RE .RS 4 .RE .IP "\fBtrellis\fR" 4 .IX Item "trellis" .PD 0 .IP "\fBme_method\fR" 4 .IX Item "me_method" .PD Set motion estimation method. Possible values in decreasing order of speed and increasing order of quality: .RS 4 .IP "\fBzero\fR" 4 .IX Item "zero" Use no motion estimation (default). .IP "\fBphods\fR" 4 .IX Item "phods" .PD 0 .IP "\fBx1\fR" 4 .IX Item "x1" .IP "\fBlog\fR" 4 .IX Item "log" .PD Enable advanced diamond zonal search for 16x16 blocks and half-pixel refinement for 16x16 blocks. \fBx1\fR and \fBlog\fR are aliases for \&\fBphods\fR. .IP "\fBepzs\fR" 4 .IX Item "epzs" Enable all of the things described above, plus advanced diamond zonal search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion estimation on chroma planes. .IP "\fBfull\fR" 4 .IX Item "full" Enable all of the things described above, plus extended 16x16 and 8x8 blocks search. .RE .RS 4 .RE .IP "\fBmbd\fR" 4 .IX Item "mbd" Set macroblock decision algorithm. Possible values in the increasing order of quality: .RS 4 .IP "\fBsimple\fR" 4 .IX Item "simple" Use macroblock comparing function algorithm (default). .IP "\fBbits\fR" 4 .IX Item "bits" Enable rate distortion-based half pixel and quarter pixel refinement for 16x16 blocks. .IP "\fBrd\fR" 4 .IX Item "rd" Enable all of the things described above, plus rate distortion-based half pixel and quarter pixel refinement for 8x8 blocks, and rate distortion-based search using square pattern. .RE .RS 4 .RE .IP "\fBlumi_aq\fR" 4 .IX Item "lumi_aq" Enable lumi masking adaptive quantization when set to 1. Default is 0 (disabled). .IP "\fBvariance_aq\fR" 4 .IX Item "variance_aq" Enable variance adaptive quantization when set to 1. Default is 0 (disabled). .Sp When combined with \fBlumi_aq\fR, the resulting quality will not be better than any of the two specified individually. In other words, the resulting quality will be the worse one of the two effects. .IP "\fBssim\fR" 4 .IX Item "ssim" Set structural similarity (\s-1SSIM\s0) displaying method. Possible values: .RS 4 .IP "\fBoff\fR" 4 .IX Item "off" Disable displaying of \s-1SSIM\s0 information. .IP "\fBavg\fR" 4 .IX Item "avg" Output average \s-1SSIM\s0 at the end of encoding to stdout. The format of showing the average \s-1SSIM\s0 is: .Sp .Vb 1 \& Average SSIM: %f .Ve .Sp For users who are not familiar with C, \f(CW%f\fR means a float number, or a decimal (e.g. 0.939232). .IP "\fBframe\fR" 4 .IX Item "frame" Output both per-frame \s-1SSIM\s0 data during encoding and average \s-1SSIM\s0 at the end of encoding to stdout. The format of per-frame information is: .Sp .Vb 1 \& SSIM: avg: %1.3f min: %1.3f max: %1.3f .Ve .Sp For users who are not familiar with C, \f(CW%1\fR.3f means a float number rounded to 3 digits after the dot (e.g. 0.932). .RE .RS 4 .RE .IP "\fBssim_acc\fR" 4 .IX Item "ssim_acc" Set \s-1SSIM\s0 accuracy. Valid options are integers within the range of 0\-4, while 0 gives the most accurate result and 4 computes the fastest. .SS "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 "mpeg2" .IX Subsection "mpeg2" \&\s-1MPEG\-2\s0 video encoder. .PP \fIOptions\fR .IX Subsection "Options" .IP "\fBprofile\fR \fIinteger\fR" 4 .IX Item "profile integer" Select the mpeg2 profile to encode: .RS 4 .IP "\fB422\fR" 4 .IX Item "422" .PD 0 .IP "\fBmain\fR" 4 .IX Item "main" .IP "\fBss\fR" 4 .IX Item "ss" .PD Spatially Scalable .IP "\fBsnr\fR" 4 .IX Item "snr" \&\s-1SNR\s0 Scalable .IP "\fBhigh\fR" 4 .IX Item "high" .PD 0 .IP "\fBsimple\fR" 4 .IX Item "simple" .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\s0 and \s-1VP9\s0) .PP The ratecontrol method is selected as follows: .IP "\(bu" 4 When \fBglobal_quality\fR is specified, a quality-based mode is used. Specifically this means either .RS 4 .IP "\-" 4 \&\fI\s-1CQP\s0\fR \- constant quantizer scale, when the \fBqscale\fR codec flag is also set (the \fB\-qscale\fR ffmpeg option). .IP "\-" 4 \&\fI\s-1LA_ICQ\s0\fR \- intelligent constant quality with lookahead, when the \&\fBlook_ahead\fR option is also set. .IP "\-" 4 \&\fI\s-1ICQ\s0\fR \*(-- intelligent constant quality otherwise. .RE .RS 4 .RE .IP "\(bu" 4 Otherwise, a bitrate-based mode is used. For all of those, you should specify at least the desired average bitrate with the \fBb\fR option. .RS 4 .IP "\-" 4 \&\fI\s-1LA\s0\fR \- \s-1VBR\s0 with lookahead, when the \fBlook_ahead\fR option is specified. .IP "\-" 4 \&\fI\s-1VCM\s0\fR \- video conferencing mode, when the \fBvcm\fR option is set. .IP "\-" 4 \&\fI\s-1CBR\s0\fR \- constant bitrate, when \fBmaxrate\fR is specified and equal to the average bitrate. .IP "\-" 4 \&\fI\s-1VBR\s0\fR \- variable bitrate, when \fBmaxrate\fR is specified, but is higher than the average bitrate. .IP "\-" 4 \&\fI\s-1AVBR\s0\fR \- average \s-1VBR\s0 mode, when \fBmaxrate\fR is not specified. This mode is further configured by the \fBavbr_accuracy\fR and \&\fBavbr_convergence\fR options. .RE .RS 4 .RE .PP Note that depending on your system, a different mode than the one you specified may be selected by the encoder. Set the verbosity level to \fIverbose\fR or higher to see the actual settings used by the \s-1QSV\s0 runtime. .PP Additional libavcodec global options are mapped to \s-1MSDK\s0 options as follows: .IP "\(bu" 4 \&\fBg/gop_size\fR \-> \fBGopPicSize\fR .IP "\(bu" 4 \&\fBbf/max_b_frames\fR+1 \-> \fBGopRefDist\fR .IP "\(bu" 4 \&\fBrc_init_occupancy/rc_initial_buffer_occupancy\fR \-> \&\fBInitialDelayInKB\fR .IP "\(bu" 4 \&\fBslices\fR \-> \fBNumSlice\fR .IP "\(bu" 4 \&\fBrefs\fR \-> \fBNumRefFrame\fR .IP "\(bu" 4 \&\fBb_strategy/b_frame_strategy\fR \-> \fBBRefType\fR .IP "\(bu" 4 \&\fBcgop/CLOSED_GOP\fR codec flag \-> \fBGopOptFlag\fR .IP "\(bu" 4 For the \fI\s-1CQP\s0\fR mode, the \fBi_qfactor/i_qoffset\fR and \&\fBb_qfactor/b_qoffset\fR set the difference between \fI\s-1QPP\s0\fR and \fI\s-1QPI\s0\fR, and \fI\s-1QPP\s0\fR and \fI\s-1QPB\s0\fR respectively. .IP "\(bu" 4 Setting the \fBcoder\fR option to the value \fIvlc\fR will make the H.264 encoder use \s-1CAVLC\s0 instead of \s-1CABAC.\s0 .SS "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 "\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 .PP Each encoder also has its own specific options: .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 .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 "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 (\fInum_units_in_display_tick / time_scale\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 "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 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 .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 "\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 of the stream in the \s-1VUI\s0 parameters. .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 (num_units_in_tick / time_scale) 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 "\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 "\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. .PP A new single global \s-1PPS\s0 is created, and all of the redundant PPSs within the stream are removed. .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 (num_units_in_tick / time_scale). 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 "mp3decomp" .IX Subsection "mp3decomp" Decompress non-standard compressed \s-1MP3\s0 audio headers. .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" A numeral string, whose value is related to how often output bytes will be modified. Therefore, values below or equal to 0 are forbidden, and the lower the more frequent bytes will be modified, with 1 meaning every byte is modified. .IP "\fBdropamount\fR" 4 .IX Item "dropamount" A numeral string, whose value is related to how often packets will be dropped. Therefore, values below or equal to 0 are forbidden, and the lower the more frequent packets will be dropped, with 1 meaning every packet is dropped. .PP The following example applies the modification to every byte but does not drop any packets. .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf noise[=1] 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 "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 "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 set. Inert when nofillin is set. .IP "\fBignidx\fR" 4 .IX Item "ignidx" Ignore index. .IP "\fBkeepside (\fR\fIdeprecated\fR\fB,\fR\fIinert\fR\fB)\fR" 4 .IX Item "keepside (deprecated,inert)" .PD 0 .IP "\fBnobuffer\fR" 4 .IX Item "nobuffer" .PD 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 "\fBlatm (\fR\fIdeprecated\fR\fB,\fR\fIinert\fR\fB)\fR" 4 .IX Item "latm (deprecated,inert)" .PD 0 .IP "\fBshortest\fR" 4 .IX Item "shortest" .PD 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 "apng" .IX Subsection "apng" Animated Portable Network Graphics demuxer. .PP This demuxer is used to demux \s-1APNG\s0 files. All headers, but the \s-1PNG\s0 signature, up to (but not including) the first fcTL chunk are transmitted as extradata. Frames are then split as being all the chunks between two fcTL ones, or between the last fcTL and \s-1IEND\s0 chunks. .IP "\fB\-ignore_loop\fR \fIbool\fR" 4 .IX Item "-ignore_loop bool" Ignore the loop variable in the file if set. .IP "\fB\-max_fps\fR \fIint\fR" 4 .IX Item "-max_fps int" Maximum framerate in frames per second (0 for no limit). .IP "\fB\-default_fps\fR \fIint\fR" 4 .IX Item "-default_fps int" Default framerate in frames per second when none is specified in the file (0 meaning as fast as possible). .SS "asf" .IX Subsection "asf" Advanced Systems Format demuxer. .PP This demuxer is used to demux \s-1ASF\s0 files and \s-1MMS\s0 network streams. .IP "\fB\-no_resync_search\fR \fIbool\fR" 4 .IX Item "-no_resync_search bool" Do not try to resynchronize by looking for a certain optional start code. .SS "concat" .IX Subsection "concat" Virtual concatenation script demuxer. .PP This demuxer reads a list of files and other directives from a text file and demuxes them one after the other, as if all their packets had been muxed together. .PP The timestamps in the files are adjusted so that the first file starts at 0 and each next file starts where the previous one finishes. Note that it is done globally and may cause gaps if all streams do not have exactly the same length. .PP All files must have the same streams (same codecs, same time base, etc.). .PP The duration of each file is used to adjust the timestamps of the next file: if the duration is incorrect (because it was computed using the bit-rate or because the file is truncated, for example), it can cause artifacts. The \&\f(CW\*(C`duration\*(C'\fR directive can be used to override the duration stored in each file. .PP \fISyntax\fR .IX Subsection "Syntax" .PP The script is a text file in extended-ASCII, with one directive per line. Empty lines, leading spaces and lines starting with '#' are ignored. The following directive is recognized: .ie n .IP "\fB\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. It also sets the \fBsafe\fR option to 1 if it was \-1. .Sp To make FFmpeg recognize the format automatically, this directive must appear exactly as is (no extra space or byte-order-mark) on the very first line of the script. .ie n .IP "\fB\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. .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. .PP \fIOptions\fR .IX Subsection "Options" .PP This demuxer accepts the following option: .IP "\fBsafe\fR" 4 .IX Item "safe" If set to 1, reject unsafe file paths. A file path is considered safe if it does not contain a protocol specification and is relative and all components only contain characters from the portable character set (letters, digits, period, underscore and hyphen) and have no period at the beginning of a component. .Sp If set to 0, any file name is accepted. .Sp The default is 1. .Sp \&\-1 is equivalent to 1 if the format was automatically probed and 0 otherwise. .IP "\fBauto_convert\fR" 4 .IX Item "auto_convert" If set to 1, try to perform automatic conversions on packet data to make the streams concatenable. The default is 1. .Sp Currently, the only conversion is adding the h264_mp4toannexb bitstream filter to H.264 streams in \s-1MP4\s0 format. This is necessary in particular if there are resolution changes. .IP "\fBsegment_time_metadata\fR" 4 .IX Item "segment_time_metadata" If set to 1, every packet will contain the \fIlavf.concat.start_time\fR and the \&\fIlavf.concat.duration\fR packet metadata values which are the start_time and the duration of the respective file segments in the concatenated output expressed in microseconds. The duration metadata is only set if it is known based on the concat file. The default is 0. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Use absolute filenames and include some comments: .Sp .Vb 6 \& # my first filename \& file /mnt/share/file\-1.wav \& # my second filename including whitespace \& file \*(Aq/mnt/share/file 2.wav\*(Aq \& # my third filename including whitespace plus single quote \& file \*(Aq/mnt/share/file 3\*(Aq\e\*(Aq\*(Aq.wav\*(Aq .Ve .IP "\(bu" 4 Allow for input format auto-probing, use safe filenames and set the duration of the first file: .Sp .Vb 1 \& ffconcat version 1.0 \& \& file file\-1.wav \& duration 20.0 \& \& file subdir/file\-2.wav .Ve .SS "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. .SS "flv, live_flv" .IX Subsection "flv, live_flv" 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. .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 "\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. .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 "\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). .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. .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. .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 "aiff" .IX Subsection "aiff" Audio Interchange File Format muxer. .PP \fIOptions\fR .IX Subsection "Options" .PP It accepts the following options: .IP "\fBwrite_id3v2\fR" 4 .IX Item "write_id3v2" Enable ID3v2 tags writing when set to 1. Default is 0 (disabled). .IP "\fBid3v2_version\fR" 4 .IX Item "id3v2_version" Select ID3v2 version to write. Currently only version 3 and 4 (aka. ID3v2.3 and ID3v2.4) are supported. The default is version 4. .SS "asf" .IX Subsection "asf" Advanced Systems Format muxer. .PP Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this muxer too. .PP \fIOptions\fR .IX Subsection "Options" .PP It accepts the following options: .IP "\fBpacket_size\fR" 4 .IX Item "packet_size" Set the muxer packet size. By tuning this setting you may reduce data fragmentation or muxer overhead depending on your source. Default value is 3200, minimum is 100, maximum is 64k. .SS "avi" .IX Subsection "avi" Audio Video Interleaved muxer. .PP \fIOptions\fR .IX Subsection "Options" .PP It accepts the following options: .IP "\fBreserve_index_space\fR" 4 .IX Item "reserve_index_space" 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. .IP "\fBwrite_channel_mask\fR" 4 .IX Item "write_channel_mask" 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 "chromaprint" .IX Subsection "chromaprint" Chromaprint fingerprinter. .PP This muxer feeds audio data to the Chromaprint library, which generates a fingerprint for the provided audio data. 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 "\fBsilence_threshold\fR" 4 .IX Item "silence_threshold" Threshold for detecting silence. Range is from \-1 to 32767, where \-1 disables silence detection. Silence detection can only be used with version 3 of the algorithm. Silence detection must be disabled for use with the AcoustID service. Default is \-1. .IP "\fBalgorithm\fR" 4 .IX Item "algorithm" Version of algorithm to fingerprint with. Range is 0 to 4. Version 3 enables silence detection. Default is 1. .IP "\fBfp_format\fR" 4 .IX Item "fp_format" Format to output the fingerprint as. Accepts the following options: .RS 4 .IP "\fBraw\fR" 4 .IX Item "raw" Binary raw fingerprint .IP "\fBcompressed\fR" 4 .IX Item "compressed" Binary compressed fingerprint .IP "\fBbase64\fR" 4 .IX Item "base64" Base64 compressed fingerprint \fI(default)\fR .RE .RS 4 .RE .SS "crc" .IX Subsection "crc" \&\s-1CRC\s0 (Cyclic Redundancy Check) testing format. .PP This muxer computes and prints the Adler\-32 \s-1CRC\s0 of all the input audio and video frames. By default audio frames are converted to signed 16\-bit raw audio and video frames to raw video before computing the \&\s-1CRC.\s0 .PP The output of the muxer consists of a single line of the form: CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the \s-1CRC\s0 for all the decoded input frames. .PP See also the \fBframecrc\fR muxer. .PP \fIExamples\fR .IX Subsection "Examples" .PP For example to compute the \s-1CRC\s0 of the input, and store it in the file \&\fIout.crc\fR: .PP .Vb 1 \& ffmpeg \-i INPUT \-f crc out.crc .Ve .PP You can print the \s-1CRC\s0 to stdout with the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f crc \- .Ve .PP You can select the output format of each frame with \fBffmpeg\fR by specifying the audio and video codec and format. For example to compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit and the input video converted to \s-1MPEG\-2\s0 video, use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f crc \- .Ve .SS "flv" .IX Subsection "flv" Adobe Flash Video Format muxer. .PP This muxer accepts the following options: .IP "\fBflvflags\fR \fIflags\fR" 4 .IX Item "flvflags flags" Possible values: .RS 4 .IP "\fBaac_seq_header_detect\fR" 4 .IX Item "aac_seq_header_detect" Place \s-1AAC\s0 sequence header based on audio stream data. .IP "\fBno_sequence_end\fR" 4 .IX Item "no_sequence_end" Disable sequence end tag. .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 "dash" .IX Subsection "dash" Dynamic Adaptive Streaming over \s-1HTTP\s0 (\s-1DASH\s0) muxer that creates segments and manifest files according to the MPEG-DASH standard \s-1ISO/IEC 23009\-1:2014.\s0 .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 It creates a \s-1MPD\s0 manifest file and segment files for each stream. .PP The segment filename might contain pre-defined identifiers used with SegmentTemplate as defined in section 5.3.9.4.4 of the standard. Available identifiers are \*(L"$RepresentationID$\*(R", \&\*(L"$Number$\*(R", \*(L"$Bandwidth$\*(R" and \*(L"$Time$\*(R". In addition to the standard identifiers, an ffmpeg-specific \*(L"$ext$\*(R" identifier is also supported. When specified ffmpeg will replace \f(CW$ext\fR$ in the file name with muxing format's extensions such as mp4, webm etc., .PP .Vb 6 \& ffmpeg \-re \-i \-map 0 \-map 0 \-c:a libfdk_aac \-c:v libx264 \e \& \-b:v:0 800k \-b:v:1 300k \-s:v:1 320x170 \-profile:v:1 baseline \e \& \-profile:v:0 main \-bf 1 \-keyint_min 120 \-g 120 \-sc_threshold 0 \e \& \-b_strategy 0 \-ar:a:1 22050 \-use_timeline 1 \-use_template 1 \e \& \-window_size 5 \-adaptation_sets "id=0,streams=v id=1,streams=a" \e \& \-f dash /path/to/out.mpd .Ve .IP "\fBmin_seg_duration\fR \fImicroseconds\fR" 4 .IX Item "min_seg_duration microseconds" This is a deprecated option to set the segment length in microseconds, use \fIseg_duration\fR instead. .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 \fIuse_template\fR is enabled and .IP "\fBfrag_duration\fR \fIduration\fR" 4 .IX Item "frag_duration duration" Set the length in seconds of fragments within segments (fractional value can be set). .IP "\fBfrag_type\fR \fItype\fR" 4 .IX Item "frag_type type" Set the type of interval for fragmentation. .IP "\fBwindow_size\fR \fIsize\fR" 4 .IX Item "window_size size" Set the maximum number of segments kept in the manifest. .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 "\fBremove_at_exit\fR \fIremove\fR" 4 .IX Item "remove_at_exit remove" Enable (1) or disable (0) removal of all segments when finished. .IP "\fBuse_template\fR \fItemplate\fR" 4 .IX Item "use_template template" Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList. .IP "\fBuse_timeline\fR \fItimeline\fR" 4 .IX Item "use_timeline timeline" Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate. .IP "\fBsingle_file\fR \fIsingle_file\fR" 4 .IX Item "single_file single_file" Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges. .IP "\fBsingle_file_name\fR \fIfile_name\fR" 4 .IX Item "single_file_name file_name" DASH-templated name to be used for baseURL. Implies \fIsingle_file\fR set to \*(L"1\*(R". In the template, \*(L"$ext$\*(R" is replaced with the file name extension specific for the segment format. .IP "\fBinit_seg_name\fR \fIinit_name\fR" 4 .IX Item "init_seg_name init_name" DASH-templated name to used for the initialization segment. Default is \*(L"init\-stream$RepresentationID$.$ext$\*(R". \*(L"$ext$\*(R" is replaced with the file name extension specific for the segment format. .IP "\fBmedia_seg_name\fR \fIsegment_name\fR" 4 .IX Item "media_seg_name segment_name" DASH-templated name to used for the media segments. Default is \*(L"chunk\-stream$RepresentationID$\-$Number%05d$.$ext$\*(R". \*(L"$ext$\*(R" is replaced with the file name extension specific for the segment format. .IP "\fButc_timing_url\fR \fIutc_url\fR" 4 .IX Item "utc_timing_url utc_url" \&\s-1URL\s0 of the page that will return the \s-1UTC\s0 timestamp in \s-1ISO\s0 format. Example: \*(L"https://time.akamai.com/?iso\*(R" .IP "\fBmethod\fR \fImethod\fR" 4 .IX Item "method method" Use the given \s-1HTTP\s0 method to create output files. Generally set to \s-1PUT\s0 or \s-1POST.\s0 .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 "\fBhttp_persistent\fR \fIhttp_persistent\fR" 4 .IX Item "http_persistent http_persistent" Use persistent \s-1HTTP\s0 connections. Applicable only for \s-1HTTP\s0 output. .IP "\fBhls_playlist\fR \fIhls_playlist\fR" 4 .IX Item "hls_playlist hls_playlist" Generate \s-1HLS\s0 playlist files as well. The master playlist is generated with the filename master.m3u8. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc. .IP "\fBstreaming\fR \fIstreaming\fR" 4 .IX Item "streaming streaming" Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming mode, each frame will be a moof fragment which forms a chunk. .IP "\fBadaptation_sets\fR \fIadaptation_sets\fR" 4 .IX Item "adaptation_sets adaptation_sets" Assign streams to AdaptationSets. Syntax is \*(L"id=x,streams=a,b,c id=y,streams=d,e\*(R" with x and y being the IDs of the adaptation sets and a,b,c,d and e are the indices of the mapped streams. .Sp To map all video (or audio) streams to an AdaptationSet, \*(L"v\*(R" (or \*(L"a\*(R") can be used as stream identifier instead of IDs. .Sp When no assignment is defined, this defaults to an AdaptationSet for each stream. .Sp Optional syntax is \*(L"id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e\*(R" and so on, descriptor is useful to the scheme defined by \s-1ISO/IEC\s0 23009\-1:2014/Amd.2:2015. For example, \-adaptation_sets \*(L"id=0,descriptor=,streams=v\*(R". Please note that descriptor string should be a self-closing xml tag. seg_duration, frag_duration and frag_type override the global option values for each adaptation set. For example, \-adaptation_sets \*(L"id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a\*(R" type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set. For example, \-adaptation_sets \*(L"id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1\*(R" .IP "\fBtimeout\fR \fItimeout\fR" 4 .IX Item "timeout timeout" Set timeout for socket I/O operations. Applicable only for \s-1HTTP\s0 output. .IP "\fBindex_correction\fR \fIindex_correction\fR" 4 .IX Item "index_correction index_correction" Enable (1) or Disable (0) segment index correction logic. Applicable only when \&\fIuse_template\fR is enabled and \fIuse_timeline\fR is disabled. .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 "\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 "\fBglobal_sidx\fR \fIglobal_sidx\fR" 4 .IX Item "global_sidx global_sidx" Write global \s-1SIDX\s0 atom. Applicable only for single file, mp4 output, non-streaming mode. .IP "\fBdash_segment_type\fR \fIdash_segment_type\fR" 4 .IX Item "dash_segment_type dash_segment_type" Possible values: .RS 4 .IP "\fBauto\fR" 4 .IX Item "auto" If this flag is set, 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" If this flag is set, the dash segment files will be in in \s-1ISOBMFF\s0 format. .IP "\fBwebm\fR" 4 .IX Item "webm" If this flag is set, the dash segment files will be in in WebM format. .RE .RS 4 .RE .IP "\fBignore_io_errors\fR \fIignore_io_errors\fR" 4 .IX Item "ignore_io_errors ignore_io_errors" Ignore \s-1IO\s0 errors during open and write. Useful for long-duration runs with network output. .IP "\fBlhls\fR \fIlhls\fR" 4 .IX Item "lhls lhls" Enable Low-latency \s-1HLS\s0(\s-1LHLS\s0). Adds #EXT\-X\-PREFETCH tag with current segment's \s-1URI.\s0 Apple doesn't have an official spec for \s-1LHLS.\s0 Meanwhile hls.js player folks are trying to standardize a open \s-1LHLS\s0 spec. The draft spec is available in https://github.com/video\-dev/hlsjs\-rfcs/blob/lhls\-spec/proposals/0001\-lhls.md This option will also try to comply with the above open spec, till Apple's spec officially supports it. Applicable only when \fIstreaming\fR and \fIhls_playlist\fR options are enabled. This is an experimental feature. .IP "\fBldash\fR \fIldash\fR" 4 .IX Item "ldash ldash" Enable Low-latency Dash by constraining the presence and values of some elements. .IP "\fBmaster_m3u8_publish_rate\fR \fImaster_m3u8_publish_rate\fR" 4 .IX Item "master_m3u8_publish_rate master_m3u8_publish_rate" Publish master playlist repeatedly every after specified number of segment intervals. .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's set to auto by default, in which case the muxer will attempt to enable it only in modes that require it. .IP "\fBmpd_profile\fR \fImpd_profile\fR" 4 .IX Item "mpd_profile mpd_profile" Set one or more manifest profiles. .IP "\fBhttp_opts\fR \fIhttp_opts\fR" 4 .IX Item "http_opts http_opts" A :\-separated list of key=value options to pass to the underlying \s-1HTTP\s0 protocol. Applicable only for \s-1HTTP\s0 output. .IP "\fBtarget_latency\fR \fItarget_latency\fR" 4 .IX Item "target_latency target_latency" Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when \fIstreaming\fR and \fIwrite_prft\fR options are enabled. This is an informative fields clients can use to measure the latency of the service. .IP "\fBmin_playback_rate\fR \fImin_playback_rate\fR" 4 .IX Item "min_playback_rate min_playback_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 "\fBmax_playback_rate\fR \fImax_playback_rate\fR" 4 .IX Item "max_playback_rate max_playback_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. .SS "framecrc" .IX Subsection "framecrc" Per-packet \s-1CRC\s0 (Cyclic Redundancy Check) testing format. .PP This muxer computes and prints the Adler\-32 \s-1CRC\s0 for each audio and video packet. By default audio frames are converted to signed 16\-bit raw audio and video frames to raw video before computing the \&\s-1CRC.\s0 .PP The output of the muxer consists of a line for each audio and video packet of the form: .PP .Vb 1 \& , , , , , 0x .Ve .PP \&\fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the \&\s-1CRC\s0 of the packet. .PP \fIExamples\fR .IX Subsection "Examples" .PP For example to compute the \s-1CRC\s0 of the audio and video frames in \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it in the file \fIout.crc\fR: .PP .Vb 1 \& ffmpeg \-i INPUT \-f framecrc out.crc .Ve .PP To print the information to stdout, use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f framecrc \- .Ve .PP With \fBffmpeg\fR, you can select the output format to which the audio and video frames are encoded before computing the \s-1CRC\s0 for each packet by specifying the audio and video codec. For example, to compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0 unsigned 8\-bit and of each decoded input video frame converted to \&\s-1MPEG\-2\s0 video, use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f framecrc \- .Ve .PP See also the \fBcrc\fR muxer. .SS "framehash" .IX Subsection "framehash" Per-packet hash testing format. .PP This muxer computes and prints a cryptographic hash for each audio and video packet. This can be used for packet-by-packet equality checks without having to individually do a binary comparison on each. .PP By default audio frames are converted to signed 16\-bit raw audio and video frames to raw video before computing the hash, but the output of explicit conversions to other codecs can also be used. It uses the \&\s-1SHA\-256\s0 cryptographic hash function by default, but supports several other algorithms. .PP The output of the muxer consists of a line for each audio and video packet of the form: .PP .Vb 1 \& , , , , , .Ve .PP \&\fIhash\fR is a hexadecimal number representing the computed hash for the packet. .IP "\fBhash\fR \fIalgorithm\fR" 4 .IX Item "hash algorithm" Use the cryptographic hash function specified by the string \fIalgorithm\fR. Supported values include \f(CW\*(C`MD5\*(C'\fR, \f(CW\*(C`murmur3\*(C'\fR, \f(CW\*(C`RIPEMD128\*(C'\fR, \&\f(CW\*(C`RIPEMD160\*(C'\fR, \f(CW\*(C`RIPEMD256\*(C'\fR, \f(CW\*(C`RIPEMD320\*(C'\fR, \f(CW\*(C`SHA160\*(C'\fR, \&\f(CW\*(C`SHA224\*(C'\fR, \f(CW\*(C`SHA256\*(C'\fR (default), \f(CW\*(C`SHA512/224\*(C'\fR, \f(CW\*(C`SHA512/256\*(C'\fR, \&\f(CW\*(C`SHA384\*(C'\fR, \f(CW\*(C`SHA512\*(C'\fR, \f(CW\*(C`CRC32\*(C'\fR and \f(CW\*(C`adler32\*(C'\fR. .PP \fIExamples\fR .IX Subsection "Examples" .PP To compute the \s-1SHA\-256\s0 hash of the audio and video frames in \fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it in the file \&\fIout.sha256\fR: .PP .Vb 1 \& ffmpeg \-i INPUT \-f framehash out.sha256 .Ve .PP To print the information to stdout, using the \s-1MD5\s0 hash function, use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f framehash \-hash md5 \- .Ve .PP See also the \fBhash\fR muxer. .SS "framemd5" .IX Subsection "framemd5" Per-packet \s-1MD5\s0 testing format. .PP This is a variant of the \fBframehash\fR muxer. Unlike that muxer, it defaults to using the \s-1MD5\s0 hash function. .PP \fIExamples\fR .IX Subsection "Examples" .PP To compute the \s-1MD5\s0 hash of the audio and video frames in \fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it in the file \&\fIout.md5\fR: .PP .Vb 1 \& ffmpeg \-i INPUT \-f framemd5 out.md5 .Ve .PP To print the information to stdout, use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f framemd5 \- .Ve .PP See also the \fBframehash\fR and \fBmd5\fR muxers. .SS "gif" .IX Subsection "gif" Animated \s-1GIF\s0 muxer. .PP It accepts the following options: .IP "\fBloop\fR" 4 .IX Item "loop" Set the number of times to loop the output. Use \f(CW\*(C`\-1\*(C'\fR for no loop, \f(CW0\fR for looping indefinitely (default). .IP "\fBfinal_delay\fR" 4 .IX Item "final_delay" Force the delay (expressed in centiseconds) after the last frame. Each frame ends with a delay until the next frame. The default is \f(CW\*(C`\-1\*(C'\fR, which is a special value to tell the muxer to re-use the previous delay. In case of a loop, you might want to customize this value to mark a pause for instance. .PP For example, to encode a gif looping 10 times, with a 5 seconds delay between the loops: .PP .Vb 1 \& ffmpeg \-i INPUT \-loop 10 \-final_delay 500 out.gif .Ve .PP Note 1: if you wish to extract the frames into separate \s-1GIF\s0 files, you need to force the \fBimage2\fR muxer: .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v gif \-f image2 "out%d.gif" .Ve .PP Note 2: the \s-1GIF\s0 format has a very large time base: the delay between two frames can therefore not be smaller than one centi second. .SS "hash" .IX Subsection "hash" Hash testing format. .PP This muxer computes and prints a cryptographic hash of all the input audio and video frames. This can be used for equality checks without having to do a complete binary comparison. .PP By default audio frames are converted to signed 16\-bit raw audio and video frames to raw video before computing the hash, but the output of explicit conversions to other codecs can also be used. Timestamps are ignored. It uses the \s-1SHA\-256\s0 cryptographic hash function by default, but supports several other algorithms. .PP The output of the muxer consists of a single line of the form: \&\fIalgo\fR=\fIhash\fR, where \fIalgo\fR is a short string representing the hash function used, and \fIhash\fR is a hexadecimal number representing the computed hash. .IP "\fBhash\fR \fIalgorithm\fR" 4 .IX Item "hash algorithm" Use the cryptographic hash function specified by the string \fIalgorithm\fR. Supported values include \f(CW\*(C`MD5\*(C'\fR, \f(CW\*(C`murmur3\*(C'\fR, \f(CW\*(C`RIPEMD128\*(C'\fR, \&\f(CW\*(C`RIPEMD160\*(C'\fR, \f(CW\*(C`RIPEMD256\*(C'\fR, \f(CW\*(C`RIPEMD320\*(C'\fR, \f(CW\*(C`SHA160\*(C'\fR, \&\f(CW\*(C`SHA224\*(C'\fR, \f(CW\*(C`SHA256\*(C'\fR (default), \f(CW\*(C`SHA512/224\*(C'\fR, \f(CW\*(C`SHA512/256\*(C'\fR, \&\f(CW\*(C`SHA384\*(C'\fR, \f(CW\*(C`SHA512\*(C'\fR, \f(CW\*(C`CRC32\*(C'\fR and \f(CW\*(C`adler32\*(C'\fR. .PP \fIExamples\fR .IX Subsection "Examples" .PP To compute the \s-1SHA\-256\s0 hash of the input converted to raw audio and video, and store it in the file \fIout.sha256\fR: .PP .Vb 1 \& ffmpeg \-i INPUT \-f hash out.sha256 .Ve .PP To print an \s-1MD5\s0 hash to stdout use the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f hash \-hash md5 \- .Ve .PP See also the \fBframehash\fR muxer. .SS "hls" .IX Subsection "hls" Apple \s-1HTTP\s0 Live Streaming muxer that segments MPEG-TS according to the \s-1HTTP\s0 Live Streaming (\s-1HLS\s0) specification. .PP It creates a playlist file, and one or more segment files. The output filename specifies the playlist filename. .PP By default, the muxer creates a file for each segment produced. These files have the same name as the playlist, followed by a sequential number and a \&.ts extension. .PP 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 \fIseconds\fR" 4 .IX Item "hls_init_time seconds" Set the initial target segment length in seconds. Default value is \fI0\fR. Segment will be cut on the next key frame after this time has passed on the first m3u8 list. After the initial playlist is filled \fBffmpeg\fR will cut segments at duration equal to \f(CW\*(C`hls_time\*(C'\fR .IP "\fBhls_time\fR \fIseconds\fR" 4 .IX Item "hls_time seconds" Set the target segment length in seconds. Default value is 2. Segment will be cut on the next key frame after this time has passed. .IP "\fBhls_list_size\fR \fIsize\fR" 4 .IX Item "hls_list_size size" Set the maximum number of playlist entries. If set to 0 the list file will contain all the segments. Default value is 5. .IP "\fBhls_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_ts_options\fR \fIoptions_list\fR" 4 .IX Item "hls_ts_options options_list" Set output format options using a :\-separated list of key=value parameters. Values containing \f(CW\*(C`:\*(C'\fR special characters must be escaped. .IP "\fBhls_wrap\fR \fIwrap\fR" 4 .IX Item "hls_wrap wrap" This is a deprecated option, you can use \f(CW\*(C`hls_list_size\*(C'\fR and \f(CW\*(C`hls_flags delete_segments\*(C'\fR instead it .Sp This option is useful to avoid to fill the disk with many segment files, and limits the maximum number of segment files written to disk to \fIwrap\fR. .IP "\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 "\fBuse_localtime\fR" 4 .IX Item "use_localtime" Same as strftime option, will be deprecated. .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 "\fBuse_localtime_mkdir\fR" 4 .IX Item "use_localtime_mkdir" Same as strftime_mkdir option, will be deprecated . .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_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" Hex-coded 16byte 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" Hex-coded 16byte 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. .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. .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 "\fB\-ignore_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 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 "\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 "\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 \fBinfer\fR. .RS 4 .IP "\fBinfer\fR" 4 .IX Item "infer" In this mode, for each type of track (audio, video or subtitle), if there is a track with disposition default of this type, then the first such track (i.e. the one with the lowest index) will be marked as default; if no such track exists, the first track of this type will be marked as default instead (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 .SS "md5" .IX Subsection "md5" \&\s-1MD5\s0 testing format. .PP This is a variant of the \fBhash\fR muxer. Unlike that muxer, it defaults to using the \s-1MD5\s0 hash function. .PP \fIExamples\fR .IX Subsection "Examples" .PP To compute the \s-1MD5\s0 hash of the input converted to raw audio and video, and store it in the file \fIout.md5\fR: .PP .Vb 1 \& ffmpeg \-i INPUT \-f md5 out.md5 .Ve .PP You can print the \s-1MD5\s0 to stdout with the command: .PP .Vb 1 \& ffmpeg \-i INPUT \-f md5 \- .Ve .PP See also the \fBhash\fR and \fBframemd5\fR muxers. .SS "mov, mp4, ismv" .IX Subsection "mov, mp4, ismv" \&\s-1MOV/MP4/ISMV\s0 (Smooth Streaming) muxer. .PP The mov/mp4/ismv muxer supports fragmentation. Normally, a \s-1MOV/MP4\s0 file has all the metadata about all packets stored in one location (written at the end of the file, it can be moved to the start for better playback by adding \fIfaststart\fR to the \fImovflags\fR, or using the \fBqt-faststart\fR tool). A fragmented file consists of a number of fragments, where packets and metadata about these packets are stored together. Writing a fragmented file has the advantage that the file is decodable even if the writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if it is not properly finished), and it requires less memory when writing very long files (since writing normal \s-1MOV/MP4\s0 files stores info about every single packet in memory until the file is closed). The downside is that it is less compatible with other applications. .PP \fIOptions\fR .IX Subsection "Options" .PP Fragmentation is enabled by setting one of the AVOptions that define how to cut the file into fragments: .IP "\fB\-moov_size\fR \fIbytes\fR" 4 .IX Item "-moov_size bytes" Reserves space for the moov atom at the beginning of the file instead of placing the moov atom at the end. If the space reserved is insufficient, muxing will fail. .IP "\fB\-movflags frag_keyframe\fR" 4 .IX Item "-movflags frag_keyframe" Start a new fragment at each video keyframe. .IP "\fB\-frag_duration\fR \fIduration\fR" 4 .IX Item "-frag_duration duration" Create fragments that are \fIduration\fR microseconds long. .IP "\fB\-frag_size\fR \fIsize\fR" 4 .IX Item "-frag_size size" Create fragments that contain up to \fIsize\fR bytes of payload data. .IP "\fB\-movflags frag_custom\fR" 4 .IX Item "-movflags frag_custom" Allow the caller to manually choose when to cut fragments, by calling \f(CW\*(C`av_write_frame(ctx, NULL)\*(C'\fR to write a fragment with the packets written so far. (This is only useful with other applications integrating libavformat, not from \fBffmpeg\fR.) .IP "\fB\-min_frag_duration\fR \fIduration\fR" 4 .IX Item "-min_frag_duration duration" Don't create fragments that are shorter than \fIduration\fR microseconds long. .PP If more than one condition is specified, fragments are cut when one of the specified conditions is fulfilled. The exception to this is \&\f(CW\*(C`\-min_frag_duration\*(C'\fR, which has to be fulfilled for any of the other conditions to apply. .PP Additionally, the way the output file is written can be adjusted through a few other options: .IP "\fB\-movflags empty_moov\fR" 4 .IX Item "-movflags empty_moov" Write an initial moov atom directly at the start of the file, without describing any samples in it. Generally, an mdat/moov pair is written at the start of the file, as a normal \s-1MOV/MP4\s0 file, containing only a short portion of the file. With this option set, there is no initial mdat atom, and the moov atom only describes the tracks but has a zero duration. .Sp This option is implicitly set when writing ismv (Smooth Streaming) files. .IP "\fB\-movflags separate_moof\fR" 4 .IX Item "-movflags separate_moof" Write a separate moof (movie fragment) atom for each track. Normally, packets for all tracks are written in a moof atom (which is slightly more efficient), but with this option set, the muxer writes one moof/mdat pair for each track, making it easier to separate tracks. .Sp This option is implicitly set when writing ismv (Smooth Streaming) files. .IP "\fB\-movflags skip_sidx\fR" 4 .IX Item "-movflags 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 global_sidx flag is enabled, this option will be ignored. .IP "\fB\-movflags faststart\fR" 4 .IX Item "-movflags faststart" Run a second pass moving the index (moov atom) to the beginning of the file. This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default. .IP "\fB\-movflags rtphint\fR" 4 .IX Item "-movflags rtphint" Add \s-1RTP\s0 hinting tracks to the output file. .IP "\fB\-movflags disable_chpl\fR" 4 .IX Item "-movflags disable_chpl" Disable Nero chapter markers (chpl atom). Normally, both Nero chapters and a QuickTime chapter track are written to the file. With this option set, only the QuickTime chapter track will be written. Nero chapters can cause failures when the file is reprocessed with certain tagging programs, like mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well. .IP "\fB\-movflags omit_tfhd_offset\fR" 4 .IX Item "-movflags omit_tfhd_offset" Do not write any absolute base_data_offset in tfhd atoms. This avoids tying fragments to absolute byte positions in the file/streams. .IP "\fB\-movflags default_base_moof\fR" 4 .IX Item "-movflags default_base_moof" Similarly to the omit_tfhd_offset, this flag avoids writing the absolute base_data_offset field in tfhd atoms, but does so by using the new default-base-is-moof flag instead. This flag is new from 14496\-12:2012. This may make the fragments easier to parse in certain circumstances (avoiding basing track fragment location calculations on the implicit end of the previous track fragment). .IP "\fB\-write_tmcd\fR" 4 .IX Item "-write_tmcd" Specify \f(CW\*(C`on\*(C'\fR to force writing a timecode track, \f(CW\*(C`off\*(C'\fR to disable it and \f(CW\*(C`auto\*(C'\fR to write a timecode track only for mov and mp4 output (default). .IP "\fB\-movflags negative_cts_offsets\fR" 4 .IX Item "-movflags 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 ismv (Smooth Streaming) files. .IP "\fB\-write_prft\fR" 4 .IX Item "-write_prft" 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. .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 \fIExample\fR .IX Subsection "Example" .PP Smooth Streaming content can be pushed in real time to a publishing point on \s-1IIS\s0 with this muxer. Example: .PP .Vb 1 \& ffmpeg \-re <> \-movflags isml+frag_keyframe \-f ismv http://server/publishingpoint.isml/Streams(Encoder1) .Ve .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. .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 "\fBtables_version\fR \fIinteger\fR" 4 .IX Item "tables_version integer" Set \s-1PAT, PMT\s0 and \s-1SDT\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 "segment, stream_segment, ssegment" .IX Subsection "segment, stream_segment, ssegment" Basic stream segmenter. .PP This muxer outputs streams to a number of separate files of nearly fixed duration. Output filename pattern can be set in a fashion similar to \fBimage2\fR, or by using a \f(CW\*(C`strftime\*(C'\fR template if the \fBstrftime\fR option is enabled. .PP \&\f(CW\*(C`stream_segment\*(C'\fR is a variant of the muxer used to write to streaming output formats, i.e. which do not require global headers, and is recommended for outputting e.g. to \s-1MPEG\s0 transport stream segments. \&\f(CW\*(C`ssegment\*(C'\fR is a shorter alias for \f(CW\*(C`stream_segment\*(C'\fR. .PP Every segment starts with a keyframe of the selected reference stream, which is set through the \fBreference_stream\fR option. .PP Note that if you want accurate splitting for a video file, you need to make the input key frames correspond to the exact splitting times expected by the segmenter, or the segment muxer will start the new segment with the key frame found next after the specified start time. .PP The segment muxer works best with a single constant frame rate video. .PP Optionally it can generate a list of the created segments, by setting the option \fIsegment_list\fR. The list type is specified by the \&\fIsegment_list_type\fR option. The entry filenames in the segment list are set by default to the basename of the corresponding segment files. .PP See also the \fBhls\fR muxer, which provides a more specific implementation for \s-1HLS\s0 segmentation. .PP \fIOptions\fR .IX Subsection "Options" .PP The segment muxer supports the following options: .IP "\fBincrement_tc\fR \fI1|0\fR" 4 .IX Item "increment_tc 1|0" if set to \f(CW1\fR, increment timecode between each segment If this is selected, the input need to have a timecode in the first video stream. Default value is \&\f(CW0\fR. .IP "\fBreference_stream\fR \fIspecifier\fR" 4 .IX Item "reference_stream specifier" Set the reference stream, as specified by the string \fIspecifier\fR. If \fIspecifier\fR is set to \f(CW\*(C`auto\*(C'\fR, the reference is chosen automatically. Otherwise it must be a stream specifier (see the ``Stream specifiers'' chapter in the ffmpeg manual) which specifies the reference stream. The default value is \f(CW\*(C`auto\*(C'\fR. .IP "\fBsegment_format\fR \fIformat\fR" 4 .IX Item "segment_format format" Override the inner container format, by default it is guessed by the filename extension. .IP "\fBsegment_format_options\fR \fIoptions_list\fR" 4 .IX Item "segment_format_options options_list" Set output format options using a :\-separated list of key=value parameters. Values containing the \f(CW\*(C`:\*(C'\fR special character must be escaped. .IP "\fBsegment_list\fR \fIname\fR" 4 .IX Item "segment_list name" Generate also a listfile named \fIname\fR. If not specified no listfile is generated. .IP "\fBsegment_list_flags\fR \fIflags\fR" 4 .IX Item "segment_list_flags flags" Set flags affecting the segment list generation. .Sp It currently supports the following flags: .RS 4 .IP "\fBcache\fR" 4 .IX Item "cache" Allow caching (only affects M3U8 list files). .IP "\fBlive\fR" 4 .IX Item "live" Allow live-friendly file generation. .RE .RS 4 .RE .IP "\fBsegment_list_size\fR \fIsize\fR" 4 .IX Item "segment_list_size size" Update the list file so that it contains at most \fIsize\fR segments. If 0 the list file will contain all the segments. Default value is 0. .IP "\fBsegment_list_entry_prefix\fR \fIprefix\fR" 4 .IX Item "segment_list_entry_prefix prefix" Prepend \fIprefix\fR to each entry. Useful to generate absolute paths. By default no prefix is applied. .IP "\fBsegment_list_type\fR \fItype\fR" 4 .IX Item "segment_list_type type" Select the listing format. .Sp The following values are recognized: .RS 4 .IP "\fBflat\fR" 4 .IX Item "flat" Generate a flat list for the created segments, one segment per line. .IP "\fBcsv, ext\fR" 4 .IX Item "csv, ext" Generate a list for the created segments, one segment per line, each line matching the format (comma-separated values): .Sp .Vb 1 \& ,, .Ve .Sp \&\fIsegment_filename\fR is the name of the output file generated by the muxer according to the provided pattern. \s-1CSV\s0 escaping (according to \&\s-1RFC4180\s0) is applied if required. .Sp \&\fIsegment_start_time\fR and \fIsegment_end_time\fR specify the segment start and end time expressed in seconds. .Sp A list file with the suffix \f(CW".csv"\fR or \f(CW".ext"\fR will auto-select this format. .Sp \&\fBext\fR is deprecated in favor or \fBcsv\fR. .IP "\fBffconcat\fR" 4 .IX Item "ffconcat" Generate an ffconcat file for the created segments. The resulting file can be read using the FFmpeg \fBconcat\fR demuxer. .Sp A list file with the suffix \f(CW".ffcat"\fR or \f(CW".ffconcat"\fR will auto-select this format. .IP "\fBm3u8\fR" 4 .IX Item "m3u8" Generate an extended M3U8 file, version 3, compliant with <\fBhttp://tools.ietf.org/id/draft\-pantos\-http\-live\-streaming\fR>. .Sp A list file with the suffix \f(CW".m3u8"\fR will auto-select this format. .RE .RS 4 .Sp If not specified the type is guessed from the list file name suffix. .RE .IP "\fBsegment_time\fR \fItime\fR" 4 .IX Item "segment_time time" Set segment duration to \fItime\fR, the value must be a duration specification. Default value is \*(L"2\*(R". See also the \&\fBsegment_times\fR option. .Sp Note that splitting may not be accurate, unless you force the reference stream key-frames at the given time. See the introductory notice and the examples below. .IP "\fBsegment_atclocktime\fR \fI1|0\fR" 4 .IX Item "segment_atclocktime 1|0" If set to \*(L"1\*(R" split at regular clock time intervals starting from 00:00 o'clock. The \fItime\fR value specified in \fBsegment_time\fR is used for setting the length of the splitting interval. .Sp For example with \fBsegment_time\fR set to \*(L"900\*(R" this makes it possible to create files at 12:00 o'clock, 12:15, 12:30, etc. .Sp Default value is \*(L"0\*(R". .IP "\fBsegment_clocktime_offset\fR \fIduration\fR" 4 .IX Item "segment_clocktime_offset duration" Delay the segment splitting times with the specified duration when using \&\fBsegment_atclocktime\fR. .Sp For example with \fBsegment_time\fR set to \*(L"900\*(R" and \&\fBsegment_clocktime_offset\fR set to \*(L"300\*(R" this makes it possible to create files at 12:05, 12:20, 12:35, etc. .Sp Default value is \*(L"0\*(R". .IP "\fBsegment_clocktime_wrap_duration\fR \fIduration\fR" 4 .IX Item "segment_clocktime_wrap_duration duration" Force the segmenter to only start a new segment if a packet reaches the muxer within the specified duration after the segmenting clock time. This way you can make the segmenter more resilient to backward local time jumps, such as leap seconds or transition to standard time from daylight savings time. .Sp 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 "fifo" .IX Subsection "fifo" The fifo pseudo-muxer allows the separation of encoding and muxing by using first-in-first-out queue and running the actual muxer in a separate thread. This is especially useful in combination with the \fBtee\fR muxer and can be used to send data to several destinations with different reliability/writing speed/latency. .PP \&\s-1API\s0 users should be aware that callback functions (interrupt_callback, io_open and io_close) used within its AVFormatContext must be thread-safe. .PP The behavior of the fifo muxer if the queue fills up or if the output fails is selectable, .IP "\(bu" 4 output can be transparently restarted with configurable delay between retries based on real time or time of the processed stream. .IP "\(bu" 4 encoding can be blocked during temporary failure, or continue transparently dropping packets in case fifo queue fills up. .IP "\fBfifo_format\fR" 4 .IX Item "fifo_format" Specify the format name. Useful if it cannot be guessed from the output name suffix. .IP "\fBqueue_size\fR" 4 .IX Item "queue_size" Specify size of the queue (number of packets). Default value is 60. .IP "\fBformat_opts\fR" 4 .IX Item "format_opts" Specify format options for the underlying muxer. Muxer options can be specified as a list of \fIkey\fR=\fIvalue\fR pairs separated by ':'. .IP "\fBdrop_pkts_on_overflow\fR \fIbool\fR" 4 .IX Item "drop_pkts_on_overflow bool" If set to 1 (true), in case the fifo queue fills up, packets will be dropped rather than blocking the encoder. This makes it possible to continue streaming without delaying the input, at the cost of omitting part of the stream. By default this option is set to 0 (false), so in such cases the encoder will be blocked until the muxer processes some of the packets and none of them is lost. .IP "\fBattempt_recovery\fR \fIbool\fR" 4 .IX Item "attempt_recovery bool" If failure occurs, attempt to recover the output. This is especially useful when used with network output, since it makes it possible to restart streaming transparently. By default this option is set to 0 (false). .IP "\fBmax_recovery_attempts\fR" 4 .IX Item "max_recovery_attempts" Sets maximum number of successive unsuccessful recovery attempts after which the output fails permanently. By default this option is set to 0 (unlimited). .IP "\fBrecovery_wait_time\fR \fIduration\fR" 4 .IX Item "recovery_wait_time duration" Waiting time before the next recovery attempt after previous unsuccessful recovery attempt. Default value is 5 seconds. .IP "\fBrecovery_wait_streamtime\fR \fIbool\fR" 4 .IX Item "recovery_wait_streamtime bool" If set to 0 (false), the real time is used when waiting for the recovery attempt (i.e. the recovery will be attempted after at least recovery_wait_time seconds). If set to 1 (true), the time of the processed stream is taken into account instead (i.e. the recovery will be attempted after at least \fIrecovery_wait_time\fR seconds of the stream is omitted). By default, this option is set to 0 (false). .IP "\fBrecover_any_error\fR \fIbool\fR" 4 .IX Item "recover_any_error bool" If set to 1 (true), recovery will be attempted regardless of type of the error causing the failure. By default this option is set to 0 (false) and in case of certain (usually permanent) errors the recovery is not attempted even when \&\fIattempt_recovery\fR is set to 1. .IP "\fBrestart_with_keyframe\fR \fIbool\fR" 4 .IX Item "restart_with_keyframe bool" Specify whether to wait for the keyframe after recovering from queue overflow or failure. This option is set to 0 (false) by default. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Stream something to rtmp server, continue processing the stream at real-time rate even in case of temporary failure (network outage) and attempt to recover streaming every second indefinitely. .Sp .Vb 2 \& ffmpeg \-re \-i ... \-c:v libx264 \-c:a aac \-f fifo \-fifo_format flv \-map 0:v \-map 0:a \& \-drop_pkts_on_overflow 1 \-attempt_recovery 1 \-recovery_wait_time 1 rtmp://example.com/live/stream_name .Ve .SS "tee" .IX Subsection "tee" The tee muxer can be used to write the same data to several 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_dash_manifest" .IX Subsection "webm_dash_manifest" WebM \s-1DASH\s0 Manifest muxer. .PP This muxer implements the WebM \s-1DASH\s0 Manifest specification to generate the \s-1DASH\s0 manifest \s-1XML.\s0 It also supports manifest generation for \s-1DASH\s0 live streams. .PP For more information see: .IP "\(bu" 4 WebM \s-1DASH\s0 Specification: <\fBhttps://sites.google.com/a/webmproject.org/wiki/adaptive\-streaming/webm\-dash\-specification\fR> .IP "\(bu" 4 \&\s-1ISO DASH\s0 Specification: <\fBhttp://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009\-1_2014.zip\fR> .PP \fIOptions\fR .IX Subsection "Options" .PP This muxer supports the following options: .IP "\fBadaptation_sets\fR" 4 .IX Item "adaptation_sets" This option has the following syntax: \*(L"id=x,streams=a,b,c id=y,streams=d,e\*(R" where x and y are the unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding audio and video streams. Any number of adaptation sets can be added using this option. .IP "\fBlive\fR" 4 .IX Item "live" Set this to 1 to create a live stream \s-1DASH\s0 Manifest. Default: 0. .IP "\fBchunk_start_index\fR" 4 .IX Item "chunk_start_index" Start index of the first chunk. This will go in the \fBstartNumber\fR attribute of the \fBSegmentTemplate\fR element in the manifest. Default: 0. .IP "\fBchunk_duration_ms\fR" 4 .IX Item "chunk_duration_ms" Duration of each chunk in milliseconds. This will go in the \fBduration\fR attribute of the \fBSegmentTemplate\fR element in the manifest. Default: 1000. .IP "\fButc_timing_url\fR" 4 .IX Item "utc_timing_url" \&\s-1URL\s0 of the page that will return the \s-1UTC\s0 timestamp in \s-1ISO\s0 format. This will go in the \fBvalue\fR attribute of the \fBUTCTiming\fR element in the manifest. Default: None. .IP "\fBtime_shift_buffer_depth\fR" 4 .IX Item "time_shift_buffer_depth" Smallest time (in seconds) shifting buffer for which any Representation is guaranteed to be available. This will go in the \fBtimeShiftBufferDepth\fR attribute of the \fB\s-1MPD\s0\fR element. Default: 60. .IP "\fBminimum_update_period\fR" 4 .IX Item "minimum_update_period" Minimum update period (in seconds) of the manifest. This will go in the \&\fBminimumUpdatePeriod\fR attribute of the \fB\s-1MPD\s0\fR element. Default: 0. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 9 \& ffmpeg \-f webm_dash_manifest \-i video1.webm \e \& \-f webm_dash_manifest \-i video2.webm \e \& \-f webm_dash_manifest \-i audio1.webm \e \& \-f webm_dash_manifest \-i audio2.webm \e \& \-map 0 \-map 1 \-map 2 \-map 3 \e \& \-c copy \e \& \-f webm_dash_manifest \e \& \-adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \e \& manifest.xml .Ve .SS "webm_chunk" .IX Subsection "webm_chunk" WebM Live Chunk Muxer. .PP This muxer writes out WebM headers and chunks as separate files which can be consumed by clients that support WebM Live streams via \s-1DASH.\s0 .PP \fIOptions\fR .IX Subsection "Options" .PP This muxer supports the following options: .IP "\fBchunk_start_index\fR" 4 .IX Item "chunk_start_index" Index of the first chunk (defaults to 0). .IP "\fBheader\fR" 4 .IX Item "header" Filename of the header where the initialization data will be written. .IP "\fBaudio_chunk_duration\fR" 4 .IX Item "audio_chunk_duration" Duration of each audio chunk in milliseconds (defaults to 5000). .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 10 \& ffmpeg \-f v4l2 \-i /dev/video0 \e \& \-f alsa \-i hw:0 \e \& \-map 0:0 \e \& \-c:v libvpx\-vp9 \e \& \-s 640x360 \-keyint_min 30 \-g 30 \e \& \-f webm_chunk \e \& \-header webm_live_video_360.hdr \e \& \-chunk_start_index 1 \e \& webm_live_video_360_%d.chk \e \& \-map 1:0 \e \& \-c:a libvorbis \e \& \-b:a 128k \e \& \-f webm_chunk \e \& \-header webm_live_audio_128.hdr \e \& \-chunk_start_index 1 \e \& \-audio_chunk_duration 1000 \e \& webm_live_audio_128_%d.chk .Ve .SH "METADATA" .IX Header "METADATA" FFmpeg is able to dump metadata from media files into a simple UTF\-8\-encoded INI-like text file and then load it back using the metadata muxer/demuxer. .PP The file format is as follows: .IP "1." 4 A file consists of a header and a number of metadata tags divided into sections, each on its own line. .IP "2." 4 The header is a \fB;FFMETADATA\fR string, followed by a version number (now 1). .IP "3." 4 Metadata tags are of the form \fBkey=value\fR .IP "4." 4 Immediately after header follows global metadata .IP "5." 4 After global metadata there may be sections with per\-stream/per\-chapter metadata. .IP "6." 4 A section starts with the section name in uppercase (i.e. \s-1STREAM\s0 or \s-1CHAPTER\s0) in brackets (\fB[\fR, \fB]\fR) and ends with next section or end of file. .IP "7." 4 At the beginning of a chapter section there may be an optional timebase to be used for start/end values. It must be in form \&\fBTIMEBASE=\fR\fInum\fR\fB/\fR\fIden\fR, where \fInum\fR and \fIden\fR are integers. If the timebase is missing then start/end times are assumed to be in 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] .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". .PP Muliple subscribers may stream from the broker using the command: .PP .Vb 1 \& ffplay amqp://[[user]:[password]@]hostname[:port] .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. .SS "async" .IX Subsection "async" Asynchronous data filling wrapper for input stream. .PP Fill data in a background thread, to decouple I/O operation from demux thread. .PP .Vb 3 \& async: \& async:http://host/resource \& async:cache:http://host/resource .Ve .SS "bluray" .IX Subsection "bluray" Read BluRay playlist. .PP The accepted options are: .IP "\fBangle\fR" 4 .IX Item "angle" BluRay angle .IP "\fBchapter\fR" 4 .IX Item "chapter" Start chapter (1...N) .IP "\fBplaylist\fR" 4 .IX Item "playlist" Playlist to read (\s-1BDMV/PLAYLIST/\s0?????.mpls) .PP Examples: .PP Read longest playlist from BluRay mounted to /mnt/bluray: .PP .Vb 1 \& bluray:/mnt/bluray .Ve .PP Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: .PP .Vb 1 \& \-playlist 4 \-angle 2 \-chapter 2 bluray:/mnt/bluray .Ve .SS "cache" .IX Subsection "cache" Caching wrapper for input stream. .PP Cache the input stream to temporary file. It brings seeking capability to live streams. .PP .Vb 1 \& cache: .Ve .SS "concat" .IX Subsection "concat" Physical concatenation protocol. .PP Read and seek from many resources in sequence as if they were a unique resource. .PP A \s-1URL\s0 accepted by this protocol has the syntax: .PP .Vb 1 \& concat:||...| .Ve .PP where \fI\s-1URL1\s0\fR, \fI\s-1URL2\s0\fR, ..., \fI\s-1URLN\s0\fR are the urls of the resource to be concatenated, each one possibly specifying a distinct protocol. .PP For example to read a sequence of files \fIsplit1.mpeg\fR, \&\fIsplit2.mpeg\fR, \fIsplit3.mpeg\fR with \fBffplay\fR use the command: .PP .Vb 1 \& ffplay concat:split1.mpeg\e|split2.mpeg\e|split3.mpeg .Ve .PP Note that you may need to escape the character \*(L"|\*(R" which is special for many shells. .SS "crypto" .IX Subsection "crypto" AES-encrypted stream reading protocol. .PP The accepted options are: .IP "\fBkey\fR" 4 .IX Item "key" Set the \s-1AES\s0 decryption key binary block from given hexadecimal representation. .IP "\fBiv\fR" 4 .IX Item "iv" Set the \s-1AES\s0 decryption initialization vector binary block from given hexadecimal representation. .PP Accepted \s-1URL\s0 formats: .PP .Vb 2 \& crypto: \& crypto+ .Ve .SS "data" .IX Subsection "data" Data in-line in the \s-1URI.\s0 See <\fBhttp://en.wikipedia.org/wiki/Data_URI_scheme\fR>. .PP For example, to convert a \s-1GIF\s0 file given inline with \fBffmpeg\fR: .PP .Vb 1 \& ffmpeg \-i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png .Ve .SS "file" .IX Subsection "file" File access protocol. .PP Read from or write to a file. .PP A file \s-1URL\s0 can have the form: .PP .Vb 1 \& file: .Ve .PP where \fIfilename\fR is the path of the file to read. .PP An \s-1URL\s0 that does not have a protocol prefix will be assumed to be a file \s-1URL.\s0 Depending on the build, an \s-1URL\s0 that looks like a Windows path with the drive letter at the beginning will also be assumed to be a file \s-1URL\s0 (usually not the case in builds for unix-like systems). .PP For example to read from a file \fIinput.mpeg\fR with \fBffmpeg\fR use the command: .PP .Vb 1 \& ffmpeg \-i file:input.mpeg output.mpeg .Ve .PP This protocol accepts the following options: .IP "\fBtruncate\fR" 4 .IX Item "truncate" Truncate existing files on write, if set to 1. A value of 0 prevents truncating. Default value is 1. .IP "\fBblocksize\fR" 4 .IX Item "blocksize" Set I/O operation maximum block size, in bytes. Default value is \&\f(CW\*(C`INT_MAX\*(C'\fR, which results in not limiting the requested block size. Setting this value reasonably low improves user termination request reaction time, which is valuable for files on slow medium. .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 "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 "\fBuser-agent\fR" 4 .IX Item "user-agent" This is a deprecated option, you can use user_agent instead it. .IP "\fBtimeout\fR" 4 .IX Item "timeout" Set timeout in microseconds of socket I/O operations used by the underlying low level operation. By default it is set to \-1, which means that the timeout is not specified. .IP "\fBreconnect_at_eof\fR" 4 .IX Item "reconnect_at_eof" If set then eof is treated like an error and causes reconnection, this is useful for live / endless streams. .IP "\fBreconnect_streamed\fR" 4 .IX Item "reconnect_streamed" If set then even streamed/non seekable streams will be reconnected on errors. .IP "\fBreconnect_delay_max\fR" 4 .IX Item "reconnect_delay_max" Sets the maximum delay in seconds after which to give up reconnecting .IP "\fBmime_type\fR" 4 .IX Item "mime_type" Export the \s-1MIME\s0 type. .IP "\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. .PP \fI\s-1HTTP\s0 Cookies\fR .IX Subsection "HTTP Cookies" .PP Some \s-1HTTP\s0 requests will be denied unless cookie values are passed in with the request. The \fBcookies\fR option allows these cookies to be specified. At the very least, each cookie must specify a value along with a path and domain. \&\s-1HTTP\s0 requests that match both the domain and path will automatically include the cookie value in the \s-1HTTP\s0 Cookie header field. Multiple cookies can be delimited by a newline. .PP The required syntax to play a stream specifying a cookie is: .PP .Vb 1 \& ffplay \-cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8 .Ve .SS "Icecast" .IX Subsection "Icecast" Icecast protocol (stream to Icecast servers) .PP This protocol accepts the following options: .IP "\fBice_genre\fR" 4 .IX Item "ice_genre" Set the stream genre. .IP "\fBice_name\fR" 4 .IX Item "ice_name" Set the stream name. .IP "\fBice_description\fR" 4 .IX Item "ice_description" Set the stream description. .IP "\fBice_url\fR" 4 .IX Item "ice_url" Set the stream website \s-1URL.\s0 .IP "\fBice_public\fR" 4 .IX Item "ice_public" Set if the stream should be public. The default is 0 (not public). .IP "\fBuser_agent\fR" 4 .IX Item "user_agent" Override the User-Agent header. If not specified a string of the form \&\*(L"Lavf/\*(R" will be used. .IP "\fBpassword\fR" 4 .IX Item "password" Set the Icecast mountpoint password. .IP "\fBcontent_type\fR" 4 .IX Item "content_type" Set the stream content type. This must be set if it is different from audio/mpeg. .IP "\fBlegacy_icecast\fR" 4 .IX Item "legacy_icecast" This enables support for Icecast versions < 2.4.0, that do not support the \&\s-1HTTP PUT\s0 method but the \s-1SOURCE\s0 method. .PP .Vb 1 \& icecast://[[:]@]:/ .Ve .SS "mmst" .IX Subsection "mmst" \&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1TCP.\s0 .SS "mmsh" .IX Subsection "mmsh" \&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1HTTP.\s0 .PP The required syntax is: .PP .Vb 1 \& mmsh://[:][/][/] .Ve .SS "md5" .IX Subsection "md5" \&\s-1MD5\s0 output protocol. .PP Computes the \s-1MD5\s0 hash of the data to be written, and on close writes this to the designated output or stdout if none is specified. It can be used to test muxers without writing an actual file. .PP Some examples follow. .PP .Vb 2 \& # Write the MD5 hash of the encoded AVI file to the file output.avi.md5. \& ffmpeg \-i input.flv \-f avi \-y md5:output.avi.md5 \& \& # Write the MD5 hash of the encoded AVI file to stdout. \& ffmpeg \-i input.flv \-f avi \-y md5: .Ve .PP Note that some formats (typically \s-1MOV\s0) require the output protocol to be seekable, so they will fail with the \s-1MD5\s0 output protocol. .SS "pipe" .IX Subsection "pipe" \&\s-1UNIX\s0 pipe access protocol. .PP Read and write from \s-1UNIX\s0 pipes. .PP The accepted syntax is: .PP .Vb 1 \& pipe:[] .Ve .PP \&\fInumber\fR is the number corresponding to the file descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If \fInumber\fR is not specified, by default the stdout file descriptor will be used for writing, stdin for reading. .PP For example to read from stdin with \fBffmpeg\fR: .PP .Vb 3 \& cat test.wav | ffmpeg \-i pipe:0 \& # ...this is the same as... \& cat test.wav | ffmpeg \-i pipe: .Ve .PP For writing to stdout with \fBffmpeg\fR: .PP .Vb 3 \& ffmpeg \-i test.wav \-f avi pipe:1 | cat > test.avi \& # ...this is the same as... \& ffmpeg \-i test.wav \-f avi pipe: | cat > test.avi .Ve .PP This protocol accepts the following options: .IP "\fBblocksize\fR" 4 .IX Item "blocksize" Set I/O operation maximum block size, in bytes. Default value is \&\f(CW\*(C`INT_MAX\*(C'\fR, which results in not limiting the requested block size. Setting this value reasonably low improves user termination request reaction time, which is valuable if data transmission is slow. .PP Note that some formats (typically \s-1MOV\s0), require the output protocol to be seekable, so they will fail with the pipe output protocol. .SS "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=