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.

1950 lines
52KB

  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 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. 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. @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{libfaac}
  412. @section libfaac
  413. libfaac AAC (Advanced Audio Coding) encoder wrapper.
  414. Requires the presence of the libfaac headers and library during
  415. configuration. You need to explicitly configure the build with
  416. @code{--enable-libfaac --enable-nonfree}.
  417. This encoder is considered to be of higher quality with respect to the
  418. @ref{aacenc,,the native experimental FFmpeg AAC encoder}.
  419. For more information see the libfaac project at
  420. @url{http://www.audiocoding.com/faac.html/}.
  421. @subsection Options
  422. The following shared FFmpeg codec options are recognized.
  423. The following options are supported by the libfaac wrapper. The
  424. @command{faac}-equivalent of the options are listed in parentheses.
  425. @table @option
  426. @item b (@emph{-b})
  427. Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
  428. is not explicitly specified, it is automatically set to a suitable
  429. value depending on the selected profile. @command{faac} bitrate is
  430. expressed in kilobits/s.
  431. Note that libfaac does not support CBR (Constant Bit Rate) but only
  432. ABR (Average Bit Rate).
  433. If VBR mode is enabled this option is ignored.
  434. @item ar (@emph{-R})
  435. Set audio sampling rate (in Hz).
  436. @item ac (@emph{-c})
  437. Set the number of audio channels.
  438. @item cutoff (@emph{-C})
  439. Set cutoff frequency. If not specified (or explicitly set to 0) it
  440. will use a value automatically computed by the library. Default value
  441. is 0.
  442. @item profile
  443. Set audio profile.
  444. The following profiles are recognized:
  445. @table @samp
  446. @item aac_main
  447. Main AAC (Main)
  448. @item aac_low
  449. Low Complexity AAC (LC)
  450. @item aac_ssr
  451. Scalable Sample Rate (SSR)
  452. @item aac_ltp
  453. Long Term Prediction (LTP)
  454. @end table
  455. If not specified it is set to @samp{aac_low}.
  456. @item flags +qscale
  457. Set constant quality VBR (Variable Bit Rate) mode.
  458. @item global_quality
  459. Set quality in VBR mode as an integer number of lambda units.
  460. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  461. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  462. and used to set the quality value used by libfaac. A reasonable range
  463. for the option value in QP units is [10-500], the higher the value the
  464. higher the quality.
  465. @item q (@emph{-q})
  466. Enable VBR mode when set to a non-negative value, and set constant
  467. quality value as a double floating point value in QP units.
  468. The value sets the quality value used by libfaac. A reasonable range
  469. for the option value is [10-500], the higher the value the higher the
  470. quality.
  471. This option is valid only using the @command{ffmpeg} command-line
  472. tool. For library interface users, use @option{global_quality}.
  473. @end table
  474. @subsection Examples
  475. @itemize
  476. @item
  477. Use @command{ffmpeg} to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
  478. container:
  479. @example
  480. ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
  481. @end example
  482. @item
  483. Use @command{ffmpeg} to convert an audio file to VBR AAC, using the
  484. LTP AAC profile:
  485. @example
  486. ffmpeg -i input.wav -c:a libfaac -profile:a aac_ltp -q:a 100 output.m4a
  487. @end example
  488. @end itemize
  489. @anchor{libfdk-aac-enc}
  490. @section libfdk_aac
  491. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  492. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  493. the Android project.
  494. Requires the presence of the libfdk-aac headers and library during
  495. configuration. You need to explicitly configure the build with
  496. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  497. so if you allow the use of GPL, you should configure with
  498. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  499. This encoder is considered to be of higher quality with respect to
  500. both @ref{aacenc,,the native experimental FFmpeg AAC encoder} and
  501. libfaac.
  502. For more information see the fdk-aac project at
  503. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  504. @subsection Options
  505. The following options are mapped on the shared FFmpeg codec options.
  506. @table @option
  507. @item b
  508. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  509. is automatically set to a suitable value depending on the selected
  510. profile.
  511. In case VBR mode is enabled the option is ignored.
  512. @item ar
  513. Set audio sampling rate (in Hz).
  514. @item channels
  515. Set the number of audio channels.
  516. @item flags +qscale
  517. Enable fixed quality, VBR (Variable Bit Rate) mode.
  518. Note that VBR is implicitely enabled when the @option{vbr} value is
  519. positive.
  520. @item cutoff
  521. Set cutoff frequency. If not specified (or explicitly set to 0) it
  522. will use a value automatically computed by the library. Default value
  523. is 0.
  524. @item profile
  525. Set audio profile.
  526. The following profiles are recognized:
  527. @table @samp
  528. @item aac_low
  529. Low Complexity AAC (LC)
  530. @item aac_he
  531. High Efficiency AAC (HE-AAC)
  532. @item aac_he_v2
  533. High Efficiency AAC version 2 (HE-AACv2)
  534. @item aac_ld
  535. Low Delay AAC (LD)
  536. @item aac_eld
  537. Enhanced Low Delay AAC (ELD)
  538. @end table
  539. If not specified it is set to @samp{aac_low}.
  540. @end table
  541. The following are private options of the libfdk_aac encoder.
  542. @table @option
  543. @item afterburner
  544. Enable afterburner feature if set to 1, disabled if set to 0. This
  545. improves the quality but also the required processing power.
  546. Default value is 1.
  547. @item eld_sbr
  548. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  549. if set to 0.
  550. Default value is 0.
  551. @item signaling
  552. Set SBR/PS signaling style.
  553. It can assume one of the following values:
  554. @table @samp
  555. @item default
  556. choose signaling implicitly (explicit hierarchical by default,
  557. implicit if global header is disabled)
  558. @item implicit
  559. implicit backwards compatible signaling
  560. @item explicit_sbr
  561. explicit SBR, implicit PS signaling
  562. @item explicit_hierarchical
  563. explicit hierarchical signaling
  564. @end table
  565. Default value is @samp{default}.
  566. @item latm
  567. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  568. Default value is 0.
  569. @item header_period
  570. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  571. in-band configuration buffers within LATM/LOAS transport layer.
  572. Must be a 16-bits non-negative integer.
  573. Default value is 0.
  574. @item vbr
  575. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  576. good) and 5 is highest quality. A value of 0 will disable VBR mode,
  577. and CBR (Constant Bit Rate) mode is enabled.
  578. Currently only the @samp{aac_low} profile supports VBR mode.
  579. VBR modes 1-5 correspond to roughly the following average bit rate:
  580. @table @samp
  581. @item 1
  582. 32 kbps/channel
  583. @item 2
  584. 40 kbps/channel
  585. @item 3
  586. 48-56 kbps/channel
  587. @item 4
  588. 64 kbps/channel
  589. @item 5
  590. about 80-96 kbps/channel
  591. @end table
  592. Default value is 0.
  593. @end table
  594. @section Examples
  595. @itemize
  596. @item
  597. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  598. container:
  599. @example
  600. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  601. @end example
  602. @item
  603. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  604. High-Efficiency AAC profile:
  605. @example
  606. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  607. @end example
  608. @end itemize
  609. @anchor{libmp3lame}
  610. @section libmp3lame
  611. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  612. Requires the presence of the libmp3lame headers and library during
  613. configuration. You need to explicitly configure the build with
  614. @code{--enable-libmp3lame}.
  615. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  616. lower quality.
  617. @subsection Options
  618. The following options are supported by the libmp3lame wrapper. The
  619. @command{lame}-equivalent of the options are listed in parentheses.
  620. @table @option
  621. @item b (@emph{-b})
  622. Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
  623. expressed in kilobits/s.
  624. @item q (@emph{-V})
  625. Set constant quality setting for VBR. This option is valid only
  626. using the @command{ffmpeg} command-line tool. For library interface
  627. users, use @option{global_quality}.
  628. @item compression_level (@emph{-q})
  629. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  630. with 0 meaning highest quality but slowest, and 9 meaning fastest
  631. while producing the worst quality.
  632. @item reservoir
  633. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  634. has this enabled by default, but can be overriden by use
  635. @option{--nores} option.
  636. @item joint_stereo (@emph{-m j})
  637. Enable the encoder to use (on a frame by frame basis) either L/R
  638. stereo or mid/side stereo. Default value is 1.
  639. @end table
  640. @section libopencore-amrnb
  641. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  642. Requires the presence of the libopencore-amrnb headers and library during
  643. configuration. You need to explicitly configure the build with
  644. @code{--enable-libopencore-amrnb --enable-version3}.
  645. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  646. but you can override it by setting @option{strict} to @samp{unofficial} or
  647. lower.
  648. @subsection Options
  649. @table @option
  650. @item b
  651. Set bitrate in bits per second. Only the following bitrates are supported,
  652. otherwise libavcodec will round to the nearest valid bitrate.
  653. @table @option
  654. @item 4750
  655. @item 5150
  656. @item 5900
  657. @item 6700
  658. @item 7400
  659. @item 7950
  660. @item 10200
  661. @item 12200
  662. @end table
  663. @item dtx
  664. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  665. default value is 0 (disabled).
  666. @end table
  667. @anchor{libshine}
  668. @section libshine
  669. Shine Fixed-Point MP3 encoder wrapper.
  670. Shine is a fixed-point MP3 encoder. It has a far better performance on
  671. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  672. However, as it is more targeted on performance than quality, it is not on par
  673. with LAME and other production-grade encoders quality-wise. Also, according to
  674. the project's homepage, this encoder may not be free of bugs as the code was
  675. written a long time ago and the project was dead for at least 5 years.
  676. This encoder only supports stereo and mono input. This is also CBR-only.
  677. The original project (last updated in early 2007) is at
  678. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  679. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  680. Requires the presence of the libshine headers and library during
  681. configuration. You need to explicitly configure the build with
  682. @code{--enable-libshine}.
  683. See also @ref{libmp3lame}.
  684. @subsection Options
  685. The following options are supported by the libshine wrapper. The
  686. @command{shineenc}-equivalent of the options are listed in parentheses.
  687. @table @option
  688. @item b (@emph{-b})
  689. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  690. is expressed in kilobits/s.
  691. @end table
  692. @section libtwolame
  693. TwoLAME MP2 encoder wrapper.
  694. Requires the presence of the libtwolame headers and library during
  695. configuration. You need to explicitly configure the build with
  696. @code{--enable-libtwolame}.
  697. @subsection Options
  698. The following options are supported by the libtwolame wrapper. The
  699. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  700. parentheses.
  701. @table @option
  702. @item b (@emph{-b})
  703. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  704. option is expressed in kilobits/s. Default value is 128k.
  705. @item q (@emph{-V})
  706. Set quality for experimental VBR support. Maximum value range is
  707. from -50 to 50, useful range is from -10 to 10. The higher the
  708. value, the better the quality. This option is valid only using the
  709. @command{ffmpeg} command-line tool. For library interface users,
  710. use @option{global_quality}.
  711. @item mode (@emph{--mode})
  712. Set the mode of the resulting audio. Possible values:
  713. @table @samp
  714. @item auto
  715. Choose mode automatically based on the input. This is the default.
  716. @item stereo
  717. Stereo
  718. @item joint_stereo
  719. Joint stereo
  720. @item dual_channel
  721. Dual channel
  722. @item mono
  723. Mono
  724. @end table
  725. @item psymodel (@emph{--psyc-mode})
  726. Set psychoacoustic model to use in encoding. The argument must be
  727. an integer between -1 and 4, inclusive. The higher the value, the
  728. better the quality. The default value is 3.
  729. @item energy_levels (@emph{--energy})
  730. Enable energy levels extensions when set to 1. The default value is
  731. 0 (disabled).
  732. @item error_protection (@emph{--protect})
  733. Enable CRC error protection when set to 1. The default value is 0
  734. (disabled).
  735. @item copyright (@emph{--copyright})
  736. Set MPEG audio copyright flag when set to 1. The default value is 0
  737. (disabled).
  738. @item original (@emph{--original})
  739. Set MPEG audio original flag when set to 1. The default value is 0
  740. (disabled).
  741. @end table
  742. @anchor{libvo-aacenc}
  743. @section libvo-aacenc
  744. VisualOn AAC encoder.
  745. Requires the presence of the libvo-aacenc headers and library during
  746. configuration. You need to explicitly configure the build with
  747. @code{--enable-libvo-aacenc --enable-version3}.
  748. This encoder is considered to be worse than the
  749. @ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
  750. multiple sources.
  751. @subsection Options
  752. The VisualOn AAC encoder only support encoding AAC-LC and up to 2
  753. channels. It is also CBR-only.
  754. @table @option
  755. @item b
  756. Set bit rate in bits/s.
  757. @end table
  758. @section libvo-amrwbenc
  759. VisualOn Adaptive Multi-Rate Wideband encoder.
  760. Requires the presence of the libvo-amrwbenc headers and library during
  761. configuration. You need to explicitly configure the build with
  762. @code{--enable-libvo-amrwbenc --enable-version3}.
  763. This is a mono-only encoder. Officially it only supports 16000Hz sample
  764. rate, but you can override it by setting @option{strict} to
  765. @samp{unofficial} or lower.
  766. @subsection Options
  767. @table @option
  768. @item b
  769. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  770. libavcodec will round to the nearest valid bitrate.
  771. @table @samp
  772. @item 6600
  773. @item 8850
  774. @item 12650
  775. @item 14250
  776. @item 15850
  777. @item 18250
  778. @item 19850
  779. @item 23050
  780. @item 23850
  781. @end table
  782. @item dtx
  783. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  784. default value is 0 (disabled).
  785. @end table
  786. @section libopus
  787. libopus Opus Interactive Audio Codec encoder wrapper.
  788. Requires the presence of the libopus headers and library during
  789. configuration. You need to explicitly configure the build with
  790. @code{--enable-libopus}.
  791. @subsection Option Mapping
  792. Most libopus options are modeled after the @command{opusenc} utility from
  793. opus-tools. The following is an option mapping chart describing options
  794. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  795. in parentheses.
  796. @table @option
  797. @item b (@emph{bitrate})
  798. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  799. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  800. kilobits/s.
  801. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  802. Set VBR mode. The FFmpeg @option{vbr} option has the following
  803. valid arguments, with the their @command{opusenc} equivalent options
  804. in parentheses:
  805. @table @samp
  806. @item off (@emph{hard-cbr})
  807. Use constant bit rate encoding.
  808. @item on (@emph{vbr})
  809. Use variable bit rate encoding (the default).
  810. @item constrained (@emph{cvbr})
  811. Use constrained variable bit rate encoding.
  812. @end table
  813. @item compression_level (@emph{comp})
  814. Set encoding algorithm complexity. Valid options are integers in
  815. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  816. gives the highest quality but slowest encoding. The default is 10.
  817. @item frame_duration (@emph{framesize})
  818. Set maximum frame size, or duration of a frame in milliseconds. The
  819. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  820. frame sizes achieve lower latency but less quality at a given bitrate.
  821. Sizes greater than 20ms are only interesting at fairly low bitrates.
  822. The default of FFmpeg is 10ms, but is 20ms in @command{opusenc}.
  823. @item packet_loss (@emph{expect-loss})
  824. Set expected packet loss percentage. The default is 0.
  825. @item application (N.A.)
  826. Set intended application type. Valid options are listed below:
  827. @table @samp
  828. @item voip
  829. Favor improved speech intelligibility.
  830. @item audio
  831. Favor faithfulness to the input (the default).
  832. @item lowdelay
  833. Restrict to only the lowest delay modes.
  834. @end table
  835. @item cutoff (N.A.)
  836. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  837. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  838. narrowband, mediumband, wideband, super wideband, and fullband
  839. respectively. The default is 0 (cutoff disabled).
  840. @end table
  841. @section libvorbis
  842. libvorbis encoder wrapper.
  843. Requires the presence of the libvorbisenc headers and library during
  844. configuration. You need to explicitly configure the build with
  845. @code{--enable-libvorbis}.
  846. @subsection Options
  847. The following options are supported by the libvorbis wrapper. The
  848. @command{oggenc}-equivalent of the options are listed in parentheses.
  849. To get a more accurate and extensive documentation of the libvorbis
  850. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  851. See @url{http://xiph.org/vorbis/},
  852. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  853. @table @option
  854. @item b (@emph{-b})
  855. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  856. expressed in kilobits/s.
  857. @item q (@emph{-q})
  858. Set constant quality setting for VBR. The value should be a float
  859. number in the range of -1.0 to 10.0. The higher the value, the better
  860. the quality. The default value is @samp{3.0}.
  861. This option is valid only using the @command{ffmpeg} command-line tool.
  862. For library interface users, use @option{global_quality}.
  863. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  864. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  865. related option is expressed in kHz. The default value is @samp{0} (cutoff
  866. disabled).
  867. @item minrate (@emph{-m})
  868. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  869. expressed in kilobits/s.
  870. @item maxrate (@emph{-M})
  871. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  872. expressed in kilobits/s. This only has effect on ABR mode.
  873. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  874. Set noise floor bias for impulse blocks. The value is a float number from
  875. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  876. to the crispness of transients in the encoded audio. The tradeoff for better
  877. transient response is a higher bitrate.
  878. @end table
  879. @section libwavpack
  880. A wrapper providing WavPack encoding through libwavpack.
  881. Only lossless mode using 32-bit integer samples is supported currently.
  882. The @option{compression_level} option can be used to control speed vs.
  883. compression tradeoff, with the values mapped to libwavpack as follows:
  884. @table @option
  885. @item 0
  886. Fast mode - corresponding to the wavpack @option{-f} option.
  887. @item 1
  888. Normal (default) settings.
  889. @item 2
  890. High quality - corresponding to the wavpack @option{-h} option.
  891. @item 3
  892. Very high quality - corresponding to the wavpack @option{-hh} option.
  893. @item 4-8
  894. Same as 3, but with extra processing enabled - corresponding to the wavpack
  895. @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
  896. @option{-x6}.
  897. @end table
  898. @c man end AUDIO ENCODERS
  899. @chapter Video Encoders
  900. @c man begin VIDEO ENCODERS
  901. A description of some of the currently available video encoders
  902. follows.
  903. @section libtheora
  904. libtheora Theora encoder wrapper.
  905. Requires the presence of the libtheora headers and library during
  906. configuration. You need to explicitly configure the build with
  907. @code{--enable-libtheora}.
  908. For more informations about the libtheora project see
  909. @url{http://www.theora.org/}.
  910. @subsection Options
  911. The following global options are mapped to internal libtheora options
  912. which affect the quality and the bitrate of the encoded stream.
  913. @table @option
  914. @item b
  915. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  916. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  917. @item flags
  918. Used to enable constant quality mode (VBR) encoding through the
  919. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  920. modes.
  921. @item g
  922. Set the GOP size.
  923. @item global_quality
  924. Set the global quality as an integer in lambda units.
  925. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  926. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  927. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  928. value in the native libtheora range [0-63]. A higher value corresponds
  929. to a higher quality.
  930. @item q
  931. Enable VBR mode when set to a non-negative value, and set constant
  932. quality value as a double floating point value in QP units.
  933. The value is clipped in the [0-10] range, and then multiplied by 6.3
  934. to get a value in the native libtheora range [0-63].
  935. This option is valid only using the @command{ffmpeg} command-line
  936. tool. For library interface users, use @option{global_quality}.
  937. @end table
  938. @subsection Examples
  939. @itemize
  940. @item
  941. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  942. @example
  943. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  944. @end example
  945. @item
  946. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  947. @example
  948. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  949. @end example
  950. @end itemize
  951. @section libvpx
  952. VP8 format supported through libvpx.
  953. Requires the presence of the libvpx headers and library during configuration.
  954. You need to explicitly configure the build with @code{--enable-libvpx}.
  955. @subsection Options
  956. Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
  957. @table @option
  958. @item threads
  959. g_threads
  960. @item profile
  961. g_profile
  962. @item vb
  963. rc_target_bitrate
  964. @item g
  965. kf_max_dist
  966. @item keyint_min
  967. kf_min_dist
  968. @item qmin
  969. rc_min_quantizer
  970. @item qmax
  971. rc_max_quantizer
  972. @item bufsize, vb
  973. rc_buf_sz
  974. @code{(bufsize * 1000 / vb)}
  975. rc_buf_optimal_sz
  976. @code{(bufsize * 1000 / vb * 5 / 6)}
  977. @item rc_init_occupancy, vb
  978. rc_buf_initial_sz
  979. @code{(rc_init_occupancy * 1000 / vb)}
  980. @item rc_buffer_aggressivity
  981. rc_undershoot_pct
  982. @item skip_threshold
  983. rc_dropframe_thresh
  984. @item qcomp
  985. rc_2pass_vbr_bias_pct
  986. @item maxrate, vb
  987. rc_2pass_vbr_maxsection_pct
  988. @code{(maxrate * 100 / vb)}
  989. @item minrate, vb
  990. rc_2pass_vbr_minsection_pct
  991. @code{(minrate * 100 / vb)}
  992. @item minrate, maxrate, vb
  993. @code{VPX_CBR}
  994. @code{(minrate == maxrate == vb)}
  995. @item crf
  996. @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
  997. @item quality
  998. @table @option
  999. @item @var{best}
  1000. @code{VPX_DL_BEST_QUALITY}
  1001. @item @var{good}
  1002. @code{VPX_DL_GOOD_QUALITY}
  1003. @item @var{realtime}
  1004. @code{VPX_DL_REALTIME}
  1005. @end table
  1006. @item speed
  1007. @code{VP8E_SET_CPUUSED}
  1008. @item nr
  1009. @code{VP8E_SET_NOISE_SENSITIVITY}
  1010. @item mb_threshold
  1011. @code{VP8E_SET_STATIC_THRESHOLD}
  1012. @item slices
  1013. @code{VP8E_SET_TOKEN_PARTITIONS}
  1014. @item max-intra-rate
  1015. @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
  1016. @item force_key_frames
  1017. @code{VPX_EFLAG_FORCE_KF}
  1018. @item Alternate reference frame related
  1019. @table @option
  1020. @item vp8flags altref
  1021. @code{VP8E_SET_ENABLEAUTOALTREF}
  1022. @item @var{arnr_max_frames}
  1023. @code{VP8E_SET_ARNR_MAXFRAMES}
  1024. @item @var{arnr_type}
  1025. @code{VP8E_SET_ARNR_TYPE}
  1026. @item @var{arnr_strength}
  1027. @code{VP8E_SET_ARNR_STRENGTH}
  1028. @item @var{rc_lookahead}
  1029. g_lag_in_frames
  1030. @end table
  1031. @item vp8flags error_resilient
  1032. g_error_resilient
  1033. @end table
  1034. For more information about libvpx see:
  1035. @url{http://www.webmproject.org/}
  1036. @section libx264
  1037. x264 H.264/MPEG-4 AVC encoder wrapper.
  1038. This encoder requires the presence of the libx264 headers and library
  1039. during configuration. You need to explicitly configure the build with
  1040. @code{--enable-libx264}.
  1041. libx264 supports an impressive number of features, including 8x8 and
  1042. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1043. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1044. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1045. Many libx264 encoder options are mapped to FFmpeg global codec
  1046. options, while unique encoder options are provided through private
  1047. options. Additionally the @option{x264opts} and @option{x264-params}
  1048. private options allows to pass a list of key=value tuples as accepted
  1049. by the libx264 @code{x264_param_parse} function.
  1050. The x264 project website is at
  1051. @url{http://www.videolan.org/developers/x264.html}.
  1052. @subsection Options
  1053. The following options are supported by the libx264 wrapper. The
  1054. @command{x264}-equivalent options or values are listed in parentheses
  1055. for easy migration.
  1056. To reduce the duplication of documentation, only the private options
  1057. and some others requiring special attention are documented here. For
  1058. the documentation of the undocumented generic options, see
  1059. @ref{codec-options,,the Codec Options chapter}.
  1060. To get a more accurate and extensive documentation of the libx264
  1061. options, invoke the command @command{x264 --full-help} or consult
  1062. the libx264 documentation.
  1063. @table @option
  1064. @item b (@emph{bitrate})
  1065. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1066. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1067. kilobits/s.
  1068. @item bf (@emph{bframes})
  1069. @item g (@emph{keyint})
  1070. @item qmax (@emph{qpmax})
  1071. @item qmin (@emph{qpmin})
  1072. @item qdiff (@emph{qpstep})
  1073. @item qblur (@emph{qblur})
  1074. @item qcomp (@emph{qcomp})
  1075. @item refs (@emph{ref})
  1076. @item sc_threshold (@emph{scenecut})
  1077. @item trellis (@emph{trellis})
  1078. @item nr (@emph{nr})
  1079. @item me_range (@emph{merange})
  1080. @item me_method (@emph{me})
  1081. Set motion estimation method. Possible values in the decreasing order
  1082. of speed:
  1083. @table @samp
  1084. @item dia (@emph{dia})
  1085. @item epzs (@emph{dia})
  1086. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1087. @samp{dia}.
  1088. @item hex (@emph{hex})
  1089. Hexagonal search with radius 2.
  1090. @item umh (@emph{umh})
  1091. Uneven multi-hexagon search.
  1092. @item esa (@emph{esa})
  1093. Exhaustive search.
  1094. @item tesa (@emph{tesa})
  1095. Hadamard exhaustive search (slowest).
  1096. @end table
  1097. @item subq (@emph{subme})
  1098. @item b_strategy (@emph{b-adapt})
  1099. @item keyint_min (@emph{min-keyint})
  1100. @item coder
  1101. Set entropy encoder. Possible values:
  1102. @table @samp
  1103. @item ac
  1104. Enable CABAC.
  1105. @item vlc
  1106. Enable CAVLC and disable CABAC. It generates the same effect as
  1107. @command{x264}'s @option{--no-cabac} option.
  1108. @end table
  1109. @item cmp
  1110. Set full pixel motion estimation comparation algorithm. Possible values:
  1111. @table @samp
  1112. @item chroma
  1113. Enable chroma in motion estimation.
  1114. @item sad
  1115. Ignore chroma in motion estimation. It generates the same effect as
  1116. @command{x264}'s @option{--no-chroma-me} option.
  1117. @end table
  1118. @item threads (@emph{threads})
  1119. @item thread_type
  1120. Set multithreading technique. Possible values:
  1121. @table @samp
  1122. @item slice
  1123. Slice-based multithreading. It generates the same effect as
  1124. @command{x264}'s @option{--sliced-threads} option.
  1125. @item frame
  1126. Frame-based multithreading.
  1127. @end table
  1128. @item flags
  1129. Set encoding flags. It can be used to disable closed GOP and enable
  1130. open GOP by setting it to @code{-cgop}. The result is similar to
  1131. the behavior of @command{x264}'s @option{--open-gop} option.
  1132. @item rc_init_occupancy (@emph{vbv-init})
  1133. @item preset (@emph{preset})
  1134. Set the encoding preset.
  1135. @item tune (@emph{tune})
  1136. Set tuning of the encoding params.
  1137. @item profile (@emph{profile})
  1138. Set profile restrictions.
  1139. @item fastfirstpass
  1140. Enable fast settings when encoding first pass, when set to 1. When set
  1141. to 0, it has the same effect of @command{x264}'s
  1142. @option{--slow-firstpass} option.
  1143. @item crf (@emph{crf})
  1144. Set the quality for constant quality mode.
  1145. @item crf_max (@emph{crf-max})
  1146. In CRF mode, prevents VBV from lowering quality beyond this point.
  1147. @item qp (@emph{qp})
  1148. Set constant quantization rate control method parameter.
  1149. @item aq-mode (@emph{aq-mode})
  1150. Set AQ method. Possible values:
  1151. @table @samp
  1152. @item none (@emph{0})
  1153. Disabled.
  1154. @item variance (@emph{1})
  1155. Variance AQ (complexity mask).
  1156. @item autovariance (@emph{2})
  1157. Auto-variance AQ (experimental).
  1158. @end table
  1159. @item aq-strength (@emph{aq-strength})
  1160. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1161. @item psy
  1162. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1163. same effect as @command{x264}'s @option{--no-psy} option.
  1164. @item psy-rd (@emph{psy-rd})
  1165. Set strength of psychovisual optimization, in
  1166. @var{psy-rd}:@var{psy-trellis} format.
  1167. @item rc-lookahead (@emph{rc-lookahead})
  1168. Set number of frames to look ahead for frametype and ratecontrol.
  1169. @item weightb
  1170. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1171. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1172. @item weightp (@emph{weightp})
  1173. Set weighted prediction method for P-frames. Possible values:
  1174. @table @samp
  1175. @item none (@emph{0})
  1176. Disabled
  1177. @item simple (@emph{1})
  1178. Enable only weighted refs
  1179. @item smart (@emph{2})
  1180. Enable both weighted refs and duplicates
  1181. @end table
  1182. @item ssim (@emph{ssim})
  1183. Enable calculation and printing SSIM stats after the encoding.
  1184. @item intra-refresh (@emph{intra-refresh})
  1185. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1186. to 1.
  1187. @item bluray-compat (@emph{bluray-compat})
  1188. Configure the encoder to be compatible with the bluray standard.
  1189. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  1190. @item b-bias (@emph{b-bias})
  1191. Set the influence on how often B-frames are used.
  1192. @item b-pyramid (@emph{b-pyramid})
  1193. Set method for keeping of some B-frames as references. Possible values:
  1194. @table @samp
  1195. @item none (@emph{none})
  1196. Disabled.
  1197. @item strict (@emph{strict})
  1198. Strictly hierarchical pyramid.
  1199. @item normal (@emph{normal})
  1200. Non-strict (not Blu-ray compatible).
  1201. @end table
  1202. @item mixed-refs
  1203. Enable the use of one reference per partition, as opposed to one
  1204. reference per macroblock when set to 1. When set to 0, it has the
  1205. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  1206. @item 8x8dct
  1207. Enable adaptive spatial transform (high profile 8x8 transform)
  1208. when set to 1. When set to 0, it has the same effect as
  1209. @command{x264}'s @option{--no-8x8dct} option.
  1210. @item fast-pskip
  1211. Enable early SKIP detection on P-frames when set to 1. When set
  1212. to 0, it has the same effect as @command{x264}'s
  1213. @option{--no-fast-pskip} option.
  1214. @item aud (@emph{aud})
  1215. Enable use of access unit delimiters when set to 1.
  1216. @item mbtree
  1217. Enable use macroblock tree ratecontrol when set to 1. When set
  1218. to 0, it has the same effect as @command{x264}'s
  1219. @option{--no-mbtree} option.
  1220. @item deblock (@emph{deblock})
  1221. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  1222. @item cplxblur (@emph{cplxblur})
  1223. Set fluctuations reduction in QP (before curve compression).
  1224. @item partitions (@emph{partitions})
  1225. Set partitions to consider as a comma-separated list of. Possible
  1226. values in the list:
  1227. @table @samp
  1228. @item p8x8
  1229. 8x8 P-frame partition.
  1230. @item p4x4
  1231. 4x4 P-frame partition.
  1232. @item b8x8
  1233. 4x4 B-frame partition.
  1234. @item i8x8
  1235. 8x8 I-frame partition.
  1236. @item i4x4
  1237. 4x4 I-frame partition.
  1238. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  1239. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  1240. option) to be enabled.)
  1241. @item none (@emph{none})
  1242. Do not consider any partitions.
  1243. @item all (@emph{all})
  1244. Consider every partition.
  1245. @end table
  1246. @item direct-pred (@emph{direct})
  1247. Set direct MV prediction mode. Possible values:
  1248. @table @samp
  1249. @item none (@emph{none})
  1250. Disable MV prediction.
  1251. @item spatial (@emph{spatial})
  1252. Enable spatial predicting.
  1253. @item temporal (@emph{temporal})
  1254. Enable temporal predicting.
  1255. @item auto (@emph{auto})
  1256. Automatically decided.
  1257. @end table
  1258. @item slice-max-size (@emph{slice-max-size})
  1259. Set the limit of the size of each slice in bytes. If not specified
  1260. but RTP payload size (@option{ps}) is specified, that is used.
  1261. @item stats (@emph{stats})
  1262. Set the file name for multi-pass stats.
  1263. @item nal-hrd (@emph{nal-hrd})
  1264. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  1265. Possible values:
  1266. @table @samp
  1267. @item none (@emph{none})
  1268. Disable HRD information signaling.
  1269. @item vbr (@emph{vbr})
  1270. Variable bit rate.
  1271. @item cbr (@emph{cbr})
  1272. Constant bit rate (not allowed in MP4 container).
  1273. @end table
  1274. @item x264opts (N.A.)
  1275. Set any x264 option, see @command{x264 --fullhelp} for a list.
  1276. Argument is a list of @var{key}=@var{value} couples separated by
  1277. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  1278. themselves, use "," instead. They accept it as well since long ago but this
  1279. is kept undocumented for some reason.
  1280. For example to specify libx264 encoding options with @command{ffmpeg}:
  1281. @example
  1282. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  1283. @end example
  1284. @item x264-params (N.A.)
  1285. Override the x264 configuration using a :-separated list of key=value
  1286. parameters.
  1287. This option is functionally the same as the @option{x264opts}, but is
  1288. duplicated for compability with the Libav fork.
  1289. For example to specify libx264 encoding options with @command{ffmpeg}:
  1290. @example
  1291. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  1292. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  1293. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  1294. @end example
  1295. @end table
  1296. Encoding ffpresets for common usages are provided so they can be used with the
  1297. general presets system (e.g. passing the @option{pre} option).
  1298. @section libxvid
  1299. Xvid MPEG-4 Part 2 encoder wrapper.
  1300. This encoder requires the presence of the libxvidcore headers and library
  1301. during configuration. You need to explicitly configure the build with
  1302. @code{--enable-libxvid --enable-gpl}.
  1303. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  1304. users can encode to this format without this library.
  1305. @subsection Options
  1306. The following options are supported by the libxvid wrapper. Some of
  1307. the following options are listed but are not documented, and
  1308. correspond to shared codec options. See @ref{codec-options,,the Codec
  1309. Options chapter} for their documentation. The other shared options
  1310. which are not listed have no effect for the libxvid encoder.
  1311. @table @option
  1312. @item b
  1313. @item g
  1314. @item qmin
  1315. @item qmax
  1316. @item mpeg_quant
  1317. @item threads
  1318. @item bf
  1319. @item b_qfactor
  1320. @item b_qoffset
  1321. @item flags
  1322. Set specific encoding flags. Possible values:
  1323. @table @samp
  1324. @item mv4
  1325. Use four motion vector by macroblock.
  1326. @item aic
  1327. Enable high quality AC prediction.
  1328. @item gray
  1329. Only encode grayscale.
  1330. @item gmc
  1331. Enable the use of global motion compensation (GMC).
  1332. @item qpel
  1333. Enable quarter-pixel motion compensation.
  1334. @item cgop
  1335. Enable closed GOP.
  1336. @item global_header
  1337. Place global headers in extradata instead of every keyframe.
  1338. @end table
  1339. @item trellis
  1340. @item me_method
  1341. Set motion estimation method. Possible values in decreasing order of
  1342. speed and increasing order of quality:
  1343. @table @samp
  1344. @item zero
  1345. Use no motion estimation (default).
  1346. @item phods
  1347. @item x1
  1348. @item log
  1349. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  1350. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  1351. @samp{phods}.
  1352. @item epzs
  1353. Enable all of the things described above, plus advanced diamond zonal
  1354. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  1355. estimation on chroma planes.
  1356. @item full
  1357. Enable all of the things described above, plus extended 16x16 and 8x8
  1358. blocks search.
  1359. @end table
  1360. @item mbd
  1361. Set macroblock decision algorithm. Possible values in the increasing
  1362. order of quality:
  1363. @table @samp
  1364. @item simple
  1365. Use macroblock comparing function algorithm (default).
  1366. @item bits
  1367. Enable rate distortion-based half pixel and quarter pixel refinement for
  1368. 16x16 blocks.
  1369. @item rd
  1370. Enable all of the things described above, plus rate distortion-based
  1371. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  1372. distortion-based search using square pattern.
  1373. @end table
  1374. @item lumi_aq
  1375. Enable lumi masking adaptive quantization when set to 1. Default is 0
  1376. (disabled).
  1377. @item variance_aq
  1378. Enable variance adaptive quantization when set to 1. Default is 0
  1379. (disabled).
  1380. When combined with @option{lumi_aq}, the resulting quality will not
  1381. be better than any of the two specified individually. In other
  1382. words, the resulting quality will be the worse one of the two
  1383. effects.
  1384. @item ssim
  1385. Set structural similarity (SSIM) displaying method. Possible values:
  1386. @table @samp
  1387. @item off
  1388. Disable displaying of SSIM information.
  1389. @item avg
  1390. Output average SSIM at the end of encoding to stdout. The format of
  1391. showing the average SSIM is:
  1392. @example
  1393. Average SSIM: %f
  1394. @end example
  1395. For users who are not familiar with C, %f means a float number, or
  1396. a decimal (e.g. 0.939232).
  1397. @item frame
  1398. Output both per-frame SSIM data during encoding and average SSIM at
  1399. the end of encoding to stdout. The format of per-frame information
  1400. is:
  1401. @example
  1402. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  1403. @end example
  1404. For users who are not familiar with C, %1.3f means a float number
  1405. rounded to 3 digits after the dot (e.g. 0.932).
  1406. @end table
  1407. @item ssim_acc
  1408. Set SSIM accuracy. Valid options are integers within the range of
  1409. 0-4, while 0 gives the most accurate result and 4 computes the
  1410. fastest.
  1411. @end table
  1412. @section png
  1413. PNG image encoder.
  1414. @subsection Private options
  1415. @table @option
  1416. @item dpi @var{integer}
  1417. Set physical density of pixels, in dots per inch, unset by default
  1418. @item dpm @var{integer}
  1419. Set physical density of pixels, in dots per meter, unset by default
  1420. @end table
  1421. @section ProRes
  1422. Apple ProRes encoder.
  1423. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  1424. The used encoder can be choosen with the @code{-vcodec} option.
  1425. @subsection Private Options for prores-ks
  1426. @table @option
  1427. @item profile @var{integer}
  1428. Select the ProRes profile to encode
  1429. @table @samp
  1430. @item proxy
  1431. @item lt
  1432. @item standard
  1433. @item hq
  1434. @item 4444
  1435. @end table
  1436. @item quant_mat @var{integer}
  1437. Select quantization matrix.
  1438. @table @samp
  1439. @item auto
  1440. @item default
  1441. @item proxy
  1442. @item lt
  1443. @item standard
  1444. @item hq
  1445. @end table
  1446. If set to @var{auto}, the matrix matching the profile will be picked.
  1447. If not set, the matrix providing the highest quality, @var{default}, will be
  1448. picked.
  1449. @item bits_per_mb @var{integer}
  1450. How many bits to allot for coding one macroblock. Different profiles use
  1451. between 200 and 2400 bits per macroblock, the maximum is 8000.
  1452. @item mbs_per_slice @var{integer}
  1453. Number of macroblocks in each slice (1-8); the default value (8)
  1454. should be good in almost all situations.
  1455. @item vendor @var{string}
  1456. Override the 4-byte vendor ID.
  1457. A custom vendor ID like @var{apl0} would claim the stream was produced by
  1458. the Apple encoder.
  1459. @item alpha_bits @var{integer}
  1460. Specify number of bits for alpha component.
  1461. Possible values are @var{0}, @var{8} and @var{16}.
  1462. Use @var{0} to disable alpha plane coding.
  1463. @end table
  1464. @subsection Speed considerations
  1465. In the default mode of operation the encoder has to honor frame constraints
  1466. (i.e. not produc frames with size bigger than requested) while still making
  1467. output picture as good as possible.
  1468. A frame containing a lot of small details is harder to compress and the encoder
  1469. would spend more time searching for appropriate quantizers for each slice.
  1470. Setting a higher @option{bits_per_mb} limit will improve the speed.
  1471. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  1472. recommended value) and do not set a size constraint.
  1473. @c man end VIDEO ENCODERS