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