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