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.

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