encoders.texi 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111
  1. @chapter Encoders
  2. @c man begin ENCODERS
  3. Encoders are configured elements in FFmpeg which allow the encoding of
  4. multimedia streams.
  5. When you configure your FFmpeg build, all the supported native encoders
  6. are enabled by default. Encoders requiring an external library must be enabled
  7. manually via the corresponding @code{--enable-lib} option. You can list all
  8. available encoders using the configure option @code{--list-encoders}.
  9. You can disable all the encoders with the configure option
  10. @code{--disable-encoders} and selectively enable / disable single encoders
  11. with the options @code{--enable-encoder=@var{ENCODER}} /
  12. @code{--disable-encoder=@var{ENCODER}}.
  13. The option @code{-codecs} of the ff* tools will display the list of
  14. enabled encoders.
  15. @c man end ENCODERS
  16. @chapter Audio Encoders
  17. @c man begin AUDIO ENCODERS
  18. A description of some of the currently available audio encoders
  19. follows.
  20. @anchor{aacenc}
  21. @section aac
  22. Advanced Audio Coding (AAC) encoder.
  23. This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
  24. low complexity (AAC-LC) profile is supported. To use this encoder, you must set
  25. @option{strict} option to @samp{experimental} or lower.
  26. As this encoder is experimental, unexpected behavior may exist from time to
  27. time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
  28. that it has a worse quality reported by some users.
  29. @c Comment this out until somebody writes the respective documentation.
  30. @c See also @ref{libfaac}, @ref{libaacplus}, and @ref{libfdk-aac-enc}.
  31. @subsection Options
  32. @table @option
  33. @item b
  34. Set bit rate in bits/s. Setting this automatically activates constant bit rate
  35. (CBR) mode.
  36. @item q
  37. Set quality for variable bit rate (VBR) mode. This option is valid only using
  38. the @command{ffmpeg} command-line tool. For library interface users, use
  39. @option{global_quality}.
  40. @item stereo_mode
  41. Set stereo encoding mode. Possible values:
  42. @table @samp
  43. @item auto
  44. Automatically selected by the encoder.
  45. @item ms_off
  46. Disable middle/side encoding. This is the default.
  47. @item ms_force
  48. Force middle/side encoding.
  49. @end table
  50. @item aac_coder
  51. Set AAC encoder coding method. Possible values:
  52. @table @samp
  53. @item 0
  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 1
  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 2
  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 3
  72. Constant quantizer method.
  73. This method sets a constant quantizer for all bands. This is the fastest of all
  74. the methods, yet produces the worst quality.
  75. @end table
  76. @end table
  77. @subsection Tips and Tricks
  78. According to some reports
  79. (e.g. @url{http://d.hatena.ne.jp/kamedo2/20120729/1343545890}), setting the
  80. @option{cutoff} option to 15000 Hz greatly improves the quality of the output
  81. quality. As a result, we encourage you to do the same.
  82. @section ac3 and ac3_fixed
  83. AC-3 audio encoders.
  84. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  85. the undocumented RealAudio 3 (a.k.a. dnet).
  86. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  87. encoder only uses fixed-point integer math. This does not mean that one is
  88. always faster, just that one or the other may be better suited to a
  89. particular system. The floating-point encoder will generally produce better
  90. quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
  91. default codec for any of the output formats, so it must be specified explicitly
  92. using the option @code{-acodec ac3_fixed} in order to use it.
  93. @subsection AC-3 Metadata
  94. The AC-3 metadata options are used to set parameters that describe the audio,
  95. but in most cases do not affect the audio encoding itself. Some of the options
  96. do directly affect or influence the decoding and playback of the resulting
  97. bitstream, while others are just for informational purposes. A few of the
  98. options will add bits to the output stream that could otherwise be used for
  99. audio data, and will thus affect the quality of the output. Those will be
  100. indicated accordingly with a note in the option list below.
  101. These parameters are described in detail in several publicly-available
  102. documents.
  103. @itemize
  104. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  105. @item @uref{http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf,A/54 - Guide to the Use of the ATSC Digital Television Standard}
  106. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  107. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  108. @end itemize
  109. @subsubsection Metadata Control Options
  110. @table @option
  111. @item -per_frame_metadata @var{boolean}
  112. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  113. metadata for each frame.
  114. @table @option
  115. @item 0
  116. The metadata values set at initialization will be used for every frame in the
  117. stream. (default)
  118. @item 1
  119. Metadata values can be changed before encoding each frame.
  120. @end table
  121. @end table
  122. @subsubsection Downmix Levels
  123. @table @option
  124. @item -center_mixlev @var{level}
  125. Center Mix Level. The amount of gain the decoder should apply to the center
  126. channel when downmixing to stereo. This field will only be written to the
  127. bitstream if a center channel is present. The value is specified as a scale
  128. factor. There are 3 valid values:
  129. @table @option
  130. @item 0.707
  131. Apply -3dB gain
  132. @item 0.595
  133. Apply -4.5dB gain (default)
  134. @item 0.500
  135. Apply -6dB gain
  136. @end table
  137. @item -surround_mixlev @var{level}
  138. Surround Mix Level. The amount of gain the decoder should apply to the surround
  139. channel(s) when downmixing to stereo. This field will only be written to the
  140. bitstream if one or more surround channels are present. The value is specified
  141. as a scale factor. There are 3 valid values:
  142. @table @option
  143. @item 0.707
  144. Apply -3dB gain
  145. @item 0.500
  146. Apply -6dB gain (default)
  147. @item 0.000
  148. Silence Surround Channel(s)
  149. @end table
  150. @end table
  151. @subsubsection Audio Production Information
  152. Audio Production Information is optional information describing the mixing
  153. environment. Either none or both of the fields are written to the bitstream.
  154. @table @option
  155. @item -mixing_level @var{number}
  156. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  157. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  158. unknown or not indicated. The default value is -1, but that value cannot be
  159. used if the Audio Production Information is written to the bitstream. Therefore,
  160. if the @code{room_type} option is not the default value, the @code{mixing_level}
  161. option must not be -1.
  162. @item -room_type @var{type}
  163. Room Type. Describes the equalization used during the final mixing session at
  164. the studio or on the dubbing stage. A large room is a dubbing stage with the
  165. industry standard X-curve equalization; a small room has flat equalization.
  166. This field will not be written to the bitstream if both the @code{mixing_level}
  167. option and the @code{room_type} option have the default values.
  168. @table @option
  169. @item 0
  170. @itemx notindicated
  171. Not Indicated (default)
  172. @item 1
  173. @itemx large
  174. Large Room
  175. @item 2
  176. @itemx small
  177. Small Room
  178. @end table
  179. @end table
  180. @subsubsection Other Metadata Options
  181. @table @option
  182. @item -copyright @var{boolean}
  183. Copyright Indicator. Specifies whether a copyright exists for this audio.
  184. @table @option
  185. @item 0
  186. @itemx off
  187. No Copyright Exists (default)
  188. @item 1
  189. @itemx on
  190. Copyright Exists
  191. @end table
  192. @item -dialnorm @var{value}
  193. Dialogue Normalization. Indicates how far the average dialogue level of the
  194. program is below digital 100% full scale (0 dBFS). This parameter determines a
  195. level shift during audio reproduction that sets the average volume of the
  196. dialogue to a preset level. The goal is to match volume level between program
  197. sources. A value of -31dB will result in no volume level change, relative to
  198. the source volume, during audio reproduction. Valid values are whole numbers in
  199. the range -31 to -1, with -31 being the default.
  200. @item -dsur_mode @var{mode}
  201. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  202. (Pro Logic). This field will only be written to the bitstream if the audio
  203. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  204. apply Dolby Surround processing.
  205. @table @option
  206. @item 0
  207. @itemx notindicated
  208. Not Indicated (default)
  209. @item 1
  210. @itemx off
  211. Not Dolby Surround Encoded
  212. @item 2
  213. @itemx on
  214. Dolby Surround Encoded
  215. @end table
  216. @item -original @var{boolean}
  217. Original Bit Stream Indicator. Specifies whether this audio is from the
  218. original source and not a copy.
  219. @table @option
  220. @item 0
  221. @itemx off
  222. Not Original Source
  223. @item 1
  224. @itemx on
  225. Original Source (default)
  226. @end table
  227. @end table
  228. @subsection Extended Bitstream Information
  229. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  230. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  231. If any one parameter in a group is specified, all values in that group will be
  232. written to the bitstream. Default values are used for those that are written
  233. but have not been specified. If the mixing levels are written, the decoder
  234. will use these values instead of the ones specified in the @code{center_mixlev}
  235. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  236. Syntax.
  237. @subsubsection Extended Bitstream Information - Part 1
  238. @table @option
  239. @item -dmix_mode @var{mode}
  240. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  241. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  242. @table @option
  243. @item 0
  244. @itemx notindicated
  245. Not Indicated (default)
  246. @item 1
  247. @itemx ltrt
  248. Lt/Rt Downmix Preferred
  249. @item 2
  250. @itemx loro
  251. Lo/Ro Downmix Preferred
  252. @end table
  253. @item -ltrt_cmixlev @var{level}
  254. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  255. center channel when downmixing to stereo in Lt/Rt mode.
  256. @table @option
  257. @item 1.414
  258. Apply +3dB gain
  259. @item 1.189
  260. Apply +1.5dB gain
  261. @item 1.000
  262. Apply 0dB gain
  263. @item 0.841
  264. Apply -1.5dB gain
  265. @item 0.707
  266. Apply -3.0dB gain
  267. @item 0.595
  268. Apply -4.5dB gain (default)
  269. @item 0.500
  270. Apply -6.0dB gain
  271. @item 0.000
  272. Silence Center Channel
  273. @end table
  274. @item -ltrt_surmixlev @var{level}
  275. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  276. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  277. @table @option
  278. @item 0.841
  279. Apply -1.5dB gain
  280. @item 0.707
  281. Apply -3.0dB gain
  282. @item 0.595
  283. Apply -4.5dB gain
  284. @item 0.500
  285. Apply -6.0dB gain (default)
  286. @item 0.000
  287. Silence Surround Channel(s)
  288. @end table
  289. @item -loro_cmixlev @var{level}
  290. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  291. center channel when downmixing to stereo in Lo/Ro mode.
  292. @table @option
  293. @item 1.414
  294. Apply +3dB gain
  295. @item 1.189
  296. Apply +1.5dB gain
  297. @item 1.000
  298. Apply 0dB gain
  299. @item 0.841
  300. Apply -1.5dB gain
  301. @item 0.707
  302. Apply -3.0dB gain
  303. @item 0.595
  304. Apply -4.5dB gain (default)
  305. @item 0.500
  306. Apply -6.0dB gain
  307. @item 0.000
  308. Silence Center Channel
  309. @end table
  310. @item -loro_surmixlev @var{level}
  311. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  312. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  313. @table @option
  314. @item 0.841
  315. Apply -1.5dB gain
  316. @item 0.707
  317. Apply -3.0dB gain
  318. @item 0.595
  319. Apply -4.5dB gain
  320. @item 0.500
  321. Apply -6.0dB gain (default)
  322. @item 0.000
  323. Silence Surround Channel(s)
  324. @end table
  325. @end table
  326. @subsubsection Extended Bitstream Information - Part 2
  327. @table @option
  328. @item -dsurex_mode @var{mode}
  329. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  330. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  331. apply Dolby Surround EX processing.
  332. @table @option
  333. @item 0
  334. @itemx notindicated
  335. Not Indicated (default)
  336. @item 1
  337. @itemx on
  338. Dolby Surround EX Off
  339. @item 2
  340. @itemx off
  341. Dolby Surround EX On
  342. @end table
  343. @item -dheadphone_mode @var{mode}
  344. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  345. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  346. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  347. processing.
  348. @table @option
  349. @item 0
  350. @itemx notindicated
  351. Not Indicated (default)
  352. @item 1
  353. @itemx on
  354. Dolby Headphone Off
  355. @item 2
  356. @itemx off
  357. Dolby Headphone On
  358. @end table
  359. @item -ad_conv_type @var{type}
  360. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  361. conversion.
  362. @table @option
  363. @item 0
  364. @itemx standard
  365. Standard A/D Converter (default)
  366. @item 1
  367. @itemx hdcd
  368. HDCD A/D Converter
  369. @end table
  370. @end table
  371. @subsection Other AC-3 Encoding Options
  372. @table @option
  373. @item -stereo_rematrixing @var{boolean}
  374. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  375. is an optional AC-3 feature that increases quality by selectively encoding
  376. the left/right channels as mid/side. This option is enabled by default, and it
  377. is highly recommended that it be left as enabled except for testing purposes.
  378. @end table
  379. @subsection Floating-Point-Only AC-3 Encoding Options
  380. These options are only valid for the floating-point encoder and do not exist
  381. for the fixed-point encoder due to the corresponding features not being
  382. implemented in fixed-point.
  383. @table @option
  384. @item -channel_coupling @var{boolean}
  385. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  386. that increases quality by combining high frequency information from multiple
  387. channels into a single channel. The per-channel high frequency information is
  388. sent with less accuracy in both the frequency and time domains. This allows
  389. more bits to be used for lower frequencies while preserving enough information
  390. to reconstruct the high frequencies. This option is enabled by default for the
  391. floating-point encoder and should generally be left as enabled except for
  392. testing purposes or to increase encoding speed.
  393. @table @option
  394. @item -1
  395. @itemx auto
  396. Selected by Encoder (default)
  397. @item 0
  398. @itemx off
  399. Disable Channel Coupling
  400. @item 1
  401. @itemx on
  402. Enable Channel Coupling
  403. @end table
  404. @item -cpl_start_band @var{number}
  405. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  406. value higher than the bandwidth is used, it will be reduced to 1 less than the
  407. coupling end band. If @var{auto} is used, the start band will be determined by
  408. the encoder based on the bit rate, sample rate, and channel layout. This option
  409. has no effect if channel coupling is disabled.
  410. @table @option
  411. @item -1
  412. @itemx auto
  413. Selected by Encoder (default)
  414. @end table
  415. @end table
  416. @section libmp3lame
  417. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper
  418. Requires the presence of the libmp3lame headers and library during
  419. configuration. You need to explicitly configure the build with
  420. @code{--enable-libmp3lame}.
  421. @subsection Options
  422. The following options are supported by the libmp3lame wrapper. The
  423. @command{lame}-equivalent of the options are listed in parentheses.
  424. @table @option
  425. @item b (@emph{-b})
  426. Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
  427. expressed in kilobits/s.
  428. @item q (@emph{-V})
  429. Set constant quality setting for VBR. This option is valid only
  430. using the @command{ffmpeg} command-line tool. For library interface
  431. users, use @option{global_quality}.
  432. @item compression_level (@emph{-q})
  433. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  434. with 0 meaning highest quality but slowest, and 9 meaning fastest
  435. while producing the worst quality.
  436. @item reservoir
  437. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  438. has this enabled by default, but can be overriden by use
  439. @option{--nores} option.
  440. @end table
  441. @section libopencore-amrnb
  442. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  443. Requires the presence of the libopencore-amrnb headers and library during
  444. configuration. You need to explicitly configure the build with
  445. @code{--enable-libopencore-amrnb --enable-version3}.
  446. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  447. but you can override it by setting @option{strict} to @samp{unofficial} or
  448. lower.
  449. @subsection Options
  450. @table @option
  451. @item b
  452. Set bitrate in bits per second. Only the following bitrates are supported,
  453. otherwise libavcodec will round to the nearest valid bitrate.
  454. @table @option
  455. @item 4750
  456. @item 5150
  457. @item 5900
  458. @item 6700
  459. @item 7400
  460. @item 7950
  461. @item 10200
  462. @item 12200
  463. @end table
  464. @item dtx
  465. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  466. default value is 0 (disabled).
  467. @end table
  468. @section libtwolame
  469. TwoLAME MP2 encoder wrapper
  470. Requires the presence of the libtwolame headers and library during
  471. configuration. You need to explicitly configure the build with
  472. @code{--enable-libtwolame}.
  473. @subsection Options
  474. The following options are supported by the libtwolame wrapper. The
  475. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  476. parentheses.
  477. @table @option
  478. @item b (@emph{-b})
  479. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  480. option is expressed in kilobits/s. Default value is 128k.
  481. @item q (@emph{-V})
  482. Set quality for experimental VBR support. Maximum value range is
  483. from -50 to 50, useful range is from -10 to 10. The higher the
  484. value, the better the quality. This option is valid only using the
  485. @command{ffmpeg} command-line tool. For library interface users,
  486. use @option{global_quality}.
  487. @item mode (@emph{--mode})
  488. Set the mode of the resulting audio. Possible values:
  489. @table @samp
  490. @item auto
  491. Choose mode automatically based on the input. This is the default.
  492. @item stereo
  493. Stereo
  494. @item joint_stereo
  495. Joint stereo
  496. @item dual_channel
  497. Dual channel
  498. @item mono
  499. Mono
  500. @end table
  501. @item psymodel (@emph{--psyc-mode})
  502. Set psychoacoustic model to use in encoding. The argument must be
  503. an integer between -1 and 4, inclusive. The higher the value, the
  504. better the quality. The default value is 3.
  505. @item energy_levels (@emph{--energy})
  506. Enable energy levels extensions when set to 1. The default value is
  507. 0 (disabled).
  508. @item error_protection (@emph{--protect})
  509. Enable CRC error protection when set to 1. The default value is 0
  510. (disabled).
  511. @item copyright (@emph{--copyright})
  512. Set MPEG audio copyright flag when set to 1. The default value is 0
  513. (disabled).
  514. @item original (@emph{--original})
  515. Set MPEG audio original flag when set to 1. The default value is 0
  516. (disabled).
  517. @end table
  518. @anchor{libvo-aacenc}
  519. @section libvo-aacenc
  520. VisualOn AAC encoder
  521. Requires the presence of the libvo-aacenc headers and library during
  522. configuration. You need to explicitly configure the build with
  523. @code{--enable-libvo-aacenc --enable-version3}.
  524. This encoder is considered to be worse than the
  525. @ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
  526. multiple sources.
  527. @subsection Options
  528. The VisualOn AAC encoder only support encoding AAC-LC and up to 2
  529. channels. It is also CBR-only.
  530. @table @option
  531. @item b
  532. Set bit rate in bits/s.
  533. @end table
  534. @section libvo-amrwbenc
  535. VisualOn Adaptive Multi-Rate Wideband encoder
  536. Requires the presence of the libvo-amrwbenc headers and library during
  537. configuration. You need to explicitly configure the build with
  538. @code{--enable-libvo-amrwbenc --enable-version3}.
  539. This is a mono-only encoder. Officially it only supports 16000Hz sample
  540. rate, but you can override it by setting @option{strict} to
  541. @samp{unofficial} or lower.
  542. @subsection Options
  543. @table @option
  544. @item b
  545. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  546. libavcodec will round to the nearest valid bitrate.
  547. @table @samp
  548. @item 6600
  549. @item 8850
  550. @item 12650
  551. @item 14250
  552. @item 15850
  553. @item 18250
  554. @item 19850
  555. @item 23050
  556. @item 23850
  557. @end table
  558. @item dtx
  559. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  560. default value is 0 (disabled).
  561. @end table
  562. @section libopus
  563. libopus Opus Interactive Audio Codec encoder wrapper.
  564. Requires the presence of the libopus headers and library during
  565. configuration. You need to explicitly configure the build with
  566. @code{--enable-libopus}.
  567. @subsection Option Mapping
  568. Most libopus options are modeled after the @command{opusenc} utility from
  569. opus-tools. The following is an option mapping chart describing options
  570. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  571. in parentheses.
  572. @table @option
  573. @item b (@emph{bitrate})
  574. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  575. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  576. kilobits/s.
  577. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  578. Set VBR mode. The FFmpeg @option{vbr} option has the following
  579. valid arguments, with the their @command{opusenc} equivalent options
  580. in parentheses:
  581. @table @samp
  582. @item off (@emph{hard-cbr})
  583. Use constant bit rate encoding.
  584. @item on (@emph{vbr})
  585. Use variable bit rate encoding (the default).
  586. @item constrained (@emph{cvbr})
  587. Use constrained variable bit rate encoding.
  588. @end table
  589. @item compression_level (@emph{comp})
  590. Set encoding algorithm complexity. Valid options are integers in
  591. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  592. gives the highest quality but slowest encoding. The default is 10.
  593. @item frame_duration (@emph{framesize})
  594. Set maximum frame size, or duration of a frame in milliseconds. The
  595. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  596. frame sizes achieve lower latency but less quality at a given bitrate.
  597. Sizes greater than 20ms are only interesting at fairly low bitrates.
  598. The default is 20ms.
  599. @item packet_loss (@emph{expect-loss})
  600. Set expected packet loss percentage. The default is 0.
  601. @item application (N.A.)
  602. Set intended application type. Valid options are listed below:
  603. @table @samp
  604. @item voip
  605. Favor improved speech intelligibility.
  606. @item audio
  607. Favor faithfulness to the input (the default).
  608. @item lowdelay
  609. Restrict to only the lowest delay modes.
  610. @end table
  611. @item cutoff (N.A.)
  612. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  613. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  614. narrowband, mediumband, wideband, super wideband, and fullband
  615. respectively. The default is 0 (cutoff disabled).
  616. @end table
  617. @c man end AUDIO ENCODERS
  618. @chapter Video Encoders
  619. @c man begin VIDEO ENCODERS
  620. A description of some of the currently available video encoders
  621. follows.
  622. @section libtheora
  623. Theora format supported through libtheora.
  624. Requires the presence of the libtheora headers and library during
  625. configuration. You need to explicitly configure the build with
  626. @code{--enable-libtheora}.
  627. @subsection Options
  628. The following global options are mapped to internal libtheora options
  629. which affect the quality and the bitrate of the encoded stream.
  630. @table @option
  631. @item b
  632. Set the video bitrate, only works if the @code{qscale} flag in
  633. @option{flags} is not enabled.
  634. @item flags
  635. Used to enable constant quality mode encoding through the
  636. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  637. modes.
  638. @item g
  639. Set the GOP size.
  640. @item global_quality
  641. Set the global quality in lambda units, only works if the
  642. @code{qscale} flag in @option{flags} is enabled. The value is clipped
  643. in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
  644. to get a value in the native libtheora range [0-63]. A higher value
  645. corresponds to a higher quality.
  646. For example, to set maximum constant quality encoding with
  647. @command{ffmpeg}:
  648. @example
  649. ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
  650. @end example
  651. @end table
  652. @section libvpx
  653. VP8 format supported through libvpx.
  654. Requires the presence of the libvpx headers and library during configuration.
  655. You need to explicitly configure the build with @code{--enable-libvpx}.
  656. @subsection Options
  657. Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
  658. @table @option
  659. @item threads
  660. g_threads
  661. @item profile
  662. g_profile
  663. @item vb
  664. rc_target_bitrate
  665. @item g
  666. kf_max_dist
  667. @item keyint_min
  668. kf_min_dist
  669. @item qmin
  670. rc_min_quantizer
  671. @item qmax
  672. rc_max_quantizer
  673. @item bufsize, vb
  674. rc_buf_sz
  675. @code{(bufsize * 1000 / vb)}
  676. rc_buf_optimal_sz
  677. @code{(bufsize * 1000 / vb * 5 / 6)}
  678. @item rc_init_occupancy, vb
  679. rc_buf_initial_sz
  680. @code{(rc_init_occupancy * 1000 / vb)}
  681. @item rc_buffer_aggressivity
  682. rc_undershoot_pct
  683. @item skip_threshold
  684. rc_dropframe_thresh
  685. @item qcomp
  686. rc_2pass_vbr_bias_pct
  687. @item maxrate, vb
  688. rc_2pass_vbr_maxsection_pct
  689. @code{(maxrate * 100 / vb)}
  690. @item minrate, vb
  691. rc_2pass_vbr_minsection_pct
  692. @code{(minrate * 100 / vb)}
  693. @item minrate, maxrate, vb
  694. @code{VPX_CBR}
  695. @code{(minrate == maxrate == vb)}
  696. @item crf
  697. @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
  698. @item quality
  699. @table @option
  700. @item @var{best}
  701. @code{VPX_DL_BEST_QUALITY}
  702. @item @var{good}
  703. @code{VPX_DL_GOOD_QUALITY}
  704. @item @var{realtime}
  705. @code{VPX_DL_REALTIME}
  706. @end table
  707. @item speed
  708. @code{VP8E_SET_CPUUSED}
  709. @item nr
  710. @code{VP8E_SET_NOISE_SENSITIVITY}
  711. @item mb_threshold
  712. @code{VP8E_SET_STATIC_THRESHOLD}
  713. @item slices
  714. @code{VP8E_SET_TOKEN_PARTITIONS}
  715. @item max-intra-rate
  716. @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
  717. @item force_key_frames
  718. @code{VPX_EFLAG_FORCE_KF}
  719. @item Alternate reference frame related
  720. @table @option
  721. @item vp8flags altref
  722. @code{VP8E_SET_ENABLEAUTOALTREF}
  723. @item @var{arnr_max_frames}
  724. @code{VP8E_SET_ARNR_MAXFRAMES}
  725. @item @var{arnr_type}
  726. @code{VP8E_SET_ARNR_TYPE}
  727. @item @var{arnr_strength}
  728. @code{VP8E_SET_ARNR_STRENGTH}
  729. @item @var{rc_lookahead}
  730. g_lag_in_frames
  731. @end table
  732. @item vp8flags error_resilient
  733. g_error_resilient
  734. @end table
  735. For more information about libvpx see:
  736. @url{http://www.webmproject.org/}
  737. @section libx264
  738. H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
  739. libx264.
  740. Requires the presence of the libx264 headers and library during
  741. configuration. You need to explicitly configure the build with
  742. @code{--enable-libx264}.
  743. @subsection Options
  744. @table @option
  745. @item preset @var{preset_name}
  746. Set the encoding preset.
  747. @item tune @var{tune_name}
  748. Tune the encoding params.
  749. @item fastfirstpass @var{bool}
  750. Use fast settings when encoding first pass, default value is 1.
  751. @item profile @var{profile_name}
  752. Set profile restrictions.
  753. @item level @var{level}
  754. Specify level (as defined by Annex A).
  755. Deprecated in favor of @var{x264opts}.
  756. @item passlogfile @var{filename}
  757. Specify filename for 2 pass stats.
  758. Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
  759. @item wpredp @var{wpred_type}
  760. Specify Weighted prediction for P-frames.
  761. Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
  762. @item x264opts @var{options}
  763. Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
  764. @var{options} is a list of @var{key}=@var{value} couples separated by
  765. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  766. themselves, use "," instead. They accept it as well since long ago but this
  767. is kept undocumented for some reason.
  768. @end table
  769. For example to specify libx264 encoding options with @command{ffmpeg}:
  770. @example
  771. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  772. @end example
  773. For more information about libx264 and the supported options see:
  774. @url{http://www.videolan.org/developers/x264.html}
  775. @section libxvid
  776. Xvid MPEG-4 Part 2 encoder wrapper.
  777. This encoder requires the presence of the libxvidcore headers and library
  778. during configuration. You need to explicitly configure the build with
  779. @code{--enable-libxvid --enable-gpl}.
  780. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  781. users can encode to this format without this library.
  782. @subsection Options
  783. The following options are supported by the libxvid wrapper. Some of
  784. the following options are listed but are not documented, and
  785. correspond to shared codec options. See @ref{codec-options,,the Codec
  786. Options chapter} for their documentation. The other shared options
  787. which are not listed have no effect for the libxvid encoder.
  788. @table @option
  789. @item b
  790. @item g
  791. @item qmin
  792. @item qmax
  793. @item mpeg_quant
  794. @item threads
  795. @item bf
  796. @item b_qfactor
  797. @item b_qoffset
  798. @item flags
  799. Set specific encoding flags. Possible values:
  800. @table @samp
  801. @item mv4
  802. Use four motion vector by macroblock.
  803. @item aic
  804. Enable high quality AC prediction.
  805. @item gray
  806. Only encode grayscale.
  807. @item gmc
  808. Enable the use of global motion compensation (GMC).
  809. @item qpel
  810. Enable quarter-pixel motion compensation.
  811. @item cgop
  812. Enable closed GOP.
  813. @item global_header
  814. Place global headers in extradata instead of every keyframe.
  815. @end table
  816. @item trellis
  817. @item me_method
  818. Set motion estimation method. Possible values in decreasing order of
  819. speed and increasing order of quality:
  820. @table @samp
  821. @item zero
  822. Use no motion estimation (default).
  823. @item phods
  824. @item x1
  825. @item log
  826. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  827. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  828. @samp{phods}.
  829. @item epzs
  830. Enable all of the things described above, plus advanced diamond zonal
  831. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  832. estimation on chroma planes.
  833. @item full
  834. Enable all of the things described above, plus extended 16x16 and 8x8
  835. blocks search.
  836. @end table
  837. @item mbd
  838. Set macroblock decision algorithm. Possible values in the increasing
  839. order of quality:
  840. @table @samp
  841. @item simple
  842. Use macroblock comparing function algorithm (default).
  843. @item bits
  844. Enable rate distortion-based half pixel and quarter pixel refinement for
  845. 16x16 blocks.
  846. @item rd
  847. Enable all of the things described above, plus rate distortion-based
  848. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  849. distortion-based search using square pattern.
  850. @end table
  851. @end table
  852. @c man end VIDEO ENCODERS