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.

2567 lines
72KB

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