1 @chapter Format Options
2 @c man begin FORMAT OPTIONS
4 The libavformat library provides some generic global options, which
5 can be set on all the muxers and demuxers. In addition each muxer or
6 demuxer may support so-called private options, which are specific for
9 Options may be set by specifying -@var{option} @var{value} in the
10 FFmpeg tools, or by setting the value explicitly in the
11 @code{AVFormatContext} options or using the @file{libavutil/opt.h} API
14 The list of supported options follows:
17 @item avioflags @var{flags} (@emph{input/output})
24 @item probesize @var{integer} (@emph{input})
25 Set probing size in bytes, i.e. the size of the data to analyze to get
26 stream information. A higher value will enable detecting more
27 information in case it is dispersed into the stream, but will increase
28 latency. Must be an integer not lesser than 32. It is 5000000 by default.
30 @item packetsize @var{integer} (@emph{output})
33 @item fflags @var{flags} (@emph{input/output})
41 Enable fast, but inaccurate seeks for some formats.
45 Do not fill in missing values that can be exactly calculated.
47 Disable AVParsers, this needs @code{+nofillin} too.
51 Discard corrupted frames.
53 Try to interleave output packets by DTS.
55 Do not merge side data.
57 Reduce the latency introduced by optional buffering
59 Only write platform-, build- and time-independent data.
60 This ensures that file and data checksums are reproducible and match between
61 platforms. Its primary use is for regression testing.
63 Stop muxing at the end of the shortest stream.
64 It may be needed to increase max_interleave_delta to avoid flushing the longer
68 @item seek2any @var{integer} (@emph{input})
69 Allow seeking to non-keyframes on demuxer level when supported if set to 1.
72 @item analyzeduration @var{integer} (@emph{input})
73 Specify how many microseconds are analyzed to probe the input. A
74 higher value will enable detecting more accurate information, but will
75 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
77 @item cryptokey @var{hexadecimal string} (@emph{input})
80 @item indexmem @var{integer} (@emph{input})
81 Set max memory used for timestamp index (per stream).
83 @item rtbufsize @var{integer} (@emph{input})
84 Set max memory used for buffering real-time frames.
86 @item fdebug @var{flags} (@emph{input/output})
87 Print specific debug info.
94 @item max_delay @var{integer} (@emph{input/output})
95 Set maximum muxing or demuxing delay in microseconds.
97 @item fpsprobesize @var{integer} (@emph{input})
98 Set number of frames used to probe fps.
100 @item audio_preload @var{integer} (@emph{output})
101 Set microseconds by which audio packets should be interleaved earlier.
103 @item chunk_duration @var{integer} (@emph{output})
104 Set microseconds for each chunk.
106 @item chunk_size @var{integer} (@emph{output})
107 Set size in bytes for each chunk.
109 @item err_detect, f_err_detect @var{flags} (@emph{input})
110 Set error detection flags. @code{f_err_detect} is deprecated and
111 should be used only via the @command{ffmpeg} tool.
116 Verify embedded CRCs.
118 Detect bitstream specification deviations.
120 Detect improper bitstream length.
122 Abort decoding on minor error detection.
124 Consider things that violate the spec and have not been seen in the
127 Consider all spec non compliancies as errors.
129 Consider things that a sane encoder should not do as an error.
132 @item max_interleave_delta @var{integer} (@emph{output})
133 Set maximum buffering duration for interleaving. The duration is
134 expressed in microseconds, and defaults to 1000000 (1 second).
136 To ensure all the streams are interleaved correctly, libavformat will
137 wait until it has at least one packet for each stream before actually
138 writing any packets to the output file. When some streams are
139 "sparse" (i.e. there are large gaps between successive packets), this
140 can result in excessive buffering.
142 This field specifies the maximum difference between the timestamps of the
143 first and the last packet in the muxing queue, above which libavformat
144 will output a packet regardless of whether it has queued a packet for all
147 If set to 0, libavformat will continue buffering packets until it has
148 a packet for each stream, regardless of the maximum timestamp
149 difference between the buffered packets.
151 @item use_wallclock_as_timestamps @var{integer} (@emph{input})
152 Use wallclock as timestamps if set to 1. Default is 0.
154 @item avoid_negative_ts @var{integer} (@emph{output})
158 @item make_non_negative
159 Shift timestamps to make them non-negative.
160 Also note that this affects only leading negative timestamps, and not
161 non-monotonic negative timestamps.
163 Shift timestamps so that the first timestamp is 0.
165 Enables shifting when required by the target format.
167 Disables shifting of timestamp.
170 When shifting is enabled, all output timestamps are shifted by the
171 same amount. Audio, video, and subtitles desynching and relative
172 timestamp differences are preserved compared to how they would have
173 been without shifting.
175 @item skip_initial_bytes @var{integer} (@emph{input})
176 Set number of bytes to skip before reading header and frames if set to 1.
179 @item correct_ts_overflow @var{integer} (@emph{input})
180 Correct single timestamp overflows if set to 1. Default is 1.
182 @item flush_packets @var{integer} (@emph{output})
183 Flush the underlying I/O stream after each packet. Default is -1 (auto), which
184 means that the underlying protocol will decide, 1 enables it, and has the
185 effect of reducing the latency, 0 disables it and may increase IO throughput in
188 @item output_ts_offset @var{offset} (@emph{output})
189 Set the output time offset.
191 @var{offset} must be a time duration specification,
192 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
194 The offset is added by the muxer to the output timestamps.
196 Specifying a positive offset means that the corresponding streams are
197 delayed bt the time duration specified in @var{offset}. Default value
198 is @code{0} (meaning that no offset is applied).
200 @item format_whitelist @var{list} (@emph{input})
201 "," separated list of allowed demuxers. By default all are allowed.
203 @item dump_separator @var{string} (@emph{input})
204 Separator used to separate the fields printed on the command line about the
206 For example to separate the fields with newlines and indention:
208 ffprobe -dump_separator "
209 " -i ~/videos/matrixbench_mpeg2.mpg
212 @item max_streams @var{integer} (@emph{input})
213 Specifies the maximum number of streams. This can be used to reject files that
214 would require too many resources due to a large number of streams.
217 @c man end FORMAT OPTIONS
219 @anchor{Format stream specifiers}
220 @section Format stream specifiers
222 Format stream specifiers allow selection of one or more streams that
223 match specific properties.
225 Possible forms of stream specifiers are:
227 @item @var{stream_index}
228 Matches the stream with this index.
230 @item @var{stream_type}[:@var{stream_index}]
231 @var{stream_type} is one of following: 'v' for video, 'a' for audio,
232 's' for subtitle, 'd' for data, and 't' for attachments. If
233 @var{stream_index} is given, then it matches the stream number
234 @var{stream_index} of this type. Otherwise, it matches all streams of
237 @item p:@var{program_id}[:@var{stream_index}]
238 If @var{stream_index} is given, then it matches the stream with number
239 @var{stream_index} in the program with the id
240 @var{program_id}. Otherwise, it matches all streams in the program.
242 @item #@var{stream_id}
243 Matches the stream by a format-specific ID.
246 The exact semantics of stream specifiers is defined by the
247 @code{avformat_match_stream_specifier()} function declared in the
248 @file{libavformat/avformat.h} header.
250 @ifclear config-writeonly
251 @include demuxers.texi
253 @ifclear config-readonly
256 @include metadata.texi