1All the numerical options, if not specified otherwise, accept a string
2representing a number as input, which may be followed by one of the SI
3unit prefixes, for example: 'K', 'M', or 'G'.
4
5If 'i' is appended to the SI unit prefix, the complete prefix will be
6interpreted as a unit prefix for binary multiplies, which are based on
7powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
8prefix multiplies the value by 8. This allows using, for example:
9'KB', 'MiB', 'G' and 'B' as number suffixes.
10
11Options which do not take arguments are boolean options, and set the
12corresponding value to true. They can be set to false by prefixing
13the option name with "no". For example using "-nofoo"
14will set the boolean option with name "foo" to false.
15
16@anchor{Stream specifiers}
17@section Stream specifiers
18Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
19are used to precisely specify which stream(s) a given option belongs to.
20
21A stream specifier is a string generally appended to the option name and
22separated 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
24would select the ac3 codec for the second audio stream.
25
26A stream specifier can match several streams, so that the option is applied to all
27of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
28streams.
29
30An empty stream specifier matches all streams. For example, @code{-codec copy}
31or @code{-codec: copy} would copy all the streams without reencoding.
32
33Possible forms of stream specifiers are:
34@table @option
35@item @var{stream_index}
36Matches the stream with this index. E.g. @code{-threads:1 4} would set the
37thread 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
41stream number @var{stream_index} of this type. Otherwise, it matches all
42streams of this type.
43@item p:@var{program_id}[:@var{stream_index}]
44If @var{stream_index} is given, then it matches the stream with number @var{stream_index}
45in the program with the id @var{program_id}. Otherwise, it matches all streams in the
46program.
47@item #@var{stream_id} or i:@var{stream_id}
48Match the stream by stream id (e.g. PID in MPEG-TS container).
49@end table
50
51@section Generic options
52
53These options are shared amongst the ff* tools.
54
55@table @option
56
57@item -L
58Show license.
59
60@item -h, -?, -help, --help [@var{arg}]
61Show help. An optional parameter may be specified to print help about a specific
62item. If no argument is specified, only basic (non advanced) tool
63options are shown.
64
65Possible values of @var{arg} are:
66@table @option
67@item long
68Print advanced tool options in addition to the basic tool options.
69
70@item full
71Print complete list of options, including shared and private options
72for encoders, decoders, demuxers, muxers, filters, etc.
73
74@item decoder=@var{decoder_name}
75Print detailed information about the decoder named @var{decoder_name}. Use the
76@option{-decoders} option to get a list of all decoders.
77
78@item encoder=@var{encoder_name}
79Print detailed information about the encoder named @var{encoder_name}. Use the
80@option{-encoders} option to get a list of all encoders.
81
82@item demuxer=@var{demuxer_name}
83Print detailed information about the demuxer named @var{demuxer_name}. Use the
84@option{-formats} option to get a list of all demuxers and muxers.
85
86@item muxer=@var{muxer_name}
87Print detailed information about the muxer named @var{muxer_name}. Use the
88@option{-formats} option to get a list of all muxers and demuxers.
89
90@item filter=@var{filter_name}
91Print detailed information about the filter name @var{filter_name}. Use the
92@option{-filters} option to get a list of all filters.
93@end table
94
95@item -version
96Show version.
97
98@item -formats
99Show available formats.
100
101@item -codecs
102Show all codecs known to libavcodec.
103
104Note that the term 'codec' is used throughout this documentation as a shortcut
105for what is more correctly called a media bitstream format.
106
107@item -decoders
108Show available decoders.
109
110@item -encoders
111Show all available encoders.
112
113@item -bsfs
114Show available bitstream filters.
115
116@item -protocols
117Show available protocols.
118
119@item -filters
120Show available libavfilter filters.
121
122@item -pix_fmts
123Show available pixel formats.
124
125@item -sample_fmts
126Show available sample formats.
127
128@item -layouts
129Show channel names and standard channel layouts.
130
131@item -colors
132Show recognized color names.
133
134@item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
135Set the logging level used by the library.
136Adding "repeat+" indicates that repeated log output should not be compressed
137to the first line and the "Last message repeated n times" line will be
138omitted. "repeat" can also be used alone.
139If "repeat" is used alone, and with no prior loglevel set, the default
140loglevel will be used. If multiple loglevel parameters are given, using
141'repeat' will not change the loglevel.
142@var{loglevel} is a number or a string containing one of the following values:
143@table @samp
144@item quiet
145Show nothing at all; be silent.
146@item panic
147Only show fatal errors which could lead the process to crash, such as
148and assert failure. This is not currently used for anything.
149@item fatal
150Only show fatal errors. These are errors after which the process absolutely
151cannot continue after.
152@item error
153Show all errors, including ones which can be recovered from.
154@item warning
155Show all warnings and errors. Any message related to possibly
156incorrect or unexpected events will be shown.
157@item info
158Show informative messages during processing. This is in addition to
159warnings and errors. This is the default value.
160@item verbose
161Same as @code{info}, except more verbose.
162@item debug
163Show everything, including debugging information.
164@end table
165
166By default the program logs to stderr, if coloring is supported by the
167terminal, colors are used to mark errors and warnings. Log coloring
168can be disabled setting the environment variable
169@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
170the environment variable @env{AV_LOG_FORCE_COLOR}.
171The use of the environment variable @env{NO_COLOR} is deprecated and
172will be dropped in a following FFmpeg version.
173
174@item -report
175Dump full command line and console output to a file named
176@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
177directory.
178This file can be useful for bug reports.
179It also implies @code{-loglevel verbose}.
180
181Setting the environment variable @code{FFREPORT} to any value has the
182same effect. If the value is a ':'-separated key=value sequence, these
183options will affect the report; options values must be escaped if they
184contain special characters or the options delimiter ':' (see the
185``Quoting and escaping'' section in the ffmpeg-utils manual). The
186following option is recognized:
187@table @option
188@item file
189set the file name to use for the report; @code{%p} is expanded to the name
190of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
191to a plain @code{%}
192@item level
193set the log level
194@end table
195
196Errors in parsing the environment variable are not fatal, and will not
197appear in the report.
198
199@item -hide_banner
200Suppress printing banner.
201
202All FFmpeg tools will normally show a copyright notice, build options
203and library versions. This option can be used to suppress printing
204this information.
205
206@item -cpuflags flags (@emph{global})
207Allows setting and clearing cpu flags. This option is intended
208for testing. Do not use it unless you know what you're doing.
209@example
210ffmpeg -cpuflags -sse+mmx ...
211ffmpeg -cpuflags mmx ...
212ffmpeg -cpuflags 0 ...
213@end example
214Possible flags for this option are:
215@table @samp
216@item x86
217@table @samp
218@item mmx
219@item mmxext
220@item sse
221@item sse2
222@item sse2slow
223@item sse3
224@item sse3slow
225@item ssse3
226@item atom
227@item sse4.1
228@item sse4.2
229@item avx
230@item xop
231@item fma4
232@item 3dnow
233@item 3dnowext
234@item cmov
235@end table
236@item ARM
237@table @samp
238@item armv5te
239@item armv6
240@item armv6t2
241@item vfp
242@item vfpv3
243@item neon
244@end table
245@item PowerPC
246@table @samp
247@item altivec
248@end table
249@item Specific Processors
250@table @samp
251@item pentium2
252@item pentium3
253@item pentium4
254@item k6
255@item k62
256@item athlon
257@item athlonxp
258@item k8
259@end table
260@end table
261
262@item -opencl_bench
263Benchmark all available OpenCL devices and show the results. This option
264is only available when FFmpeg has been compiled with @code{--enable-opencl}.
265
266@item -opencl_options options (@emph{global})
267Set OpenCL environment options. This option is only available when
268FFmpeg has been compiled with @code{--enable-opencl}.
269
270@var{options} must be a list of @var{key}=@var{value} option pairs
271separated by ':'. See the ``OpenCL Options'' section in the
272ffmpeg-utils manual for the list of supported options.
273@end table
274
275@section AVOptions
276
277These options are provided directly by the libavformat, libavdevice and
278libavcodec libraries. To see the list of available AVOptions, use the
279@option{-help} option. They are separated into two categories:
280@table @option
281@item generic
282These options can be set for any container, codec or device. Generic options
283are listed under AVFormatContext options for containers/devices and under
284AVCodecContext options for codecs.
285@item private
286These options are specific to the given container, device or codec. Private
287options are listed under their corresponding containers/devices/codecs.
288@end table
289
290For example to write an ID3v2.3 header instead of a default ID3v2.4 to
291an MP3 file, use the @option{id3v2_version} private option of the MP3
292muxer:
293@example
294ffmpeg -i input.flac -id3v2_version 3 out.mp3
295@end example
296
297All codec AVOptions are per-stream, and thus a stream specifier
298should be attached to them.
299
300Note: the @option{-nooption} syntax cannot be used for boolean
301AVOptions, use @option{-option 0}/@option{-option 1}.
302
303Note: the old undocumented way of specifying per-stream AVOptions by
304prepending v/a/s to the options name is now obsolete and will be
305removed soon.
306