fftools-common-opts.texi 14 KB

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