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 name @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 name @var{bitstream_filter_name}. 115Use the @option{-bsfs} option to get a list of all bitstream filters. 116@end table 117 118@item -version 119Show version. 120 121@item -formats 122Show available formats (including devices). 123 124@item -demuxers 125Show available demuxers. 126 127@item -muxers 128Show available muxers. 129 130@item -devices 131Show available devices. 132 133@item -codecs 134Show all codecs known to libavcodec. 135 136Note that the term 'codec' is used throughout this documentation as a shortcut 137for what is more correctly called a media bitstream format. 138 139@item -decoders 140Show available decoders. 141 142@item -encoders 143Show all available encoders. 144 145@item -bsfs 146Show available bitstream filters. 147 148@item -protocols 149Show available protocols. 150 151@item -filters 152Show available libavfilter filters. 153 154@item -pix_fmts 155Show available pixel formats. 156 157@item -sample_fmts 158Show available sample formats. 159 160@item -layouts 161Show channel names and standard channel layouts. 162 163@item -colors 164Show recognized color names. 165 166@item -sources @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...] 167Show autodetected sources of the input device. 168Some devices may provide system-dependent source names that cannot be autodetected. 169The returned list cannot be assumed to be always complete. 170@example 171ffmpeg -sources pulse,server=192.168.0.4 172@end example 173 174@item -sinks @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...] 175Show autodetected sinks of the output device. 176Some devices may provide system-dependent sink names that cannot be autodetected. 177The returned list cannot be assumed to be always complete. 178@example 179ffmpeg -sinks pulse,server=192.168.0.4 180@end example 181 182@item -loglevel [@var{flags}+]@var{loglevel} | -v [@var{flags}+]@var{loglevel} 183Set logging level and flags used by the library. 184 185The optional @var{flags} prefix can consist of the following values: 186@table @samp 187@item repeat 188Indicates that repeated log output should not be compressed to the first line 189and the "Last message repeated n times" line will be omitted. 190@item level 191Indicates that log output should add a @code{[level]} prefix to each message 192line. This can be used as an alternative to log coloring, e.g. when dumping the 193log to file. 194@end table 195Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single 196flag without affecting other @var{flags} or changing @var{loglevel}. When 197setting both @var{flags} and @var{loglevel}, a '+' separator is expected 198between the last @var{flags} value and before @var{loglevel}. 199 200@var{loglevel} is a string or a number containing one of the following values: 201@table @samp 202@item quiet, -8 203Show nothing at all; be silent. 204@item panic, 0 205Only show fatal errors which could lead the process to crash, such as 206an assertion failure. This is not currently used for anything. 207@item fatal, 8 208Only show fatal errors. These are errors after which the process absolutely 209cannot continue. 210@item error, 16 211Show all errors, including ones which can be recovered from. 212@item warning, 24 213Show all warnings and errors. Any message related to possibly 214incorrect or unexpected events will be shown. 215@item info, 32 216Show informative messages during processing. This is in addition to 217warnings and errors. This is the default value. 218@item verbose, 40 219Same as @code{info}, except more verbose. 220@item debug, 48 221Show everything, including debugging information. 222@item trace, 56 223@end table 224 225For example to enable repeated log output, add the @code{level} prefix, and set 226@var{loglevel} to @code{verbose}: 227@example 228ffmpeg -loglevel repeat+level+verbose -i input output 229@end example 230Another example that enables repeated log output without affecting current 231state of @code{level} prefix flag or @var{loglevel}: 232@example 233ffmpeg [...] -loglevel +repeat 234@end example 235 236By default the program logs to stderr. If coloring is supported by the 237terminal, colors are used to mark errors and warnings. Log coloring 238can be disabled setting the environment variable 239@env{AV_LOG_FORCE_NOCOLOR}, or can be forced setting 240the environment variable @env{AV_LOG_FORCE_COLOR}. 241 242@item -report 243Dump full command line and log output to a file named 244@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current 245directory. 246This file can be useful for bug reports. 247It also implies @code{-loglevel debug}. 248 249Setting the environment variable @env{FFREPORT} to any value has the 250same effect. If the value is a ':'-separated key=value sequence, these 251options will affect the report; option values must be escaped if they 252contain special characters or the options delimiter ':' (see the 253``Quoting and escaping'' section in the ffmpeg-utils manual). 254 255The following options are recognized: 256@table @option 257@item file 258set the file name to use for the report; @code{%p} is expanded to the name 259of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded 260to a plain @code{%} 261@item level 262set the log verbosity level using a numerical value (see @code{-loglevel}). 263@end table 264 265For example, to output a report to a file named @file{ffreport.log} 266using a log level of @code{32} (alias for log level @code{info}): 267 268@example 269FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output 270@end example 271 272Errors in parsing the environment variable are not fatal, and will not 273appear in the report. 274 275@item -hide_banner 276Suppress printing banner. 277 278All FFmpeg tools will normally show a copyright notice, build options 279and library versions. This option can be used to suppress printing 280this information. 281 282@item -cpuflags flags (@emph{global}) 283Allows setting and clearing cpu flags. This option is intended 284for testing. Do not use it unless you know what you're doing. 285@example 286ffmpeg -cpuflags -sse+mmx ... 287ffmpeg -cpuflags mmx ... 288ffmpeg -cpuflags 0 ... 289@end example 290Possible flags for this option are: 291@table @samp 292@item x86 293@table @samp 294@item mmx 295@item mmxext 296@item sse 297@item sse2 298@item sse2slow 299@item sse3 300@item sse3slow 301@item ssse3 302@item atom 303@item sse4.1 304@item sse4.2 305@item avx 306@item avx2 307@item xop 308@item fma3 309@item fma4 310@item 3dnow 311@item 3dnowext 312@item bmi1 313@item bmi2 314@item cmov 315@end table 316@item ARM 317@table @samp 318@item armv5te 319@item armv6 320@item armv6t2 321@item vfp 322@item vfpv3 323@item neon 324@item setend 325@end table 326@item AArch64 327@table @samp 328@item armv8 329@item vfp 330@item neon 331@end table 332@item PowerPC 333@table @samp 334@item altivec 335@end table 336@item Specific Processors 337@table @samp 338@item pentium2 339@item pentium3 340@item pentium4 341@item k6 342@item k62 343@item athlon 344@item athlonxp 345@item k8 346@end table 347@end table 348@end table 349 350@section AVOptions 351 352These options are provided directly by the libavformat, libavdevice and 353libavcodec libraries. To see the list of available AVOptions, use the 354@option{-help} option. They are separated into two categories: 355@table @option 356@item generic 357These options can be set for any container, codec or device. Generic options 358are listed under AVFormatContext options for containers/devices and under 359AVCodecContext options for codecs. 360@item private 361These options are specific to the given container, device or codec. Private 362options are listed under their corresponding containers/devices/codecs. 363@end table 364 365For example to write an ID3v2.3 header instead of a default ID3v2.4 to 366an MP3 file, use the @option{id3v2_version} private option of the MP3 367muxer: 368@example 369ffmpeg -i input.flac -id3v2_version 3 out.mp3 370@end example 371 372All codec AVOptions are per-stream, and thus a stream specifier 373should be attached to them: 374@example 375ffmpeg -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 376@end example 377 378In the above example, a multichannel audio stream is mapped twice for output. 379The first instance is encoded with codec ac3 and bitrate 640k. 380The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using 381absolute index of the output stream. 382 383Note: the @option{-nooption} syntax cannot be used for boolean 384AVOptions, use @option{-option 0}/@option{-option 1}. 385 386Note: the old undocumented way of specifying per-stream AVOptions by 387prepending v/a/s to the options name is now obsolete and will be 388removed soon. 389