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.

2561 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.
  48. Will tune itself based on whether aac_is/aac_ms/aac_pns are enabled.
  49. This is the default choice for a coder.
  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. This method sets a constant quantizer for all bands. This is the fastest of all
  59. the methods and has no rate control or support for @option{aac_is} or
  60. @option{aac_pns}.
  61. Not recommended.
  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 benefitial.
  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 imperceivable 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. This profile disables aac_is and aac_pns which were introduced with the MPEG4
  103. specifications and could cause incompatibility with very old devices. Will
  104. reduce quality and is therefore not recommended unless necessary.
  105. @item aac_ltp
  106. Long term prediction profile, is enabled by and will enable the aac_ltp option.
  107. Introduced in MPEG4.
  108. @item aac_ltp
  109. Main-type prediction profile, is enabled by and will enable the aac_pred option.
  110. Introduced in MPEG2.
  111. If this option is unspecified it is set to @samp{aac_low}.
  112. @end table
  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{libfaac}
  509. @section libfaac
  510. libfaac AAC (Advanced Audio Coding) encoder wrapper.
  511. This encoder is of much lower quality and is more unstable than any other AAC
  512. encoders, so it's highly recommended to instead use other encoders, like
  513. @ref{aacenc,,the native FFmpeg AAC encoder}.
  514. This encoder also requires the presence of the libfaac headers and library
  515. during configuration. You need to explicitly configure the build with
  516. @code{--enable-libfaac --enable-nonfree}.
  517. @subsection Options
  518. The following shared FFmpeg codec options are recognized.
  519. The following options are supported by the libfaac wrapper. The
  520. @command{faac}-equivalent of the options are listed in parentheses.
  521. @table @option
  522. @item b (@emph{-b})
  523. Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
  524. is not explicitly specified, it is automatically set to a suitable
  525. value depending on the selected profile. @command{faac} bitrate is
  526. expressed in kilobits/s.
  527. Note that libfaac does not support CBR (Constant Bit Rate) but only
  528. ABR (Average Bit Rate).
  529. If VBR mode is enabled this option is ignored.
  530. @item ar (@emph{-R})
  531. Set audio sampling rate (in Hz).
  532. @item ac (@emph{-c})
  533. Set the number of audio channels.
  534. @item cutoff (@emph{-C})
  535. Set cutoff frequency. If not specified (or explicitly set to 0) it
  536. will use a value automatically computed by the library. Default value
  537. is 0.
  538. @item profile
  539. Set audio profile.
  540. The following profiles are recognized:
  541. @table @samp
  542. @item aac_main
  543. Main AAC (Main)
  544. @item aac_low
  545. Low Complexity AAC (LC)
  546. @item aac_ssr
  547. Scalable Sample Rate (SSR)
  548. @item aac_ltp
  549. Long Term Prediction (LTP)
  550. @end table
  551. If not specified it is set to @samp{aac_low}.
  552. @item flags +qscale
  553. Set constant quality VBR (Variable Bit Rate) mode.
  554. @item global_quality
  555. Set quality in VBR mode as an integer number of lambda units.
  556. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  557. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  558. and used to set the quality value used by libfaac. A reasonable range
  559. for the option value in QP units is [10-500], the higher the value the
  560. higher the quality.
  561. @item q (@emph{-q})
  562. Enable VBR mode when set to a non-negative value, and set constant
  563. quality value as a double floating point value in QP units.
  564. The value sets the quality value used by libfaac. A reasonable range
  565. for the option value is [10-500], the higher the value the higher the
  566. quality.
  567. This option is valid only using the @command{ffmpeg} command-line
  568. tool. For library interface users, use @option{global_quality}.
  569. @end table
  570. @subsection Examples
  571. @itemize
  572. @item
  573. Use @command{ffmpeg} to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
  574. container:
  575. @example
  576. ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
  577. @end example
  578. @item
  579. Use @command{ffmpeg} to convert an audio file to VBR AAC, using the
  580. LTP AAC profile:
  581. @example
  582. ffmpeg -i input.wav -c:a libfaac -profile:a aac_ltp -q:a 100 output.m4a
  583. @end example
  584. @end itemize
  585. @anchor{libfdk-aac-enc}
  586. @section libfdk_aac
  587. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  588. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  589. the Android project.
  590. Requires the presence of the libfdk-aac headers and library during
  591. configuration. You need to explicitly configure the build with
  592. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  593. so if you allow the use of GPL, you should configure with
  594. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  595. This encoder is considered to produce output on par or worse at 128kbps to the
  596. @ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better
  597. sounding audio at identical or lower bitrates and has support for the
  598. AAC-HE profiles.
  599. VBR encoding, enabled through the @option{vbr} or @option{flags
  600. +qscale} options, is experimental and only works with some
  601. combinations of parameters.
  602. Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  603. higher.
  604. For more information see the fdk-aac project at
  605. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  606. @subsection Options
  607. The following options are mapped on the shared FFmpeg codec options.
  608. @table @option
  609. @item b
  610. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  611. is automatically set to a suitable value depending on the selected
  612. profile.
  613. In case VBR mode is enabled the option is ignored.
  614. @item ar
  615. Set audio sampling rate (in Hz).
  616. @item channels
  617. Set the number of audio channels.
  618. @item flags +qscale
  619. Enable fixed quality, VBR (Variable Bit Rate) mode.
  620. Note that VBR is implicitly enabled when the @option{vbr} value is
  621. positive.
  622. @item cutoff
  623. Set cutoff frequency. If not specified (or explicitly set to 0) it
  624. will use a value automatically computed by the library. Default value
  625. is 0.
  626. @item profile
  627. Set audio profile.
  628. The following profiles are recognized:
  629. @table @samp
  630. @item aac_low
  631. Low Complexity AAC (LC)
  632. @item aac_he
  633. High Efficiency AAC (HE-AAC)
  634. @item aac_he_v2
  635. High Efficiency AAC version 2 (HE-AACv2)
  636. @item aac_ld
  637. Low Delay AAC (LD)
  638. @item aac_eld
  639. Enhanced Low Delay AAC (ELD)
  640. @end table
  641. If not specified it is set to @samp{aac_low}.
  642. @end table
  643. The following are private options of the libfdk_aac encoder.
  644. @table @option
  645. @item afterburner
  646. Enable afterburner feature if set to 1, disabled if set to 0. This
  647. improves the quality but also the required processing power.
  648. Default value is 1.
  649. @item eld_sbr
  650. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  651. if set to 0.
  652. Default value is 0.
  653. @item signaling
  654. Set SBR/PS signaling style.
  655. It can assume one of the following values:
  656. @table @samp
  657. @item default
  658. choose signaling implicitly (explicit hierarchical by default,
  659. implicit if global header is disabled)
  660. @item implicit
  661. implicit backwards compatible signaling
  662. @item explicit_sbr
  663. explicit SBR, implicit PS signaling
  664. @item explicit_hierarchical
  665. explicit hierarchical signaling
  666. @end table
  667. Default value is @samp{default}.
  668. @item latm
  669. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  670. Default value is 0.
  671. @item header_period
  672. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  673. in-band configuration buffers within LATM/LOAS transport layer.
  674. Must be a 16-bits non-negative integer.
  675. Default value is 0.
  676. @item vbr
  677. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  678. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  679. (Constant Bit Rate) is enabled.
  680. Currently only the @samp{aac_low} profile supports VBR encoding.
  681. VBR modes 1-5 correspond to roughly the following average bit rates:
  682. @table @samp
  683. @item 1
  684. 32 kbps/channel
  685. @item 2
  686. 40 kbps/channel
  687. @item 3
  688. 48-56 kbps/channel
  689. @item 4
  690. 64 kbps/channel
  691. @item 5
  692. about 80-96 kbps/channel
  693. @end table
  694. Default value is 0.
  695. @end table
  696. @subsection Examples
  697. @itemize
  698. @item
  699. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  700. container:
  701. @example
  702. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  703. @end example
  704. @item
  705. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  706. High-Efficiency AAC profile:
  707. @example
  708. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  709. @end example
  710. @end itemize
  711. @anchor{libmp3lame}
  712. @section libmp3lame
  713. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  714. Requires the presence of the libmp3lame headers and library during
  715. configuration. You need to explicitly configure the build with
  716. @code{--enable-libmp3lame}.
  717. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  718. lower quality.
  719. @subsection Options
  720. The following options are supported by the libmp3lame wrapper. The
  721. @command{lame}-equivalent of the options are listed in parentheses.
  722. @table @option
  723. @item b (@emph{-b})
  724. Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
  725. expressed in kilobits/s.
  726. @item q (@emph{-V})
  727. Set constant quality setting for VBR. This option is valid only
  728. using the @command{ffmpeg} command-line tool. For library interface
  729. users, use @option{global_quality}.
  730. @item compression_level (@emph{-q})
  731. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  732. with 0 meaning highest quality but slowest, and 9 meaning fastest
  733. while producing the worst quality.
  734. @item reservoir
  735. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  736. has this enabled by default, but can be overridden by use
  737. @option{--nores} option.
  738. @item joint_stereo (@emph{-m j})
  739. Enable the encoder to use (on a frame by frame basis) either L/R
  740. stereo or mid/side stereo. Default value is 1.
  741. @item abr (@emph{--abr})
  742. Enable the encoder to use ABR when set to 1. The @command{lame}
  743. @option{--abr} sets the target bitrate, while this options only
  744. tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
  745. @end table
  746. @section libopencore-amrnb
  747. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  748. Requires the presence of the libopencore-amrnb headers and library during
  749. configuration. You need to explicitly configure the build with
  750. @code{--enable-libopencore-amrnb --enable-version3}.
  751. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  752. but you can override it by setting @option{strict} to @samp{unofficial} or
  753. lower.
  754. @subsection Options
  755. @table @option
  756. @item b
  757. Set bitrate in bits per second. Only the following bitrates are supported,
  758. otherwise libavcodec will round to the nearest valid bitrate.
  759. @table @option
  760. @item 4750
  761. @item 5150
  762. @item 5900
  763. @item 6700
  764. @item 7400
  765. @item 7950
  766. @item 10200
  767. @item 12200
  768. @end table
  769. @item dtx
  770. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  771. default value is 0 (disabled).
  772. @end table
  773. @anchor{libshine}
  774. @section libshine
  775. Shine Fixed-Point MP3 encoder wrapper.
  776. Shine is a fixed-point MP3 encoder. It has a far better performance on
  777. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  778. However, as it is more targeted on performance than quality, it is not on par
  779. with LAME and other production-grade encoders quality-wise. Also, according to
  780. the project's homepage, this encoder may not be free of bugs as the code was
  781. written a long time ago and the project was dead for at least 5 years.
  782. This encoder only supports stereo and mono input. This is also CBR-only.
  783. The original project (last updated in early 2007) is at
  784. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  785. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  786. Requires the presence of the libshine headers and library during
  787. configuration. You need to explicitly configure the build with
  788. @code{--enable-libshine}.
  789. See also @ref{libmp3lame}.
  790. @subsection Options
  791. The following options are supported by the libshine wrapper. The
  792. @command{shineenc}-equivalent of the options are listed in parentheses.
  793. @table @option
  794. @item b (@emph{-b})
  795. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  796. is expressed in kilobits/s.
  797. @end table
  798. @section libtwolame
  799. TwoLAME MP2 encoder wrapper.
  800. Requires the presence of the libtwolame headers and library during
  801. configuration. You need to explicitly configure the build with
  802. @code{--enable-libtwolame}.
  803. @subsection Options
  804. The following options are supported by the libtwolame wrapper. The
  805. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  806. parentheses.
  807. @table @option
  808. @item b (@emph{-b})
  809. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  810. option is expressed in kilobits/s. Default value is 128k.
  811. @item q (@emph{-V})
  812. Set quality for experimental VBR support. Maximum value range is
  813. from -50 to 50, useful range is from -10 to 10. The higher the
  814. value, the better the quality. This option is valid only using the
  815. @command{ffmpeg} command-line tool. For library interface users,
  816. use @option{global_quality}.
  817. @item mode (@emph{--mode})
  818. Set the mode of the resulting audio. Possible values:
  819. @table @samp
  820. @item auto
  821. Choose mode automatically based on the input. This is the default.
  822. @item stereo
  823. Stereo
  824. @item joint_stereo
  825. Joint stereo
  826. @item dual_channel
  827. Dual channel
  828. @item mono
  829. Mono
  830. @end table
  831. @item psymodel (@emph{--psyc-mode})
  832. Set psychoacoustic model to use in encoding. The argument must be
  833. an integer between -1 and 4, inclusive. The higher the value, the
  834. better the quality. The default value is 3.
  835. @item energy_levels (@emph{--energy})
  836. Enable energy levels extensions when set to 1. The default value is
  837. 0 (disabled).
  838. @item error_protection (@emph{--protect})
  839. Enable CRC error protection when set to 1. The default value is 0
  840. (disabled).
  841. @item copyright (@emph{--copyright})
  842. Set MPEG audio copyright flag when set to 1. The default value is 0
  843. (disabled).
  844. @item original (@emph{--original})
  845. Set MPEG audio original flag when set to 1. The default value is 0
  846. (disabled).
  847. @end table
  848. @anchor{libvo-aacenc}
  849. @section libvo-aacenc
  850. VisualOn AAC encoder.
  851. Requires the presence of the libvo-aacenc headers and library during
  852. configuration. You need to explicitly configure the build with
  853. @code{--enable-libvo-aacenc --enable-version3}.
  854. This encoder is considered to be worse than the
  855. @ref{aacenc,,native FFmpeg AAC encoder}, according to
  856. multiple sources.
  857. @subsection Options
  858. The VisualOn AAC encoder only support encoding AAC-LC and up to 2
  859. channels. It is also CBR-only.
  860. @table @option
  861. @item b
  862. Set bit rate in bits/s.
  863. @end table
  864. @section libvo-amrwbenc
  865. VisualOn Adaptive Multi-Rate Wideband encoder.
  866. Requires the presence of the libvo-amrwbenc headers and library during
  867. configuration. You need to explicitly configure the build with
  868. @code{--enable-libvo-amrwbenc --enable-version3}.
  869. This is a mono-only encoder. Officially it only supports 16000Hz sample
  870. rate, but you can override it by setting @option{strict} to
  871. @samp{unofficial} or lower.
  872. @subsection Options
  873. @table @option
  874. @item b
  875. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  876. libavcodec will round to the nearest valid bitrate.
  877. @table @samp
  878. @item 6600
  879. @item 8850
  880. @item 12650
  881. @item 14250
  882. @item 15850
  883. @item 18250
  884. @item 19850
  885. @item 23050
  886. @item 23850
  887. @end table
  888. @item dtx
  889. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  890. default value is 0 (disabled).
  891. @end table
  892. @section libopus
  893. libopus Opus Interactive Audio Codec encoder wrapper.
  894. Requires the presence of the libopus headers and library during
  895. configuration. You need to explicitly configure the build with
  896. @code{--enable-libopus}.
  897. @subsection Option Mapping
  898. Most libopus options are modelled after the @command{opusenc} utility from
  899. opus-tools. The following is an option mapping chart describing options
  900. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  901. in parentheses.
  902. @table @option
  903. @item b (@emph{bitrate})
  904. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  905. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  906. kilobits/s.
  907. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  908. Set VBR mode. The FFmpeg @option{vbr} option has the following
  909. valid arguments, with the @command{opusenc} equivalent options
  910. in parentheses:
  911. @table @samp
  912. @item off (@emph{hard-cbr})
  913. Use constant bit rate encoding.
  914. @item on (@emph{vbr})
  915. Use variable bit rate encoding (the default).
  916. @item constrained (@emph{cvbr})
  917. Use constrained variable bit rate encoding.
  918. @end table
  919. @item compression_level (@emph{comp})
  920. Set encoding algorithm complexity. Valid options are integers in
  921. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  922. gives the highest quality but slowest encoding. The default is 10.
  923. @item frame_duration (@emph{framesize})
  924. Set maximum frame size, or duration of a frame in milliseconds. The
  925. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  926. frame sizes achieve lower latency but less quality at a given bitrate.
  927. Sizes greater than 20ms are only interesting at fairly low bitrates.
  928. The default is 20ms.
  929. @item packet_loss (@emph{expect-loss})
  930. Set expected packet loss percentage. The default is 0.
  931. @item application (N.A.)
  932. Set intended application type. Valid options are listed below:
  933. @table @samp
  934. @item voip
  935. Favor improved speech intelligibility.
  936. @item audio
  937. Favor faithfulness to the input (the default).
  938. @item lowdelay
  939. Restrict to only the lowest delay modes.
  940. @end table
  941. @item cutoff (N.A.)
  942. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  943. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  944. narrowband, mediumband, wideband, super wideband, and fullband
  945. respectively. The default is 0 (cutoff disabled).
  946. @end table
  947. @section libvorbis
  948. libvorbis encoder wrapper.
  949. Requires the presence of the libvorbisenc headers and library during
  950. configuration. You need to explicitly configure the build with
  951. @code{--enable-libvorbis}.
  952. @subsection Options
  953. The following options are supported by the libvorbis wrapper. The
  954. @command{oggenc}-equivalent of the options are listed in parentheses.
  955. To get a more accurate and extensive documentation of the libvorbis
  956. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  957. See @url{http://xiph.org/vorbis/},
  958. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  959. @table @option
  960. @item b (@emph{-b})
  961. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  962. expressed in kilobits/s.
  963. @item q (@emph{-q})
  964. Set constant quality setting for VBR. The value should be a float
  965. number in the range of -1.0 to 10.0. The higher the value, the better
  966. the quality. The default value is @samp{3.0}.
  967. This option is valid only using the @command{ffmpeg} command-line tool.
  968. For library interface users, use @option{global_quality}.
  969. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  970. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  971. related option is expressed in kHz. The default value is @samp{0} (cutoff
  972. disabled).
  973. @item minrate (@emph{-m})
  974. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  975. expressed in kilobits/s.
  976. @item maxrate (@emph{-M})
  977. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  978. expressed in kilobits/s. This only has effect on ABR mode.
  979. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  980. Set noise floor bias for impulse blocks. The value is a float number from
  981. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  982. to the crispness of transients in the encoded audio. The tradeoff for better
  983. transient response is a higher bitrate.
  984. @end table
  985. @anchor{libwavpack}
  986. @section libwavpack
  987. A wrapper providing WavPack encoding through libwavpack.
  988. Only lossless mode using 32-bit integer samples is supported currently.
  989. Requires the presence of the libwavpack headers and library during
  990. configuration. You need to explicitly configure the build with
  991. @code{--enable-libwavpack}.
  992. Note that a libavcodec-native encoder for the WavPack codec exists so users can
  993. encode audios with this codec without using this encoder. See @ref{wavpackenc}.
  994. @subsection Options
  995. @command{wavpack} command line utility's corresponding options are listed in
  996. parentheses, if any.
  997. @table @option
  998. @item frame_size (@emph{--blocksize})
  999. Default is 32768.
  1000. @item compression_level
  1001. Set speed vs. compression tradeoff. Acceptable arguments are listed below:
  1002. @table @samp
  1003. @item 0 (@emph{-f})
  1004. Fast mode.
  1005. @item 1
  1006. Normal (default) settings.
  1007. @item 2 (@emph{-h})
  1008. High quality.
  1009. @item 3 (@emph{-hh})
  1010. Very high quality.
  1011. @item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
  1012. Same as @samp{3}, but with extra processing enabled.
  1013. @samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
  1014. @end table
  1015. @end table
  1016. @anchor{wavpackenc}
  1017. @section wavpack
  1018. WavPack lossless audio encoder.
  1019. This is a libavcodec-native WavPack encoder. There is also an encoder based on
  1020. libwavpack, but there is virtually no reason to use that encoder.
  1021. See also @ref{libwavpack}.
  1022. @subsection Options
  1023. The equivalent options for @command{wavpack} command line utility are listed in
  1024. parentheses.
  1025. @subsubsection Shared options
  1026. The following shared options are effective for this encoder. Only special notes
  1027. about this particular encoder will be documented here. For the general meaning
  1028. of the options, see @ref{codec-options,,the Codec Options chapter}.
  1029. @table @option
  1030. @item frame_size (@emph{--blocksize})
  1031. For this encoder, the range for this option is between 128 and 131072. Default
  1032. is automatically decided based on sample rate and number of channel.
  1033. For the complete formula of calculating default, see
  1034. @file{libavcodec/wavpackenc.c}.
  1035. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
  1036. This option's syntax is consistent with @ref{libwavpack}'s.
  1037. @end table
  1038. @subsubsection Private options
  1039. @table @option
  1040. @item joint_stereo (@emph{-j})
  1041. Set whether to enable joint stereo. Valid values are:
  1042. @table @samp
  1043. @item on (@emph{1})
  1044. Force mid/side audio encoding.
  1045. @item off (@emph{0})
  1046. Force left/right audio encoding.
  1047. @item auto
  1048. Let the encoder decide automatically.
  1049. @end table
  1050. @item optimize_mono
  1051. Set whether to enable optimization for mono. This option is only effective for
  1052. non-mono streams. Available values:
  1053. @table @samp
  1054. @item on
  1055. enabled
  1056. @item off
  1057. disabled
  1058. @end table
  1059. @end table
  1060. @c man end AUDIO ENCODERS
  1061. @chapter Video Encoders
  1062. @c man begin VIDEO ENCODERS
  1063. A description of some of the currently available video encoders
  1064. follows.
  1065. @section libopenh264
  1066. Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  1067. This encoder requires the presence of the libopenh264 headers and
  1068. library during configuration. You need to explicitly configure the
  1069. build with @code{--enable-libopenh264}. The library is detected using
  1070. @command{pkg-config}.
  1071. For more information about the library see
  1072. @url{http://www.openh264.org}.
  1073. @subsection Options
  1074. The following FFmpeg global options affect the configurations of the
  1075. libopenh264 encoder.
  1076. @table @option
  1077. @item b
  1078. Set the bitrate (as a number of bits per second).
  1079. @item g
  1080. Set the GOP size.
  1081. @item maxrate
  1082. Set the max bitrate (as a number of bits per second).
  1083. @item flags +global_header
  1084. Set global header in the bitstream.
  1085. @item slices
  1086. Set the number of slices, used in parallelized encoding. Default value
  1087. is 0. This is only used when @option{slice_mode} is set to
  1088. @samp{fixed}.
  1089. @item slice_mode
  1090. Set slice mode. Can assume one of the follwing possible values:
  1091. @table @samp
  1092. @item fixed
  1093. a fixed number of slices
  1094. @item rowmb
  1095. one slice per row of macroblocks
  1096. @item auto
  1097. automatic number of slices according to number of thread
  1098. @end table
  1099. Default value is @samp{auto}.
  1100. @item loopfilter
  1101. Enable loop filter, if set to 1 (automatically enabled). To disable
  1102. set a value of 0.
  1103. @item profile
  1104. Set profile restrictions. If set to the value of @samp{main} enable
  1105. CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
  1106. @end table
  1107. @section jpeg2000
  1108. The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
  1109. option can be used to set the encoding quality. Lossless encoding
  1110. can be selected with @code{-pred 1}.
  1111. @subsection Options
  1112. @table @option
  1113. @item format
  1114. Can be set to either @code{j2k} or @code{jp2} (the default) that
  1115. makes it possible to store non-rgb pix_fmts.
  1116. @end table
  1117. @section snow
  1118. @subsection Options
  1119. @table @option
  1120. @item iterative_dia_size
  1121. dia size for the iterative motion estimation
  1122. @end table
  1123. @section libtheora
  1124. libtheora Theora encoder wrapper.
  1125. Requires the presence of the libtheora headers and library during
  1126. configuration. You need to explicitly configure the build with
  1127. @code{--enable-libtheora}.
  1128. For more information about the libtheora project see
  1129. @url{http://www.theora.org/}.
  1130. @subsection Options
  1131. The following global options are mapped to internal libtheora options
  1132. which affect the quality and the bitrate of the encoded stream.
  1133. @table @option
  1134. @item b
  1135. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  1136. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  1137. @item flags
  1138. Used to enable constant quality mode (VBR) encoding through the
  1139. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  1140. modes.
  1141. @item g
  1142. Set the GOP size.
  1143. @item global_quality
  1144. Set the global quality as an integer in lambda units.
  1145. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  1146. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  1147. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  1148. value in the native libtheora range [0-63]. A higher value corresponds
  1149. to a higher quality.
  1150. @item q
  1151. Enable VBR mode when set to a non-negative value, and set constant
  1152. quality value as a double floating point value in QP units.
  1153. The value is clipped in the [0-10] range, and then multiplied by 6.3
  1154. to get a value in the native libtheora range [0-63].
  1155. This option is valid only using the @command{ffmpeg} command-line
  1156. tool. For library interface users, use @option{global_quality}.
  1157. @end table
  1158. @subsection Examples
  1159. @itemize
  1160. @item
  1161. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  1162. @example
  1163. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  1164. @end example
  1165. @item
  1166. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  1167. @example
  1168. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  1169. @end example
  1170. @end itemize
  1171. @section libvpx
  1172. VP8/VP9 format supported through libvpx.
  1173. Requires the presence of the libvpx headers and library during configuration.
  1174. You need to explicitly configure the build with @code{--enable-libvpx}.
  1175. @subsection Options
  1176. The following options are supported by the libvpx wrapper. The
  1177. @command{vpxenc}-equivalent options or values are listed in parentheses
  1178. for easy migration.
  1179. To reduce the duplication of documentation, only the private options
  1180. and some others requiring special attention are documented here. For
  1181. the documentation of the undocumented generic options, see
  1182. @ref{codec-options,,the Codec Options chapter}.
  1183. To get more documentation of the libvpx options, invoke the command
  1184. @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
  1185. @command{vpxenc --help}. Further information is available in the libvpx API
  1186. documentation.
  1187. @table @option
  1188. @item b (@emph{target-bitrate})
  1189. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1190. expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
  1191. kilobits/s.
  1192. @item g (@emph{kf-max-dist})
  1193. @item keyint_min (@emph{kf-min-dist})
  1194. @item qmin (@emph{min-q})
  1195. @item qmax (@emph{max-q})
  1196. @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
  1197. Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
  1198. specified in milliseconds, the libvpx wrapper converts this value as follows:
  1199. @code{buf-sz = bufsize * 1000 / bitrate},
  1200. @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
  1201. @item rc_init_occupancy (@emph{buf-initial-sz})
  1202. Set number of bits which should be loaded into the rc buffer before decoding
  1203. starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
  1204. wrapper converts this value as follows:
  1205. @code{rc_init_occupancy * 1000 / bitrate}.
  1206. @item undershoot-pct
  1207. Set datarate undershoot (min) percentage of the target bitrate.
  1208. @item overshoot-pct
  1209. Set datarate overshoot (max) percentage of the target bitrate.
  1210. @item skip_threshold (@emph{drop-frame})
  1211. @item qcomp (@emph{bias-pct})
  1212. @item maxrate (@emph{maxsection-pct})
  1213. Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1214. percentage of the target bitrate, the libvpx wrapper converts this value as
  1215. follows: @code{(maxrate * 100 / bitrate)}.
  1216. @item minrate (@emph{minsection-pct})
  1217. Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1218. percentage of the target bitrate, the libvpx wrapper converts this value as
  1219. follows: @code{(minrate * 100 / bitrate)}.
  1220. @item minrate, maxrate, b @emph{end-usage=cbr}
  1221. @code{(minrate == maxrate == bitrate)}.
  1222. @item crf (@emph{end-usage=cq}, @emph{cq-level})
  1223. @item quality, deadline (@emph{deadline})
  1224. @table @samp
  1225. @item best
  1226. Use best quality deadline. Poorly named and quite slow, this option should be
  1227. avoided as it may give worse quality output than good.
  1228. @item good
  1229. Use good quality deadline. This is a good trade-off between speed and quality
  1230. when used with the @option{cpu-used} option.
  1231. @item realtime
  1232. Use realtime quality deadline.
  1233. @end table
  1234. @item speed, cpu-used (@emph{cpu-used})
  1235. Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  1236. of quality.
  1237. @item nr (@emph{noise-sensitivity})
  1238. @item static-thresh
  1239. Set a change threshold on blocks below which they will be skipped by the
  1240. encoder.
  1241. @item slices (@emph{token-parts})
  1242. Note that FFmpeg's @option{slices} option gives the total number of partitions,
  1243. while @command{vpxenc}'s @option{token-parts} is given as
  1244. @code{log2(partitions)}.
  1245. @item max-intra-rate
  1246. Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  1247. means unlimited.
  1248. @item force_key_frames
  1249. @code{VPX_EFLAG_FORCE_KF}
  1250. @item Alternate reference frame related
  1251. @table @option
  1252. @item auto-alt-ref
  1253. Enable use of alternate reference frames (2-pass only).
  1254. @item arnr-max-frames
  1255. Set altref noise reduction max frame count.
  1256. @item arnr-type
  1257. Set altref noise reduction filter type: backward, forward, centered.
  1258. @item arnr-strength
  1259. Set altref noise reduction filter strength.
  1260. @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
  1261. Set number of frames to look ahead for frametype and ratecontrol.
  1262. @end table
  1263. @item error-resilient
  1264. Enable error resiliency features.
  1265. @item VP9-specific options
  1266. @table @option
  1267. @item lossless
  1268. Enable lossless mode.
  1269. @item tile-columns
  1270. Set number of tile columns to use. Note this is given as
  1271. @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
  1272. setting the @option{tile-columns} option to 3.
  1273. @item tile-rows
  1274. Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
  1275. For example, 4 tile rows would be requested by setting the @option{tile-rows}
  1276. option to 2.
  1277. @item frame-parallel
  1278. Enable frame parallel decodability features.
  1279. @item aq-mode
  1280. Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  1281. cyclic refresh).
  1282. @item colorspace @emph{color-space}
  1283. Set input color space. The VP9 bitstream supports signaling the following
  1284. colorspaces:
  1285. @table @option
  1286. @item @samp{rgb} @emph{sRGB}
  1287. @item @samp{bt709} @emph{bt709}
  1288. @item @samp{unspecified} @emph{unknown}
  1289. @item @samp{bt470bg} @emph{bt601}
  1290. @item @samp{smpte170m} @emph{smpte170}
  1291. @item @samp{smpte240m} @emph{smpte240}
  1292. @item @samp{bt2020_ncl} @emph{bt2020}
  1293. @end table
  1294. @end table
  1295. @end table
  1296. For more information about libvpx see:
  1297. @url{http://www.webmproject.org/}
  1298. @section libwebp
  1299. libwebp WebP Image encoder wrapper
  1300. libwebp is Google's official encoder for WebP images. It can encode in either
  1301. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  1302. frame. Lossless images are a separate codec developed by Google.
  1303. @subsection Pixel Format
  1304. Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  1305. to limitations of the format and libwebp. Alpha is supported for either mode.
  1306. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  1307. passed in for encoding lossless, the pixel format will automatically be
  1308. converted using functions from libwebp. This is not ideal and is done only for
  1309. convenience.
  1310. @subsection Options
  1311. @table @option
  1312. @item -lossless @var{boolean}
  1313. Enables/Disables use of lossless mode. Default is 0.
  1314. @item -compression_level @var{integer}
  1315. For lossy, this is a quality/speed tradeoff. Higher values give better quality
  1316. for a given size at the cost of increased encoding time. For lossless, this is
  1317. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  1318. encoding time. More specifically, it controls the number of extra algorithms
  1319. and compression tools used, and varies the combination of these tools. This
  1320. maps to the @var{method} option in libwebp. The valid range is 0 to 6.
  1321. Default is 4.
  1322. @item -qscale @var{float}
  1323. For lossy encoding, this controls image quality, 0 to 100. For lossless
  1324. encoding, this controls the effort and time spent at compressing more. The
  1325. default value is 75. Note that for usage via libavcodec, this option is called
  1326. @var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
  1327. @item -preset @var{type}
  1328. Configuration preset. This does some automatic settings based on the general
  1329. type of the image.
  1330. @table @option
  1331. @item none
  1332. Do not use a preset.
  1333. @item default
  1334. Use the encoder default.
  1335. @item picture
  1336. Digital picture, like portrait, inner shot
  1337. @item photo
  1338. Outdoor photograph, with natural lighting
  1339. @item drawing
  1340. Hand or line drawing, with high-contrast details
  1341. @item icon
  1342. Small-sized colorful images
  1343. @item text
  1344. Text-like
  1345. @end table
  1346. @end table
  1347. @section libx264, libx264rgb
  1348. x264 H.264/MPEG-4 AVC encoder wrapper.
  1349. This encoder requires the presence of the libx264 headers and library
  1350. during configuration. You need to explicitly configure the build with
  1351. @code{--enable-libx264}.
  1352. libx264 supports an impressive number of features, including 8x8 and
  1353. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1354. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1355. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1356. Many libx264 encoder options are mapped to FFmpeg global codec
  1357. options, while unique encoder options are provided through private
  1358. options. Additionally the @option{x264opts} and @option{x264-params}
  1359. private options allows one to pass a list of key=value tuples as accepted
  1360. by the libx264 @code{x264_param_parse} function.
  1361. The x264 project website is at
  1362. @url{http://www.videolan.org/developers/x264.html}.
  1363. The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  1364. pixel formats as input instead of YUV.
  1365. @subsection Supported Pixel Formats
  1366. x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  1367. x264's configure time. FFmpeg only supports one bit depth in one particular
  1368. build. In other words, it is not possible to build one FFmpeg with multiple
  1369. versions of x264 with different bit depths.
  1370. @subsection Options
  1371. The following options are supported by the libx264 wrapper. The
  1372. @command{x264}-equivalent options or values are listed in parentheses
  1373. for easy migration.
  1374. To reduce the duplication of documentation, only the private options
  1375. and some others requiring special attention are documented here. For
  1376. the documentation of the undocumented generic options, see
  1377. @ref{codec-options,,the Codec Options chapter}.
  1378. To get a more accurate and extensive documentation of the libx264
  1379. options, invoke the command @command{x264 --full-help} or consult
  1380. the libx264 documentation.
  1381. @table @option
  1382. @item b (@emph{bitrate})
  1383. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1384. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1385. kilobits/s.
  1386. @item bf (@emph{bframes})
  1387. @item g (@emph{keyint})
  1388. @item qmin (@emph{qpmin})
  1389. Minimum quantizer scale.
  1390. @item qmax (@emph{qpmax})
  1391. Maximum quantizer scale.
  1392. @item qdiff (@emph{qpstep})
  1393. Maximum difference between quantizer scales.
  1394. @item qblur (@emph{qblur})
  1395. Quantizer curve blur
  1396. @item qcomp (@emph{qcomp})
  1397. Quantizer curve compression factor
  1398. @item refs (@emph{ref})
  1399. Number of reference frames each P-frame can use. The range is from @var{0-16}.
  1400. @item sc_threshold (@emph{scenecut})
  1401. Sets the threshold for the scene change detection.
  1402. @item trellis (@emph{trellis})
  1403. Performs Trellis quantization to increase efficiency. Enabled by default.
  1404. @item nr (@emph{nr})
  1405. @item me_range (@emph{merange})
  1406. Maximum range of the motion search in pixels.
  1407. @item me_method (@emph{me})
  1408. Set motion estimation method. Possible values in the decreasing order
  1409. of speed:
  1410. @table @samp
  1411. @item dia (@emph{dia})
  1412. @item epzs (@emph{dia})
  1413. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1414. @samp{dia}.
  1415. @item hex (@emph{hex})
  1416. Hexagonal search with radius 2.
  1417. @item umh (@emph{umh})
  1418. Uneven multi-hexagon search.
  1419. @item esa (@emph{esa})
  1420. Exhaustive search.
  1421. @item tesa (@emph{tesa})
  1422. Hadamard exhaustive search (slowest).
  1423. @end table
  1424. @item subq (@emph{subme})
  1425. Sub-pixel motion estimation method.
  1426. @item b_strategy (@emph{b-adapt})
  1427. Adaptive B-frame placement decision algorithm. Use only on first-pass.
  1428. @item keyint_min (@emph{min-keyint})
  1429. Minimum GOP size.
  1430. @item coder
  1431. Set entropy encoder. Possible values:
  1432. @table @samp
  1433. @item ac
  1434. Enable CABAC.
  1435. @item vlc
  1436. Enable CAVLC and disable CABAC. It generates the same effect as
  1437. @command{x264}'s @option{--no-cabac} option.
  1438. @end table
  1439. @item cmp
  1440. Set full pixel motion estimation comparation algorithm. Possible values:
  1441. @table @samp
  1442. @item chroma
  1443. Enable chroma in motion estimation.
  1444. @item sad
  1445. Ignore chroma in motion estimation. It generates the same effect as
  1446. @command{x264}'s @option{--no-chroma-me} option.
  1447. @end table
  1448. @item threads (@emph{threads})
  1449. Number of encoding threads.
  1450. @item thread_type
  1451. Set multithreading technique. Possible values:
  1452. @table @samp
  1453. @item slice
  1454. Slice-based multithreading. It generates the same effect as
  1455. @command{x264}'s @option{--sliced-threads} option.
  1456. @item frame
  1457. Frame-based multithreading.
  1458. @end table
  1459. @item flags
  1460. Set encoding flags. It can be used to disable closed GOP and enable
  1461. open GOP by setting it to @code{-cgop}. The result is similar to
  1462. the behavior of @command{x264}'s @option{--open-gop} option.
  1463. @item rc_init_occupancy (@emph{vbv-init})
  1464. @item preset (@emph{preset})
  1465. Set the encoding preset.
  1466. @item tune (@emph{tune})
  1467. Set tuning of the encoding params.
  1468. @item profile (@emph{profile})
  1469. Set profile restrictions.
  1470. @item fastfirstpass
  1471. Enable fast settings when encoding first pass, when set to 1. When set
  1472. to 0, it has the same effect of @command{x264}'s
  1473. @option{--slow-firstpass} option.
  1474. @item crf (@emph{crf})
  1475. Set the quality for constant quality mode.
  1476. @item crf_max (@emph{crf-max})
  1477. In CRF mode, prevents VBV from lowering quality beyond this point.
  1478. @item qp (@emph{qp})
  1479. Set constant quantization rate control method parameter.
  1480. @item aq-mode (@emph{aq-mode})
  1481. Set AQ method. Possible values:
  1482. @table @samp
  1483. @item none (@emph{0})
  1484. Disabled.
  1485. @item variance (@emph{1})
  1486. Variance AQ (complexity mask).
  1487. @item autovariance (@emph{2})
  1488. Auto-variance AQ (experimental).
  1489. @end table
  1490. @item aq-strength (@emph{aq-strength})
  1491. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1492. @item psy
  1493. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1494. same effect as @command{x264}'s @option{--no-psy} option.
  1495. @item psy-rd (@emph{psy-rd})
  1496. Set strength of psychovisual optimization, in
  1497. @var{psy-rd}:@var{psy-trellis} format.
  1498. @item rc-lookahead (@emph{rc-lookahead})
  1499. Set number of frames to look ahead for frametype and ratecontrol.
  1500. @item weightb
  1501. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1502. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1503. @item weightp (@emph{weightp})
  1504. Set weighted prediction method for P-frames. Possible values:
  1505. @table @samp
  1506. @item none (@emph{0})
  1507. Disabled
  1508. @item simple (@emph{1})
  1509. Enable only weighted refs
  1510. @item smart (@emph{2})
  1511. Enable both weighted refs and duplicates
  1512. @end table
  1513. @item ssim (@emph{ssim})
  1514. Enable calculation and printing SSIM stats after the encoding.
  1515. @item intra-refresh (@emph{intra-refresh})
  1516. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1517. to 1.
  1518. @item avcintra-class (@emph{class})
  1519. Configure the encoder to generate AVC-Intra.
  1520. Valid values are 50,100 and 200
  1521. @item bluray-compat (@emph{bluray-compat})
  1522. Configure the encoder to be compatible with the bluray standard.
  1523. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  1524. @item b-bias (@emph{b-bias})
  1525. Set the influence on how often B-frames are used.
  1526. @item b-pyramid (@emph{b-pyramid})
  1527. Set method for keeping of some B-frames as references. Possible values:
  1528. @table @samp
  1529. @item none (@emph{none})
  1530. Disabled.
  1531. @item strict (@emph{strict})
  1532. Strictly hierarchical pyramid.
  1533. @item normal (@emph{normal})
  1534. Non-strict (not Blu-ray compatible).
  1535. @end table
  1536. @item mixed-refs
  1537. Enable the use of one reference per partition, as opposed to one
  1538. reference per macroblock when set to 1. When set to 0, it has the
  1539. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  1540. @item 8x8dct
  1541. Enable adaptive spatial transform (high profile 8x8 transform)
  1542. when set to 1. When set to 0, it has the same effect as
  1543. @command{x264}'s @option{--no-8x8dct} option.
  1544. @item fast-pskip
  1545. Enable early SKIP detection on P-frames when set to 1. When set
  1546. to 0, it has the same effect as @command{x264}'s
  1547. @option{--no-fast-pskip} option.
  1548. @item aud (@emph{aud})
  1549. Enable use of access unit delimiters when set to 1.
  1550. @item mbtree
  1551. Enable use macroblock tree ratecontrol when set to 1. When set
  1552. to 0, it has the same effect as @command{x264}'s
  1553. @option{--no-mbtree} option.
  1554. @item deblock (@emph{deblock})
  1555. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  1556. @item cplxblur (@emph{cplxblur})
  1557. Set fluctuations reduction in QP (before curve compression).
  1558. @item partitions (@emph{partitions})
  1559. Set partitions to consider as a comma-separated list of. Possible
  1560. values in the list:
  1561. @table @samp
  1562. @item p8x8
  1563. 8x8 P-frame partition.
  1564. @item p4x4
  1565. 4x4 P-frame partition.
  1566. @item b8x8
  1567. 4x4 B-frame partition.
  1568. @item i8x8
  1569. 8x8 I-frame partition.
  1570. @item i4x4
  1571. 4x4 I-frame partition.
  1572. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  1573. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  1574. option) to be enabled.)
  1575. @item none (@emph{none})
  1576. Do not consider any partitions.
  1577. @item all (@emph{all})
  1578. Consider every partition.
  1579. @end table
  1580. @item direct-pred (@emph{direct})
  1581. Set direct MV prediction mode. Possible values:
  1582. @table @samp
  1583. @item none (@emph{none})
  1584. Disable MV prediction.
  1585. @item spatial (@emph{spatial})
  1586. Enable spatial predicting.
  1587. @item temporal (@emph{temporal})
  1588. Enable temporal predicting.
  1589. @item auto (@emph{auto})
  1590. Automatically decided.
  1591. @end table
  1592. @item slice-max-size (@emph{slice-max-size})
  1593. Set the limit of the size of each slice in bytes. If not specified
  1594. but RTP payload size (@option{ps}) is specified, that is used.
  1595. @item stats (@emph{stats})
  1596. Set the file name for multi-pass stats.
  1597. @item nal-hrd (@emph{nal-hrd})
  1598. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  1599. Possible values:
  1600. @table @samp
  1601. @item none (@emph{none})
  1602. Disable HRD information signaling.
  1603. @item vbr (@emph{vbr})
  1604. Variable bit rate.
  1605. @item cbr (@emph{cbr})
  1606. Constant bit rate (not allowed in MP4 container).
  1607. @end table
  1608. @item x264opts (N.A.)
  1609. Set any x264 option, see @command{x264 --fullhelp} for a list.
  1610. Argument is a list of @var{key}=@var{value} couples separated by
  1611. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  1612. themselves, use "," instead. They accept it as well since long ago but this
  1613. is kept undocumented for some reason.
  1614. For example to specify libx264 encoding options with @command{ffmpeg}:
  1615. @example
  1616. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  1617. @end example
  1618. @item a53cc @var{boolean}
  1619. Import closed captions (which must be ATSC compatible format) into output.
  1620. Only the mpeg2 and h264 decoders provide these. Default is 0 (off).
  1621. @item x264-params (N.A.)
  1622. Override the x264 configuration using a :-separated list of key=value
  1623. parameters.
  1624. This option is functionally the same as the @option{x264opts}, but is
  1625. duplicated for compatibility with the Libav fork.
  1626. For example to specify libx264 encoding options with @command{ffmpeg}:
  1627. @example
  1628. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  1629. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  1630. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  1631. @end example
  1632. @end table
  1633. Encoding ffpresets for common usages are provided so they can be used with the
  1634. general presets system (e.g. passing the @option{pre} option).
  1635. @section libx265
  1636. x265 H.265/HEVC encoder wrapper.
  1637. This encoder requires the presence of the libx265 headers and library
  1638. during configuration. You need to explicitly configure the build with
  1639. @option{--enable-libx265}.
  1640. @subsection Options
  1641. @table @option
  1642. @item preset
  1643. Set the x265 preset.
  1644. @item tune
  1645. Set the x265 tune parameter.
  1646. @item x265-params
  1647. Set x265 options using a list of @var{key}=@var{value} couples separated
  1648. by ":". See @command{x265 --help} for a list of options.
  1649. For example to specify libx265 encoding options with @option{-x265-params}:
  1650. @example
  1651. ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  1652. @end example
  1653. @end table
  1654. @section libxvid
  1655. Xvid MPEG-4 Part 2 encoder wrapper.
  1656. This encoder requires the presence of the libxvidcore headers and library
  1657. during configuration. You need to explicitly configure the build with
  1658. @code{--enable-libxvid --enable-gpl}.
  1659. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  1660. users can encode to this format without this library.
  1661. @subsection Options
  1662. The following options are supported by the libxvid wrapper. Some of
  1663. the following options are listed but are not documented, and
  1664. correspond to shared codec options. See @ref{codec-options,,the Codec
  1665. Options chapter} for their documentation. The other shared options
  1666. which are not listed have no effect for the libxvid encoder.
  1667. @table @option
  1668. @item b
  1669. @item g
  1670. @item qmin
  1671. @item qmax
  1672. @item mpeg_quant
  1673. @item threads
  1674. @item bf
  1675. @item b_qfactor
  1676. @item b_qoffset
  1677. @item flags
  1678. Set specific encoding flags. Possible values:
  1679. @table @samp
  1680. @item mv4
  1681. Use four motion vector by macroblock.
  1682. @item aic
  1683. Enable high quality AC prediction.
  1684. @item gray
  1685. Only encode grayscale.
  1686. @item gmc
  1687. Enable the use of global motion compensation (GMC).
  1688. @item qpel
  1689. Enable quarter-pixel motion compensation.
  1690. @item cgop
  1691. Enable closed GOP.
  1692. @item global_header
  1693. Place global headers in extradata instead of every keyframe.
  1694. @end table
  1695. @item trellis
  1696. @item me_method
  1697. Set motion estimation method. Possible values in decreasing order of
  1698. speed and increasing order of quality:
  1699. @table @samp
  1700. @item zero
  1701. Use no motion estimation (default).
  1702. @item phods
  1703. @item x1
  1704. @item log
  1705. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  1706. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  1707. @samp{phods}.
  1708. @item epzs
  1709. Enable all of the things described above, plus advanced diamond zonal
  1710. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  1711. estimation on chroma planes.
  1712. @item full
  1713. Enable all of the things described above, plus extended 16x16 and 8x8
  1714. blocks search.
  1715. @end table
  1716. @item mbd
  1717. Set macroblock decision algorithm. Possible values in the increasing
  1718. order of quality:
  1719. @table @samp
  1720. @item simple
  1721. Use macroblock comparing function algorithm (default).
  1722. @item bits
  1723. Enable rate distortion-based half pixel and quarter pixel refinement for
  1724. 16x16 blocks.
  1725. @item rd
  1726. Enable all of the things described above, plus rate distortion-based
  1727. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  1728. distortion-based search using square pattern.
  1729. @end table
  1730. @item lumi_aq
  1731. Enable lumi masking adaptive quantization when set to 1. Default is 0
  1732. (disabled).
  1733. @item variance_aq
  1734. Enable variance adaptive quantization when set to 1. Default is 0
  1735. (disabled).
  1736. When combined with @option{lumi_aq}, the resulting quality will not
  1737. be better than any of the two specified individually. In other
  1738. words, the resulting quality will be the worse one of the two
  1739. effects.
  1740. @item ssim
  1741. Set structural similarity (SSIM) displaying method. Possible values:
  1742. @table @samp
  1743. @item off
  1744. Disable displaying of SSIM information.
  1745. @item avg
  1746. Output average SSIM at the end of encoding to stdout. The format of
  1747. showing the average SSIM is:
  1748. @example
  1749. Average SSIM: %f
  1750. @end example
  1751. For users who are not familiar with C, %f means a float number, or
  1752. a decimal (e.g. 0.939232).
  1753. @item frame
  1754. Output both per-frame SSIM data during encoding and average SSIM at
  1755. the end of encoding to stdout. The format of per-frame information
  1756. is:
  1757. @example
  1758. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  1759. @end example
  1760. For users who are not familiar with C, %1.3f means a float number
  1761. rounded to 3 digits after the dot (e.g. 0.932).
  1762. @end table
  1763. @item ssim_acc
  1764. Set SSIM accuracy. Valid options are integers within the range of
  1765. 0-4, while 0 gives the most accurate result and 4 computes the
  1766. fastest.
  1767. @end table
  1768. @section mpeg2
  1769. MPEG-2 video encoder.
  1770. @subsection Options
  1771. @table @option
  1772. @item seq_disp_ext @var{integer}
  1773. Specifies if the encoder should write a sequence_display_extension to the
  1774. output.
  1775. @table @option
  1776. @item -1
  1777. @itemx auto
  1778. Decide automatically to write it or not (this is the default) by checking if
  1779. the data to be written is different from the default or unspecified values.
  1780. @item 0
  1781. @itemx never
  1782. Never write it.
  1783. @item 1
  1784. @itemx always
  1785. Always write it.
  1786. @end table
  1787. @end table
  1788. @section png
  1789. PNG image encoder.
  1790. @subsection Private options
  1791. @table @option
  1792. @item dpi @var{integer}
  1793. Set physical density of pixels, in dots per inch, unset by default
  1794. @item dpm @var{integer}
  1795. Set physical density of pixels, in dots per meter, unset by default
  1796. @end table
  1797. @section ProRes
  1798. Apple ProRes encoder.
  1799. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  1800. The used encoder can be chosen with the @code{-vcodec} option.
  1801. @subsection Private Options for prores-ks
  1802. @table @option
  1803. @item profile @var{integer}
  1804. Select the ProRes profile to encode
  1805. @table @samp
  1806. @item proxy
  1807. @item lt
  1808. @item standard
  1809. @item hq
  1810. @item 4444
  1811. @end table
  1812. @item quant_mat @var{integer}
  1813. Select quantization matrix.
  1814. @table @samp
  1815. @item auto
  1816. @item default
  1817. @item proxy
  1818. @item lt
  1819. @item standard
  1820. @item hq
  1821. @end table
  1822. If set to @var{auto}, the matrix matching the profile will be picked.
  1823. If not set, the matrix providing the highest quality, @var{default}, will be
  1824. picked.
  1825. @item bits_per_mb @var{integer}
  1826. How many bits to allot for coding one macroblock. Different profiles use
  1827. between 200 and 2400 bits per macroblock, the maximum is 8000.
  1828. @item mbs_per_slice @var{integer}
  1829. Number of macroblocks in each slice (1-8); the default value (8)
  1830. should be good in almost all situations.
  1831. @item vendor @var{string}
  1832. Override the 4-byte vendor ID.
  1833. A custom vendor ID like @var{apl0} would claim the stream was produced by
  1834. the Apple encoder.
  1835. @item alpha_bits @var{integer}
  1836. Specify number of bits for alpha component.
  1837. Possible values are @var{0}, @var{8} and @var{16}.
  1838. Use @var{0} to disable alpha plane coding.
  1839. @end table
  1840. @subsection Speed considerations
  1841. In the default mode of operation the encoder has to honor frame constraints
  1842. (i.e. not produce frames with size bigger than requested) while still making
  1843. output picture as good as possible.
  1844. A frame containing a lot of small details is harder to compress and the encoder
  1845. would spend more time searching for appropriate quantizers for each slice.
  1846. Setting a higher @option{bits_per_mb} limit will improve the speed.
  1847. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  1848. recommended value) and do not set a size constraint.
  1849. @section libkvazaar
  1850. Kvazaar H.265/HEVC encoder.
  1851. Requires the presence of the libkvazaar headers and library during
  1852. configuration. You need to explicitly configure the build with
  1853. @option{--enable-libkvazaar}.
  1854. @subsection Options
  1855. @table @option
  1856. @item b
  1857. Set target video bitrate in bit/s and enable rate control.
  1858. @item kvazaar-params
  1859. Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
  1860. by commas (,). See kvazaar documentation for a list of options.
  1861. @end table
  1862. @section QSV encoders
  1863. The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC)
  1864. The ratecontrol method is selected as follows:
  1865. @itemize @bullet
  1866. @item
  1867. When @option{global_quality} is specified, a quality-based mode is used.
  1868. Specifically this means either
  1869. @itemize @minus
  1870. @item
  1871. @var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
  1872. also set (the @option{-qscale} avconv option).
  1873. @item
  1874. @var{LA_ICQ} - intelligent constant quality with lookahead, when the
  1875. @option{look_ahead} option is also set.
  1876. @item
  1877. @var{ICQ} -- intelligent constant quality otherwise.
  1878. @end itemize
  1879. @item
  1880. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  1881. least the desired average bitrate with the @option{b} option.
  1882. @itemize @minus
  1883. @item
  1884. @var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
  1885. @item
  1886. @var{VCM} - video conferencing mode, when the @option{vcm} option is set.
  1887. @item
  1888. @var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
  1889. the average bitrate.
  1890. @item
  1891. @var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
  1892. than the average bitrate.
  1893. @item
  1894. @var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
  1895. is further configured by the @option{avbr_accuracy} and
  1896. @option{avbr_convergence} options.
  1897. @end itemize
  1898. @end itemize
  1899. Note that depending on your system, a different mode than the one you specified
  1900. may be selected by the encoder. Set the verbosity level to @var{verbose} or
  1901. higher to see the actual settings used by the QSV runtime.
  1902. Additional libavcodec global options are mapped to MSDK options as follows:
  1903. @itemize
  1904. @item
  1905. @option{g/gop_size} -> @option{GopPicSize}
  1906. @item
  1907. @option{bf/max_b_frames}+1 -> @option{GopRefDist}
  1908. @item
  1909. @option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
  1910. @option{InitialDelayInKB}
  1911. @item
  1912. @option{slices} -> @option{NumSlice}
  1913. @item
  1914. @option{refs} -> @option{NumRefFrame}
  1915. @item
  1916. @option{b_strategy/b_frame_strategy} -> @option{BRefType}
  1917. @item
  1918. @option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
  1919. @item
  1920. For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
  1921. @option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
  1922. and @var{QPP} and @var{QPB} respectively.
  1923. @item
  1924. Setting the @option{coder} option to the value @var{vlc} will make the H.264
  1925. encoder use CAVLC instead of CABAC.
  1926. @end itemize
  1927. @c man end VIDEO ENCODERS
  1928. @chapter Subtitles Encoders
  1929. @c man begin SUBTITLES ENCODERS
  1930. @section dvdsub
  1931. This codec encodes the bitmap subtitle format that is used in DVDs.
  1932. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  1933. and they can also be used in Matroska files.
  1934. @subsection Options
  1935. @table @option
  1936. @item even_rows_fix
  1937. When set to 1, enable a work-around that makes the number of pixel rows
  1938. even in all subtitles. This fixes a problem with some players that
  1939. cut off the bottom row if the number is odd. The work-around just adds
  1940. a fully transparent row if needed. The overhead is low, typically
  1941. one byte per subtitle on average.
  1942. By default, this work-around is disabled.
  1943. @end table
  1944. @c man end SUBTITLES ENCODERS