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.

3210 lines
90KB

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