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.

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