You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3508 lines
99KB

  1. @chapter Encoders
  2. @c man begin ENCODERS
  3. Encoders are configured elements in FFmpeg which allow the encoding of
  4. multimedia streams.
  5. When you configure your FFmpeg build, all the supported native encoders
  6. are enabled by default. Encoders requiring an external library must be enabled
  7. manually via the corresponding @code{--enable-lib} option. You can list all
  8. available encoders using the configure option @code{--list-encoders}.
  9. You can disable all the encoders with the configure option
  10. @code{--disable-encoders} and selectively enable / disable single encoders
  11. with the options @code{--enable-encoder=@var{ENCODER}} /
  12. @code{--disable-encoder=@var{ENCODER}}.
  13. The option @code{-encoders} of the ff* tools will display the list of
  14. enabled encoders.
  15. @c man end ENCODERS
  16. @chapter Audio Encoders
  17. @c man begin AUDIO ENCODERS
  18. A description of some of the currently available audio encoders
  19. follows.
  20. @anchor{aacenc}
  21. @section aac
  22. Advanced Audio Coding (AAC) encoder.
  23. This encoder is the default AAC encoder, natively implemented into FFmpeg.
  24. @subsection Options
  25. @table @option
  26. @item b
  27. Set bit rate in bits/s. Setting this automatically activates constant bit rate
  28. (CBR) mode. If this option is unspecified it is set to 128kbps.
  29. @item q
  30. Set quality for variable bit rate (VBR) mode. This option is valid only using
  31. the @command{ffmpeg} command-line tool. For library interface users, use
  32. @option{global_quality}.
  33. @item cutoff
  34. Set cutoff frequency. If unspecified will allow the encoder to dynamically
  35. adjust the cutoff to improve clarity on low bitrates.
  36. @item aac_coder
  37. Set AAC encoder coding method. Possible values:
  38. @table @samp
  39. @item twoloop
  40. Two loop searching (TLS) method.
  41. This method first sets quantizers depending on band thresholds and then tries
  42. to find an optimal combination by adding or subtracting a specific value from
  43. all quantizers and adjusting some individual quantizer a little. Will tune
  44. itself based on whether @option{aac_is}, @option{aac_ms} and @option{aac_pns}
  45. are enabled.
  46. @item anmr
  47. Average noise to mask ratio (ANMR) trellis-based solution.
  48. This is an experimental coder which currently produces a lower quality, is more
  49. unstable and is slower than the default twoloop coder but has potential.
  50. Currently has no support for the @option{aac_is} or @option{aac_pns} options.
  51. Not currently recommended.
  52. @item fast
  53. Constant quantizer method.
  54. Uses a cheaper version of twoloop algorithm that doesn't try to do as many
  55. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  56. and much faster at higher bitrates.
  57. This is the default choice for a coder
  58. @end table
  59. @item aac_ms
  60. Sets mid/side coding mode. The default value of "auto" will automatically use
  61. M/S with bands which will benefit from such coding. Can be forced for all bands
  62. using the value "enable", which is mainly useful for debugging or disabled using
  63. "disable".
  64. @item aac_is
  65. Sets intensity stereo coding tool usage. By default, it's enabled and will
  66. automatically toggle IS for similar pairs of stereo bands if it's beneficial.
  67. Can be disabled for debugging by setting the value to "disable".
  68. @item aac_pns
  69. Uses perceptual noise substitution to replace low entropy high frequency bands
  70. with imperceptible white noise during the decoding process. By default, it's
  71. enabled, but can be disabled for debugging purposes by using "disable".
  72. @item aac_tns
  73. Enables the use of a multitap FIR filter which spans through the high frequency
  74. bands to hide quantization noise during the encoding process and is reverted
  75. by the decoder. As well as decreasing unpleasant artifacts in the high range
  76. this also reduces the entropy in the high bands and allows for more bits to
  77. be used by the mid-low bands. By default it's enabled but can be disabled for
  78. debugging by setting the option to "disable".
  79. @item aac_ltp
  80. Enables the use of the long term prediction extension which increases coding
  81. efficiency in very low bandwidth situations such as encoding of voice or
  82. solo piano music by extending constant harmonic peaks in bands throughout
  83. frames. This option is implied by profile:a aac_low and is incompatible with
  84. aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
  85. @item aac_pred
  86. Enables the use of a more traditional style of prediction where the spectral
  87. coefficients transmitted are replaced by the difference of the current
  88. coefficients minus the previous "predicted" coefficients. In theory and sometimes
  89. in practice this can improve quality for low to mid bitrate audio.
  90. This option implies the aac_main profile and is incompatible with aac_ltp.
  91. @item profile
  92. Sets the encoding profile, possible values:
  93. @table @samp
  94. @item aac_low
  95. The default, AAC "Low-complexity" profile. Is the most compatible and produces
  96. decent quality.
  97. @item mpeg2_aac_low
  98. Equivalent to @code{-profile:a aac_low -aac_pns 0}. PNS was introduced with the
  99. MPEG4 specifications.
  100. @item aac_ltp
  101. Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
  102. option. Introduced in MPEG4.
  103. @item aac_main
  104. Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
  105. option. Introduced in MPEG2.
  106. @end table
  107. If this option is unspecified it is set to @samp{aac_low}.
  108. @end table
  109. @section ac3 and ac3_fixed
  110. AC-3 audio encoders.
  111. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  112. the undocumented RealAudio 3 (a.k.a. dnet).
  113. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  114. encoder only uses fixed-point integer math. This does not mean that one is
  115. always faster, just that one or the other may be better suited to a
  116. particular system. The @var{ac3_fixed} encoder is not the default codec for
  117. any of the output formats, so it must be specified explicitly using the option
  118. @code{-acodec ac3_fixed} in order to use it.
  119. @subsection AC-3 Metadata
  120. The AC-3 metadata options are used to set parameters that describe the audio,
  121. but in most cases do not affect the audio encoding itself. Some of the options
  122. do directly affect or influence the decoding and playback of the resulting
  123. bitstream, while others are just for informational purposes. A few of the
  124. options will add bits to the output stream that could otherwise be used for
  125. audio data, and will thus affect the quality of the output. Those will be
  126. indicated accordingly with a note in the option list below.
  127. These parameters are described in detail in several publicly-available
  128. documents.
  129. @itemize
  130. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  131. @item @uref{http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf,A/54 - Guide to the Use of the ATSC Digital Television Standard}
  132. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  133. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  134. @end itemize
  135. @subsubsection Metadata Control Options
  136. @table @option
  137. @item -per_frame_metadata @var{boolean}
  138. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  139. metadata for each frame.
  140. @table @option
  141. @item 0
  142. The metadata values set at initialization will be used for every frame in the
  143. stream. (default)
  144. @item 1
  145. Metadata values can be changed before encoding each frame.
  146. @end table
  147. @end table
  148. @subsubsection Downmix Levels
  149. @table @option
  150. @item -center_mixlev @var{level}
  151. Center Mix Level. The amount of gain the decoder should apply to the center
  152. channel when downmixing to stereo. This field will only be written to the
  153. bitstream if a center channel is present. The value is specified as a scale
  154. factor. There are 3 valid values:
  155. @table @option
  156. @item 0.707
  157. Apply -3dB gain
  158. @item 0.595
  159. Apply -4.5dB gain (default)
  160. @item 0.500
  161. Apply -6dB gain
  162. @end table
  163. @item -surround_mixlev @var{level}
  164. Surround Mix Level. The amount of gain the decoder should apply to the surround
  165. channel(s) when downmixing to stereo. This field will only be written to the
  166. bitstream if one or more surround channels are present. The value is specified
  167. as a scale factor. There are 3 valid values:
  168. @table @option
  169. @item 0.707
  170. Apply -3dB gain
  171. @item 0.500
  172. Apply -6dB gain (default)
  173. @item 0.000
  174. Silence Surround Channel(s)
  175. @end table
  176. @end table
  177. @subsubsection Audio Production Information
  178. Audio Production Information is optional information describing the mixing
  179. environment. Either none or both of the fields are written to the bitstream.
  180. @table @option
  181. @item -mixing_level @var{number}
  182. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  183. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  184. unknown or not indicated. The default value is -1, but that value cannot be
  185. used if the Audio Production Information is written to the bitstream. Therefore,
  186. if the @code{room_type} option is not the default value, the @code{mixing_level}
  187. option must not be -1.
  188. @item -room_type @var{type}
  189. Room Type. Describes the equalization used during the final mixing session at
  190. the studio or on the dubbing stage. A large room is a dubbing stage with the
  191. industry standard X-curve equalization; a small room has flat equalization.
  192. This field will not be written to the bitstream if both the @code{mixing_level}
  193. option and the @code{room_type} option have the default values.
  194. @table @option
  195. @item 0
  196. @itemx notindicated
  197. Not Indicated (default)
  198. @item 1
  199. @itemx large
  200. Large Room
  201. @item 2
  202. @itemx small
  203. Small Room
  204. @end table
  205. @end table
  206. @subsubsection Other Metadata Options
  207. @table @option
  208. @item -copyright @var{boolean}
  209. Copyright Indicator. Specifies whether a copyright exists for this audio.
  210. @table @option
  211. @item 0
  212. @itemx off
  213. No Copyright Exists (default)
  214. @item 1
  215. @itemx on
  216. Copyright Exists
  217. @end table
  218. @item -dialnorm @var{value}
  219. Dialogue Normalization. Indicates how far the average dialogue level of the
  220. program is below digital 100% full scale (0 dBFS). This parameter determines a
  221. level shift during audio reproduction that sets the average volume of the
  222. dialogue to a preset level. The goal is to match volume level between program
  223. sources. A value of -31dB will result in no volume level change, relative to
  224. the source volume, during audio reproduction. Valid values are whole numbers in
  225. the range -31 to -1, with -31 being the default.
  226. @item -dsur_mode @var{mode}
  227. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  228. (Pro Logic). This field will only be written to the bitstream if the audio
  229. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  230. apply Dolby Surround processing.
  231. @table @option
  232. @item 0
  233. @itemx notindicated
  234. Not Indicated (default)
  235. @item 1
  236. @itemx off
  237. Not Dolby Surround Encoded
  238. @item 2
  239. @itemx on
  240. Dolby Surround Encoded
  241. @end table
  242. @item -original @var{boolean}
  243. Original Bit Stream Indicator. Specifies whether this audio is from the
  244. original source and not a copy.
  245. @table @option
  246. @item 0
  247. @itemx off
  248. Not Original Source
  249. @item 1
  250. @itemx on
  251. Original Source (default)
  252. @end table
  253. @end table
  254. @subsection Extended Bitstream Information
  255. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  256. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  257. If any one parameter in a group is specified, all values in that group will be
  258. written to the bitstream. Default values are used for those that are written
  259. but have not been specified. If the mixing levels are written, the decoder
  260. will use these values instead of the ones specified in the @code{center_mixlev}
  261. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  262. Syntax.
  263. @subsubsection Extended Bitstream Information - Part 1
  264. @table @option
  265. @item -dmix_mode @var{mode}
  266. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  267. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  268. @table @option
  269. @item 0
  270. @itemx notindicated
  271. Not Indicated (default)
  272. @item 1
  273. @itemx ltrt
  274. Lt/Rt Downmix Preferred
  275. @item 2
  276. @itemx loro
  277. Lo/Ro Downmix Preferred
  278. @end table
  279. @item -ltrt_cmixlev @var{level}
  280. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  281. center channel when downmixing to stereo in Lt/Rt mode.
  282. @table @option
  283. @item 1.414
  284. Apply +3dB gain
  285. @item 1.189
  286. Apply +1.5dB gain
  287. @item 1.000
  288. Apply 0dB gain
  289. @item 0.841
  290. Apply -1.5dB gain
  291. @item 0.707
  292. Apply -3.0dB gain
  293. @item 0.595
  294. Apply -4.5dB gain (default)
  295. @item 0.500
  296. Apply -6.0dB gain
  297. @item 0.000
  298. Silence Center Channel
  299. @end table
  300. @item -ltrt_surmixlev @var{level}
  301. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  302. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  303. @table @option
  304. @item 0.841
  305. Apply -1.5dB gain
  306. @item 0.707
  307. Apply -3.0dB gain
  308. @item 0.595
  309. Apply -4.5dB gain
  310. @item 0.500
  311. Apply -6.0dB gain (default)
  312. @item 0.000
  313. Silence Surround Channel(s)
  314. @end table
  315. @item -loro_cmixlev @var{level}
  316. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  317. center channel when downmixing to stereo in Lo/Ro mode.
  318. @table @option
  319. @item 1.414
  320. Apply +3dB gain
  321. @item 1.189
  322. Apply +1.5dB gain
  323. @item 1.000
  324. Apply 0dB gain
  325. @item 0.841
  326. Apply -1.5dB gain
  327. @item 0.707
  328. Apply -3.0dB gain
  329. @item 0.595
  330. Apply -4.5dB gain (default)
  331. @item 0.500
  332. Apply -6.0dB gain
  333. @item 0.000
  334. Silence Center Channel
  335. @end table
  336. @item -loro_surmixlev @var{level}
  337. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  338. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  339. @table @option
  340. @item 0.841
  341. Apply -1.5dB gain
  342. @item 0.707
  343. Apply -3.0dB gain
  344. @item 0.595
  345. Apply -4.5dB gain
  346. @item 0.500
  347. Apply -6.0dB gain (default)
  348. @item 0.000
  349. Silence Surround Channel(s)
  350. @end table
  351. @end table
  352. @subsubsection Extended Bitstream Information - Part 2
  353. @table @option
  354. @item -dsurex_mode @var{mode}
  355. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  356. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  357. apply Dolby Surround EX processing.
  358. @table @option
  359. @item 0
  360. @itemx notindicated
  361. Not Indicated (default)
  362. @item 1
  363. @itemx on
  364. Dolby Surround EX Off
  365. @item 2
  366. @itemx off
  367. Dolby Surround EX On
  368. @end table
  369. @item -dheadphone_mode @var{mode}
  370. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  371. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  372. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  373. processing.
  374. @table @option
  375. @item 0
  376. @itemx notindicated
  377. Not Indicated (default)
  378. @item 1
  379. @itemx on
  380. Dolby Headphone Off
  381. @item 2
  382. @itemx off
  383. Dolby Headphone On
  384. @end table
  385. @item -ad_conv_type @var{type}
  386. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  387. conversion.
  388. @table @option
  389. @item 0
  390. @itemx standard
  391. Standard A/D Converter (default)
  392. @item 1
  393. @itemx hdcd
  394. HDCD A/D Converter
  395. @end table
  396. @end table
  397. @subsection Other AC-3 Encoding Options
  398. @table @option
  399. @item -stereo_rematrixing @var{boolean}
  400. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  401. is an optional AC-3 feature that increases quality by selectively encoding
  402. the left/right channels as mid/side. This option is enabled by default, and it
  403. is highly recommended that it be left as enabled except for testing purposes.
  404. @item cutoff @var{frequency}
  405. Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  406. determined by various other encoding parameters.
  407. @end table
  408. @subsection Floating-Point-Only AC-3 Encoding Options
  409. These options are only valid for the floating-point encoder and do not exist
  410. for the fixed-point encoder due to the corresponding features not being
  411. implemented in fixed-point.
  412. @table @option
  413. @item -channel_coupling @var{boolean}
  414. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  415. that increases quality by combining high frequency information from multiple
  416. channels into a single channel. The per-channel high frequency information is
  417. sent with less accuracy in both the frequency and time domains. This allows
  418. more bits to be used for lower frequencies while preserving enough information
  419. to reconstruct the high frequencies. This option is enabled by default for the
  420. floating-point encoder and should generally be left as enabled except for
  421. testing purposes or to increase encoding speed.
  422. @table @option
  423. @item -1
  424. @itemx auto
  425. Selected by Encoder (default)
  426. @item 0
  427. @itemx off
  428. Disable Channel Coupling
  429. @item 1
  430. @itemx on
  431. Enable Channel Coupling
  432. @end table
  433. @item -cpl_start_band @var{number}
  434. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  435. value higher than the bandwidth is used, it will be reduced to 1 less than the
  436. coupling end band. If @var{auto} is used, the start band will be determined by
  437. the encoder based on the bit rate, sample rate, and channel layout. This option
  438. has no effect if channel coupling is disabled.
  439. @table @option
  440. @item -1
  441. @itemx auto
  442. Selected by Encoder (default)
  443. @end table
  444. @end table
  445. @anchor{flac}
  446. @section flac
  447. FLAC (Free Lossless Audio Codec) Encoder
  448. @subsection Options
  449. The following options are supported by FFmpeg's flac encoder.
  450. @table @option
  451. @item compression_level
  452. Sets the compression level, which chooses defaults for many other options
  453. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  454. default.
  455. @item frame_size
  456. Sets the size of the frames in samples per channel.
  457. @item lpc_coeff_precision
  458. Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  459. default.
  460. @item lpc_type
  461. Sets the first stage LPC algorithm
  462. @table @samp
  463. @item none
  464. LPC is not used
  465. @item fixed
  466. fixed LPC coefficients
  467. @item levinson
  468. @item cholesky
  469. @end table
  470. @item lpc_passes
  471. Number of passes to use for Cholesky factorization during LPC analysis
  472. @item min_partition_order
  473. The minimum partition order
  474. @item max_partition_order
  475. The maximum partition order
  476. @item prediction_order_method
  477. @table @samp
  478. @item estimation
  479. @item 2level
  480. @item 4level
  481. @item 8level
  482. @item search
  483. Bruteforce search
  484. @item log
  485. @end table
  486. @item ch_mode
  487. Channel mode
  488. @table @samp
  489. @item auto
  490. The mode is chosen automatically for each frame
  491. @item indep
  492. Channels are independently coded
  493. @item left_side
  494. @item right_side
  495. @item mid_side
  496. @end table
  497. @item exact_rice_parameters
  498. Chooses if rice parameters are calculated exactly or approximately.
  499. if set to 1 then they are chosen exactly, which slows the code down slightly and
  500. improves compression slightly.
  501. @item multi_dim_quant
  502. Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  503. applied after the first stage to finetune the coefficients. This is quite slow
  504. and slightly improves compression.
  505. @end table
  506. @anchor{opusenc}
  507. @section opus
  508. Opus encoder.
  509. This is a native FFmpeg encoder for the Opus format. Currently its in development and
  510. only implements the CELT part of the codec. Its quality is usually worse and at best
  511. is equal to the libopus encoder.
  512. @subsection Options
  513. @table @option
  514. @item b
  515. Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  516. to make a good guess.
  517. @item opus_delay
  518. Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  519. decrease quality.
  520. @end table
  521. @anchor{libfdk-aac-enc}
  522. @section libfdk_aac
  523. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  524. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  525. the Android project.
  526. Requires the presence of the libfdk-aac headers and library during
  527. configuration. You need to explicitly configure the build with
  528. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  529. so if you allow the use of GPL, you should configure with
  530. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  531. This encoder has support for the AAC-HE profiles.
  532. VBR encoding, enabled through the @option{vbr} or @option{flags
  533. +qscale} options, is experimental and only works with some
  534. combinations of parameters.
  535. Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  536. higher.
  537. For more information see the fdk-aac project at
  538. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  539. @subsection Options
  540. The following options are mapped on the shared FFmpeg codec options.
  541. @table @option
  542. @item b
  543. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  544. is automatically set to a suitable value depending on the selected
  545. profile.
  546. In case VBR mode is enabled the option is ignored.
  547. @item ar
  548. Set audio sampling rate (in Hz).
  549. @item channels
  550. Set the number of audio channels.
  551. @item flags +qscale
  552. Enable fixed quality, VBR (Variable Bit Rate) mode.
  553. Note that VBR is implicitly enabled when the @option{vbr} value is
  554. positive.
  555. @item cutoff
  556. Set cutoff frequency. If not specified (or explicitly set to 0) it
  557. will use a value automatically computed by the library. Default value
  558. is 0.
  559. @item profile
  560. Set audio profile.
  561. The following profiles are recognized:
  562. @table @samp
  563. @item aac_low
  564. Low Complexity AAC (LC)
  565. @item aac_he
  566. High Efficiency AAC (HE-AAC)
  567. @item aac_he_v2
  568. High Efficiency AAC version 2 (HE-AACv2)
  569. @item aac_ld
  570. Low Delay AAC (LD)
  571. @item aac_eld
  572. Enhanced Low Delay AAC (ELD)
  573. @end table
  574. If not specified it is set to @samp{aac_low}.
  575. @end table
  576. The following are private options of the libfdk_aac encoder.
  577. @table @option
  578. @item afterburner
  579. Enable afterburner feature if set to 1, disabled if set to 0. This
  580. improves the quality but also the required processing power.
  581. Default value is 1.
  582. @item eld_sbr
  583. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  584. if set to 0.
  585. Default value is 0.
  586. @item eld_v2
  587. Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  588. disabled if set to 0.
  589. Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
  590. Default value is 0.
  591. @item signaling
  592. Set SBR/PS signaling style.
  593. It can assume one of the following values:
  594. @table @samp
  595. @item default
  596. choose signaling implicitly (explicit hierarchical by default,
  597. implicit if global header is disabled)
  598. @item implicit
  599. implicit backwards compatible signaling
  600. @item explicit_sbr
  601. explicit SBR, implicit PS signaling
  602. @item explicit_hierarchical
  603. explicit hierarchical signaling
  604. @end table
  605. Default value is @samp{default}.
  606. @item latm
  607. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  608. Default value is 0.
  609. @item header_period
  610. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  611. in-band configuration buffers within LATM/LOAS transport layer.
  612. Must be a 16-bits non-negative integer.
  613. Default value is 0.
  614. @item vbr
  615. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  616. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  617. (Constant Bit Rate) is enabled.
  618. Currently only the @samp{aac_low} profile supports VBR encoding.
  619. VBR modes 1-5 correspond to roughly the following average bit rates:
  620. @table @samp
  621. @item 1
  622. 32 kbps/channel
  623. @item 2
  624. 40 kbps/channel
  625. @item 3
  626. 48-56 kbps/channel
  627. @item 4
  628. 64 kbps/channel
  629. @item 5
  630. about 80-96 kbps/channel
  631. @end table
  632. Default value is 0.
  633. @end table
  634. @subsection Examples
  635. @itemize
  636. @item
  637. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  638. container:
  639. @example
  640. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  641. @end example
  642. @item
  643. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  644. High-Efficiency AAC profile:
  645. @example
  646. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  647. @end example
  648. @end itemize
  649. @anchor{libmp3lame}
  650. @section libmp3lame
  651. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  652. Requires the presence of the libmp3lame headers and library during
  653. configuration. You need to explicitly configure the build with
  654. @code{--enable-libmp3lame}.
  655. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  656. lower quality.
  657. @subsection Options
  658. The following options are supported by the libmp3lame wrapper. The
  659. @command{lame}-equivalent of the options are listed in parentheses.
  660. @table @option
  661. @item b (@emph{-b})
  662. Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
  663. expressed in kilobits/s.
  664. @item q (@emph{-V})
  665. Set constant quality setting for VBR. This option is valid only
  666. using the @command{ffmpeg} command-line tool. For library interface
  667. users, use @option{global_quality}.
  668. @item compression_level (@emph{-q})
  669. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  670. with 0 meaning highest quality but slowest, and 9 meaning fastest
  671. while producing the worst quality.
  672. @item cutoff (@emph{--lowpass})
  673. Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  674. adjusts the cutoff.
  675. @item reservoir
  676. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  677. has this enabled by default, but can be overridden by use
  678. @option{--nores} option.
  679. @item joint_stereo (@emph{-m j})
  680. Enable the encoder to use (on a frame by frame basis) either L/R
  681. stereo or mid/side stereo. Default value is 1.
  682. @item abr (@emph{--abr})
  683. Enable the encoder to use ABR when set to 1. The @command{lame}
  684. @option{--abr} sets the target bitrate, while this options only
  685. tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
  686. @end table
  687. @section libopencore-amrnb
  688. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  689. Requires the presence of the libopencore-amrnb headers and library during
  690. configuration. You need to explicitly configure the build with
  691. @code{--enable-libopencore-amrnb --enable-version3}.
  692. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  693. but you can override it by setting @option{strict} to @samp{unofficial} or
  694. lower.
  695. @subsection Options
  696. @table @option
  697. @item b
  698. Set bitrate in bits per second. Only the following bitrates are supported,
  699. otherwise libavcodec will round to the nearest valid bitrate.
  700. @table @option
  701. @item 4750
  702. @item 5150
  703. @item 5900
  704. @item 6700
  705. @item 7400
  706. @item 7950
  707. @item 10200
  708. @item 12200
  709. @end table
  710. @item dtx
  711. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  712. default value is 0 (disabled).
  713. @end table
  714. @section libopus
  715. libopus Opus Interactive Audio Codec encoder wrapper.
  716. Requires the presence of the libopus headers and library during
  717. configuration. You need to explicitly configure the build with
  718. @code{--enable-libopus}.
  719. @subsection Option Mapping
  720. Most libopus options are modelled after the @command{opusenc} utility from
  721. opus-tools. The following is an option mapping chart describing options
  722. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  723. in parentheses.
  724. @table @option
  725. @item b (@emph{bitrate})
  726. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  727. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  728. kilobits/s.
  729. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  730. Set VBR mode. The FFmpeg @option{vbr} option has the following
  731. valid arguments, with the @command{opusenc} equivalent options
  732. in parentheses:
  733. @table @samp
  734. @item off (@emph{hard-cbr})
  735. Use constant bit rate encoding.
  736. @item on (@emph{vbr})
  737. Use variable bit rate encoding (the default).
  738. @item constrained (@emph{cvbr})
  739. Use constrained variable bit rate encoding.
  740. @end table
  741. @item compression_level (@emph{comp})
  742. Set encoding algorithm complexity. Valid options are integers in
  743. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  744. gives the highest quality but slowest encoding. The default is 10.
  745. @item frame_duration (@emph{framesize})
  746. Set maximum frame size, or duration of a frame in milliseconds. The
  747. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  748. frame sizes achieve lower latency but less quality at a given bitrate.
  749. Sizes greater than 20ms are only interesting at fairly low bitrates.
  750. The default is 20ms.
  751. @item packet_loss (@emph{expect-loss})
  752. Set expected packet loss percentage. The default is 0.
  753. @item fec (@emph{n/a})
  754. Enable inband forward error correction. @option{packet_loss} must be non-zero
  755. to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss.
  756. Default is disabled.
  757. @item application (N.A.)
  758. Set intended application type. Valid options are listed below:
  759. @table @samp
  760. @item voip
  761. Favor improved speech intelligibility.
  762. @item audio
  763. Favor faithfulness to the input (the default).
  764. @item lowdelay
  765. Restrict to only the lowest delay modes.
  766. @end table
  767. @item cutoff (N.A.)
  768. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  769. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  770. narrowband, mediumband, wideband, super wideband, and fullband
  771. respectively. The default is 0 (cutoff disabled).
  772. @item mapping_family (@emph{mapping_family})
  773. Set channel mapping family to be used by the encoder. The default value of -1
  774. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  775. otherwise. The default also disables the surround masking and LFE bandwidth
  776. optimzations in libopus, and requires that the input contains 8 channels or
  777. fewer.
  778. Other values include 0 for mono and stereo, 1 for surround sound with masking
  779. and LFE bandwidth optimizations, and 255 for independent streams with an
  780. unspecified channel layout.
  781. @item apply_phase_inv (N.A.) (requires libopus >= 1.2)
  782. If set to 0, disables the use of phase inversion for intensity stereo,
  783. improving the quality of mono downmixes, but slightly reducing normal stereo
  784. quality. The default is 1 (phase inversion enabled).
  785. @end table
  786. @anchor{libshine}
  787. @section libshine
  788. Shine Fixed-Point MP3 encoder wrapper.
  789. Shine is a fixed-point MP3 encoder. It has a far better performance on
  790. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  791. However, as it is more targeted on performance than quality, it is not on par
  792. with LAME and other production-grade encoders quality-wise. Also, according to
  793. the project's homepage, this encoder may not be free of bugs as the code was
  794. written a long time ago and the project was dead for at least 5 years.
  795. This encoder only supports stereo and mono input. This is also CBR-only.
  796. The original project (last updated in early 2007) is at
  797. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  798. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  799. Requires the presence of the libshine headers and library during
  800. configuration. You need to explicitly configure the build with
  801. @code{--enable-libshine}.
  802. See also @ref{libmp3lame}.
  803. @subsection Options
  804. The following options are supported by the libshine wrapper. The
  805. @command{shineenc}-equivalent of the options are listed in parentheses.
  806. @table @option
  807. @item b (@emph{-b})
  808. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  809. is expressed in kilobits/s.
  810. @end table
  811. @section libtwolame
  812. TwoLAME MP2 encoder wrapper.
  813. Requires the presence of the libtwolame headers and library during
  814. configuration. You need to explicitly configure the build with
  815. @code{--enable-libtwolame}.
  816. @subsection Options
  817. The following options are supported by the libtwolame wrapper. The
  818. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  819. parentheses.
  820. @table @option
  821. @item b (@emph{-b})
  822. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  823. option is expressed in kilobits/s. Default value is 128k.
  824. @item q (@emph{-V})
  825. Set quality for experimental VBR support. Maximum value range is
  826. from -50 to 50, useful range is from -10 to 10. The higher the
  827. value, the better the quality. This option is valid only using the
  828. @command{ffmpeg} command-line tool. For library interface users,
  829. use @option{global_quality}.
  830. @item mode (@emph{--mode})
  831. Set the mode of the resulting audio. Possible values:
  832. @table @samp
  833. @item auto
  834. Choose mode automatically based on the input. This is the default.
  835. @item stereo
  836. Stereo
  837. @item joint_stereo
  838. Joint stereo
  839. @item dual_channel
  840. Dual channel
  841. @item mono
  842. Mono
  843. @end table
  844. @item psymodel (@emph{--psyc-mode})
  845. Set psychoacoustic model to use in encoding. The argument must be
  846. an integer between -1 and 4, inclusive. The higher the value, the
  847. better the quality. The default value is 3.
  848. @item energy_levels (@emph{--energy})
  849. Enable energy levels extensions when set to 1. The default value is
  850. 0 (disabled).
  851. @item error_protection (@emph{--protect})
  852. Enable CRC error protection when set to 1. The default value is 0
  853. (disabled).
  854. @item copyright (@emph{--copyright})
  855. Set MPEG audio copyright flag when set to 1. The default value is 0
  856. (disabled).
  857. @item original (@emph{--original})
  858. Set MPEG audio original flag when set to 1. The default value is 0
  859. (disabled).
  860. @end table
  861. @section libvo-amrwbenc
  862. VisualOn Adaptive Multi-Rate Wideband encoder.
  863. Requires the presence of the libvo-amrwbenc headers and library during
  864. configuration. You need to explicitly configure the build with
  865. @code{--enable-libvo-amrwbenc --enable-version3}.
  866. This is a mono-only encoder. Officially it only supports 16000Hz sample
  867. rate, but you can override it by setting @option{strict} to
  868. @samp{unofficial} or lower.
  869. @subsection Options
  870. @table @option
  871. @item b
  872. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  873. libavcodec will round to the nearest valid bitrate.
  874. @table @samp
  875. @item 6600
  876. @item 8850
  877. @item 12650
  878. @item 14250
  879. @item 15850
  880. @item 18250
  881. @item 19850
  882. @item 23050
  883. @item 23850
  884. @end table
  885. @item dtx
  886. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  887. default value is 0 (disabled).
  888. @end table
  889. @section libvorbis
  890. libvorbis encoder wrapper.
  891. Requires the presence of the libvorbisenc headers and library during
  892. configuration. You need to explicitly configure the build with
  893. @code{--enable-libvorbis}.
  894. @subsection Options
  895. The following options are supported by the libvorbis wrapper. The
  896. @command{oggenc}-equivalent of the options are listed in parentheses.
  897. To get a more accurate and extensive documentation of the libvorbis
  898. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  899. See @url{http://xiph.org/vorbis/},
  900. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  901. @table @option
  902. @item b (@emph{-b})
  903. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  904. expressed in kilobits/s.
  905. @item q (@emph{-q})
  906. Set constant quality setting for VBR. The value should be a float
  907. number in the range of -1.0 to 10.0. The higher the value, the better
  908. the quality. The default value is @samp{3.0}.
  909. This option is valid only using the @command{ffmpeg} command-line tool.
  910. For library interface users, use @option{global_quality}.
  911. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  912. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  913. related option is expressed in kHz. The default value is @samp{0} (cutoff
  914. disabled).
  915. @item minrate (@emph{-m})
  916. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  917. expressed in kilobits/s.
  918. @item maxrate (@emph{-M})
  919. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  920. expressed in kilobits/s. This only has effect on ABR mode.
  921. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  922. Set noise floor bias for impulse blocks. The value is a float number from
  923. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  924. to the crispness of transients in the encoded audio. The tradeoff for better
  925. transient response is a higher bitrate.
  926. @end table
  927. @anchor{mjpegenc}
  928. @section mjpeg
  929. Motion JPEG encoder.
  930. @subsection Options
  931. @table @option
  932. @item huffman
  933. Set the huffman encoding strategy. Possible values:
  934. @table @samp
  935. @item default
  936. Use the default huffman tables. This is the default strategy.
  937. @item optimal
  938. Compute and use optimal huffman tables.
  939. @end table
  940. @end table
  941. @anchor{wavpackenc}
  942. @section wavpack
  943. WavPack lossless audio encoder.
  944. @subsection Options
  945. The equivalent options for @command{wavpack} command line utility are listed in
  946. parentheses.
  947. @subsubsection Shared options
  948. The following shared options are effective for this encoder. Only special notes
  949. about this particular encoder will be documented here. For the general meaning
  950. of the options, see @ref{codec-options,,the Codec Options chapter}.
  951. @table @option
  952. @item frame_size (@emph{--blocksize})
  953. For this encoder, the range for this option is between 128 and 131072. Default
  954. is automatically decided based on sample rate and number of channel.
  955. For the complete formula of calculating default, see
  956. @file{libavcodec/wavpackenc.c}.
  957. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
  958. @end table
  959. @subsubsection Private options
  960. @table @option
  961. @item joint_stereo (@emph{-j})
  962. Set whether to enable joint stereo. Valid values are:
  963. @table @samp
  964. @item on (@emph{1})
  965. Force mid/side audio encoding.
  966. @item off (@emph{0})
  967. Force left/right audio encoding.
  968. @item auto
  969. Let the encoder decide automatically.
  970. @end table
  971. @item optimize_mono
  972. Set whether to enable optimization for mono. This option is only effective for
  973. non-mono streams. Available values:
  974. @table @samp
  975. @item on
  976. enabled
  977. @item off
  978. disabled
  979. @end table
  980. @end table
  981. @c man end AUDIO ENCODERS
  982. @chapter Video Encoders
  983. @c man begin VIDEO ENCODERS
  984. A description of some of the currently available video encoders
  985. follows.
  986. @section GIF
  987. GIF image/animation encoder.
  988. @subsection Options
  989. @table @option
  990. @item gifflags @var{integer}
  991. Sets the flags used for GIF encoding.
  992. @table @option
  993. @item offsetting
  994. Enables picture offsetting.
  995. Default is enabled.
  996. @item transdiff
  997. Enables transparency detection between frames.
  998. Default is enabled.
  999. @end table
  1000. @item gifimage @var{integer}
  1001. Enables encoding one full GIF image per frame, rather than an animated GIF.
  1002. Default value is @option{0}.
  1003. @item global_palette @var{integer}
  1004. Writes a palette to the global GIF header where feasible.
  1005. If disabled, every frame will always have a palette written, even if there
  1006. is a global palette supplied.
  1007. Default value is @option{1}.
  1008. @end table
  1009. @section Hap
  1010. Vidvox Hap video encoder.
  1011. @subsection Options
  1012. @table @option
  1013. @item format @var{integer}
  1014. Specifies the Hap format to encode.
  1015. @table @option
  1016. @item hap
  1017. @item hap_alpha
  1018. @item hap_q
  1019. @end table
  1020. Default value is @option{hap}.
  1021. @item chunks @var{integer}
  1022. Specifies the number of chunks to split frames into, between 1 and 64. This
  1023. permits multithreaded decoding of large frames, potentially at the cost of
  1024. data-rate. The encoder may modify this value to divide frames evenly.
  1025. Default value is @var{1}.
  1026. @item compressor @var{integer}
  1027. Specifies the second-stage compressor to use. If set to @option{none},
  1028. @option{chunks} will be limited to 1, as chunked uncompressed frames offer no
  1029. benefit.
  1030. @table @option
  1031. @item none
  1032. @item snappy
  1033. @end table
  1034. Default value is @option{snappy}.
  1035. @end table
  1036. @section jpeg2000
  1037. The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
  1038. option can be used to set the encoding quality. Lossless encoding
  1039. can be selected with @code{-pred 1}.
  1040. @subsection Options
  1041. @table @option
  1042. @item format @var{integer}
  1043. Can be set to either @code{j2k} or @code{jp2} (the default) that
  1044. makes it possible to store non-rgb pix_fmts.
  1045. @item tile_width @var{integer}
  1046. Sets tile width. Range is 1 to 1073741824. Default is 256.
  1047. @item tile_height @var{integer}
  1048. Sets tile height. Range is 1 to 1073741824. Default is 256.
  1049. @item pred @var{integer}
  1050. Allows setting the discrete wavelet transform (DWT) type
  1051. @table @option
  1052. @item dwt97int (Lossy)
  1053. @item dwt53 (Lossless)
  1054. @end table
  1055. Default is @code{dwt97int}
  1056. @item sop @var{boolean}
  1057. Enable this to add SOP marker at the start of each packet. Disabled by default.
  1058. @item eph @var{boolean}
  1059. Enable this to add EPH marker at the end of each packet header. Disabled by default.
  1060. @item prog @var{integer}
  1061. Sets the progression order to be used by the encoder.
  1062. Possible values are:
  1063. @table @option
  1064. @item lrcp
  1065. @item rlcp
  1066. @item rpcl
  1067. @item pcrl
  1068. @item cprl
  1069. @end table
  1070. Set to @code{lrcp} by default.
  1071. @item layer_rates @var{string}
  1072. By default, when this option is not used, compression is done using the quality metric.
  1073. This option allows for compression using compression ratio. The compression ratio for each
  1074. level could be specified. The compression ratio of a layer @code{l} species the what ratio of
  1075. total file size is contained in the first @code{l} layers.
  1076. Example usage:
  1077. @example
  1078. ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
  1079. @end example
  1080. This would compress the image to contain 3 layers, where the data contained in the
  1081. first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
  1082. and shall contain all data while using all 3 layers.
  1083. @end table
  1084. @section librav1e
  1085. rav1e AV1 encoder wrapper.
  1086. Requires the presence of the rav1e headers and library during configuration.
  1087. You need to explicitly configure the build with @code{--enable-librav1e}.
  1088. @subsection Options
  1089. @table @option
  1090. @item qmax
  1091. Sets the maximum quantizer to use when using bitrate mode.
  1092. @item qmin
  1093. Sets the minimum quantizer to use when using bitrate mode.
  1094. @item qp
  1095. Uses quantizer mode to encode at the given quantizer (0-255).
  1096. @item speed
  1097. Selects the speed preset (0-10) to encode with.
  1098. @item tiles
  1099. Selects how many tiles to encode with.
  1100. @item tile-rows
  1101. Selects how many rows of tiles to encode with.
  1102. @item tile-columns
  1103. Selects how many columns of tiles to encode with.
  1104. @item rav1e-params
  1105. Set rav1e options using a list of @var{key}=@var{value} pairs separated
  1106. by ":". See @command{rav1e --help} for a list of options.
  1107. For example to specify librav1e encoding options with @option{-rav1e-params}:
  1108. @example
  1109. ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  1110. @end example
  1111. @end table
  1112. @section libaom-av1
  1113. libaom AV1 encoder wrapper.
  1114. Requires the presence of the libaom headers and library during
  1115. configuration. You need to explicitly configure the build with
  1116. @code{--enable-libaom}.
  1117. @subsection Options
  1118. The wrapper supports the following standard libavcodec options:
  1119. @table @option
  1120. @item b
  1121. Set bitrate target in bits/second. By default this will use
  1122. variable-bitrate mode. If @option{maxrate} and @option{minrate} are
  1123. also set to the same value then it will use constant-bitrate mode,
  1124. otherwise if @option{crf} is set as well then it will use
  1125. constrained-quality mode.
  1126. @item g keyint_min
  1127. Set key frame placement. The GOP size sets the maximum distance between
  1128. key frames; if zero the output stream will be intra-only. The minimum
  1129. distance is ignored unless it is the same as the GOP size, in which case
  1130. key frames will always appear at a fixed interval. Not set by default,
  1131. so without this option the library has completely free choice about
  1132. where to place key frames.
  1133. @item qmin qmax
  1134. Set minimum/maximum quantisation values. Valid range is from 0 to 63
  1135. (warning: this does not match the quantiser values actually used by AV1
  1136. - divide by four to map real quantiser values to this range). Defaults
  1137. to min/max (no constraint).
  1138. @item minrate maxrate bufsize rc_init_occupancy
  1139. Set rate control buffering parameters. Not used if not set - defaults
  1140. to unconstrained variable bitrate.
  1141. @item threads
  1142. Set the number of threads to use while encoding. This may require the
  1143. @option{tiles} or @option{row-mt} options to also be set to actually
  1144. use the specified number of threads fully. Defaults to the number of
  1145. hardware threads supported by the host machine.
  1146. @item profile
  1147. Set the encoding profile. Defaults to using the profile which matches
  1148. the bit depth and chroma subsampling of the input.
  1149. @end table
  1150. The wrapper also has some specific options:
  1151. @table @option
  1152. @item cpu-used
  1153. Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  1154. higher numbers indicating greater speed and lower quality. The default
  1155. value is 1, which will be slow and high quality.
  1156. @item auto-alt-ref
  1157. Enable use of alternate reference frames. Defaults to the internal
  1158. default of the library.
  1159. @item arnr-max-frames (@emph{frames})
  1160. Set altref noise reduction max frame count. Default is -1.
  1161. @item arnr-strength (@emph{strength})
  1162. Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  1163. @item aq-mode (@emph{aq-mode})
  1164. Set adaptive quantization mode. Possible values:
  1165. @table @samp
  1166. @item none (@emph{0})
  1167. Disabled.
  1168. @item variance (@emph{1})
  1169. Variance-based.
  1170. @item complexity (@emph{2})
  1171. Complexity-based.
  1172. @item cyclic (@emph{3})
  1173. Cyclic refresh.
  1174. @end table
  1175. @item tune (@emph{tune})
  1176. Set the distortion metric the encoder is tuned with. Default is @code{psnr}.
  1177. @table @samp
  1178. @item psnr (@emph{0})
  1179. @item ssim (@emph{1})
  1180. @end table
  1181. @item lag-in-frames
  1182. Set the maximum number of frames which the encoder may keep in flight
  1183. at any one time for lookahead purposes. Defaults to the internal
  1184. default of the library.
  1185. @item error-resilience
  1186. Enable error resilience features:
  1187. @table @option
  1188. @item default
  1189. Improve resilience against losses of whole frames.
  1190. @end table
  1191. Not enabled by default.
  1192. @item crf
  1193. Set the quality/size tradeoff for constant-quality (no bitrate target)
  1194. and constrained-quality (with maximum bitrate target) modes. Valid
  1195. range is 0 to 63, higher numbers indicating lower quality and smaller
  1196. output size. Only used if set; by default only the bitrate target is
  1197. used.
  1198. @item static-thresh
  1199. Set a change threshold on blocks below which they will be skipped by
  1200. the encoder. Defined in arbitrary units as a nonnegative integer,
  1201. defaulting to zero (no blocks are skipped).
  1202. @item drop-threshold
  1203. Set a threshold for dropping frames when close to rate control bounds.
  1204. Defined as a percentage of the target buffer - when the rate control
  1205. buffer falls below this percentage, frames will be dropped until it
  1206. has refilled above the threshold. Defaults to zero (no frames are
  1207. dropped).
  1208. @item denoise-noise-level (@emph{level})
  1209. Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  1210. this option is not set or set to 0.
  1211. @item denoise-block-size (@emph{pixels})
  1212. Block size used for denoising for grain synthesis. If not set, AV1 codec
  1213. uses the default value of 32.
  1214. @item undershoot-pct (@emph{pct})
  1215. Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  1216. Default is -1.
  1217. @item overshoot-pct (@emph{pct})
  1218. Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  1219. Default is -1.
  1220. @item minsection-pct (@emph{pct})
  1221. Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  1222. is not set, the libaomenc wrapper computes it as follows: @code{(minrate * 100 / bitrate)}.
  1223. Range is -1 to 100. Default is -1 (unset).
  1224. @item maxsection-pct (@emph{pct})
  1225. Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  1226. is not set, the libaomenc wrapper computes it as follows: @code{(maxrate * 100 / bitrate)}.
  1227. Range is -1 to 5000. Default is -1 (unset).
  1228. @item frame-parallel (@emph{boolean})
  1229. Enable frame parallel decodability features. Default is true.
  1230. @item tiles
  1231. Set the number of tiles to encode the input video with, as columns x
  1232. rows. Larger numbers allow greater parallelism in both encoding and
  1233. decoding, but may decrease coding efficiency. Defaults to the minimum
  1234. number of tiles required by the size of the input video (this is 1x1
  1235. (that is, a single tile) for sizes up to and including 4K).
  1236. @item tile-columns tile-rows
  1237. Set the number of tiles as log2 of the number of tile rows and columns.
  1238. Provided for compatibility with libvpx/VP9.
  1239. @item row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
  1240. Enable row based multi-threading. Disabled by default.
  1241. @item enable-cdef (@emph{boolean})
  1242. Enable Constrained Directional Enhancement Filter. The libaom-av1
  1243. encoder enables CDEF by default.
  1244. @item enable-restoration (@emph{boolean})
  1245. Enable Loop Restoration Filter. Default is true for libaom-av1.
  1246. @item enable-global-motion (@emph{boolean})
  1247. Enable the use of global motion for block prediction. Default is true.
  1248. @item enable-intrabc (@emph{boolean})
  1249. Enable block copy mode for intra block prediction. This mode is
  1250. useful for screen content. Default is true.
  1251. @item enable-rect-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
  1252. Enable rectangular partitions. Default is true.
  1253. @item enable-1to4-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
  1254. Enable 1:4/4:1 partitions. Default is true.
  1255. @item enable-ab-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
  1256. Enable AB shape partitions. Default is true.
  1257. @item enable-angle-delta (@emph{boolean}) (Requires libaom >= v2.0.0)
  1258. Enable angle delta intra prediction. Default is true.
  1259. @item enable-cfl-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1260. Enable chroma predicted from luma intra prediction. Default is true.
  1261. @item enable-filter-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1262. Enable filter intra predictor. Default is true.
  1263. @item enable-intra-edge-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
  1264. Enable intra edge filter. Default is true.
  1265. @item enable-smooth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1266. Enable smooth intra prediction mode. Default is true.
  1267. @item enable-paeth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1268. Enable paeth predictor in intra prediction. Default is true.
  1269. @item enable-palette (@emph{boolean}) (Requires libaom >= v2.0.0)
  1270. Enable palette prediction mode. Default is true.
  1271. @item enable-flip-idtx (@emph{boolean}) (Requires libaom >= v2.0.0)
  1272. Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
  1273. FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
  1274. V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
  1275. @item enable-tx64 (@emph{boolean}) (Requires libaom >= v2.0.0)
  1276. Enable 64-pt transform. Default is true.
  1277. @item reduced-tx-type-set (@emph{boolean}) (Requires libaom >= v2.0.0)
  1278. Use reduced set of transform types. Default is false.
  1279. @item use-intra-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
  1280. Use DCT only for INTRA modes. Default is false.
  1281. @item use-inter-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
  1282. Use DCT only for INTER modes. Default is false.
  1283. @item use-intra-default-tx-only (@emph{boolean}) (Requires libaom >= v2.0.0)
  1284. Use Default-transform only for INTRA modes. Default is false.
  1285. @item enable-ref-frame-mvs (@emph{boolean}) (Requires libaom >= v2.0.0)
  1286. Enable temporal mv prediction. Default is true.
  1287. @item enable-reduced-reference-set (@emph{boolean}) (Requires libaom >= v2.0.0)
  1288. Use reduced set of single and compound references. Default is false.
  1289. @item enable-obmc (@emph{boolean}) (Requires libaom >= v2.0.0)
  1290. Enable obmc. Default is true.
  1291. @item enable-dual-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
  1292. Enable dual filter. Default is true.
  1293. @item enable-diff-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1294. Enable difference-weighted compound. Default is true.
  1295. @item enable-dist-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1296. Enable distance-weighted compound. Default is true.
  1297. @item enable-onesided-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1298. Enable one sided compound. Default is true.
  1299. @item enable-interinter-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
  1300. Enable interinter wedge compound. Default is true.
  1301. @item enable-interintra-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
  1302. Enable interintra wedge compound. Default is true.
  1303. @item enable-masked-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1304. Enable masked compound. Default is true.
  1305. @item enable-interintra-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1306. Enable interintra compound. Default is true.
  1307. @item enable-smooth-interintra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1308. Enable smooth interintra mode. Default is true.
  1309. @item aom-params
  1310. Set libaom options using a list of @var{key}=@var{value} pairs separated
  1311. by ":". For a list of supported options, see @command{aomenc --help} under the
  1312. section "AV1 Specific Options".
  1313. For example to specify libaom encoding options with @option{-aom-params}:
  1314. @example
  1315. ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
  1316. @end example
  1317. @end table
  1318. @section libsvtav1
  1319. SVT-AV1 encoder wrapper.
  1320. Requires the presence of the SVT-AV1 headers and library during configuration.
  1321. You need to explicitly configure the build with @code{--enable-libsvtav1}.
  1322. @subsection Options
  1323. @table @option
  1324. @item profile
  1325. Set the encoding profile.
  1326. @item level
  1327. Set the operating point level.
  1328. @item tier
  1329. Set the operating point tier.
  1330. @item rc
  1331. Set the rate control mode to use.
  1332. Possible modes:
  1333. @table @option
  1334. @item cqp
  1335. Constant quantizer: use fixed values of qindex (dependent on the frame type)
  1336. throughout the stream. This mode is the default.
  1337. @item vbr
  1338. Variable bitrate: use a target bitrate for the whole stream.
  1339. @item cvbr
  1340. Constrained variable bitrate: use a target bitrate for each GOP.
  1341. @end table
  1342. @item qmax
  1343. Set the maximum quantizer to use when using a bitrate mode.
  1344. @item qmin
  1345. Set the minimum quantizer to use when using a bitrate mode.
  1346. @item qp
  1347. Set the quantizer used in cqp rate control mode (0-63).
  1348. @item sc_detection
  1349. Enable scene change detection.
  1350. @item la_depth
  1351. Set number of frames to look ahead (0-120).
  1352. @item preset
  1353. Set the quality-speed tradeoff, in the range 0 to 8. Higher values are
  1354. faster but lower quality. Defaults to 8 (highest speed).
  1355. @item tile_rows
  1356. Set log2 of the number of rows of tiles to use (0-6).
  1357. @item tile_columns
  1358. Set log2 of the number of columns of tiles to use (0-4).
  1359. @end table
  1360. @section libkvazaar
  1361. Kvazaar H.265/HEVC encoder.
  1362. Requires the presence of the libkvazaar headers and library during
  1363. configuration. You need to explicitly configure the build with
  1364. @option{--enable-libkvazaar}.
  1365. @subsection Options
  1366. @table @option
  1367. @item b
  1368. Set target video bitrate in bit/s and enable rate control.
  1369. @item kvazaar-params
  1370. Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
  1371. by commas (,). See kvazaar documentation for a list of options.
  1372. @end table
  1373. @section libopenh264
  1374. Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  1375. This encoder requires the presence of the libopenh264 headers and
  1376. library during configuration. You need to explicitly configure the
  1377. build with @code{--enable-libopenh264}. The library is detected using
  1378. @command{pkg-config}.
  1379. For more information about the library see
  1380. @url{http://www.openh264.org}.
  1381. @subsection Options
  1382. The following FFmpeg global options affect the configurations of the
  1383. libopenh264 encoder.
  1384. @table @option
  1385. @item b
  1386. Set the bitrate (as a number of bits per second).
  1387. @item g
  1388. Set the GOP size.
  1389. @item maxrate
  1390. Set the max bitrate (as a number of bits per second).
  1391. @item flags +global_header
  1392. Set global header in the bitstream.
  1393. @item slices
  1394. Set the number of slices, used in parallelized encoding. Default value
  1395. is 0. This is only used when @option{slice_mode} is set to
  1396. @samp{fixed}.
  1397. @item slice_mode
  1398. Set slice mode. Can assume one of the following possible values:
  1399. @table @samp
  1400. @item fixed
  1401. a fixed number of slices
  1402. @item rowmb
  1403. one slice per row of macroblocks
  1404. @item auto
  1405. automatic number of slices according to number of threads
  1406. @item dyn
  1407. dynamic slicing
  1408. @end table
  1409. Default value is @samp{auto}.
  1410. @item loopfilter
  1411. Enable loop filter, if set to 1 (automatically enabled). To disable
  1412. set a value of 0.
  1413. @item profile
  1414. Set profile restrictions. If set to the value of @samp{main} enable
  1415. CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
  1416. @item max_nal_size
  1417. Set maximum NAL size in bytes.
  1418. @item allow_skip_frames
  1419. Allow skipping frames to hit the target bitrate if set to 1.
  1420. @end table
  1421. @section libtheora
  1422. libtheora Theora encoder wrapper.
  1423. Requires the presence of the libtheora headers and library during
  1424. configuration. You need to explicitly configure the build with
  1425. @code{--enable-libtheora}.
  1426. For more information about the libtheora project see
  1427. @url{http://www.theora.org/}.
  1428. @subsection Options
  1429. The following global options are mapped to internal libtheora options
  1430. which affect the quality and the bitrate of the encoded stream.
  1431. @table @option
  1432. @item b
  1433. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  1434. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  1435. @item flags
  1436. Used to enable constant quality mode (VBR) encoding through the
  1437. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  1438. modes.
  1439. @item g
  1440. Set the GOP size.
  1441. @item global_quality
  1442. Set the global quality as an integer in lambda units.
  1443. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  1444. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  1445. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  1446. value in the native libtheora range [0-63]. A higher value corresponds
  1447. to a higher quality.
  1448. @item q
  1449. Enable VBR mode when set to a non-negative value, and set constant
  1450. quality value as a double floating point value in QP units.
  1451. The value is clipped in the [0-10] range, and then multiplied by 6.3
  1452. to get a value in the native libtheora range [0-63].
  1453. This option is valid only using the @command{ffmpeg} command-line
  1454. tool. For library interface users, use @option{global_quality}.
  1455. @end table
  1456. @subsection Examples
  1457. @itemize
  1458. @item
  1459. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  1460. @example
  1461. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  1462. @end example
  1463. @item
  1464. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  1465. @example
  1466. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  1467. @end example
  1468. @end itemize
  1469. @section libvpx
  1470. VP8/VP9 format supported through libvpx.
  1471. Requires the presence of the libvpx headers and library during configuration.
  1472. You need to explicitly configure the build with @code{--enable-libvpx}.
  1473. @subsection Options
  1474. The following options are supported by the libvpx wrapper. The
  1475. @command{vpxenc}-equivalent options or values are listed in parentheses
  1476. for easy migration.
  1477. To reduce the duplication of documentation, only the private options
  1478. and some others requiring special attention are documented here. For
  1479. the documentation of the undocumented generic options, see
  1480. @ref{codec-options,,the Codec Options chapter}.
  1481. To get more documentation of the libvpx options, invoke the command
  1482. @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
  1483. @command{vpxenc --help}. Further information is available in the libvpx API
  1484. documentation.
  1485. @table @option
  1486. @item b (@emph{target-bitrate})
  1487. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1488. expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
  1489. kilobits/s.
  1490. @item g (@emph{kf-max-dist})
  1491. @item keyint_min (@emph{kf-min-dist})
  1492. @item qmin (@emph{min-q})
  1493. @item qmax (@emph{max-q})
  1494. @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
  1495. Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
  1496. specified in milliseconds, the libvpx wrapper converts this value as follows:
  1497. @code{buf-sz = bufsize * 1000 / bitrate},
  1498. @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
  1499. @item rc_init_occupancy (@emph{buf-initial-sz})
  1500. Set number of bits which should be loaded into the rc buffer before decoding
  1501. starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
  1502. wrapper converts this value as follows:
  1503. @code{rc_init_occupancy * 1000 / bitrate}.
  1504. @item undershoot-pct
  1505. Set datarate undershoot (min) percentage of the target bitrate.
  1506. @item overshoot-pct
  1507. Set datarate overshoot (max) percentage of the target bitrate.
  1508. @item skip_threshold (@emph{drop-frame})
  1509. @item qcomp (@emph{bias-pct})
  1510. @item maxrate (@emph{maxsection-pct})
  1511. Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1512. percentage of the target bitrate, the libvpx wrapper converts this value as
  1513. follows: @code{(maxrate * 100 / bitrate)}.
  1514. @item minrate (@emph{minsection-pct})
  1515. Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1516. percentage of the target bitrate, the libvpx wrapper converts this value as
  1517. follows: @code{(minrate * 100 / bitrate)}.
  1518. @item minrate, maxrate, b @emph{end-usage=cbr}
  1519. @code{(minrate == maxrate == bitrate)}.
  1520. @item crf (@emph{end-usage=cq}, @emph{cq-level})
  1521. @item tune (@emph{tune})
  1522. @table @samp
  1523. @item psnr (@emph{psnr})
  1524. @item ssim (@emph{ssim})
  1525. @end table
  1526. @item quality, deadline (@emph{deadline})
  1527. @table @samp
  1528. @item best
  1529. Use best quality deadline. Poorly named and quite slow, this option should be
  1530. avoided as it may give worse quality output than good.
  1531. @item good
  1532. Use good quality deadline. This is a good trade-off between speed and quality
  1533. when used with the @option{cpu-used} option.
  1534. @item realtime
  1535. Use realtime quality deadline.
  1536. @end table
  1537. @item speed, cpu-used (@emph{cpu-used})
  1538. Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  1539. of quality.
  1540. @item nr (@emph{noise-sensitivity})
  1541. @item static-thresh
  1542. Set a change threshold on blocks below which they will be skipped by the
  1543. encoder.
  1544. @item slices (@emph{token-parts})
  1545. Note that FFmpeg's @option{slices} option gives the total number of partitions,
  1546. while @command{vpxenc}'s @option{token-parts} is given as
  1547. @code{log2(partitions)}.
  1548. @item max-intra-rate
  1549. Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  1550. means unlimited.
  1551. @item force_key_frames
  1552. @code{VPX_EFLAG_FORCE_KF}
  1553. @item Alternate reference frame related
  1554. @table @option
  1555. @item auto-alt-ref
  1556. Enable use of alternate reference frames (2-pass only).
  1557. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  1558. @item arnr-maxframes
  1559. Set altref noise reduction max frame count.
  1560. @item arnr-type
  1561. Set altref noise reduction filter type: backward, forward, centered.
  1562. @item arnr-strength
  1563. Set altref noise reduction filter strength.
  1564. @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
  1565. Set number of frames to look ahead for frametype and ratecontrol.
  1566. @end table
  1567. @item error-resilient
  1568. Enable error resiliency features.
  1569. @item sharpness @var{integer}
  1570. Increase sharpness at the expense of lower PSNR.
  1571. The valid range is [0, 7].
  1572. @item ts-parameters
  1573. Sets the temporal scalability configuration using a :-separated list of
  1574. key=value pairs. For example, to specify temporal scalability parameters
  1575. with @code{ffmpeg}:
  1576. @example
  1577. ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  1578. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  1579. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  1580. @end example
  1581. Below is a brief explanation of each of the parameters, please
  1582. refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
  1583. details.
  1584. @table @option
  1585. @item ts_number_layers
  1586. Number of temporal coding layers.
  1587. @item ts_target_bitrate
  1588. Target bitrate for each temporal layer (in kbps).
  1589. (bitrate should be inclusive of the lower temporal layer).
  1590. @item ts_rate_decimator
  1591. Frame rate decimation factor for each temporal layer.
  1592. @item ts_periodicity
  1593. Length of the sequence defining frame temporal layer membership.
  1594. @item ts_layer_id
  1595. Template defining the membership of frames to temporal layers.
  1596. @item ts_layering_mode
  1597. (optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  1598. Currently supports the following options.
  1599. @table @option
  1600. @item 0
  1601. No temporal layering flags are provided internally,
  1602. relies on flags being passed in using @code{metadata} field in @code{AVFrame}
  1603. with following keys.
  1604. @table @option
  1605. @item vp8-flags
  1606. Sets the flags passed into the encoder to indicate the referencing scheme for
  1607. the current frame.
  1608. Refer to function @code{vpx_codec_encode} in @code{vpx/vpx_encoder.h} for more
  1609. details.
  1610. @item temporal_id
  1611. Explicitly sets the temporal id of the current frame to encode.
  1612. @end table
  1613. @item 2
  1614. Two temporal layers. 0-1...
  1615. @item 3
  1616. Three temporal layers. 0-2-1-2...; with single reference frame.
  1617. @item 4
  1618. Same as option "3", except there is a dependency between
  1619. the two temporal layer 2 frames within the temporal period.
  1620. @end table
  1621. @end table
  1622. @item VP9-specific options
  1623. @table @option
  1624. @item lossless
  1625. Enable lossless mode.
  1626. @item tile-columns
  1627. Set number of tile columns to use. Note this is given as
  1628. @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
  1629. setting the @option{tile-columns} option to 3.
  1630. @item tile-rows
  1631. Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
  1632. For example, 4 tile rows would be requested by setting the @option{tile-rows}
  1633. option to 2.
  1634. @item frame-parallel
  1635. Enable frame parallel decodability features.
  1636. @item aq-mode
  1637. Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  1638. cyclic refresh, 4: equator360).
  1639. @item colorspace @emph{color-space}
  1640. Set input color space. The VP9 bitstream supports signaling the following
  1641. colorspaces:
  1642. @table @option
  1643. @item @samp{rgb} @emph{sRGB}
  1644. @item @samp{bt709} @emph{bt709}
  1645. @item @samp{unspecified} @emph{unknown}
  1646. @item @samp{bt470bg} @emph{bt601}
  1647. @item @samp{smpte170m} @emph{smpte170}
  1648. @item @samp{smpte240m} @emph{smpte240}
  1649. @item @samp{bt2020_ncl} @emph{bt2020}
  1650. @end table
  1651. @item row-mt @var{boolean}
  1652. Enable row based multi-threading.
  1653. @item tune-content
  1654. Set content type: default (0), screen (1), film (2).
  1655. @item corpus-complexity
  1656. Corpus VBR mode is a variant of standard VBR where the complexity distribution
  1657. midpoint is passed in rather than calculated for a specific clip or chunk.
  1658. The valid range is [0, 10000]. 0 (default) uses standard VBR.
  1659. @item enable-tpl @var{boolean}
  1660. Enable temporal dependency model.
  1661. @item ref-frame-config
  1662. Using per-frame metadata, set members of the structure @code{vpx_svc_ref_frame_config_t} in @code{vpx/vp8cx.h} to fine-control referencing schemes and frame buffer management.
  1663. @*Use a :-separated list of key=value pairs.
  1664. For example,
  1665. @example
  1666. av_dict_set(&av_frame->metadata, "ref-frame-config", \
  1667. "rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
  1668. @end example
  1669. @table @option
  1670. @item rfc_update_buffer_slot
  1671. Indicates the buffer slot number to update
  1672. @item rfc_update_last
  1673. Indicates whether to update the LAST frame
  1674. @item rfc_update_golden
  1675. Indicates whether to update GOLDEN frame
  1676. @item rfc_update_alt_ref
  1677. Indicates whether to update ALT_REF frame
  1678. @item rfc_lst_fb_idx
  1679. LAST frame buffer index
  1680. @item rfc_gld_fb_idx
  1681. GOLDEN frame buffer index
  1682. @item rfc_alt_fb_idx
  1683. ALT_REF frame buffer index
  1684. @item rfc_reference_last
  1685. Indicates whether to reference LAST frame
  1686. @item rfc_reference_golden
  1687. Indicates whether to reference GOLDEN frame
  1688. @item rfc_reference_alt_ref
  1689. Indicates whether to reference ALT_REF frame
  1690. @item rfc_reference_duration
  1691. Indicates frame duration
  1692. @end table
  1693. @end table
  1694. @end table
  1695. For more information about libvpx see:
  1696. @url{http://www.webmproject.org/}
  1697. @section libwebp
  1698. libwebp WebP Image encoder wrapper
  1699. libwebp is Google's official encoder for WebP images. It can encode in either
  1700. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  1701. frame. Lossless images are a separate codec developed by Google.
  1702. @subsection Pixel Format
  1703. Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  1704. to limitations of the format and libwebp. Alpha is supported for either mode.
  1705. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  1706. passed in for encoding lossless, the pixel format will automatically be
  1707. converted using functions from libwebp. This is not ideal and is done only for
  1708. convenience.
  1709. @subsection Options
  1710. @table @option
  1711. @item -lossless @var{boolean}
  1712. Enables/Disables use of lossless mode. Default is 0.
  1713. @item -compression_level @var{integer}
  1714. For lossy, this is a quality/speed tradeoff. Higher values give better quality
  1715. for a given size at the cost of increased encoding time. For lossless, this is
  1716. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  1717. encoding time. More specifically, it controls the number of extra algorithms
  1718. and compression tools used, and varies the combination of these tools. This
  1719. maps to the @var{method} option in libwebp. The valid range is 0 to 6.
  1720. Default is 4.
  1721. @item -qscale @var{float}
  1722. For lossy encoding, this controls image quality, 0 to 100. For lossless
  1723. encoding, this controls the effort and time spent at compressing more. The
  1724. default value is 75. Note that for usage via libavcodec, this option is called
  1725. @var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
  1726. @item -preset @var{type}
  1727. Configuration preset. This does some automatic settings based on the general
  1728. type of the image.
  1729. @table @option
  1730. @item none
  1731. Do not use a preset.
  1732. @item default
  1733. Use the encoder default.
  1734. @item picture
  1735. Digital picture, like portrait, inner shot
  1736. @item photo
  1737. Outdoor photograph, with natural lighting
  1738. @item drawing
  1739. Hand or line drawing, with high-contrast details
  1740. @item icon
  1741. Small-sized colorful images
  1742. @item text
  1743. Text-like
  1744. @end table
  1745. @end table
  1746. @section libx264, libx264rgb
  1747. x264 H.264/MPEG-4 AVC encoder wrapper.
  1748. This encoder requires the presence of the libx264 headers and library
  1749. during configuration. You need to explicitly configure the build with
  1750. @code{--enable-libx264}.
  1751. libx264 supports an impressive number of features, including 8x8 and
  1752. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1753. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1754. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1755. Many libx264 encoder options are mapped to FFmpeg global codec
  1756. options, while unique encoder options are provided through private
  1757. options. Additionally the @option{x264opts} and @option{x264-params}
  1758. private options allows one to pass a list of key=value tuples as accepted
  1759. by the libx264 @code{x264_param_parse} function.
  1760. The x264 project website is at
  1761. @url{http://www.videolan.org/developers/x264.html}.
  1762. The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  1763. pixel formats as input instead of YUV.
  1764. @subsection Supported Pixel Formats
  1765. x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  1766. x264's configure time.
  1767. @subsection Options
  1768. The following options are supported by the libx264 wrapper. The
  1769. @command{x264}-equivalent options or values are listed in parentheses
  1770. for easy migration.
  1771. To reduce the duplication of documentation, only the private options
  1772. and some others requiring special attention are documented here. For
  1773. the documentation of the undocumented generic options, see
  1774. @ref{codec-options,,the Codec Options chapter}.
  1775. To get a more accurate and extensive documentation of the libx264
  1776. options, invoke the command @command{x264 --fullhelp} or consult
  1777. the libx264 documentation.
  1778. @table @option
  1779. @item b (@emph{bitrate})
  1780. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1781. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1782. kilobits/s.
  1783. @item bf (@emph{bframes})
  1784. @item g (@emph{keyint})
  1785. @item qmin (@emph{qpmin})
  1786. Minimum quantizer scale.
  1787. @item qmax (@emph{qpmax})
  1788. Maximum quantizer scale.
  1789. @item qdiff (@emph{qpstep})
  1790. Maximum difference between quantizer scales.
  1791. @item qblur (@emph{qblur})
  1792. Quantizer curve blur
  1793. @item qcomp (@emph{qcomp})
  1794. Quantizer curve compression factor
  1795. @item refs (@emph{ref})
  1796. Number of reference frames each P-frame can use. The range is from @var{0-16}.
  1797. @item sc_threshold (@emph{scenecut})
  1798. Sets the threshold for the scene change detection.
  1799. @item trellis (@emph{trellis})
  1800. Performs Trellis quantization to increase efficiency. Enabled by default.
  1801. @item nr (@emph{nr})
  1802. @item me_range (@emph{merange})
  1803. Maximum range of the motion search in pixels.
  1804. @item me_method (@emph{me})
  1805. Set motion estimation method. Possible values in the decreasing order
  1806. of speed:
  1807. @table @samp
  1808. @item dia (@emph{dia})
  1809. @item epzs (@emph{dia})
  1810. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1811. @samp{dia}.
  1812. @item hex (@emph{hex})
  1813. Hexagonal search with radius 2.
  1814. @item umh (@emph{umh})
  1815. Uneven multi-hexagon search.
  1816. @item esa (@emph{esa})
  1817. Exhaustive search.
  1818. @item tesa (@emph{tesa})
  1819. Hadamard exhaustive search (slowest).
  1820. @end table
  1821. @item forced-idr
  1822. Normally, when forcing a I-frame type, the encoder can select any type
  1823. of I-frame. This option forces it to choose an IDR-frame.
  1824. @item subq (@emph{subme})
  1825. Sub-pixel motion estimation method.
  1826. @item b_strategy (@emph{b-adapt})
  1827. Adaptive B-frame placement decision algorithm. Use only on first-pass.
  1828. @item keyint_min (@emph{min-keyint})
  1829. Minimum GOP size.
  1830. @item coder
  1831. Set entropy encoder. Possible values:
  1832. @table @samp
  1833. @item ac
  1834. Enable CABAC.
  1835. @item vlc
  1836. Enable CAVLC and disable CABAC. It generates the same effect as
  1837. @command{x264}'s @option{--no-cabac} option.
  1838. @end table
  1839. @item cmp
  1840. Set full pixel motion estimation comparison algorithm. Possible values:
  1841. @table @samp
  1842. @item chroma
  1843. Enable chroma in motion estimation.
  1844. @item sad
  1845. Ignore chroma in motion estimation. It generates the same effect as
  1846. @command{x264}'s @option{--no-chroma-me} option.
  1847. @end table
  1848. @item threads (@emph{threads})
  1849. Number of encoding threads.
  1850. @item thread_type
  1851. Set multithreading technique. Possible values:
  1852. @table @samp
  1853. @item slice
  1854. Slice-based multithreading. It generates the same effect as
  1855. @command{x264}'s @option{--sliced-threads} option.
  1856. @item frame
  1857. Frame-based multithreading.
  1858. @end table
  1859. @item flags
  1860. Set encoding flags. It can be used to disable closed GOP and enable
  1861. open GOP by setting it to @code{-cgop}. The result is similar to
  1862. the behavior of @command{x264}'s @option{--open-gop} option.
  1863. @item rc_init_occupancy (@emph{vbv-init})
  1864. @item preset (@emph{preset})
  1865. Set the encoding preset.
  1866. @item tune (@emph{tune})
  1867. Set tuning of the encoding params.
  1868. @item profile (@emph{profile})
  1869. Set profile restrictions.
  1870. @item fastfirstpass
  1871. Enable fast settings when encoding first pass, when set to 1. When set
  1872. to 0, it has the same effect of @command{x264}'s
  1873. @option{--slow-firstpass} option.
  1874. @item crf (@emph{crf})
  1875. Set the quality for constant quality mode.
  1876. @item crf_max (@emph{crf-max})
  1877. In CRF mode, prevents VBV from lowering quality beyond this point.
  1878. @item qp (@emph{qp})
  1879. Set constant quantization rate control method parameter.
  1880. @item aq-mode (@emph{aq-mode})
  1881. Set AQ method. Possible values:
  1882. @table @samp
  1883. @item none (@emph{0})
  1884. Disabled.
  1885. @item variance (@emph{1})
  1886. Variance AQ (complexity mask).
  1887. @item autovariance (@emph{2})
  1888. Auto-variance AQ (experimental).
  1889. @end table
  1890. @item aq-strength (@emph{aq-strength})
  1891. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1892. @item psy
  1893. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1894. same effect as @command{x264}'s @option{--no-psy} option.
  1895. @item psy-rd (@emph{psy-rd})
  1896. Set strength of psychovisual optimization, in
  1897. @var{psy-rd}:@var{psy-trellis} format.
  1898. @item rc-lookahead (@emph{rc-lookahead})
  1899. Set number of frames to look ahead for frametype and ratecontrol.
  1900. @item weightb
  1901. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1902. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1903. @item weightp (@emph{weightp})
  1904. Set weighted prediction method for P-frames. Possible values:
  1905. @table @samp
  1906. @item none (@emph{0})
  1907. Disabled
  1908. @item simple (@emph{1})
  1909. Enable only weighted refs
  1910. @item smart (@emph{2})
  1911. Enable both weighted refs and duplicates
  1912. @end table
  1913. @item ssim (@emph{ssim})
  1914. Enable calculation and printing SSIM stats after the encoding.
  1915. @item intra-refresh (@emph{intra-refresh})
  1916. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1917. to 1.
  1918. @item avcintra-class (@emph{class})
  1919. Configure the encoder to generate AVC-Intra.
  1920. Valid values are 50,100 and 200
  1921. @item bluray-compat (@emph{bluray-compat})
  1922. Configure the encoder to be compatible with the bluray standard.
  1923. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  1924. @item b-bias (@emph{b-bias})
  1925. Set the influence on how often B-frames are used.
  1926. @item b-pyramid (@emph{b-pyramid})
  1927. Set method for keeping of some B-frames as references. Possible values:
  1928. @table @samp
  1929. @item none (@emph{none})
  1930. Disabled.
  1931. @item strict (@emph{strict})
  1932. Strictly hierarchical pyramid.
  1933. @item normal (@emph{normal})
  1934. Non-strict (not Blu-ray compatible).
  1935. @end table
  1936. @item mixed-refs
  1937. Enable the use of one reference per partition, as opposed to one
  1938. reference per macroblock when set to 1. When set to 0, it has the
  1939. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  1940. @item 8x8dct
  1941. Enable adaptive spatial transform (high profile 8x8 transform)
  1942. when set to 1. When set to 0, it has the same effect as
  1943. @command{x264}'s @option{--no-8x8dct} option.
  1944. @item fast-pskip
  1945. Enable early SKIP detection on P-frames when set to 1. When set
  1946. to 0, it has the same effect as @command{x264}'s
  1947. @option{--no-fast-pskip} option.
  1948. @item aud (@emph{aud})
  1949. Enable use of access unit delimiters when set to 1.
  1950. @item mbtree
  1951. Enable use macroblock tree ratecontrol when set to 1. When set
  1952. to 0, it has the same effect as @command{x264}'s
  1953. @option{--no-mbtree} option.
  1954. @item deblock (@emph{deblock})
  1955. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  1956. @item cplxblur (@emph{cplxblur})
  1957. Set fluctuations reduction in QP (before curve compression).
  1958. @item partitions (@emph{partitions})
  1959. Set partitions to consider as a comma-separated list of. Possible
  1960. values in the list:
  1961. @table @samp
  1962. @item p8x8
  1963. 8x8 P-frame partition.
  1964. @item p4x4
  1965. 4x4 P-frame partition.
  1966. @item b8x8
  1967. 4x4 B-frame partition.
  1968. @item i8x8
  1969. 8x8 I-frame partition.
  1970. @item i4x4
  1971. 4x4 I-frame partition.
  1972. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  1973. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  1974. option) to be enabled.)
  1975. @item none (@emph{none})
  1976. Do not consider any partitions.
  1977. @item all (@emph{all})
  1978. Consider every partition.
  1979. @end table
  1980. @item direct-pred (@emph{direct})
  1981. Set direct MV prediction mode. Possible values:
  1982. @table @samp
  1983. @item none (@emph{none})
  1984. Disable MV prediction.
  1985. @item spatial (@emph{spatial})
  1986. Enable spatial predicting.
  1987. @item temporal (@emph{temporal})
  1988. Enable temporal predicting.
  1989. @item auto (@emph{auto})
  1990. Automatically decided.
  1991. @end table
  1992. @item slice-max-size (@emph{slice-max-size})
  1993. Set the limit of the size of each slice in bytes. If not specified
  1994. but RTP payload size (@option{ps}) is specified, that is used.
  1995. @item stats (@emph{stats})
  1996. Set the file name for multi-pass stats.
  1997. @item nal-hrd (@emph{nal-hrd})
  1998. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  1999. Possible values:
  2000. @table @samp
  2001. @item none (@emph{none})
  2002. Disable HRD information signaling.
  2003. @item vbr (@emph{vbr})
  2004. Variable bit rate.
  2005. @item cbr (@emph{cbr})
  2006. Constant bit rate (not allowed in MP4 container).
  2007. @end table
  2008. @item x264opts (N.A.)
  2009. Set any x264 option, see @command{x264 --fullhelp} for a list.
  2010. Argument is a list of @var{key}=@var{value} couples separated by
  2011. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  2012. themselves, use "," instead. They accept it as well since long ago but this
  2013. is kept undocumented for some reason.
  2014. For example to specify libx264 encoding options with @command{ffmpeg}:
  2015. @example
  2016. ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  2017. @end example
  2018. @item a53cc @var{boolean}
  2019. Import closed captions (which must be ATSC compatible format) into output.
  2020. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  2021. @item x264-params (N.A.)
  2022. Override the x264 configuration using a :-separated list of key=value
  2023. parameters.
  2024. This option is functionally the same as the @option{x264opts}, but is
  2025. duplicated for compatibility with the Libav fork.
  2026. For example to specify libx264 encoding options with @command{ffmpeg}:
  2027. @example
  2028. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  2029. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  2030. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  2031. @end example
  2032. @end table
  2033. Encoding ffpresets for common usages are provided so they can be used with the
  2034. general presets system (e.g. passing the @option{pre} option).
  2035. @section libx265
  2036. x265 H.265/HEVC encoder wrapper.
  2037. This encoder requires the presence of the libx265 headers and library
  2038. during configuration. You need to explicitly configure the build with
  2039. @option{--enable-libx265}.
  2040. @subsection Options
  2041. @table @option
  2042. @item b
  2043. Sets target video bitrate.
  2044. @item bf
  2045. @item g
  2046. Set the GOP size.
  2047. @item keyint_min
  2048. Minimum GOP size.
  2049. @item refs
  2050. Number of reference frames each P-frame can use. The range is from @var{1-16}.
  2051. @item preset
  2052. Set the x265 preset.
  2053. @item tune
  2054. Set the x265 tune parameter.
  2055. @item profile
  2056. Set profile restrictions.
  2057. @item crf
  2058. Set the quality for constant quality mode.
  2059. @item qp
  2060. Set constant quantization rate control method parameter.
  2061. @item qmin
  2062. Minimum quantizer scale.
  2063. @item qmax
  2064. Maximum quantizer scale.
  2065. @item qdiff
  2066. Maximum difference between quantizer scales.
  2067. @item qblur
  2068. Quantizer curve blur
  2069. @item qcomp
  2070. Quantizer curve compression factor
  2071. @item i_qfactor
  2072. @item b_qfactor
  2073. @item forced-idr
  2074. Normally, when forcing a I-frame type, the encoder can select any type
  2075. of I-frame. This option forces it to choose an IDR-frame.
  2076. @item x265-params
  2077. Set x265 options using a list of @var{key}=@var{value} couples separated
  2078. by ":". See @command{x265 --help} for a list of options.
  2079. For example to specify libx265 encoding options with @option{-x265-params}:
  2080. @example
  2081. ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  2082. @end example
  2083. @end table
  2084. @section libxavs2
  2085. xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  2086. This encoder requires the presence of the libxavs2 headers and library
  2087. during configuration. You need to explicitly configure the build with
  2088. @option{--enable-libxavs2}.
  2089. The following standard libavcodec options are used:
  2090. @itemize
  2091. @item
  2092. @option{b} / @option{bit_rate}
  2093. @item
  2094. @option{g} / @option{gop_size}
  2095. @item
  2096. @option{bf} / @option{max_b_frames}
  2097. @end itemize
  2098. The encoder also has its own specific options:
  2099. @subsection Options
  2100. @table @option
  2101. @item lcu_row_threads
  2102. Set the number of parallel threads for rows from 1 to 8 (default 5).
  2103. @item initial_qp
  2104. Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  2105. used to set the initial qp for the first frame.
  2106. @item qp
  2107. Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  2108. used to set the qp value under constant-QP mode.
  2109. @item max_qp
  2110. Set the max qp for rate control from 1 to 63 (default 55).
  2111. @item min_qp
  2112. Set the min qp for rate control from 1 to 63 (default 20).
  2113. @item speed_level
  2114. Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  2115. @item log_level
  2116. Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  2117. 1: warning, 2: info, 3: debug.
  2118. @item xavs2-params
  2119. Set xavs2 options using a list of @var{key}=@var{value} couples separated
  2120. by ":".
  2121. For example to specify libxavs2 encoding options with @option{-xavs2-params}:
  2122. @example
  2123. ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  2124. @end example
  2125. @end table
  2126. @section libxvid
  2127. Xvid MPEG-4 Part 2 encoder wrapper.
  2128. This encoder requires the presence of the libxvidcore headers and library
  2129. during configuration. You need to explicitly configure the build with
  2130. @code{--enable-libxvid --enable-gpl}.
  2131. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  2132. users can encode to this format without this library.
  2133. @subsection Options
  2134. The following options are supported by the libxvid wrapper. Some of
  2135. the following options are listed but are not documented, and
  2136. correspond to shared codec options. See @ref{codec-options,,the Codec
  2137. Options chapter} for their documentation. The other shared options
  2138. which are not listed have no effect for the libxvid encoder.
  2139. @table @option
  2140. @item b
  2141. @item g
  2142. @item qmin
  2143. @item qmax
  2144. @item mpeg_quant
  2145. @item threads
  2146. @item bf
  2147. @item b_qfactor
  2148. @item b_qoffset
  2149. @item flags
  2150. Set specific encoding flags. Possible values:
  2151. @table @samp
  2152. @item mv4
  2153. Use four motion vector by macroblock.
  2154. @item aic
  2155. Enable high quality AC prediction.
  2156. @item gray
  2157. Only encode grayscale.
  2158. @item gmc
  2159. Enable the use of global motion compensation (GMC).
  2160. @item qpel
  2161. Enable quarter-pixel motion compensation.
  2162. @item cgop
  2163. Enable closed GOP.
  2164. @item global_header
  2165. Place global headers in extradata instead of every keyframe.
  2166. @end table
  2167. @item trellis
  2168. @item me_method
  2169. Set motion estimation method. Possible values in decreasing order of
  2170. speed and increasing order of quality:
  2171. @table @samp
  2172. @item zero
  2173. Use no motion estimation (default).
  2174. @item phods
  2175. @item x1
  2176. @item log
  2177. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  2178. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  2179. @samp{phods}.
  2180. @item epzs
  2181. Enable all of the things described above, plus advanced diamond zonal
  2182. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  2183. estimation on chroma planes.
  2184. @item full
  2185. Enable all of the things described above, plus extended 16x16 and 8x8
  2186. blocks search.
  2187. @end table
  2188. @item mbd
  2189. Set macroblock decision algorithm. Possible values in the increasing
  2190. order of quality:
  2191. @table @samp
  2192. @item simple
  2193. Use macroblock comparing function algorithm (default).
  2194. @item bits
  2195. Enable rate distortion-based half pixel and quarter pixel refinement for
  2196. 16x16 blocks.
  2197. @item rd
  2198. Enable all of the things described above, plus rate distortion-based
  2199. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  2200. distortion-based search using square pattern.
  2201. @end table
  2202. @item lumi_aq
  2203. Enable lumi masking adaptive quantization when set to 1. Default is 0
  2204. (disabled).
  2205. @item variance_aq
  2206. Enable variance adaptive quantization when set to 1. Default is 0
  2207. (disabled).
  2208. When combined with @option{lumi_aq}, the resulting quality will not
  2209. be better than any of the two specified individually. In other
  2210. words, the resulting quality will be the worse one of the two
  2211. effects.
  2212. @item ssim
  2213. Set structural similarity (SSIM) displaying method. Possible values:
  2214. @table @samp
  2215. @item off
  2216. Disable displaying of SSIM information.
  2217. @item avg
  2218. Output average SSIM at the end of encoding to stdout. The format of
  2219. showing the average SSIM is:
  2220. @example
  2221. Average SSIM: %f
  2222. @end example
  2223. For users who are not familiar with C, %f means a float number, or
  2224. a decimal (e.g. 0.939232).
  2225. @item frame
  2226. Output both per-frame SSIM data during encoding and average SSIM at
  2227. the end of encoding to stdout. The format of per-frame information
  2228. is:
  2229. @example
  2230. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  2231. @end example
  2232. For users who are not familiar with C, %1.3f means a float number
  2233. rounded to 3 digits after the dot (e.g. 0.932).
  2234. @end table
  2235. @item ssim_acc
  2236. Set SSIM accuracy. Valid options are integers within the range of
  2237. 0-4, while 0 gives the most accurate result and 4 computes the
  2238. fastest.
  2239. @end table
  2240. @section MediaFoundation
  2241. This provides wrappers to encoders (both audio and video) in the
  2242. MediaFoundation framework. It can access both SW and HW encoders.
  2243. Video encoders can take input in either of nv12 or yuv420p form
  2244. (some encoders support both, some support only either - in practice,
  2245. nv12 is the safer choice, especially among HW encoders).
  2246. @section mpeg2
  2247. MPEG-2 video encoder.
  2248. @subsection Options
  2249. @table @option
  2250. @item profile
  2251. Select the mpeg2 profile to encode:
  2252. @table @samp
  2253. @item 422
  2254. @item high
  2255. @item ss
  2256. Spatially Scalable
  2257. @item snr
  2258. SNR Scalable
  2259. @item main
  2260. @item simple
  2261. @end table
  2262. @item level
  2263. Select the mpeg2 level to encode:
  2264. @table @samp
  2265. @item high
  2266. @item high1440
  2267. @item main
  2268. @item low
  2269. @end table
  2270. @item seq_disp_ext @var{integer}
  2271. Specifies if the encoder should write a sequence_display_extension to the
  2272. output.
  2273. @table @option
  2274. @item -1
  2275. @itemx auto
  2276. Decide automatically to write it or not (this is the default) by checking if
  2277. the data to be written is different from the default or unspecified values.
  2278. @item 0
  2279. @itemx never
  2280. Never write it.
  2281. @item 1
  2282. @itemx always
  2283. Always write it.
  2284. @end table
  2285. @item video_format @var{integer}
  2286. Specifies the video_format written into the sequence display extension
  2287. indicating the source of the video pictures. The default is @samp{unspecified},
  2288. can be @samp{component}, @samp{pal}, @samp{ntsc}, @samp{secam} or @samp{mac}.
  2289. For maximum compatibility, use @samp{component}.
  2290. @item a53cc @var{boolean}
  2291. Import closed captions (which must be ATSC compatible format) into output.
  2292. Default is 1 (on).
  2293. @end table
  2294. @section png
  2295. PNG image encoder.
  2296. @subsection Private options
  2297. @table @option
  2298. @item dpi @var{integer}
  2299. Set physical density of pixels, in dots per inch, unset by default
  2300. @item dpm @var{integer}
  2301. Set physical density of pixels, in dots per meter, unset by default
  2302. @end table
  2303. @section ProRes
  2304. Apple ProRes encoder.
  2305. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  2306. The used encoder can be chosen with the @code{-vcodec} option.
  2307. @subsection Private Options for prores-ks
  2308. @table @option
  2309. @item profile @var{integer}
  2310. Select the ProRes profile to encode
  2311. @table @samp
  2312. @item proxy
  2313. @item lt
  2314. @item standard
  2315. @item hq
  2316. @item 4444
  2317. @item 4444xq
  2318. @end table
  2319. @item quant_mat @var{integer}
  2320. Select quantization matrix.
  2321. @table @samp
  2322. @item auto
  2323. @item default
  2324. @item proxy
  2325. @item lt
  2326. @item standard
  2327. @item hq
  2328. @end table
  2329. If set to @var{auto}, the matrix matching the profile will be picked.
  2330. If not set, the matrix providing the highest quality, @var{default}, will be
  2331. picked.
  2332. @item bits_per_mb @var{integer}
  2333. How many bits to allot for coding one macroblock. Different profiles use
  2334. between 200 and 2400 bits per macroblock, the maximum is 8000.
  2335. @item mbs_per_slice @var{integer}
  2336. Number of macroblocks in each slice (1-8); the default value (8)
  2337. should be good in almost all situations.
  2338. @item vendor @var{string}
  2339. Override the 4-byte vendor ID.
  2340. A custom vendor ID like @var{apl0} would claim the stream was produced by
  2341. the Apple encoder.
  2342. @item alpha_bits @var{integer}
  2343. Specify number of bits for alpha component.
  2344. Possible values are @var{0}, @var{8} and @var{16}.
  2345. Use @var{0} to disable alpha plane coding.
  2346. @end table
  2347. @subsection Speed considerations
  2348. In the default mode of operation the encoder has to honor frame constraints
  2349. (i.e. not produce frames with size bigger than requested) while still making
  2350. output picture as good as possible.
  2351. A frame containing a lot of small details is harder to compress and the encoder
  2352. would spend more time searching for appropriate quantizers for each slice.
  2353. Setting a higher @option{bits_per_mb} limit will improve the speed.
  2354. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  2355. recommended value) and do not set a size constraint.
  2356. @section QSV encoders
  2357. The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG and VP9)
  2358. The ratecontrol method is selected as follows:
  2359. @itemize @bullet
  2360. @item
  2361. When @option{global_quality} is specified, a quality-based mode is used.
  2362. Specifically this means either
  2363. @itemize @minus
  2364. @item
  2365. @var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
  2366. also set (the @option{-qscale} ffmpeg option).
  2367. @item
  2368. @var{LA_ICQ} - intelligent constant quality with lookahead, when the
  2369. @option{look_ahead} option is also set.
  2370. @item
  2371. @var{ICQ} -- intelligent constant quality otherwise.
  2372. @end itemize
  2373. @item
  2374. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  2375. least the desired average bitrate with the @option{b} option.
  2376. @itemize @minus
  2377. @item
  2378. @var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
  2379. @item
  2380. @var{VCM} - video conferencing mode, when the @option{vcm} option is set.
  2381. @item
  2382. @var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
  2383. the average bitrate.
  2384. @item
  2385. @var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
  2386. than the average bitrate.
  2387. @item
  2388. @var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
  2389. is further configured by the @option{avbr_accuracy} and
  2390. @option{avbr_convergence} options.
  2391. @end itemize
  2392. @end itemize
  2393. Note that depending on your system, a different mode than the one you specified
  2394. may be selected by the encoder. Set the verbosity level to @var{verbose} or
  2395. higher to see the actual settings used by the QSV runtime.
  2396. Additional libavcodec global options are mapped to MSDK options as follows:
  2397. @itemize
  2398. @item
  2399. @option{g/gop_size} -> @option{GopPicSize}
  2400. @item
  2401. @option{bf/max_b_frames}+1 -> @option{GopRefDist}
  2402. @item
  2403. @option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
  2404. @option{InitialDelayInKB}
  2405. @item
  2406. @option{slices} -> @option{NumSlice}
  2407. @item
  2408. @option{refs} -> @option{NumRefFrame}
  2409. @item
  2410. @option{b_strategy/b_frame_strategy} -> @option{BRefType}
  2411. @item
  2412. @option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
  2413. @item
  2414. For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
  2415. @option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
  2416. and @var{QPP} and @var{QPB} respectively.
  2417. @item
  2418. Setting the @option{coder} option to the value @var{vlc} will make the H.264
  2419. encoder use CAVLC instead of CABAC.
  2420. @end itemize
  2421. @section snow
  2422. @subsection Options
  2423. @table @option
  2424. @item iterative_dia_size
  2425. dia size for the iterative motion estimation
  2426. @end table
  2427. @section VAAPI encoders
  2428. Wrappers for hardware encoders accessible via VAAPI.
  2429. These encoders only accept input in VAAPI hardware surfaces. If you have input
  2430. in software frames, use the @option{hwupload} filter to upload them to the GPU.
  2431. The following standard libavcodec options are used:
  2432. @itemize
  2433. @item
  2434. @option{g} / @option{gop_size}
  2435. @item
  2436. @option{bf} / @option{max_b_frames}
  2437. @item
  2438. @option{profile}
  2439. If not set, this will be determined automatically from the format of the input
  2440. frames and the profiles supported by the driver.
  2441. @item
  2442. @option{level}
  2443. @item
  2444. @option{b} / @option{bit_rate}
  2445. @item
  2446. @option{maxrate} / @option{rc_max_rate}
  2447. @item
  2448. @option{bufsize} / @option{rc_buffer_size}
  2449. @item
  2450. @option{rc_init_occupancy} / @option{rc_initial_buffer_occupancy}
  2451. @item
  2452. @option{compression_level}
  2453. Speed / quality tradeoff: higher values are faster / worse quality.
  2454. @item
  2455. @option{q} / @option{global_quality}
  2456. Size / quality tradeoff: higher values are smaller / worse quality.
  2457. @item
  2458. @option{qmin}
  2459. @item
  2460. @option{qmax}
  2461. @item
  2462. @option{i_qfactor} / @option{i_quant_factor}
  2463. @item
  2464. @option{i_qoffset} / @option{i_quant_offset}
  2465. @item
  2466. @option{b_qfactor} / @option{b_quant_factor}
  2467. @item
  2468. @option{b_qoffset} / @option{b_quant_offset}
  2469. @item
  2470. @option{slices}
  2471. @end itemize
  2472. All encoders support the following options:
  2473. @table @option
  2474. @item low_power
  2475. Some drivers/platforms offer a second encoder for some codecs intended to use
  2476. less power than the default encoder; setting this option will attempt to use
  2477. that encoder. Note that it may support a reduced feature set, so some other
  2478. options may not be available in this mode.
  2479. @item idr_interval
  2480. Set the number of normal intra frames between full-refresh (IDR) frames in
  2481. open-GOP mode. The intra frames are still IRAPs, but will not include global
  2482. headers and may have non-decodable leading pictures.
  2483. @item b_depth
  2484. Set the B-frame reference depth. When set to one (the default), all B-frames
  2485. will refer only to P- or I-frames. When set to greater values multiple layers
  2486. of B-frames will be present, frames in each layer only referring to frames in
  2487. higher layers.
  2488. @item rc_mode
  2489. Set the rate control mode to use. A given driver may only support a subset of
  2490. modes.
  2491. Possible modes:
  2492. @table @option
  2493. @item auto
  2494. Choose the mode automatically based on driver support and the other options.
  2495. This is the default.
  2496. @item CQP
  2497. Constant-quality.
  2498. @item CBR
  2499. Constant-bitrate.
  2500. @item VBR
  2501. Variable-bitrate.
  2502. @item ICQ
  2503. Intelligent constant-quality.
  2504. @item QVBR
  2505. Quality-defined variable-bitrate.
  2506. @item AVBR
  2507. Average variable bitrate.
  2508. @end table
  2509. @end table
  2510. Each encoder also has its own specific options:
  2511. @table @option
  2512. @item h264_vaapi
  2513. @option{profile} sets the value of @emph{profile_idc} and the @emph{constraint_set*_flag}s.
  2514. @option{level} sets the value of @emph{level_idc}.
  2515. @table @option
  2516. @item coder
  2517. Set entropy encoder (default is @emph{cabac}). Possible values:
  2518. @table @samp
  2519. @item ac
  2520. @item cabac
  2521. Use CABAC.
  2522. @item vlc
  2523. @item cavlc
  2524. Use CAVLC.
  2525. @end table
  2526. @item aud
  2527. Include access unit delimiters in the stream (not included by default).
  2528. @item sei
  2529. Set SEI message types to include.
  2530. Some combination of the following values:
  2531. @table @samp
  2532. @item identifier
  2533. Include a @emph{user_data_unregistered} message containing information about
  2534. the encoder.
  2535. @item timing
  2536. Include picture timing parameters (@emph{buffering_period} and
  2537. @emph{pic_timing} messages).
  2538. @item recovery_point
  2539. Include recovery points where appropriate (@emph{recovery_point} messages).
  2540. @end table
  2541. @end table
  2542. @item hevc_vaapi
  2543. @option{profile} and @option{level} set the values of
  2544. @emph{general_profile_idc} and @emph{general_level_idc} respectively.
  2545. @table @option
  2546. @item aud
  2547. Include access unit delimiters in the stream (not included by default).
  2548. @item tier
  2549. Set @emph{general_tier_flag}. This may affect the level chosen for the stream
  2550. if it is not explicitly specified.
  2551. @item sei
  2552. Set SEI message types to include.
  2553. Some combination of the following values:
  2554. @table @samp
  2555. @item hdr
  2556. Include HDR metadata if the input frames have it
  2557. (@emph{mastering_display_colour_volume} and @emph{content_light_level}
  2558. messages).
  2559. @end table
  2560. @item tiles
  2561. Set the number of tiles to encode the input video with, as columns x rows.
  2562. Larger numbers allow greater parallelism in both encoding and decoding, but
  2563. may decrease coding efficiency.
  2564. @end table
  2565. @item mjpeg_vaapi
  2566. Only baseline DCT encoding is supported. The encoder always uses the standard
  2567. quantisation and huffman tables - @option{global_quality} scales the standard
  2568. quantisation table (range 1-100).
  2569. For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  2570. supported, and will create an RGB JPEG.
  2571. @table @option
  2572. @item jfif
  2573. Include JFIF header in each frame (not included by default).
  2574. @item huffman
  2575. Include standard huffman tables (on by default). Turning this off will save
  2576. a few hundred bytes in each output frame, but may lose compatibility with some
  2577. JPEG decoders which don't fully handle MJPEG.
  2578. @end table
  2579. @item mpeg2_vaapi
  2580. @option{profile} and @option{level} set the value of @emph{profile_and_level_indication}.
  2581. @item vp8_vaapi
  2582. B-frames are not supported.
  2583. @option{global_quality} sets the @emph{q_idx} used for non-key frames (range 0-127).
  2584. @table @option
  2585. @item loop_filter_level
  2586. @item loop_filter_sharpness
  2587. Manually set the loop filter parameters.
  2588. @end table
  2589. @item vp9_vaapi
  2590. @option{global_quality} sets the @emph{q_idx} used for P-frames (range 0-255).
  2591. @table @option
  2592. @item loop_filter_level
  2593. @item loop_filter_sharpness
  2594. Manually set the loop filter parameters.
  2595. @end table
  2596. B-frames are supported, but the output stream is always in encode order rather than display
  2597. order. If B-frames are enabled, it may be necessary to use the @option{vp9_raw_reorder}
  2598. bitstream filter to modify the output stream to display frames in the correct order.
  2599. Only normal frames are produced - the @option{vp9_superframe} bitstream filter may be
  2600. required to produce a stream usable with all decoders.
  2601. @end table
  2602. @section vc2
  2603. SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  2604. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  2605. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  2606. other tasks which require low overhead and low compression (like screen
  2607. recording).
  2608. @subsection Options
  2609. @table @option
  2610. @item b
  2611. Sets target video bitrate. Usually that's around 1:6 of the uncompressed
  2612. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
  2613. values (close to the uncompressed bitrate) turn on lossless compression mode.
  2614. @item field_order
  2615. Enables field coding when set (e.g. to tt - top field first) for interlaced
  2616. inputs. Should increase compression with interlaced content as it splits the
  2617. fields and encodes each separately.
  2618. @item wavelet_depth
  2619. Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  2620. Lower values reduce compression and quality. Less capable decoders may not be
  2621. able to handle values of @option{wavelet_depth} over 3.
  2622. @item wavelet_type
  2623. Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
  2624. (Deslauriers-Dubuc)
  2625. are implemented, with 9_7 being the one with better compression and thus
  2626. is the default.
  2627. @item slice_width
  2628. @item slice_height
  2629. Sets the slice size for each slice. Larger values result in better compression.
  2630. For compatibility with other more limited decoders use @option{slice_width} of
  2631. 32 and @option{slice_height} of 8.
  2632. @item tolerance
  2633. Sets the undershoot tolerance of the rate control system in percent. This is
  2634. to prevent an expensive search from being run.
  2635. @item qm
  2636. Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
  2637. is set to 5
  2638. @itemize @minus
  2639. @item
  2640. @var{default}
  2641. Uses the default quantization matrix from the specifications, extended with
  2642. values for the fifth level. This provides a good balance between keeping detail
  2643. and omitting artifacts.
  2644. @item
  2645. @var{flat}
  2646. Use a completely zeroed out quantization matrix. This increases PSNR but might
  2647. reduce perception. Use in bogus benchmarks.
  2648. @item
  2649. @var{color}
  2650. Reduces detail but attempts to preserve color at extremely low bitrates.
  2651. @end itemize
  2652. @end table
  2653. @c man end VIDEO ENCODERS
  2654. @chapter Subtitles Encoders
  2655. @c man begin SUBTITLES ENCODERS
  2656. @section dvdsub
  2657. This codec encodes the bitmap subtitle format that is used in DVDs.
  2658. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  2659. and they can also be used in Matroska files.
  2660. @subsection Options
  2661. @table @option
  2662. @item palette
  2663. Specify the global palette used by the bitmaps.
  2664. The format for this option is a string containing 16 24-bits hexadecimal
  2665. numbers (without 0x prefix) separated by commas, for example @code{0d00ee,
  2666. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  2667. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
  2668. @item even_rows_fix
  2669. When set to 1, enable a work-around that makes the number of pixel rows
  2670. even in all subtitles. This fixes a problem with some players that
  2671. cut off the bottom row if the number is odd. The work-around just adds
  2672. a fully transparent row if needed. The overhead is low, typically
  2673. one byte per subtitle on average.
  2674. By default, this work-around is disabled.
  2675. @end table
  2676. @c man end SUBTITLES ENCODERS