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.

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