]> git.sesse.net Git - ffmpeg/blob - doc/fftools-common-opts.texi
Merge commit '90b15f60bf4919deaed66d868e18107eba371da7'
[ffmpeg] / doc / fftools-common-opts.texi
1 All the numerical options, if not specified otherwise, accept a string
2 representing a number as input, which may be followed by one of the SI
3 unit prefixes, for example: 'K', 'M', or 'G'.
4
5 If 'i' is appended to the SI unit prefix, the complete prefix will be
6 interpreted as a unit prefix for binary multiples, which are based on
7 powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
8 prefix multiplies the value by 8. This allows using, for example:
9 'KB', 'MiB', 'G' and 'B' as number suffixes.
10
11 Options which do not take arguments are boolean options, and set the
12 corresponding value to true. They can be set to false by prefixing
13 the option name with "no". For example using "-nofoo"
14 will set the boolean option with name "foo" to false.
15
16 @anchor{Stream specifiers}
17 @section Stream specifiers
18 Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
19 are used to precisely specify which stream(s) a given option belongs to.
20
21 A stream specifier is a string generally appended to the option name and
22 separated from it by a colon. E.g. @code{-codec:a:1 ac3} contains the
23 @code{a:1} stream specifier, which matches the second audio stream. Therefore, it
24 would select the ac3 codec for the second audio stream.
25
26 A stream specifier can match several streams, so that the option is applied to all
27 of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
28 streams.
29
30 An empty stream specifier matches all streams. For example, @code{-codec copy}
31 or @code{-codec: copy} would copy all the streams without reencoding.
32
33 Possible forms of stream specifiers are:
34 @table @option
35 @item @var{stream_index}
36 Matches the stream with this index. E.g. @code{-threads:1 4} would set the
37 thread count for the second stream to 4. If @var{stream_index} is used as an
38 additional stream specifier (see below), then it selects stream number
39 @var{stream_index} from the matching streams.
40 @item @var{stream_type}[:@var{additional_stream_specifier}]
41 @var{stream_type} is one of following: 'v' or 'V' for video, 'a' for audio, 's'
42 for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video
43 streams, 'V' only matches video streams which are not attached pictures, video
44 thumbnails or cover arts. If @var{additional_stream_specifier} is used, then
45 it matches streams which both have this type and match the
46 @var{additional_stream_specifier}. Otherwise, it matches all streams of the
47 specified type.
48 @item p:@var{program_id}[:@var{additional_stream_specifier}]
49 Matches streams which are in the program with the id @var{program_id}. If
50 @var{additional_stream_specifier} is used, then it matches streams which both
51 are part of the program and match the @var{additional_stream_specifier}.
52
53 @item #@var{stream_id} or i:@var{stream_id}
54 Match the stream by stream id (e.g. PID in MPEG-TS container).
55 @item m:@var{key}[:@var{value}]
56 Matches streams with the metadata tag @var{key} having the specified value. If
57 @var{value} is not given, matches streams that contain the given tag with any
58 value.
59 @item u
60 Matches streams with usable configuration, the codec must be defined and the
61 essential information such as video dimension or audio sample rate must be present.
62
63 Note that in @command{ffmpeg}, matching by metadata will only work properly for
64 input files.
65 @end table
66
67 @section Generic options
68
69 These options are shared amongst the ff* tools.
70
71 @table @option
72
73 @item -L
74 Show license.
75
76 @item -h, -?, -help, --help [@var{arg}]
77 Show help. An optional parameter may be specified to print help about a specific
78 item. If no argument is specified, only basic (non advanced) tool
79 options are shown.
80
81 Possible values of @var{arg} are:
82 @table @option
83 @item long
84 Print advanced tool options in addition to the basic tool options.
85
86 @item full
87 Print complete list of options, including shared and private options
88 for encoders, decoders, demuxers, muxers, filters, etc.
89
90 @item decoder=@var{decoder_name}
91 Print detailed information about the decoder named @var{decoder_name}. Use the
92 @option{-decoders} option to get a list of all decoders.
93
94 @item encoder=@var{encoder_name}
95 Print detailed information about the encoder named @var{encoder_name}. Use the
96 @option{-encoders} option to get a list of all encoders.
97
98 @item demuxer=@var{demuxer_name}
99 Print detailed information about the demuxer named @var{demuxer_name}. Use the
100 @option{-formats} option to get a list of all demuxers and muxers.
101
102 @item muxer=@var{muxer_name}
103 Print detailed information about the muxer named @var{muxer_name}. Use the
104 @option{-formats} option to get a list of all muxers and demuxers.
105
106 @item filter=@var{filter_name}
107 Print detailed information about the filter name @var{filter_name}. Use the
108 @option{-filters} option to get a list of all filters.
109 @end table
110
111 @item -version
112 Show version.
113
114 @item -formats
115 Show available formats (including devices).
116
117 @item -demuxers
118 Show available demuxers.
119
120 @item -muxers
121 Show available muxers.
122
123 @item -devices
124 Show available devices.
125
126 @item -codecs
127 Show all codecs known to libavcodec.
128
129 Note that the term 'codec' is used throughout this documentation as a shortcut
130 for what is more correctly called a media bitstream format.
131
132 @item -decoders
133 Show available decoders.
134
135 @item -encoders
136 Show all available encoders.
137
138 @item -bsfs
139 Show available bitstream filters.
140
141 @item -protocols
142 Show available protocols.
143
144 @item -filters
145 Show available libavfilter filters.
146
147 @item -pix_fmts
148 Show available pixel formats.
149
150 @item -sample_fmts
151 Show available sample formats.
152
153 @item -layouts
154 Show channel names and standard channel layouts.
155
156 @item -colors
157 Show recognized color names.
158
159 @item -sources @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
160 Show autodetected sources of the input device.
161 Some devices may provide system-dependent source names that cannot be autodetected.
162 The returned list cannot be assumed to be always complete.
163 @example
164 ffmpeg -sources pulse,server=192.168.0.4
165 @end example
166
167 @item -sinks @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
168 Show autodetected sinks of the output device.
169 Some devices may provide system-dependent sink names that cannot be autodetected.
170 The returned list cannot be assumed to be always complete.
171 @example
172 ffmpeg -sinks pulse,server=192.168.0.4
173 @end example
174
175 @item -loglevel [@var{flags}+]@var{loglevel} | -v [@var{flags}+]@var{loglevel}
176 Set logging level and flags used by the library.
177
178 The optional @var{flags} prefix can consist of the following values:
179 @table @samp
180 @item repeat
181 Indicates that repeated log output should not be compressed to the first line
182 and the "Last message repeated n times" line will be omitted.
183 @item level
184 Indicates that log output should add a @code{[level]} prefix to each message
185 line. This can be used as an alternative to log coloring, e.g. when dumping the
186 log to file.
187 @end table
188 Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
189 flag without affecting other @var{flags} or changing @var{loglevel}. When
190 setting both @var{flags} and @var{loglevel}, a '+' separator is expected
191 between the last @var{flags} value and before @var{loglevel}.
192
193 @var{loglevel} is a string or a number containing one of the following values:
194 @table @samp
195 @item quiet, -8
196 Show nothing at all; be silent.
197 @item panic, 0
198 Only show fatal errors which could lead the process to crash, such as
199 an assertion failure. This is not currently used for anything.
200 @item fatal, 8
201 Only show fatal errors. These are errors after which the process absolutely
202 cannot continue.
203 @item error, 16
204 Show all errors, including ones which can be recovered from.
205 @item warning, 24
206 Show all warnings and errors. Any message related to possibly
207 incorrect or unexpected events will be shown.
208 @item info, 32
209 Show informative messages during processing. This is in addition to
210 warnings and errors. This is the default value.
211 @item verbose, 40
212 Same as @code{info}, except more verbose.
213 @item debug, 48
214 Show everything, including debugging information.
215 @item trace, 56
216 @end table
217
218 For example to enable repeated log output, add the @code{level} prefix, and set
219 @var{loglevel} to @code{verbose}:
220 @example
221 ffmpeg -loglevel repeat+level+verbose -i input output
222 @end example
223 Another example that enables repeated log output without affecting current
224 state of @code{level} prefix flag or @var{loglevel}:
225 @example
226 ffmpeg [...] -loglevel +repeat
227 @end example
228
229 By default the program logs to stderr. If coloring is supported by the
230 terminal, colors are used to mark errors and warnings. Log coloring
231 can be disabled setting the environment variable
232 @env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
233 the environment variable @env{AV_LOG_FORCE_COLOR}.
234 The use of the environment variable @env{NO_COLOR} is deprecated and
235 will be dropped in a future FFmpeg version.
236
237 @item -report
238 Dump full command line and console output to a file named
239 @code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
240 directory.
241 This file can be useful for bug reports.
242 It also implies @code{-loglevel verbose}.
243
244 Setting the environment variable @env{FFREPORT} to any value has the
245 same effect. If the value is a ':'-separated key=value sequence, these
246 options will affect the report; option values must be escaped if they
247 contain special characters or the options delimiter ':' (see the
248 ``Quoting and escaping'' section in the ffmpeg-utils manual).
249
250 The following options are recognized:
251 @table @option
252 @item file
253 set the file name to use for the report; @code{%p} is expanded to the name
254 of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
255 to a plain @code{%}
256 @item level
257 set the log verbosity level using a numerical value (see @code{-loglevel}).
258 @end table
259
260 For example, to output a report to a file named @file{ffreport.log}
261 using a log level of @code{32} (alias for log level @code{info}):
262
263 @example
264 FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
265 @end example
266
267 Errors in parsing the environment variable are not fatal, and will not
268 appear in the report.
269
270 @item -hide_banner
271 Suppress printing banner.
272
273 All FFmpeg tools will normally show a copyright notice, build options
274 and library versions. This option can be used to suppress printing
275 this information.
276
277 @item -cpuflags flags (@emph{global})
278 Allows setting and clearing cpu flags. This option is intended
279 for testing. Do not use it unless you know what you're doing.
280 @example
281 ffmpeg -cpuflags -sse+mmx ...
282 ffmpeg -cpuflags mmx ...
283 ffmpeg -cpuflags 0 ...
284 @end example
285 Possible flags for this option are:
286 @table @samp
287 @item x86
288 @table @samp
289 @item mmx
290 @item mmxext
291 @item sse
292 @item sse2
293 @item sse2slow
294 @item sse3
295 @item sse3slow
296 @item ssse3
297 @item atom
298 @item sse4.1
299 @item sse4.2
300 @item avx
301 @item avx2
302 @item xop
303 @item fma3
304 @item fma4
305 @item 3dnow
306 @item 3dnowext
307 @item bmi1
308 @item bmi2
309 @item cmov
310 @end table
311 @item ARM
312 @table @samp
313 @item armv5te
314 @item armv6
315 @item armv6t2
316 @item vfp
317 @item vfpv3
318 @item neon
319 @item setend
320 @end table
321 @item AArch64
322 @table @samp
323 @item armv8
324 @item vfp
325 @item neon
326 @end table
327 @item PowerPC
328 @table @samp
329 @item altivec
330 @end table
331 @item Specific Processors
332 @table @samp
333 @item pentium2
334 @item pentium3
335 @item pentium4
336 @item k6
337 @item k62
338 @item athlon
339 @item athlonxp
340 @item k8
341 @end table
342 @end table
343 @end table
344
345 @section AVOptions
346
347 These options are provided directly by the libavformat, libavdevice and
348 libavcodec libraries. To see the list of available AVOptions, use the
349 @option{-help} option. They are separated into two categories:
350 @table @option
351 @item generic
352 These options can be set for any container, codec or device. Generic options
353 are listed under AVFormatContext options for containers/devices and under
354 AVCodecContext options for codecs.
355 @item private
356 These options are specific to the given container, device or codec. Private
357 options are listed under their corresponding containers/devices/codecs.
358 @end table
359
360 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
361 an MP3 file, use the @option{id3v2_version} private option of the MP3
362 muxer:
363 @example
364 ffmpeg -i input.flac -id3v2_version 3 out.mp3
365 @end example
366
367 All codec AVOptions are per-stream, and thus a stream specifier
368 should be attached to them:
369 @example
370 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
371 @end example
372
373 In the above example, a multichannel audio stream is mapped twice for output.
374 The first instance is encoded with codec ac3 and bitrate 640k.
375 The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
376 absolute index of the output stream.
377
378 Note: the @option{-nooption} syntax cannot be used for boolean
379 AVOptions, use @option{-option 0}/@option{-option 1}.
380
381 Note: the old undocumented way of specifying per-stream AVOptions by
382 prepending v/a/s to the options name is now obsolete and will be
383 removed soon.