fftools-common-opts.texi 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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}] or p:@var{program_id}[:@var{stream_type}[:@var{stream_index}]] or
  39. p:@var{program_id}:m:@var{key}[:@var{value}]
  40. In first version, if @var{stream_index} is given, then it matches the stream with number @var{stream_index}
  41. in the program with the id @var{program_id}. Otherwise, it matches all streams in the
  42. program. In the second version, @var{stream_type} is one of following: 'v' for video, 'a' for audio, 's'
  43. for subtitle, 'd' for data. If @var{stream_index} is also given, then it matches
  44. stream number @var{stream_index} of this type in the program with the id @var{program_id}.
  45. Otherwise, if only @var{stream_type} is given, it matches all
  46. streams of this type in the program with the id @var{program_id}.
  47. In the third version matches streams in the program with the id @var{program_id} with the metadata
  48. tag @var{key} having the specified value. If
  49. @var{value} is not given, matches streams that contain the given tag with any
  50. value.
  51. @item #@var{stream_id} or i:@var{stream_id}
  52. Match the stream by stream id (e.g. PID in MPEG-TS container).
  53. @item m:@var{key}[:@var{value}]
  54. Matches streams with the metadata tag @var{key} having the specified value. If
  55. @var{value} is not given, matches streams that contain the given tag with any
  56. value.
  57. @item u
  58. Matches streams with usable configuration, the codec must be defined and the
  59. essential information such as video dimension or audio sample rate must be present.
  60. Note that in @command{ffmpeg}, matching by metadata will only work properly for
  61. input files.
  62. @end table
  63. @section Generic options
  64. These options are shared amongst the ff* tools.
  65. @table @option
  66. @item -L
  67. Show license.
  68. @item -h, -?, -help, --help [@var{arg}]
  69. Show help. An optional parameter may be specified to print help about a specific
  70. item. If no argument is specified, only basic (non advanced) tool
  71. options are shown.
  72. Possible values of @var{arg} are:
  73. @table @option
  74. @item long
  75. Print advanced tool options in addition to the basic tool options.
  76. @item full
  77. Print complete list of options, including shared and private options
  78. for encoders, decoders, demuxers, muxers, filters, etc.
  79. @item decoder=@var{decoder_name}
  80. Print detailed information about the decoder named @var{decoder_name}. Use the
  81. @option{-decoders} option to get a list of all decoders.
  82. @item encoder=@var{encoder_name}
  83. Print detailed information about the encoder named @var{encoder_name}. Use the
  84. @option{-encoders} option to get a list of all encoders.
  85. @item demuxer=@var{demuxer_name}
  86. Print detailed information about the demuxer named @var{demuxer_name}. Use the
  87. @option{-formats} option to get a list of all demuxers and muxers.
  88. @item muxer=@var{muxer_name}
  89. Print detailed information about the muxer named @var{muxer_name}. Use the
  90. @option{-formats} option to get a list of all muxers and demuxers.
  91. @item filter=@var{filter_name}
  92. Print detailed information about the filter name @var{filter_name}. Use the
  93. @option{-filters} option to get a list of all 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 @env{NO_COLOR}, or can be forced setting
  195. the environment variable @env{AV_LOG_FORCE_COLOR}.
  196. The use of the environment variable @env{NO_COLOR} is deprecated and
  197. will be dropped in a future FFmpeg version.
  198. @item -report
  199. Dump full command line and console output to a file named
  200. @code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
  201. directory.
  202. This file can be useful for bug reports.
  203. It also implies @code{-loglevel verbose}.
  204. Setting the environment variable @env{FFREPORT} to any value has the
  205. same effect. If the value is a ':'-separated key=value sequence, these
  206. options will affect the report; option values must be escaped if they
  207. contain special characters or the options delimiter ':' (see the
  208. ``Quoting and escaping'' section in the ffmpeg-utils manual).
  209. The following options are recognized:
  210. @table @option
  211. @item file
  212. set the file name to use for the report; @code{%p} is expanded to the name
  213. of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
  214. to a plain @code{%}
  215. @item level
  216. set the log verbosity level using a numerical value (see @code{-loglevel}).
  217. @end table
  218. For example, to output a report to a file named @file{ffreport.log}
  219. using a log level of @code{32} (alias for log level @code{info}):
  220. @example
  221. FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  222. @end example
  223. Errors in parsing the environment variable are not fatal, and will not
  224. appear in the report.
  225. @item -hide_banner
  226. Suppress printing banner.
  227. All FFmpeg tools will normally show a copyright notice, build options
  228. and library versions. This option can be used to suppress printing
  229. this information.
  230. @item -cpuflags flags (@emph{global})
  231. Allows setting and clearing cpu flags. This option is intended
  232. for testing. Do not use it unless you know what you're doing.
  233. @example
  234. ffmpeg -cpuflags -sse+mmx ...
  235. ffmpeg -cpuflags mmx ...
  236. ffmpeg -cpuflags 0 ...
  237. @end example
  238. Possible flags for this option are:
  239. @table @samp
  240. @item x86
  241. @table @samp
  242. @item mmx
  243. @item mmxext
  244. @item sse
  245. @item sse2
  246. @item sse2slow
  247. @item sse3
  248. @item sse3slow
  249. @item ssse3
  250. @item atom
  251. @item sse4.1
  252. @item sse4.2
  253. @item avx
  254. @item avx2
  255. @item xop
  256. @item fma3
  257. @item fma4
  258. @item 3dnow
  259. @item 3dnowext
  260. @item bmi1
  261. @item bmi2
  262. @item cmov
  263. @end table
  264. @item ARM
  265. @table @samp
  266. @item armv5te
  267. @item armv6
  268. @item armv6t2
  269. @item vfp
  270. @item vfpv3
  271. @item neon
  272. @item setend
  273. @end table
  274. @item AArch64
  275. @table @samp
  276. @item armv8
  277. @item vfp
  278. @item neon
  279. @end table
  280. @item PowerPC
  281. @table @samp
  282. @item altivec
  283. @end table
  284. @item Specific Processors
  285. @table @samp
  286. @item pentium2
  287. @item pentium3
  288. @item pentium4
  289. @item k6
  290. @item k62
  291. @item athlon
  292. @item athlonxp
  293. @item k8
  294. @end table
  295. @end table
  296. @end table
  297. @section AVOptions
  298. These options are provided directly by the libavformat, libavdevice and
  299. libavcodec libraries. To see the list of available AVOptions, use the
  300. @option{-help} option. They are separated into two categories:
  301. @table @option
  302. @item generic
  303. These options can be set for any container, codec or device. Generic options
  304. are listed under AVFormatContext options for containers/devices and under
  305. AVCodecContext options for codecs.
  306. @item private
  307. These options are specific to the given container, device or codec. Private
  308. options are listed under their corresponding containers/devices/codecs.
  309. @end table
  310. For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  311. an MP3 file, use the @option{id3v2_version} private option of the MP3
  312. muxer:
  313. @example
  314. ffmpeg -i input.flac -id3v2_version 3 out.mp3
  315. @end example
  316. All codec AVOptions are per-stream, and thus a stream specifier
  317. should be attached to them.
  318. Note: the @option{-nooption} syntax cannot be used for boolean
  319. AVOptions, use @option{-option 0}/@option{-option 1}.
  320. Note: the old undocumented way of specifying per-stream AVOptions by
  321. prepending v/a/s to the options name is now obsolete and will be
  322. removed soon.