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.
  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. @end table
  157. By default the program logs to stderr, if coloring is supported by the
  158. terminal, colors are used to mark errors and warnings. Log coloring
  159. can be disabled setting the environment variable
  160. @env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
  161. the environment variable @env{AV_LOG_FORCE_COLOR}.
  162. The use of the environment variable @env{NO_COLOR} is deprecated and
  163. will be dropped in a following FFmpeg version.
  164. @item -report
  165. Dump full command line and console output to a file named
  166. @code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
  167. directory.
  168. This file can be useful for bug reports.
  169. It also implies @code{-loglevel verbose}.
  170. Setting the environment variable @env{FFREPORT} to any value has the
  171. same effect. If the value is a ':'-separated key=value sequence, these
  172. options will affect the report; option values must be escaped if they
  173. contain special characters or the options delimiter ':' (see the
  174. ``Quoting and escaping'' section in the ffmpeg-utils manual).
  175. The following options are recognized:
  176. @table @option
  177. @item file
  178. set the file name to use for the report; @code{%p} is expanded to the name
  179. of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
  180. to a plain @code{%}
  181. @item level
  182. set the log verbosity level using a numerical value (see @code{-loglevel}).
  183. @end table
  184. For example, to output a report to a file named @file{ffreport.log}
  185. using a log level of @code{32} (alias for log level @code{info}):
  186. @example
  187. FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  188. @end example
  189. Errors in parsing the environment variable are not fatal, and will not
  190. appear in the report.
  191. @item -hide_banner
  192. Suppress printing banner.
  193. All FFmpeg tools will normally show a copyright notice, build options
  194. and library versions. This option can be used to suppress printing
  195. this information.
  196. @item -cpuflags flags (@emph{global})
  197. Allows setting and clearing cpu flags. This option is intended
  198. for testing. Do not use it unless you know what you're doing.
  199. @example
  200. ffmpeg -cpuflags -sse+mmx ...
  201. ffmpeg -cpuflags mmx ...
  202. ffmpeg -cpuflags 0 ...
  203. @end example
  204. Possible flags for this option are:
  205. @table @samp
  206. @item x86
  207. @table @samp
  208. @item mmx
  209. @item mmxext
  210. @item sse
  211. @item sse2
  212. @item sse2slow
  213. @item sse3
  214. @item sse3slow
  215. @item ssse3
  216. @item atom
  217. @item sse4.1
  218. @item sse4.2
  219. @item avx
  220. @item avx2
  221. @item xop
  222. @item fma3
  223. @item fma4
  224. @item 3dnow
  225. @item 3dnowext
  226. @item bmi1
  227. @item bmi2
  228. @item cmov
  229. @end table
  230. @item ARM
  231. @table @samp
  232. @item armv5te
  233. @item armv6
  234. @item armv6t2
  235. @item vfp
  236. @item vfpv3
  237. @item neon
  238. @item setend
  239. @end table
  240. @item AArch64
  241. @table @samp
  242. @item armv8
  243. @item vfp
  244. @item neon
  245. @end table
  246. @item PowerPC
  247. @table @samp
  248. @item altivec
  249. @end table
  250. @item Specific Processors
  251. @table @samp
  252. @item pentium2
  253. @item pentium3
  254. @item pentium4
  255. @item k6
  256. @item k62
  257. @item athlon
  258. @item athlonxp
  259. @item k8
  260. @end table
  261. @end table
  262. @item -opencl_bench
  263. This option is used to benchmark all available OpenCL devices and print the
  264. results. This option is only available when FFmpeg has been compiled with
  265. @code{--enable-opencl}.
  266. When FFmpeg is configured with @code{--enable-opencl}, the options for the
  267. global OpenCL context are set via @option{-opencl_options}. See the
  268. "OpenCL Options" section in the ffmpeg-utils manual for the complete list of
  269. supported options. Amongst others, these options include the ability to select
  270. a specific platform and device to run the OpenCL code on. By default, FFmpeg
  271. will run on the first device of the first platform. While the options for the
  272. global OpenCL context provide flexibility to the user in selecting the OpenCL
  273. device of their choice, most users would probably want to select the fastest
  274. OpenCL device for their system.
  275. This option assists the selection of the most efficient configuration by
  276. identifying the appropriate device for the user's system. The built-in
  277. benchmark is run on all the OpenCL devices and the performance is measured for
  278. each device. The devices in the results list are sorted based on their
  279. performance with the fastest device listed first. The user can subsequently
  280. invoke @command{ffmpeg} using the device deemed most appropriate via
  281. @option{-opencl_options} to obtain the best performance for the OpenCL
  282. accelerated code.
  283. Typical usage to use the fastest OpenCL device involve the following steps.
  284. Run the command:
  285. @example
  286. ffmpeg -opencl_bench
  287. @end example
  288. Note down the platform ID (@var{pidx}) and device ID (@var{didx}) of the first
  289. i.e. fastest device in the list.
  290. Select the platform and device using the command:
  291. @example
  292. ffmpeg -opencl_options platform_idx=@var{pidx}:device_idx=@var{didx} ...
  293. @end example
  294. @item -opencl_options options (@emph{global})
  295. Set OpenCL environment options. This option is only available when
  296. FFmpeg has been compiled with @code{--enable-opencl}.
  297. @var{options} must be a list of @var{key}=@var{value} option pairs
  298. separated by ':'. See the ``OpenCL Options'' section in the
  299. ffmpeg-utils manual for the list of supported options.
  300. @end table
  301. @section AVOptions
  302. These options are provided directly by the libavformat, libavdevice and
  303. libavcodec libraries. To see the list of available AVOptions, use the
  304. @option{-help} option. They are separated into two categories:
  305. @table @option
  306. @item generic
  307. These options can be set for any container, codec or device. Generic options
  308. are listed under AVFormatContext options for containers/devices and under
  309. AVCodecContext options for codecs.
  310. @item private
  311. These options are specific to the given container, device or codec. Private
  312. options are listed under their corresponding containers/devices/codecs.
  313. @end table
  314. For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  315. an MP3 file, use the @option{id3v2_version} private option of the MP3
  316. muxer:
  317. @example
  318. ffmpeg -i input.flac -id3v2_version 3 out.mp3
  319. @end example
  320. All codec AVOptions are per-stream, and thus a stream specifier
  321. should be attached to them.
  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.