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.

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