• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@chapter Format Options
2@c man begin FORMAT OPTIONS
3
4The libavformat library provides some generic global options, which
5can be set on all the muxers and demuxers. In addition each muxer or
6demuxer may support so-called private options, which are specific for
7that component.
8
9Options may be set by specifying -@var{option} @var{value} in the
10FFmpeg tools, or by setting the value explicitly in the
11@code{AVFormatContext} options or using the @file{libavutil/opt.h} API
12for programmatic use.
13
14The list of supported options follows:
15
16@table @option
17@item avioflags @var{flags} (@emph{input/output})
18Possible values:
19@table @samp
20@item direct
21Reduce buffering.
22@end table
23
24@item probesize @var{integer} (@emph{input})
25Set probing size in bytes, i.e. the size of the data to analyze to get
26stream information. A higher value will enable detecting more
27information in case it is dispersed into the stream, but will increase
28latency. Must be an integer not lesser than 32. It is 5000000 by default.
29
30@item max_probe_packets @var{integer} (@emph{input})
31Set the maximum number of buffered packets when probing a codec.
32Default is 2500 packets.
33
34@item packetsize @var{integer} (@emph{output})
35Set packet size.
36
37@item fflags @var{flags}
38Set format flags. Some are implemented for a limited number of formats.
39
40Possible values for input files:
41@table @samp
42@item discardcorrupt
43Discard corrupted packets.
44@item fastseek
45Enable fast, but inaccurate seeks for some formats.
46@item genpts
47Generate missing PTS if DTS is present.
48@item igndts
49Ignore DTS if PTS is set. Inert when nofillin is set.
50@item ignidx
51Ignore index.
52@item nobuffer
53Reduce the latency introduced by buffering during initial input streams analysis.
54@item nofillin
55Do not fill in missing values in packet fields that can be exactly calculated.
56@item noparse
57Disable AVParsers, this needs @code{+nofillin} too.
58@item sortdts
59Try to interleave output packets by DTS. At present, available only for AVIs with an index.
60@end table
61
62Possible values for output files:
63@table @samp
64@item autobsf
65Automatically apply bitstream filters as required by the output format. Enabled by default.
66@item bitexact
67Only write platform-, build- and time-independent data.
68This ensures that file and data checksums are reproducible and match between
69platforms. Its primary use is for regression testing.
70@item flush_packets
71Write out packets immediately.
72@item shortest
73Stop muxing at the end of the shortest stream.
74It may be needed to increase max_interleave_delta to avoid flushing the longer
75streams before EOF.
76@end table
77
78@item seek2any @var{integer} (@emph{input})
79Allow seeking to non-keyframes on demuxer level when supported if set to 1.
80Default is 0.
81
82@item analyzeduration @var{integer} (@emph{input})
83Specify how many microseconds are analyzed to probe the input. A
84higher value will enable detecting more accurate information, but will
85increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
86
87@item cryptokey @var{hexadecimal string} (@emph{input})
88Set decryption key.
89
90@item indexmem @var{integer} (@emph{input})
91Set max memory used for timestamp index (per stream).
92
93@item rtbufsize @var{integer} (@emph{input})
94Set max memory used for buffering real-time frames.
95
96@item fdebug @var{flags} (@emph{input/output})
97Print specific debug info.
98
99Possible values:
100@table @samp
101@item ts
102@end table
103
104@item max_delay @var{integer} (@emph{input/output})
105Set maximum muxing or demuxing delay in microseconds.
106
107@item fpsprobesize @var{integer} (@emph{input})
108Set number of frames used to probe fps.
109
110@item audio_preload @var{integer} (@emph{output})
111Set microseconds by which audio packets should be interleaved earlier.
112
113@item chunk_duration @var{integer} (@emph{output})
114Set microseconds for each chunk.
115
116@item chunk_size @var{integer} (@emph{output})
117Set size in bytes for each chunk.
118
119@item err_detect, f_err_detect @var{flags} (@emph{input})
120Set error detection flags. @code{f_err_detect} is deprecated and
121should be used only via the @command{ffmpeg} tool.
122
123Possible values:
124@table @samp
125@item crccheck
126Verify embedded CRCs.
127@item bitstream
128Detect bitstream specification deviations.
129@item buffer
130Detect improper bitstream length.
131@item explode
132Abort decoding on minor error detection.
133@item careful
134Consider things that violate the spec and have not been seen in the
135wild as errors.
136@item compliant
137Consider all spec non compliancies as errors.
138@item aggressive
139Consider things that a sane encoder should not do as an error.
140@end table
141
142@item max_interleave_delta @var{integer} (@emph{output})
143Set maximum buffering duration for interleaving. The duration is
144expressed in microseconds, and defaults to 10000000 (10 seconds).
145
146To ensure all the streams are interleaved correctly, libavformat will
147wait until it has at least one packet for each stream before actually
148writing any packets to the output file. When some streams are
149"sparse" (i.e. there are large gaps between successive packets), this
150can result in excessive buffering.
151
152This field specifies the maximum difference between the timestamps of the
153first and the last packet in the muxing queue, above which libavformat
154will output a packet regardless of whether it has queued a packet for all
155the streams.
156
157If set to 0, libavformat will continue buffering packets until it has
158a packet for each stream, regardless of the maximum timestamp
159difference between the buffered packets.
160
161@item use_wallclock_as_timestamps @var{integer} (@emph{input})
162Use wallclock as timestamps if set to 1. Default is 0.
163
164@item avoid_negative_ts @var{integer} (@emph{output})
165
166Possible values:
167@table @samp
168@item make_non_negative
169Shift timestamps to make them non-negative.
170Also note that this affects only leading negative timestamps, and not
171non-monotonic negative timestamps.
172@item make_zero
173Shift timestamps so that the first timestamp is 0.
174@item auto (default)
175Enables shifting when required by the target format.
176@item disabled
177Disables shifting of timestamp.
178@end table
179
180When shifting is enabled, all output timestamps are shifted by the
181same amount. Audio, video, and subtitles desynching and relative
182timestamp differences are preserved compared to how they would have
183been without shifting.
184
185@item skip_initial_bytes @var{integer} (@emph{input})
186Set number of bytes to skip before reading header and frames if set to 1.
187Default is 0.
188
189@item correct_ts_overflow @var{integer} (@emph{input})
190Correct single timestamp overflows if set to 1. Default is 1.
191
192@item flush_packets @var{integer} (@emph{output})
193Flush the underlying I/O stream after each packet. Default is -1 (auto), which
194means that the underlying protocol will decide, 1 enables it, and has the
195effect of reducing the latency, 0 disables it and may increase IO throughput in
196some cases.
197
198@item output_ts_offset @var{offset} (@emph{output})
199Set the output time offset.
200
201@var{offset} must be a time duration specification,
202see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
203
204The offset is added by the muxer to the output timestamps.
205
206Specifying a positive offset means that the corresponding streams are
207delayed bt the time duration specified in @var{offset}. Default value
208is @code{0} (meaning that no offset is applied).
209
210@item format_whitelist @var{list} (@emph{input})
211"," separated list of allowed demuxers. By default all are allowed.
212
213@item dump_separator @var{string} (@emph{input})
214Separator used to separate the fields printed on the command line about the
215Stream parameters.
216For example, to separate the fields with newlines and indentation:
217@example
218ffprobe -dump_separator "
219                          "  -i ~/videos/matrixbench_mpeg2.mpg
220@end example
221
222@item max_streams @var{integer} (@emph{input})
223Specifies the maximum number of streams. This can be used to reject files that
224would require too many resources due to a large number of streams.
225
226@item skip_estimate_duration_from_pts @var{bool} (@emph{input})
227Skip estimation of input duration when calculated using PTS.
228At present, applicable for MPEG-PS and MPEG-TS.
229
230@item strict, f_strict @var{integer} (@emph{input/output})
231Specify how strictly to follow the standards. @code{f_strict} is deprecated and
232should be used only via the @command{ffmpeg} tool.
233
234Possible values:
235@table @samp
236@item very
237strictly conform to an older more strict version of the spec or reference software
238@item strict
239strictly conform to all the things in the spec no matter what consequences
240@item normal
241
242@item unofficial
243allow unofficial extensions
244@item experimental
245allow non standardized experimental things, experimental
246(unfinished/work in progress/not well tested) decoders and encoders.
247Note: experimental decoders can pose a security risk, do not use this for
248decoding untrusted input.
249@end table
250
251@end table
252
253@c man end FORMAT OPTIONS
254
255@anchor{Format stream specifiers}
256@section Format stream specifiers
257
258Format stream specifiers allow selection of one or more streams that
259match specific properties.
260
261The exact semantics of stream specifiers is defined by the
262@code{avformat_match_stream_specifier()} function declared in the
263@file{libavformat/avformat.h} header and documented in the
264@ref{Stream specifiers,,Stream specifiers section in the ffmpeg(1) manual,ffmpeg}.
265
266@ifclear config-writeonly
267@include demuxers.texi
268@end ifclear
269@ifclear config-readonly
270@include muxers.texi
271@end ifclear
272@include metadata.texi
273