fftools-common-opts.texi 15 KB

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