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.

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