]> git.sesse.net Git - ffmpeg/blob - doc/formats.texi
avformat: deprecate unused MP4A_LATM flag
[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} (@emph{input/output})
34 Set format flags.
35
36 Possible values:
37 @table @samp
38 @item ignidx
39 Ignore index.
40 @item fastseek
41 Enable fast, but inaccurate seeks for some formats.
42 @item genpts
43 Generate PTS.
44 @item nofillin
45 Do not fill in missing values that can be exactly calculated.
46 @item noparse
47 Disable AVParsers, this needs @code{+nofillin} too.
48 @item igndts
49 Ignore DTS.
50 @item discardcorrupt
51 Discard corrupted frames.
52 @item sortdts
53 Try to interleave output packets by DTS.
54 @item keepside
55 Do not merge side data.
56 @item nobuffer
57 Reduce the latency introduced by optional buffering
58 @item bitexact
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.
62 @item shortest
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
65 streams before EOF.
66 @end table
67
68 @item seek2any @var{integer} (@emph{input})
69 Allow seeking to non-keyframes on demuxer level when supported if set to 1.
70 Default is 0.
71
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.
76
77 @item cryptokey @var{hexadecimal string} (@emph{input})
78 Set decryption key.
79
80 @item indexmem @var{integer} (@emph{input})
81 Set max memory used for timestamp index (per stream).
82
83 @item rtbufsize @var{integer} (@emph{input})
84 Set max memory used for buffering real-time frames.
85
86 @item fdebug @var{flags} (@emph{input/output})
87 Print specific debug info.
88
89 Possible values:
90 @table @samp
91 @item ts
92 @end table
93
94 @item max_delay @var{integer} (@emph{input/output})
95 Set maximum muxing or demuxing delay in microseconds.
96
97 @item fpsprobesize @var{integer} (@emph{input})
98 Set number of frames used to probe fps.
99
100 @item audio_preload @var{integer} (@emph{output})
101 Set microseconds by which audio packets should be interleaved earlier.
102
103 @item chunk_duration @var{integer} (@emph{output})
104 Set microseconds for each chunk.
105
106 @item chunk_size @var{integer} (@emph{output})
107 Set size in bytes for each chunk.
108
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.
112
113 Possible values:
114 @table @samp
115 @item crccheck
116 Verify embedded CRCs.
117 @item bitstream
118 Detect bitstream specification deviations.
119 @item buffer
120 Detect improper bitstream length.
121 @item explode
122 Abort decoding on minor error detection.
123 @item careful
124 Consider things that violate the spec and have not been seen in the
125 wild as errors.
126 @item compliant
127 Consider all spec non compliancies as errors.
128 @item aggressive
129 Consider things that a sane encoder should not do as an error.
130 @end table
131
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).
135
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.
141
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
145 the streams.
146
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.
150
151 @item use_wallclock_as_timestamps @var{integer} (@emph{input})
152 Use wallclock as timestamps if set to 1. Default is 0.
153
154 @item avoid_negative_ts @var{integer} (@emph{output})
155
156 Possible values:
157 @table @samp
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.
162 @item make_zero
163 Shift timestamps so that the first timestamp is 0.
164 @item auto (default)
165 Enables shifting when required by the target format.
166 @item disabled
167 Disables shifting of timestamp.
168 @end table
169
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.
174
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.
177 Default is 0.
178
179 @item correct_ts_overflow @var{integer} (@emph{input})
180 Correct single timestamp overflows if set to 1. Default is 1.
181
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
186 some cases.
187
188 @item output_ts_offset @var{offset} (@emph{output})
189 Set the output time offset.
190
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}.
193
194 The offset is added by the muxer to the output timestamps.
195
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).
199
200 @item format_whitelist @var{list} (@emph{input})
201 "," separated list of allowed demuxers. By default all are allowed.
202
203 @item dump_separator @var{string} (@emph{input})
204 Separator used to separate the fields printed on the command line about the
205 Stream parameters.
206 For example to separate the fields with newlines and indention:
207 @example
208 ffprobe -dump_separator "
209                           "  -i ~/videos/matrixbench_mpeg2.mpg
210 @end example
211
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.
215 @end table
216
217 @c man end FORMAT OPTIONS
218
219 @anchor{Format stream specifiers}
220 @section Format stream specifiers
221
222 Format stream specifiers allow selection of one or more streams that
223 match specific properties.
224
225 Possible forms of stream specifiers are:
226 @table @option
227 @item @var{stream_index}
228 Matches the stream with this index.
229
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
235 this type.
236
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.
241
242 @item #@var{stream_id}
243 Matches the stream by a format-specific ID.
244 @end table
245
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.
249
250 @ifclear config-writeonly
251 @include demuxers.texi
252 @end ifclear
253 @ifclear config-readonly
254 @include muxers.texi
255 @end ifclear
256 @include metadata.texi