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