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.

376 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 xop
  221. @item fma4
  222. @item 3dnow
  223. @item 3dnowext
  224. @item cmov
  225. @end table
  226. @item ARM
  227. @table @samp
  228. @item armv5te
  229. @item armv6
  230. @item armv6t2
  231. @item vfp
  232. @item vfpv3
  233. @item neon
  234. @end table
  235. @item PowerPC
  236. @table @samp
  237. @item altivec
  238. @end table
  239. @item Specific Processors
  240. @table @samp
  241. @item pentium2
  242. @item pentium3
  243. @item pentium4
  244. @item k6
  245. @item k62
  246. @item athlon
  247. @item athlonxp
  248. @item k8
  249. @end table
  250. @end table
  251. @item -opencl_bench
  252. This option is used to benchmark all available OpenCL devices and print the
  253. results. This option is only available when FFmpeg has been compiled with
  254. @code{--enable-opencl}.
  255. When FFmpeg is configured with @code{--enable-opencl}, the options for the
  256. global OpenCL context are set via @option{-opencl_options}. See the
  257. "OpenCL Options" section in the ffmpeg-utils manual for the complete list of
  258. supported options. Amongst others, these options include the ability to select
  259. a specific platform and device to run the OpenCL code on. By default, FFmpeg
  260. will run on the first device of the first platform. While the options for the
  261. global OpenCL context provide flexibility to the user in selecting the OpenCL
  262. device of their choice, most users would probably want to select the fastest
  263. OpenCL device for their system.
  264. This option assists the selection of the most efficient configuration by
  265. identifying the appropriate device for the user's system. The built-in
  266. benchmark is run on all the OpenCL devices and the performance is measured for
  267. each device. The devices in the results list are sorted based on their
  268. performance with the fastest device listed first. The user can subsequently
  269. invoke @command{ffmpeg} using the device deemed most appropriate via
  270. @option{-opencl_options} to obtain the best performance for the OpenCL
  271. accelerated code.
  272. Typical usage to use the fastest OpenCL device involve the following steps.
  273. Run the command:
  274. @example
  275. ffmpeg -opencl_bench
  276. @end example
  277. Note down the platform ID (@var{pidx}) and device ID (@var{didx}) of the first
  278. i.e. fastest device in the list.
  279. Select the platform and device using the command:
  280. @example
  281. ffmpeg -opencl_options platform_idx=@var{pidx}:device_idx=@var{didx} ...
  282. @end example
  283. @item -opencl_options options (@emph{global})
  284. Set OpenCL environment options. This option is only available when
  285. FFmpeg has been compiled with @code{--enable-opencl}.
  286. @var{options} must be a list of @var{key}=@var{value} option pairs
  287. separated by ':'. See the ``OpenCL Options'' section in the
  288. ffmpeg-utils manual for the list of supported options.
  289. @end table
  290. @section AVOptions
  291. These options are provided directly by the libavformat, libavdevice and
  292. libavcodec libraries. To see the list of available AVOptions, use the
  293. @option{-help} option. They are separated into two categories:
  294. @table @option
  295. @item generic
  296. These options can be set for any container, codec or device. Generic options
  297. are listed under AVFormatContext options for containers/devices and under
  298. AVCodecContext options for codecs.
  299. @item private
  300. These options are specific to the given container, device or codec. Private
  301. options are listed under their corresponding containers/devices/codecs.
  302. @end table
  303. For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  304. an MP3 file, use the @option{id3v2_version} private option of the MP3
  305. muxer:
  306. @example
  307. ffmpeg -i input.flac -id3v2_version 3 out.mp3
  308. @end example
  309. All codec AVOptions are per-stream, and thus a stream specifier
  310. should be attached to them.
  311. Note: the @option{-nooption} syntax cannot be used for boolean
  312. AVOptions, use @option{-option 0}/@option{-option 1}.
  313. Note: the old undocumented way of specifying per-stream AVOptions by
  314. prepending v/a/s to the options name is now obsolete and will be
  315. removed soon.