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.

2376 lines
65KB

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