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.

1568 lines
42KB

  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{-codecs} 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 Comment this out until somebody writes the respective documentation.
  30. @c See also @ref{libfaac}, @ref{libaacplus}, and @ref{libfdk-aac-enc}.
  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. descibed 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. @subsection Tips and Tricks
  78. According to some reports
  79. (e.g. @url{http://d.hatena.ne.jp/kamedo2/20120729/1343545890}), setting the
  80. @option{cutoff} option to 15000 Hz greatly improves the quality of the output
  81. quality. As a result, we encourage you to do the same.
  82. @section ac3 and ac3_fixed
  83. AC-3 audio encoders.
  84. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  85. the undocumented RealAudio 3 (a.k.a. dnet).
  86. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  87. encoder only uses fixed-point integer math. This does not mean that one is
  88. always faster, just that one or the other may be better suited to a
  89. particular system. The floating-point encoder will generally produce better
  90. quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
  91. default codec for any of the output formats, so it must be specified explicitly
  92. using the option @code{-acodec ac3_fixed} in order to use it.
  93. @subsection AC-3 Metadata
  94. The AC-3 metadata options are used to set parameters that describe the audio,
  95. but in most cases do not affect the audio encoding itself. Some of the options
  96. do directly affect or influence the decoding and playback of the resulting
  97. bitstream, while others are just for informational purposes. A few of the
  98. options will add bits to the output stream that could otherwise be used for
  99. audio data, and will thus affect the quality of the output. Those will be
  100. indicated accordingly with a note in the option list below.
  101. These parameters are described in detail in several publicly-available
  102. documents.
  103. @itemize
  104. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  105. @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}
  106. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  107. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  108. @end itemize
  109. @subsubsection Metadata Control Options
  110. @table @option
  111. @item -per_frame_metadata @var{boolean}
  112. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  113. metadata for each frame.
  114. @table @option
  115. @item 0
  116. The metadata values set at initialization will be used for every frame in the
  117. stream. (default)
  118. @item 1
  119. Metadata values can be changed before encoding each frame.
  120. @end table
  121. @end table
  122. @subsubsection Downmix Levels
  123. @table @option
  124. @item -center_mixlev @var{level}
  125. Center Mix Level. The amount of gain the decoder should apply to the center
  126. channel when downmixing to stereo. This field will only be written to the
  127. bitstream if a center channel is present. The value is specified as a scale
  128. factor. There are 3 valid values:
  129. @table @option
  130. @item 0.707
  131. Apply -3dB gain
  132. @item 0.595
  133. Apply -4.5dB gain (default)
  134. @item 0.500
  135. Apply -6dB gain
  136. @end table
  137. @item -surround_mixlev @var{level}
  138. Surround Mix Level. The amount of gain the decoder should apply to the surround
  139. channel(s) when downmixing to stereo. This field will only be written to the
  140. bitstream if one or more surround channels are present. The value is specified
  141. as a scale factor. There are 3 valid values:
  142. @table @option
  143. @item 0.707
  144. Apply -3dB gain
  145. @item 0.500
  146. Apply -6dB gain (default)
  147. @item 0.000
  148. Silence Surround Channel(s)
  149. @end table
  150. @end table
  151. @subsubsection Audio Production Information
  152. Audio Production Information is optional information describing the mixing
  153. environment. Either none or both of the fields are written to the bitstream.
  154. @table @option
  155. @item -mixing_level @var{number}
  156. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  157. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  158. unknown or not indicated. The default value is -1, but that value cannot be
  159. used if the Audio Production Information is written to the bitstream. Therefore,
  160. if the @code{room_type} option is not the default value, the @code{mixing_level}
  161. option must not be -1.
  162. @item -room_type @var{type}
  163. Room Type. Describes the equalization used during the final mixing session at
  164. the studio or on the dubbing stage. A large room is a dubbing stage with the
  165. industry standard X-curve equalization; a small room has flat equalization.
  166. This field will not be written to the bitstream if both the @code{mixing_level}
  167. option and the @code{room_type} option have the default values.
  168. @table @option
  169. @item 0
  170. @itemx notindicated
  171. Not Indicated (default)
  172. @item 1
  173. @itemx large
  174. Large Room
  175. @item 2
  176. @itemx small
  177. Small Room
  178. @end table
  179. @end table
  180. @subsubsection Other Metadata Options
  181. @table @option
  182. @item -copyright @var{boolean}
  183. Copyright Indicator. Specifies whether a copyright exists for this audio.
  184. @table @option
  185. @item 0
  186. @itemx off
  187. No Copyright Exists (default)
  188. @item 1
  189. @itemx on
  190. Copyright Exists
  191. @end table
  192. @item -dialnorm @var{value}
  193. Dialogue Normalization. Indicates how far the average dialogue level of the
  194. program is below digital 100% full scale (0 dBFS). This parameter determines a
  195. level shift during audio reproduction that sets the average volume of the
  196. dialogue to a preset level. The goal is to match volume level between program
  197. sources. A value of -31dB will result in no volume level change, relative to
  198. the source volume, during audio reproduction. Valid values are whole numbers in
  199. the range -31 to -1, with -31 being the default.
  200. @item -dsur_mode @var{mode}
  201. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  202. (Pro Logic). This field will only be written to the bitstream if the audio
  203. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  204. apply Dolby Surround processing.
  205. @table @option
  206. @item 0
  207. @itemx notindicated
  208. Not Indicated (default)
  209. @item 1
  210. @itemx off
  211. Not Dolby Surround Encoded
  212. @item 2
  213. @itemx on
  214. Dolby Surround Encoded
  215. @end table
  216. @item -original @var{boolean}
  217. Original Bit Stream Indicator. Specifies whether this audio is from the
  218. original source and not a copy.
  219. @table @option
  220. @item 0
  221. @itemx off
  222. Not Original Source
  223. @item 1
  224. @itemx on
  225. Original Source (default)
  226. @end table
  227. @end table
  228. @subsection Extended Bitstream Information
  229. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  230. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  231. If any one parameter in a group is specified, all values in that group will be
  232. written to the bitstream. Default values are used for those that are written
  233. but have not been specified. If the mixing levels are written, the decoder
  234. will use these values instead of the ones specified in the @code{center_mixlev}
  235. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  236. Syntax.
  237. @subsubsection Extended Bitstream Information - Part 1
  238. @table @option
  239. @item -dmix_mode @var{mode}
  240. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  241. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  242. @table @option
  243. @item 0
  244. @itemx notindicated
  245. Not Indicated (default)
  246. @item 1
  247. @itemx ltrt
  248. Lt/Rt Downmix Preferred
  249. @item 2
  250. @itemx loro
  251. Lo/Ro Downmix Preferred
  252. @end table
  253. @item -ltrt_cmixlev @var{level}
  254. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  255. center channel when downmixing to stereo in Lt/Rt mode.
  256. @table @option
  257. @item 1.414
  258. Apply +3dB gain
  259. @item 1.189
  260. Apply +1.5dB gain
  261. @item 1.000
  262. Apply 0dB gain
  263. @item 0.841
  264. Apply -1.5dB gain
  265. @item 0.707
  266. Apply -3.0dB gain
  267. @item 0.595
  268. Apply -4.5dB gain (default)
  269. @item 0.500
  270. Apply -6.0dB gain
  271. @item 0.000
  272. Silence Center Channel
  273. @end table
  274. @item -ltrt_surmixlev @var{level}
  275. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  276. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  277. @table @option
  278. @item 0.841
  279. Apply -1.5dB gain
  280. @item 0.707
  281. Apply -3.0dB gain
  282. @item 0.595
  283. Apply -4.5dB gain
  284. @item 0.500
  285. Apply -6.0dB gain (default)
  286. @item 0.000
  287. Silence Surround Channel(s)
  288. @end table
  289. @item -loro_cmixlev @var{level}
  290. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  291. center channel when downmixing to stereo in Lo/Ro mode.
  292. @table @option
  293. @item 1.414
  294. Apply +3dB gain
  295. @item 1.189
  296. Apply +1.5dB gain
  297. @item 1.000
  298. Apply 0dB gain
  299. @item 0.841
  300. Apply -1.5dB gain
  301. @item 0.707
  302. Apply -3.0dB gain
  303. @item 0.595
  304. Apply -4.5dB gain (default)
  305. @item 0.500
  306. Apply -6.0dB gain
  307. @item 0.000
  308. Silence Center Channel
  309. @end table
  310. @item -loro_surmixlev @var{level}
  311. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  312. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  313. @table @option
  314. @item 0.841
  315. Apply -1.5dB gain
  316. @item 0.707
  317. Apply -3.0dB gain
  318. @item 0.595
  319. Apply -4.5dB gain
  320. @item 0.500
  321. Apply -6.0dB gain (default)
  322. @item 0.000
  323. Silence Surround Channel(s)
  324. @end table
  325. @end table
  326. @subsubsection Extended Bitstream Information - Part 2
  327. @table @option
  328. @item -dsurex_mode @var{mode}
  329. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  330. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  331. apply Dolby Surround EX processing.
  332. @table @option
  333. @item 0
  334. @itemx notindicated
  335. Not Indicated (default)
  336. @item 1
  337. @itemx on
  338. Dolby Surround EX Off
  339. @item 2
  340. @itemx off
  341. Dolby Surround EX On
  342. @end table
  343. @item -dheadphone_mode @var{mode}
  344. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  345. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  346. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  347. processing.
  348. @table @option
  349. @item 0
  350. @itemx notindicated
  351. Not Indicated (default)
  352. @item 1
  353. @itemx on
  354. Dolby Headphone Off
  355. @item 2
  356. @itemx off
  357. Dolby Headphone On
  358. @end table
  359. @item -ad_conv_type @var{type}
  360. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  361. conversion.
  362. @table @option
  363. @item 0
  364. @itemx standard
  365. Standard A/D Converter (default)
  366. @item 1
  367. @itemx hdcd
  368. HDCD A/D Converter
  369. @end table
  370. @end table
  371. @subsection Other AC-3 Encoding Options
  372. @table @option
  373. @item -stereo_rematrixing @var{boolean}
  374. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  375. is an optional AC-3 feature that increases quality by selectively encoding
  376. the left/right channels as mid/side. This option is enabled by default, and it
  377. is highly recommended that it be left as enabled except for testing purposes.
  378. @end table
  379. @subsection Floating-Point-Only AC-3 Encoding Options
  380. These options are only valid for the floating-point encoder and do not exist
  381. for the fixed-point encoder due to the corresponding features not being
  382. implemented in fixed-point.
  383. @table @option
  384. @item -channel_coupling @var{boolean}
  385. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  386. that increases quality by combining high frequency information from multiple
  387. channels into a single channel. The per-channel high frequency information is
  388. sent with less accuracy in both the frequency and time domains. This allows
  389. more bits to be used for lower frequencies while preserving enough information
  390. to reconstruct the high frequencies. This option is enabled by default for the
  391. floating-point encoder and should generally be left as enabled except for
  392. testing purposes or to increase encoding speed.
  393. @table @option
  394. @item -1
  395. @itemx auto
  396. Selected by Encoder (default)
  397. @item 0
  398. @itemx off
  399. Disable Channel Coupling
  400. @item 1
  401. @itemx on
  402. Enable Channel Coupling
  403. @end table
  404. @item -cpl_start_band @var{number}
  405. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  406. value higher than the bandwidth is used, it will be reduced to 1 less than the
  407. coupling end band. If @var{auto} is used, the start band will be determined by
  408. the encoder based on the bit rate, sample rate, and channel layout. This option
  409. has no effect if channel coupling is disabled.
  410. @table @option
  411. @item -1
  412. @itemx auto
  413. Selected by Encoder (default)
  414. @end table
  415. @end table
  416. @section libmp3lame
  417. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  418. Requires the presence of the libmp3lame headers and library during
  419. configuration. You need to explicitly configure the build with
  420. @code{--enable-libmp3lame}.
  421. @subsection Options
  422. The following options are supported by the libmp3lame wrapper. The
  423. @command{lame}-equivalent of the options are listed in parentheses.
  424. @table @option
  425. @item b (@emph{-b})
  426. Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
  427. expressed in kilobits/s.
  428. @item q (@emph{-V})
  429. Set constant quality setting for VBR. This option is valid only
  430. using the @command{ffmpeg} command-line tool. For library interface
  431. users, use @option{global_quality}.
  432. @item compression_level (@emph{-q})
  433. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  434. with 0 meaning highest quality but slowest, and 9 meaning fastest
  435. while producing the worst quality.
  436. @item reservoir
  437. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  438. has this enabled by default, but can be overriden by use
  439. @option{--nores} option.
  440. @item joint_stereo (@emph{-m j})
  441. Enable the encoder to use (on a frame by frame basis) either L/R
  442. stereo or mid/side stereo. Default value is 1.
  443. @end table
  444. @section libopencore-amrnb
  445. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  446. Requires the presence of the libopencore-amrnb headers and library during
  447. configuration. You need to explicitly configure the build with
  448. @code{--enable-libopencore-amrnb --enable-version3}.
  449. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  450. but you can override it by setting @option{strict} to @samp{unofficial} or
  451. lower.
  452. @subsection Options
  453. @table @option
  454. @item b
  455. Set bitrate in bits per second. Only the following bitrates are supported,
  456. otherwise libavcodec will round to the nearest valid bitrate.
  457. @table @option
  458. @item 4750
  459. @item 5150
  460. @item 5900
  461. @item 6700
  462. @item 7400
  463. @item 7950
  464. @item 10200
  465. @item 12200
  466. @end table
  467. @item dtx
  468. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  469. default value is 0 (disabled).
  470. @end table
  471. @section libtwolame
  472. TwoLAME MP2 encoder wrapper.
  473. Requires the presence of the libtwolame headers and library during
  474. configuration. You need to explicitly configure the build with
  475. @code{--enable-libtwolame}.
  476. @subsection Options
  477. The following options are supported by the libtwolame wrapper. The
  478. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  479. parentheses.
  480. @table @option
  481. @item b (@emph{-b})
  482. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  483. option is expressed in kilobits/s. Default value is 128k.
  484. @item q (@emph{-V})
  485. Set quality for experimental VBR support. Maximum value range is
  486. from -50 to 50, useful range is from -10 to 10. The higher the
  487. value, the better the quality. This option is valid only using the
  488. @command{ffmpeg} command-line tool. For library interface users,
  489. use @option{global_quality}.
  490. @item mode (@emph{--mode})
  491. Set the mode of the resulting audio. Possible values:
  492. @table @samp
  493. @item auto
  494. Choose mode automatically based on the input. This is the default.
  495. @item stereo
  496. Stereo
  497. @item joint_stereo
  498. Joint stereo
  499. @item dual_channel
  500. Dual channel
  501. @item mono
  502. Mono
  503. @end table
  504. @item psymodel (@emph{--psyc-mode})
  505. Set psychoacoustic model to use in encoding. The argument must be
  506. an integer between -1 and 4, inclusive. The higher the value, the
  507. better the quality. The default value is 3.
  508. @item energy_levels (@emph{--energy})
  509. Enable energy levels extensions when set to 1. The default value is
  510. 0 (disabled).
  511. @item error_protection (@emph{--protect})
  512. Enable CRC error protection when set to 1. The default value is 0
  513. (disabled).
  514. @item copyright (@emph{--copyright})
  515. Set MPEG audio copyright flag when set to 1. The default value is 0
  516. (disabled).
  517. @item original (@emph{--original})
  518. Set MPEG audio original flag when set to 1. The default value is 0
  519. (disabled).
  520. @end table
  521. @anchor{libvo-aacenc}
  522. @section libvo-aacenc
  523. VisualOn AAC encoder.
  524. Requires the presence of the libvo-aacenc headers and library during
  525. configuration. You need to explicitly configure the build with
  526. @code{--enable-libvo-aacenc --enable-version3}.
  527. This encoder is considered to be worse than the
  528. @ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
  529. multiple sources.
  530. @subsection Options
  531. The VisualOn AAC encoder only support encoding AAC-LC and up to 2
  532. channels. It is also CBR-only.
  533. @table @option
  534. @item b
  535. Set bit rate in bits/s.
  536. @end table
  537. @section libvo-amrwbenc
  538. VisualOn Adaptive Multi-Rate Wideband encoder.
  539. Requires the presence of the libvo-amrwbenc headers and library during
  540. configuration. You need to explicitly configure the build with
  541. @code{--enable-libvo-amrwbenc --enable-version3}.
  542. This is a mono-only encoder. Officially it only supports 16000Hz sample
  543. rate, but you can override it by setting @option{strict} to
  544. @samp{unofficial} or lower.
  545. @subsection Options
  546. @table @option
  547. @item b
  548. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  549. libavcodec will round to the nearest valid bitrate.
  550. @table @samp
  551. @item 6600
  552. @item 8850
  553. @item 12650
  554. @item 14250
  555. @item 15850
  556. @item 18250
  557. @item 19850
  558. @item 23050
  559. @item 23850
  560. @end table
  561. @item dtx
  562. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  563. default value is 0 (disabled).
  564. @end table
  565. @section libopus
  566. libopus Opus Interactive Audio Codec encoder wrapper.
  567. Requires the presence of the libopus headers and library during
  568. configuration. You need to explicitly configure the build with
  569. @code{--enable-libopus}.
  570. @subsection Option Mapping
  571. Most libopus options are modeled after the @command{opusenc} utility from
  572. opus-tools. The following is an option mapping chart describing options
  573. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  574. in parentheses.
  575. @table @option
  576. @item b (@emph{bitrate})
  577. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  578. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  579. kilobits/s.
  580. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  581. Set VBR mode. The FFmpeg @option{vbr} option has the following
  582. valid arguments, with the their @command{opusenc} equivalent options
  583. in parentheses:
  584. @table @samp
  585. @item off (@emph{hard-cbr})
  586. Use constant bit rate encoding.
  587. @item on (@emph{vbr})
  588. Use variable bit rate encoding (the default).
  589. @item constrained (@emph{cvbr})
  590. Use constrained variable bit rate encoding.
  591. @end table
  592. @item compression_level (@emph{comp})
  593. Set encoding algorithm complexity. Valid options are integers in
  594. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  595. gives the highest quality but slowest encoding. The default is 10.
  596. @item frame_duration (@emph{framesize})
  597. Set maximum frame size, or duration of a frame in milliseconds. The
  598. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  599. frame sizes achieve lower latency but less quality at a given bitrate.
  600. Sizes greater than 20ms are only interesting at fairly low bitrates.
  601. The default of FFmpeg is 10ms, but is 20ms in @command{opusenc}.
  602. @item packet_loss (@emph{expect-loss})
  603. Set expected packet loss percentage. The default is 0.
  604. @item application (N.A.)
  605. Set intended application type. Valid options are listed below:
  606. @table @samp
  607. @item voip
  608. Favor improved speech intelligibility.
  609. @item audio
  610. Favor faithfulness to the input (the default).
  611. @item lowdelay
  612. Restrict to only the lowest delay modes.
  613. @end table
  614. @item cutoff (N.A.)
  615. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  616. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  617. narrowband, mediumband, wideband, super wideband, and fullband
  618. respectively. The default is 0 (cutoff disabled).
  619. @end table
  620. @section libwavpack
  621. A wrapper providing WavPack encoding through libwavpack.
  622. Only lossless mode using 32-bit integer samples is supported currently.
  623. The @option{compression_level} option can be used to control speed vs.
  624. compression tradeoff, with the values mapped to libwavpack as follows:
  625. @table @option
  626. @item 0
  627. Fast mode - corresponding to the wavpack @option{-f} option.
  628. @item 1
  629. Normal (default) settings.
  630. @item 2
  631. High quality - corresponding to the wavpack @option{-h} option.
  632. @item 3
  633. Very high quality - corresponding to the wavpack @option{-hh} option.
  634. @item 4-8
  635. Same as 3, but with extra processing enabled - corresponding to the wavpack
  636. @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
  637. @option{-x6}.
  638. @end table
  639. @c man end AUDIO ENCODERS
  640. @chapter Video Encoders
  641. @c man begin VIDEO ENCODERS
  642. A description of some of the currently available video encoders
  643. follows.
  644. @section libtheora
  645. Theora format supported through libtheora.
  646. Requires the presence of the libtheora headers and library during
  647. configuration. You need to explicitly configure the build with
  648. @code{--enable-libtheora}.
  649. @subsection Options
  650. The following global options are mapped to internal libtheora options
  651. which affect the quality and the bitrate of the encoded stream.
  652. @table @option
  653. @item b
  654. Set the video bitrate, only works if the @code{qscale} flag in
  655. @option{flags} is not enabled.
  656. @item flags
  657. Used to enable constant quality mode encoding through the
  658. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  659. modes.
  660. @item g
  661. Set the GOP size.
  662. @item global_quality
  663. Set the global quality in lambda units, only works if the
  664. @code{qscale} flag in @option{flags} is enabled. The value is clipped
  665. in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
  666. to get a value in the native libtheora range [0-63]. A higher value
  667. corresponds to a higher quality.
  668. For example, to set maximum constant quality encoding with
  669. @command{ffmpeg}:
  670. @example
  671. ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
  672. @end example
  673. @end table
  674. @section libvpx
  675. VP8 format supported through libvpx.
  676. Requires the presence of the libvpx headers and library during configuration.
  677. You need to explicitly configure the build with @code{--enable-libvpx}.
  678. @subsection Options
  679. Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
  680. @table @option
  681. @item threads
  682. g_threads
  683. @item profile
  684. g_profile
  685. @item vb
  686. rc_target_bitrate
  687. @item g
  688. kf_max_dist
  689. @item keyint_min
  690. kf_min_dist
  691. @item qmin
  692. rc_min_quantizer
  693. @item qmax
  694. rc_max_quantizer
  695. @item bufsize, vb
  696. rc_buf_sz
  697. @code{(bufsize * 1000 / vb)}
  698. rc_buf_optimal_sz
  699. @code{(bufsize * 1000 / vb * 5 / 6)}
  700. @item rc_init_occupancy, vb
  701. rc_buf_initial_sz
  702. @code{(rc_init_occupancy * 1000 / vb)}
  703. @item rc_buffer_aggressivity
  704. rc_undershoot_pct
  705. @item skip_threshold
  706. rc_dropframe_thresh
  707. @item qcomp
  708. rc_2pass_vbr_bias_pct
  709. @item maxrate, vb
  710. rc_2pass_vbr_maxsection_pct
  711. @code{(maxrate * 100 / vb)}
  712. @item minrate, vb
  713. rc_2pass_vbr_minsection_pct
  714. @code{(minrate * 100 / vb)}
  715. @item minrate, maxrate, vb
  716. @code{VPX_CBR}
  717. @code{(minrate == maxrate == vb)}
  718. @item crf
  719. @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
  720. @item quality
  721. @table @option
  722. @item @var{best}
  723. @code{VPX_DL_BEST_QUALITY}
  724. @item @var{good}
  725. @code{VPX_DL_GOOD_QUALITY}
  726. @item @var{realtime}
  727. @code{VPX_DL_REALTIME}
  728. @end table
  729. @item speed
  730. @code{VP8E_SET_CPUUSED}
  731. @item nr
  732. @code{VP8E_SET_NOISE_SENSITIVITY}
  733. @item mb_threshold
  734. @code{VP8E_SET_STATIC_THRESHOLD}
  735. @item slices
  736. @code{VP8E_SET_TOKEN_PARTITIONS}
  737. @item max-intra-rate
  738. @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
  739. @item force_key_frames
  740. @code{VPX_EFLAG_FORCE_KF}
  741. @item Alternate reference frame related
  742. @table @option
  743. @item vp8flags altref
  744. @code{VP8E_SET_ENABLEAUTOALTREF}
  745. @item @var{arnr_max_frames}
  746. @code{VP8E_SET_ARNR_MAXFRAMES}
  747. @item @var{arnr_type}
  748. @code{VP8E_SET_ARNR_TYPE}
  749. @item @var{arnr_strength}
  750. @code{VP8E_SET_ARNR_STRENGTH}
  751. @item @var{rc_lookahead}
  752. g_lag_in_frames
  753. @end table
  754. @item vp8flags error_resilient
  755. g_error_resilient
  756. @end table
  757. For more information about libvpx see:
  758. @url{http://www.webmproject.org/}
  759. @section libx264
  760. x264 H.264/MPEG-4 AVC encoder wrapper.
  761. This encoder requires the presence of the libx264 headers and library
  762. during configuration. You need to explicitly configure the build with
  763. @code{--enable-libx264}.
  764. libx264 supports an impressive number of features, including 8x8 and
  765. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  766. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  767. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  768. Many libx264 encoder options are mapped to FFmpeg global codec
  769. options, while unique encoder options are provided through private
  770. options. Additionally the @option{x264opts} and @option{x264-params}
  771. private options allows to pass a list of key=value tuples as accepted
  772. by the libx264 @code{x264_param_parse} function.
  773. The x264 project website is at
  774. @url{http://www.videolan.org/developers/x264.html}.
  775. @subsection Options
  776. The following options are supported by the libx264 wrapper. The
  777. @command{x264}-equivalent options or values are listed in parentheses
  778. for easy migration.
  779. To reduce the duplication of documentation, only the private options
  780. and some others requiring special attention are documented here. For
  781. the documentation of the undocumented generic options, see
  782. @ref{codec-options,,the Codec Options chapter}.
  783. To get a more accurate and extensive documentation of the libx264
  784. options, invoke the command @command{x264 --full-help} or consult
  785. the libx264 documentation.
  786. @table @option
  787. @item b (@emph{bitrate})
  788. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  789. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  790. kilobits/s.
  791. @item bf (@emph{bframes})
  792. @item g (@emph{keyint})
  793. @item qmax (@emph{qpmax})
  794. @item qmin (@emph{qpmin})
  795. @item qdiff (@emph{qpstep})
  796. @item qblur (@emph{qblur})
  797. @item qcomp (@emph{qcomp})
  798. @item refs (@emph{ref})
  799. @item sc_threshold (@emph{scenecut})
  800. @item trellis (@emph{trellis})
  801. @item nr (@emph{nr})
  802. @item me_range (@emph{merange})
  803. @item me_method (@emph{me})
  804. Set motion estimation method. Possible values in the decreasing order
  805. of speed:
  806. @table @samp
  807. @item dia (@emph{dia})
  808. @item epzs (@emph{dia})
  809. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  810. @samp{dia}.
  811. @item hex (@emph{hex})
  812. Hexagonal search with radius 2.
  813. @item umh (@emph{umh})
  814. Uneven multi-hexagon search.
  815. @item esa (@emph{esa})
  816. Exhaustive search.
  817. @item tesa (@emph{tesa})
  818. Hadamard exhaustive search (slowest).
  819. @end table
  820. @item subq (@emph{subme})
  821. @item b_strategy (@emph{b-adapt})
  822. @item keyint_min (@emph{min-keyint})
  823. @item coder
  824. Set entropy encoder. Possible values:
  825. @table @samp
  826. @item ac
  827. Enable CABAC.
  828. @item vlc
  829. Enable CAVLC and disable CABAC. It generates the same effect as
  830. @command{x264}'s @option{--no-cabac} option.
  831. @end table
  832. @item cmp
  833. Set full pixel motion estimation comparation algorithm. Possible values:
  834. @table @samp
  835. @item chroma
  836. Enable chroma in motion estimation.
  837. @item sad
  838. Ignore chroma in motion estimation. It generates the same effect as
  839. @command{x264}'s @option{--no-chroma-me} option.
  840. @end table
  841. @item threads (@emph{threads})
  842. @item thread_type
  843. Set multithreading technique. Possible values:
  844. @table @samp
  845. @item slice
  846. Slice-based multithreading. It generates the same effect as
  847. @command{x264}'s @option{--sliced-threads} option.
  848. @item frame
  849. Frame-based multithreading.
  850. @end table
  851. @item flags
  852. Set encoding flags. It can be used to disable closed GOP and enable
  853. open GOP by setting it to @code{-cgop}. The result is similar to
  854. the behavior of @command{x264}'s @option{--open-gop} option.
  855. @item rc_init_occupancy (@emph{vbv-init})
  856. @item preset (@emph{preset})
  857. Set the encoding preset.
  858. @item tune (@emph{tune})
  859. Set tuning of the encoding params.
  860. @item profile (@emph{profile})
  861. Set profile restrictions.
  862. @item fastfirstpass
  863. Enable fast settings when encoding first pass, when set to 1. When set
  864. to 0, it has the same effect of @command{x264}'s
  865. @option{--slow-firstpass} option.
  866. @item crf (@emph{crf})
  867. Set the quality for constant quality mode.
  868. @item crf_max (@emph{crf-max})
  869. In CRF mode, prevents VBV from lowering quality beyond this point.
  870. @item qp (@emph{qp})
  871. Set constant quantization rate control method parameter.
  872. @item aq-mode (@emph{aq-mode})
  873. Set AQ method. Possible values:
  874. @table @samp
  875. @item none (@emph{0})
  876. Disabled.
  877. @item variance (@emph{1})
  878. Variance AQ (complexity mask).
  879. @item autovariance (@emph{2})
  880. Auto-variance AQ (experimental).
  881. @end table
  882. @item aq-strength (@emph{aq-strength})
  883. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  884. @item psy
  885. Use psychovisual optimizations when set to 1. When set to 0, it has the
  886. same effect as @command{x264}'s @option{--no-psy} option.
  887. @item psy-rd (@emph{psy-rd})
  888. Set strength of psychovisual optimization, in
  889. @var{psy-rd}:@var{psy-trellis} format.
  890. @item rc-lookahead (@emph{rc-lookahead})
  891. Set number of frames to look ahead for frametype and ratecontrol.
  892. @item weightb
  893. Enable weighted prediction for B-frames when set to 1. When set to 0,
  894. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  895. @item weightp (@emph{weightp})
  896. Set weighted prediction method for P-frames. Possible values:
  897. @table @samp
  898. @item none (@emph{0})
  899. Disabled
  900. @item simple (@emph{1})
  901. Enable only weighted refs
  902. @item smart (@emph{2})
  903. Enable both weighted refs and duplicates
  904. @end table
  905. @item ssim (@emph{ssim})
  906. Enable calculation and printing SSIM stats after the encoding.
  907. @item intra-refresh (@emph{intra-refresh})
  908. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  909. to 1.
  910. @item bluray-compat (@emph{bluray-compat})
  911. Configure the encoder to be compatible with the bluray standard.
  912. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  913. @item b-bias (@emph{b-bias})
  914. Set the influence on how often B-frames are used.
  915. @item b-pyramid (@emph{b-pyramid})
  916. Set method for keeping of some B-frames as references. Possible values:
  917. @table @samp
  918. @item none (@emph{none})
  919. Disabled.
  920. @item strict (@emph{strict})
  921. Strictly hierarchical pyramid.
  922. @item normal (@emph{normal})
  923. Non-strict (not Blu-ray compatible).
  924. @end table
  925. @item mixed-refs
  926. Enable the use of one reference per partition, as opposed to one
  927. reference per macroblock when set to 1. When set to 0, it has the
  928. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  929. @item 8x8dct
  930. Enable adaptive spatial transform (high profile 8x8 transform)
  931. when set to 1. When set to 0, it has the same effect as
  932. @command{x264}'s @option{--no-8x8dct} option.
  933. @item fast-pskip
  934. Enable early SKIP detection on P-frames when set to 1. When set
  935. to 0, it has the same effect as @command{x264}'s
  936. @option{--no-fast-pskip} option.
  937. @item aud (@emph{aud})
  938. Enable use of access unit delimiters when set to 1.
  939. @item mbtree
  940. Enable use macroblock tree ratecontrol when set to 1. When set
  941. to 0, it has the same effect as @command{x264}'s
  942. @option{--no-mbtree} option.
  943. @item deblock (@emph{deblock})
  944. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  945. @item cplxblur (@emph{cplxblur})
  946. Set fluctuations reduction in QP (before curve compression).
  947. @item partitions (@emph{partitions})
  948. Set partitions to consider as a comma-separated list of. Possible
  949. values in the list:
  950. @table @samp
  951. @item p8x8
  952. 8x8 P-frame partition.
  953. @item p4x4
  954. 4x4 P-frame partition.
  955. @item b8x8
  956. 4x4 B-frame partition.
  957. @item i8x8
  958. 8x8 I-frame partition.
  959. @item i4x4
  960. 4x4 I-frame partition.
  961. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  962. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  963. option) to be enabled.)
  964. @item none (@emph{none})
  965. Do not consider any partitions.
  966. @item all (@emph{all})
  967. Consider every partition.
  968. @end table
  969. @item direct-pred (@emph{direct})
  970. Set direct MV prediction mode. Possible values:
  971. @table @samp
  972. @item none (@emph{none})
  973. Disable MV prediction.
  974. @item spatial (@emph{spatial})
  975. Enable spatial predicting.
  976. @item temporal (@emph{temporal})
  977. Enable temporal predicting.
  978. @item auto (@emph{auto})
  979. Automatically decided.
  980. @end table
  981. @item slice-max-size (@emph{slice-max-size})
  982. Set the limit of the size of each slice in bytes. If not specified
  983. but RTP payload size (@option{ps}) is specified, that is used.
  984. @item stats (@emph{stats})
  985. Set the file name for multi-pass stats.
  986. @item nal-hrd (@emph{nal-hrd})
  987. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  988. Possible values:
  989. @table @samp
  990. @item none (@emph{none})
  991. Disable HRD information signaling.
  992. @item vbr (@emph{vbr})
  993. Variable bit rate.
  994. @item cbr (@emph{cbr})
  995. Constant bit rate (not allowed in MP4 container).
  996. @end table
  997. @item x264opts (N.A.)
  998. Set any x264 option, see @command{x264 --fullhelp} for a list.
  999. Argument is a list of @var{key}=@var{value} couples separated by
  1000. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  1001. themselves, use "," instead. They accept it as well since long ago but this
  1002. is kept undocumented for some reason.
  1003. For example to specify libx264 encoding options with @command{ffmpeg}:
  1004. @example
  1005. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  1006. @end example
  1007. @item x264-params (N.A.)
  1008. Override the x264 configuration using a :-separated list of key=value
  1009. parameters.
  1010. This option is functionally the same as the @option{x264opts}, but is
  1011. duplicated for compability with the Libav fork.
  1012. For example to specify libx264 encoding options with @command{ffmpeg}:
  1013. @example
  1014. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  1015. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  1016. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  1017. @end example
  1018. @end table
  1019. Encoding ffpresets for common usages are provided so they can be used with the
  1020. general presets system (e.g. passing the @option{pre} option).
  1021. @section libxvid
  1022. Xvid MPEG-4 Part 2 encoder wrapper.
  1023. This encoder requires the presence of the libxvidcore headers and library
  1024. during configuration. You need to explicitly configure the build with
  1025. @code{--enable-libxvid --enable-gpl}.
  1026. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  1027. users can encode to this format without this library.
  1028. @subsection Options
  1029. The following options are supported by the libxvid wrapper. Some of
  1030. the following options are listed but are not documented, and
  1031. correspond to shared codec options. See @ref{codec-options,,the Codec
  1032. Options chapter} for their documentation. The other shared options
  1033. which are not listed have no effect for the libxvid encoder.
  1034. @table @option
  1035. @item b
  1036. @item g
  1037. @item qmin
  1038. @item qmax
  1039. @item mpeg_quant
  1040. @item threads
  1041. @item bf
  1042. @item b_qfactor
  1043. @item b_qoffset
  1044. @item flags
  1045. Set specific encoding flags. Possible values:
  1046. @table @samp
  1047. @item mv4
  1048. Use four motion vector by macroblock.
  1049. @item aic
  1050. Enable high quality AC prediction.
  1051. @item gray
  1052. Only encode grayscale.
  1053. @item gmc
  1054. Enable the use of global motion compensation (GMC).
  1055. @item qpel
  1056. Enable quarter-pixel motion compensation.
  1057. @item cgop
  1058. Enable closed GOP.
  1059. @item global_header
  1060. Place global headers in extradata instead of every keyframe.
  1061. @end table
  1062. @item trellis
  1063. @item me_method
  1064. Set motion estimation method. Possible values in decreasing order of
  1065. speed and increasing order of quality:
  1066. @table @samp
  1067. @item zero
  1068. Use no motion estimation (default).
  1069. @item phods
  1070. @item x1
  1071. @item log
  1072. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  1073. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  1074. @samp{phods}.
  1075. @item epzs
  1076. Enable all of the things described above, plus advanced diamond zonal
  1077. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  1078. estimation on chroma planes.
  1079. @item full
  1080. Enable all of the things described above, plus extended 16x16 and 8x8
  1081. blocks search.
  1082. @end table
  1083. @item mbd
  1084. Set macroblock decision algorithm. Possible values in the increasing
  1085. order of quality:
  1086. @table @samp
  1087. @item simple
  1088. Use macroblock comparing function algorithm (default).
  1089. @item bits
  1090. Enable rate distortion-based half pixel and quarter pixel refinement for
  1091. 16x16 blocks.
  1092. @item rd
  1093. Enable all of the things described above, plus rate distortion-based
  1094. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  1095. distortion-based search using square pattern.
  1096. @end table
  1097. @item lumi_aq
  1098. Enable lumi masking adaptive quantization when set to 1. Default is 0
  1099. (disabled).
  1100. @item variance_aq
  1101. Enable variance adaptive quantization when set to 1. Default is 0
  1102. (disabled).
  1103. When combined with @option{lumi_aq}, the resulting quality will not
  1104. be better than any of the two specified individually. In other
  1105. words, the resulting quality will be the worse one of the two
  1106. effects.
  1107. @item ssim
  1108. Set structural similarity (SSIM) displaying method. Possible values:
  1109. @table @samp
  1110. @item off
  1111. Disable displaying of SSIM information.
  1112. @item avg
  1113. Output average SSIM at the end of encoding to stdout. The format of
  1114. showing the average SSIM is:
  1115. @example
  1116. Average SSIM: %f
  1117. @end example
  1118. For users who are not familiar with C, %f means a float number, or
  1119. a decimal (e.g. 0.939232).
  1120. @item frame
  1121. Output both per-frame SSIM data during encoding and average SSIM at
  1122. the end of encoding to stdout. The format of per-frame information
  1123. is:
  1124. @example
  1125. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  1126. @end example
  1127. For users who are not familiar with C, %1.3f means a float number
  1128. rounded to 3 digits after the dot (e.g. 0.932).
  1129. @end table
  1130. @item ssim_acc
  1131. Set SSIM accuracy. Valid options are integers within the range of
  1132. 0-4, while 0 gives the most accurate result and 4 computes the
  1133. fastest.
  1134. @end table
  1135. @section png
  1136. PNG image encoder.
  1137. @subsection Private options
  1138. @table @option
  1139. @item dpi @var{integer}
  1140. Set physical density of pixels, in dots per inch, unset by default
  1141. @item dpm @var{integer}
  1142. Set physical density of pixels, in dots per meter, unset by default
  1143. @end table
  1144. @section ProRes
  1145. Apple ProRes encoder.
  1146. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  1147. The used encoder can be choosen with the @code{-vcodec} option.
  1148. @subsection Private Options for prores-ks
  1149. @table @option
  1150. @item profile @var{integer}
  1151. Select the ProRes profile to encode
  1152. @table @samp
  1153. @item proxy
  1154. @item lt
  1155. @item standard
  1156. @item hq
  1157. @item 4444
  1158. @end table
  1159. @item quant_mat @var{integer}
  1160. Select quantization matrix.
  1161. @table @samp
  1162. @item auto
  1163. @item default
  1164. @item proxy
  1165. @item lt
  1166. @item standard
  1167. @item hq
  1168. @end table
  1169. If set to @var{auto}, the matrix matching the profile will be picked.
  1170. If not set, the matrix providing the highest quality, @var{default}, will be
  1171. picked.
  1172. @item bits_per_mb @var{integer}
  1173. How many bits to allot for coding one macroblock. Different profiles use
  1174. between 200 and 2400 bits per macroblock, the maximum is 8000.
  1175. @item mbs_per_slice @var{integer}
  1176. Number of macroblocks in each slice (1-8); the default value (8)
  1177. should be good in almost all situations.
  1178. @item vendor @var{string}
  1179. Override the 4-byte vendor ID.
  1180. A custom vendor ID like @var{apl0} would claim the stream was produced by
  1181. the Apple encoder.
  1182. @item alpha_bits @var{integer}
  1183. Specify number of bits for alpha component.
  1184. Possible values are @var{0}, @var{8} and @var{16}.
  1185. Use @var{0} to disable alpha plane coding.
  1186. @end table
  1187. @subsection Speed considerations
  1188. In the default mode of operation the encoder has to honor frame constraints
  1189. (i.e. not produc frames with size bigger than requested) while still making
  1190. output picture as good as possible.
  1191. A frame containing a lot of small details is harder to compress and the encoder
  1192. would spend more time searching for appropriate quantizers for each slice.
  1193. Setting a higher @option{bits_per_mb} limit will improve the speed.
  1194. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  1195. recommended value) and do not set a size constraint.
  1196. @c man end VIDEO ENCODERS