fftools-common-opts.texi 13 KB

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