encoders.texi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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. A description of some of the currently available encoders follows.
  16. @section Audio Encoders
  17. @subsection ac3 and ac3_fixed
  18. AC-3 audio encoders.
  19. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  20. the undocumented RealAudio 3 (a.k.a. dnet).
  21. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  22. encoder only uses fixed-point integer math. This does not mean that one is
  23. always faster, just that one or the other may be better suited to a
  24. particular system. The floating-point encoder will generally produce better
  25. quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
  26. default codec for any of the output formats, so it must be specified explicitly
  27. using the option @code{-acodec ac3_fixed} in order to use it.
  28. @subheading AC-3 Metadata
  29. The AC-3 metadata options are used to set parameters that describe the audio,
  30. but in most cases do not affect the audio encoding itself. Some of the options
  31. do directly affect or influence the decoding and playback of the resulting
  32. bitstream, while others are just for informational purposes. A few of the
  33. options will add bits to the output stream that could otherwise be used for
  34. audio data, and will thus affect the quality of the output. Those will be
  35. indicated accordingly with a note in the option list below.
  36. These parameters are described in detail in several publicly-available
  37. documents.
  38. @itemize
  39. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  40. @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}
  41. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  42. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  43. @end itemize
  44. @subsubheading Metadata Control Options
  45. @table @option
  46. @item -per_frame_metadata @var{boolean}
  47. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  48. metadata for each frame.
  49. @table @option
  50. @item 0
  51. The metadata values set at initialization will be used for every frame in the
  52. stream. (default)
  53. @item 1
  54. Metadata values can be changed before encoding each frame.
  55. @end table
  56. @end table
  57. @subsubheading Downmix Levels
  58. @table @option
  59. @item -center_mixlev @var{level}
  60. Center Mix Level. The amount of gain the decoder should apply to the center
  61. channel when downmixing to stereo. This field will only be written to the
  62. bitstream if a center channel is present. The value is specified as a scale
  63. factor. There are 3 valid values:
  64. @table @option
  65. @item 0.707
  66. Apply -3dB gain
  67. @item 0.595
  68. Apply -4.5dB gain (default)
  69. @item 0.500
  70. Apply -6dB gain
  71. @end table
  72. @item -surround_mixlev @var{level}
  73. Surround Mix Level. The amount of gain the decoder should apply to the surround
  74. channel(s) when downmixing to stereo. This field will only be written to the
  75. bitstream if one or more surround channels are present. The value is specified
  76. as a scale factor. There are 3 valid values:
  77. @table @option
  78. @item 0.707
  79. Apply -3dB gain
  80. @item 0.500
  81. Apply -6dB gain (default)
  82. @item 0.000
  83. Silence Surround Channel(s)
  84. @end table
  85. @end table
  86. @subsubheading Audio Production Information
  87. Audio Production Information is optional information describing the mixing
  88. environment. Either none or both of the fields are written to the bitstream.
  89. @table @option
  90. @item -mixing_level @var{number}
  91. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  92. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  93. unknown or not indicated. The default value is -1, but that value cannot be
  94. used if the Audio Production Information is written to the bitstream. Therefore,
  95. if the @code{room_type} option is not the default value, the @code{mixing_level}
  96. option must not be -1.
  97. @item -room_type @var{type}
  98. Room Type. Describes the equalization used during the final mixing session at
  99. the studio or on the dubbing stage. A large room is a dubbing stage with the
  100. industry standard X-curve equalization; a small room has flat equalization.
  101. This field will not be written to the bitstream if both the @code{mixing_level}
  102. option and the @code{room_type} option have the default values.
  103. @table @option
  104. @item 0
  105. @itemx notindicated
  106. Not Indicated (default)
  107. @item 1
  108. @itemx large
  109. Large Room
  110. @item 2
  111. @itemx small
  112. Small Room
  113. @end table
  114. @end table
  115. @subsubheading Other Metadata Options
  116. @table @option
  117. @item -copyright @var{boolean}
  118. Copyright Indicator. Specifies whether a copyright exists for this audio.
  119. @table @option
  120. @item 0
  121. @itemx off
  122. No Copyright Exists (default)
  123. @item 1
  124. @itemx on
  125. Copyright Exists
  126. @end table
  127. @item -dialnorm @var{value}
  128. Dialogue Normalization. Indicates how far the average dialogue level of the
  129. program is below digital 100% full scale (0 dBFS). This parameter determines a
  130. level shift during audio reproduction that sets the average volume of the
  131. dialogue to a preset level. The goal is to match volume level between program
  132. sources. A value of -31dB will result in no volume level change, relative to
  133. the source volume, during audio reproduction. Valid values are whole numbers in
  134. the range -31 to -1, with -31 being the default.
  135. @item -dsur_mode @var{mode}
  136. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  137. (Pro Logic). This field will only be written to the bitstream if the audio
  138. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  139. apply Dolby Surround processing.
  140. @table @option
  141. @item 0
  142. @itemx notindicated
  143. Not Indicated (default)
  144. @item 1
  145. @itemx off
  146. Not Dolby Surround Encoded
  147. @item 2
  148. @itemx on
  149. Dolby Surround Encoded
  150. @end table
  151. @item -original @var{boolean}
  152. Original Bit Stream Indicator. Specifies whether this audio is from the
  153. original source and not a copy.
  154. @table @option
  155. @item 0
  156. @itemx off
  157. Not Original Source
  158. @item 1
  159. @itemx on
  160. Original Source (default)
  161. @end table
  162. @end table
  163. @subsubheading Extended Bitstream Information
  164. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  165. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  166. If any one parameter in a group is specified, all values in that group will be
  167. written to the bitstream. Default values are used for those that are written
  168. but have not been specified. If the mixing levels are written, the decoder
  169. will use these values instead of the ones specified in the @code{center_mixlev}
  170. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  171. Syntax.
  172. @subsubheading Extended Bitstream Information - Part 1
  173. @table @option
  174. @item -dmix_mode @var{mode}
  175. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  176. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  177. @table @option
  178. @item 0
  179. @itemx notindicated
  180. Not Indicated (default)
  181. @item 1
  182. @itemx ltrt
  183. Lt/Rt Downmix Preferred
  184. @item 2
  185. @itemx loro
  186. Lo/Ro Downmix Preferred
  187. @end table
  188. @item -ltrt_cmixlev @var{level}
  189. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  190. center channel when downmixing to stereo in Lt/Rt mode.
  191. @table @option
  192. @item 1.414
  193. Apply +3dB gain
  194. @item 1.189
  195. Apply +1.5dB gain
  196. @item 1.000
  197. Apply 0dB gain
  198. @item 0.841
  199. Apply -1.5dB gain
  200. @item 0.707
  201. Apply -3.0dB gain
  202. @item 0.595
  203. Apply -4.5dB gain (default)
  204. @item 0.500
  205. Apply -6.0dB gain
  206. @item 0.000
  207. Silence Center Channel
  208. @end table
  209. @item -ltrt_surmixlev @var{level}
  210. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  211. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  212. @table @option
  213. @item 0.841
  214. Apply -1.5dB gain
  215. @item 0.707
  216. Apply -3.0dB gain
  217. @item 0.595
  218. Apply -4.5dB gain
  219. @item 0.500
  220. Apply -6.0dB gain (default)
  221. @item 0.000
  222. Silence Surround Channel(s)
  223. @end table
  224. @item -loro_cmixlev @var{level}
  225. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  226. center channel when downmixing to stereo in Lo/Ro mode.
  227. @table @option
  228. @item 1.414
  229. Apply +3dB gain
  230. @item 1.189
  231. Apply +1.5dB gain
  232. @item 1.000
  233. Apply 0dB gain
  234. @item 0.841
  235. Apply -1.5dB gain
  236. @item 0.707
  237. Apply -3.0dB gain
  238. @item 0.595
  239. Apply -4.5dB gain (default)
  240. @item 0.500
  241. Apply -6.0dB gain
  242. @item 0.000
  243. Silence Center Channel
  244. @end table
  245. @item -loro_surmixlev @var{level}
  246. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  247. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  248. @table @option
  249. @item 0.841
  250. Apply -1.5dB gain
  251. @item 0.707
  252. Apply -3.0dB gain
  253. @item 0.595
  254. Apply -4.5dB gain
  255. @item 0.500
  256. Apply -6.0dB gain (default)
  257. @item 0.000
  258. Silence Surround Channel(s)
  259. @end table
  260. @end table
  261. @subsubheading Extended Bitstream Information - Part 2
  262. @table @option
  263. @item -dsurex_mode @var{mode}
  264. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  265. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  266. apply Dolby Surround EX processing.
  267. @table @option
  268. @item 0
  269. @itemx notindicated
  270. Not Indicated (default)
  271. @item 1
  272. @itemx on
  273. Dolby Surround EX On
  274. @item 2
  275. @itemx off
  276. Dolby Surround EX Off
  277. @end table
  278. @item -dheadphone_mode @var{mode}
  279. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  280. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  281. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  282. processing.
  283. @table @option
  284. @item 0
  285. @itemx notindicated
  286. Not Indicated (default)
  287. @item 1
  288. @itemx on
  289. Dolby Headphone On
  290. @item 2
  291. @itemx off
  292. Dolby Headphone Off
  293. @end table
  294. @item -ad_conv_type @var{type}
  295. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  296. conversion.
  297. @table @option
  298. @item 0
  299. @itemx standard
  300. Standard A/D Converter (default)
  301. @item 1
  302. @itemx hdcd
  303. HDCD A/D Converter
  304. @end table
  305. @end table
  306. @subheading Other AC-3 Encoding Options
  307. @table @option
  308. @item -stereo_rematrixing @var{boolean}
  309. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  310. is an optional AC-3 feature that increases quality by selectively encoding
  311. the left/right channels as mid/side. This option is enabled by default, and it
  312. is highly recommended that it be left as enabled except for testing purposes.
  313. @end table
  314. @c man end ENCODERS