You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

402 lines
13KB

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