fftools-common-opts.texi 13 KB

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