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