encoders.texi 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613
  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{-encoders} 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 the default AAC encoder, natively implemented into FFmpeg. Its
  24. quality is on par or better than libfdk_aac at the default bitrate of 128kbps.
  25. This encoder also implements more options, profiles and samplerates than
  26. other encoders (with only the AAC-HE profile pending to be implemented) so this
  27. encoder has become the default and is the recommended choice.
  28. @subsection Options
  29. @table @option
  30. @item b
  31. Set bit rate in bits/s. Setting this automatically activates constant bit rate
  32. (CBR) mode. If this option is unspecified it is set to 128kbps.
  33. @item q
  34. Set quality for variable bit rate (VBR) mode. This option is valid only using
  35. the @command{ffmpeg} command-line tool. For library interface users, use
  36. @option{global_quality}.
  37. @item cutoff
  38. Set cutoff frequency. If unspecified will allow the encoder to dynamically
  39. adjust the cutoff to improve clarity on low bitrates.
  40. @item aac_coder
  41. Set AAC encoder coding method. Possible values:
  42. @table @samp
  43. @item twoloop
  44. Two loop searching (TLS) method.
  45. This method first sets quantizers depending on band thresholds and then tries
  46. to find an optimal combination by adding or subtracting a specific value from
  47. all quantizers and adjusting some individual quantizer a little.
  48. Will tune itself based on whether aac_is/aac_ms/aac_pns are enabled.
  49. This is the default choice for a coder.
  50. @item anmr
  51. Average noise to mask ratio (ANMR) trellis-based solution.
  52. This is an experimental coder which currently produces a lower quality, is more
  53. unstable and is slower than the default twoloop coder but has potential.
  54. Currently has no support for the @option{aac_is} or @option{aac_pns} options.
  55. Not currently recommended.
  56. @item fast
  57. Constant quantizer method.
  58. This method sets a constant quantizer for all bands. This is the fastest of all
  59. the methods and has no rate control or support for @option{aac_is} or
  60. @option{aac_pns}.
  61. Not recommended.
  62. @end table
  63. @item aac_ms
  64. Sets mid/side coding mode. The default value of auto will automatically use
  65. M/S with bands which will benefit from such coding. Can be forced for all bands
  66. using the value "enable", which is mainly useful for debugging or disabled using
  67. "disable".
  68. @item aac_is
  69. Sets intensity stereo coding tool usage. By default, it's enabled and will
  70. automatically toggle IS for similar pairs of stereo bands if it's benefitial.
  71. Can be disabled for debugging by setting the value to "disable".
  72. @item aac_pns
  73. Uses perceptual noise substitution to replace low entropy high frequency bands
  74. with imperceivable white noise during the decoding process. By default, it's
  75. enabled, but can be disabled for debugging purposes by using "disable".
  76. @item aac_tns
  77. Enables the use of a multitap FIR filter which spans through the high frequency
  78. bands to hide quantization noise during the encoding process and is reverted
  79. by the decoder. As well as decreasing unpleasant artifacts in the high range
  80. this also reduces the entropy in the high bands and allows for more bits to
  81. be used by the mid-low bands. By default it's enabled but can be disabled for
  82. debugging by setting the option to "disable".
  83. @item aac_ltp
  84. Enables the use of the long term prediction extension which increases coding
  85. efficiency in very low bandwidth situations such as encoding of voice or
  86. solo piano music by extending constant harmonic peaks in bands throughout
  87. frames. This option is implied by profile:a aac_low and is incompatible with
  88. aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
  89. @item aac_pred
  90. Enables the use of a more traditional style of prediction where the spectral
  91. coefficients transmitted are replaced by the difference of the current
  92. coefficients minus the previous "predicted" coefficients. In theory and sometimes
  93. in practice this can improve quality for low to mid bitrate audio.
  94. This option implies the aac_main profile and is incompatible with aac_ltp.
  95. @item profile
  96. Sets the encoding profile, possible values:
  97. @table @samp
  98. @item aac_low
  99. The default, AAC "Low-complexity" profile. Is the most compatible and produces
  100. decent quality.
  101. @item mpeg2_aac_low
  102. Equivalent to -profile:a aac_low -aac_pns 0. PNS was introduced with the MPEG4
  103. specifications.
  104. @item aac_ltp
  105. Long term prediction profile, is enabled by and will enable the aac_ltp option.
  106. Introduced in MPEG4.
  107. @item aac_main
  108. Main-type prediction profile, is enabled by and will enable the aac_pred option.
  109. Introduced in MPEG2.
  110. If this option is unspecified it is set to @samp{aac_low}.
  111. @end table
  112. @end table
  113. @section ac3 and ac3_fixed
  114. AC-3 audio encoders.
  115. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  116. the undocumented RealAudio 3 (a.k.a. dnet).
  117. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  118. encoder only uses fixed-point integer math. This does not mean that one is
  119. always faster, just that one or the other may be better suited to a
  120. particular system. The floating-point encoder will generally produce better
  121. quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
  122. default codec for any of the output formats, so it must be specified explicitly
  123. using the option @code{-acodec ac3_fixed} in order to use it.
  124. @subsection AC-3 Metadata
  125. The AC-3 metadata options are used to set parameters that describe the audio,
  126. but in most cases do not affect the audio encoding itself. Some of the options
  127. do directly affect or influence the decoding and playback of the resulting
  128. bitstream, while others are just for informational purposes. A few of the
  129. options will add bits to the output stream that could otherwise be used for
  130. audio data, and will thus affect the quality of the output. Those will be
  131. indicated accordingly with a note in the option list below.
  132. These parameters are described in detail in several publicly-available
  133. documents.
  134. @itemize
  135. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  136. @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}
  137. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  138. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  139. @end itemize
  140. @subsubsection Metadata Control Options
  141. @table @option
  142. @item -per_frame_metadata @var{boolean}
  143. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  144. metadata for each frame.
  145. @table @option
  146. @item 0
  147. The metadata values set at initialization will be used for every frame in the
  148. stream. (default)
  149. @item 1
  150. Metadata values can be changed before encoding each frame.
  151. @end table
  152. @end table
  153. @subsubsection Downmix Levels
  154. @table @option
  155. @item -center_mixlev @var{level}
  156. Center Mix Level. The amount of gain the decoder should apply to the center
  157. channel when downmixing to stereo. This field will only be written to the
  158. bitstream if a center channel is present. The value is specified as a scale
  159. factor. There are 3 valid values:
  160. @table @option
  161. @item 0.707
  162. Apply -3dB gain
  163. @item 0.595
  164. Apply -4.5dB gain (default)
  165. @item 0.500
  166. Apply -6dB gain
  167. @end table
  168. @item -surround_mixlev @var{level}
  169. Surround Mix Level. The amount of gain the decoder should apply to the surround
  170. channel(s) when downmixing to stereo. This field will only be written to the
  171. bitstream if one or more surround channels are present. The value is specified
  172. as a scale factor. There are 3 valid values:
  173. @table @option
  174. @item 0.707
  175. Apply -3dB gain
  176. @item 0.500
  177. Apply -6dB gain (default)
  178. @item 0.000
  179. Silence Surround Channel(s)
  180. @end table
  181. @end table
  182. @subsubsection Audio Production Information
  183. Audio Production Information is optional information describing the mixing
  184. environment. Either none or both of the fields are written to the bitstream.
  185. @table @option
  186. @item -mixing_level @var{number}
  187. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  188. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  189. unknown or not indicated. The default value is -1, but that value cannot be
  190. used if the Audio Production Information is written to the bitstream. Therefore,
  191. if the @code{room_type} option is not the default value, the @code{mixing_level}
  192. option must not be -1.
  193. @item -room_type @var{type}
  194. Room Type. Describes the equalization used during the final mixing session at
  195. the studio or on the dubbing stage. A large room is a dubbing stage with the
  196. industry standard X-curve equalization; a small room has flat equalization.
  197. This field will not be written to the bitstream if both the @code{mixing_level}
  198. option and the @code{room_type} option have the default values.
  199. @table @option
  200. @item 0
  201. @itemx notindicated
  202. Not Indicated (default)
  203. @item 1
  204. @itemx large
  205. Large Room
  206. @item 2
  207. @itemx small
  208. Small Room
  209. @end table
  210. @end table
  211. @subsubsection Other Metadata Options
  212. @table @option
  213. @item -copyright @var{boolean}
  214. Copyright Indicator. Specifies whether a copyright exists for this audio.
  215. @table @option
  216. @item 0
  217. @itemx off
  218. No Copyright Exists (default)
  219. @item 1
  220. @itemx on
  221. Copyright Exists
  222. @end table
  223. @item -dialnorm @var{value}
  224. Dialogue Normalization. Indicates how far the average dialogue level of the
  225. program is below digital 100% full scale (0 dBFS). This parameter determines a
  226. level shift during audio reproduction that sets the average volume of the
  227. dialogue to a preset level. The goal is to match volume level between program
  228. sources. A value of -31dB will result in no volume level change, relative to
  229. the source volume, during audio reproduction. Valid values are whole numbers in
  230. the range -31 to -1, with -31 being the default.
  231. @item -dsur_mode @var{mode}
  232. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  233. (Pro Logic). This field will only be written to the bitstream if the audio
  234. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  235. apply Dolby Surround processing.
  236. @table @option
  237. @item 0
  238. @itemx notindicated
  239. Not Indicated (default)
  240. @item 1
  241. @itemx off
  242. Not Dolby Surround Encoded
  243. @item 2
  244. @itemx on
  245. Dolby Surround Encoded
  246. @end table
  247. @item -original @var{boolean}
  248. Original Bit Stream Indicator. Specifies whether this audio is from the
  249. original source and not a copy.
  250. @table @option
  251. @item 0
  252. @itemx off
  253. Not Original Source
  254. @item 1
  255. @itemx on
  256. Original Source (default)
  257. @end table
  258. @end table
  259. @subsection Extended Bitstream Information
  260. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  261. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  262. If any one parameter in a group is specified, all values in that group will be
  263. written to the bitstream. Default values are used for those that are written
  264. but have not been specified. If the mixing levels are written, the decoder
  265. will use these values instead of the ones specified in the @code{center_mixlev}
  266. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  267. Syntax.
  268. @subsubsection Extended Bitstream Information - Part 1
  269. @table @option
  270. @item -dmix_mode @var{mode}
  271. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  272. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  273. @table @option
  274. @item 0
  275. @itemx notindicated
  276. Not Indicated (default)
  277. @item 1
  278. @itemx ltrt
  279. Lt/Rt Downmix Preferred
  280. @item 2
  281. @itemx loro
  282. Lo/Ro Downmix Preferred
  283. @end table
  284. @item -ltrt_cmixlev @var{level}
  285. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  286. center channel when downmixing to stereo in Lt/Rt 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 -ltrt_surmixlev @var{level}
  306. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  307. surround channel(s) when downmixing to stereo in Lt/Rt 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. @item -loro_cmixlev @var{level}
  321. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  322. center channel when downmixing to stereo in Lo/Ro mode.
  323. @table @option
  324. @item 1.414
  325. Apply +3dB gain
  326. @item 1.189
  327. Apply +1.5dB gain
  328. @item 1.000
  329. Apply 0dB gain
  330. @item 0.841
  331. Apply -1.5dB gain
  332. @item 0.707
  333. Apply -3.0dB gain
  334. @item 0.595
  335. Apply -4.5dB gain (default)
  336. @item 0.500
  337. Apply -6.0dB gain
  338. @item 0.000
  339. Silence Center Channel
  340. @end table
  341. @item -loro_surmixlev @var{level}
  342. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  343. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  344. @table @option
  345. @item 0.841
  346. Apply -1.5dB gain
  347. @item 0.707
  348. Apply -3.0dB gain
  349. @item 0.595
  350. Apply -4.5dB gain
  351. @item 0.500
  352. Apply -6.0dB gain (default)
  353. @item 0.000
  354. Silence Surround Channel(s)
  355. @end table
  356. @end table
  357. @subsubsection Extended Bitstream Information - Part 2
  358. @table @option
  359. @item -dsurex_mode @var{mode}
  360. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  361. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  362. apply Dolby Surround EX processing.
  363. @table @option
  364. @item 0
  365. @itemx notindicated
  366. Not Indicated (default)
  367. @item 1
  368. @itemx on
  369. Dolby Surround EX Off
  370. @item 2
  371. @itemx off
  372. Dolby Surround EX On
  373. @end table
  374. @item -dheadphone_mode @var{mode}
  375. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  376. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  377. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  378. processing.
  379. @table @option
  380. @item 0
  381. @itemx notindicated
  382. Not Indicated (default)
  383. @item 1
  384. @itemx on
  385. Dolby Headphone Off
  386. @item 2
  387. @itemx off
  388. Dolby Headphone On
  389. @end table
  390. @item -ad_conv_type @var{type}
  391. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  392. conversion.
  393. @table @option
  394. @item 0
  395. @itemx standard
  396. Standard A/D Converter (default)
  397. @item 1
  398. @itemx hdcd
  399. HDCD A/D Converter
  400. @end table
  401. @end table
  402. @subsection Other AC-3 Encoding Options
  403. @table @option
  404. @item -stereo_rematrixing @var{boolean}
  405. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  406. is an optional AC-3 feature that increases quality by selectively encoding
  407. the left/right channels as mid/side. This option is enabled by default, and it
  408. is highly recommended that it be left as enabled except for testing purposes.
  409. @end table
  410. @subsection Floating-Point-Only AC-3 Encoding Options
  411. These options are only valid for the floating-point encoder and do not exist
  412. for the fixed-point encoder due to the corresponding features not being
  413. implemented in fixed-point.
  414. @table @option
  415. @item -channel_coupling @var{boolean}
  416. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  417. that increases quality by combining high frequency information from multiple
  418. channels into a single channel. The per-channel high frequency information is
  419. sent with less accuracy in both the frequency and time domains. This allows
  420. more bits to be used for lower frequencies while preserving enough information
  421. to reconstruct the high frequencies. This option is enabled by default for the
  422. floating-point encoder and should generally be left as enabled except for
  423. testing purposes or to increase encoding speed.
  424. @table @option
  425. @item -1
  426. @itemx auto
  427. Selected by Encoder (default)
  428. @item 0
  429. @itemx off
  430. Disable Channel Coupling
  431. @item 1
  432. @itemx on
  433. Enable Channel Coupling
  434. @end table
  435. @item -cpl_start_band @var{number}
  436. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  437. value higher than the bandwidth is used, it will be reduced to 1 less than the
  438. coupling end band. If @var{auto} is used, the start band will be determined by
  439. the encoder based on the bit rate, sample rate, and channel layout. This option
  440. has no effect if channel coupling is disabled.
  441. @table @option
  442. @item -1
  443. @itemx auto
  444. Selected by Encoder (default)
  445. @end table
  446. @end table
  447. @anchor{flac}
  448. @section flac
  449. FLAC (Free Lossless Audio Codec) Encoder
  450. @subsection Options
  451. The following options are supported by FFmpeg's flac encoder.
  452. @table @option
  453. @item compression_level
  454. Sets the compression level, which chooses defaults for many other options
  455. if they are not set explicitly.
  456. @item frame_size
  457. Sets the size of the frames in samples per channel.
  458. @item lpc_coeff_precision
  459. Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  460. default.
  461. @item lpc_type
  462. Sets the first stage LPC algorithm
  463. @table @samp
  464. @item none
  465. LPC is not used
  466. @item fixed
  467. fixed LPC coefficients
  468. @item levinson
  469. @item cholesky
  470. @end table
  471. @item lpc_passes
  472. Number of passes to use for Cholesky factorization during LPC analysis
  473. @item min_partition_order
  474. The minimum partition order
  475. @item max_partition_order
  476. The maximum partition order
  477. @item prediction_order_method
  478. @table @samp
  479. @item estimation
  480. @item 2level
  481. @item 4level
  482. @item 8level
  483. @item search
  484. Bruteforce search
  485. @item log
  486. @end table
  487. @item ch_mode
  488. Channel mode
  489. @table @samp
  490. @item auto
  491. The mode is chosen automatically for each frame
  492. @item indep
  493. Chanels are independently coded
  494. @item left_side
  495. @item right_side
  496. @item mid_side
  497. @end table
  498. @item exact_rice_parameters
  499. Chooses if rice parameters are calculated exactly or approximately.
  500. if set to 1 then they are chosen exactly, which slows the code down slightly and
  501. improves compression slightly.
  502. @item multi_dim_quant
  503. Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  504. applied after the first stage to finetune the coefficients. This is quite slow
  505. and slightly improves compression.
  506. @end table
  507. @anchor{libfaac}
  508. @section libfaac
  509. libfaac AAC (Advanced Audio Coding) encoder wrapper.
  510. This encoder is of much lower quality and is more unstable than any other AAC
  511. encoders, so it's highly recommended to instead use other encoders, like
  512. @ref{aacenc,,the native FFmpeg AAC encoder}.
  513. This encoder also requires the presence of the libfaac headers and library
  514. during configuration. You need to explicitly configure the build with
  515. @code{--enable-libfaac --enable-nonfree}.
  516. @subsection Options
  517. The following shared FFmpeg codec options are recognized.
  518. The following options are supported by the libfaac wrapper. The
  519. @command{faac}-equivalent of the options are listed in parentheses.
  520. @table @option
  521. @item b (@emph{-b})
  522. Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
  523. is not explicitly specified, it is automatically set to a suitable
  524. value depending on the selected profile. @command{faac} bitrate is
  525. expressed in kilobits/s.
  526. Note that libfaac does not support CBR (Constant Bit Rate) but only
  527. ABR (Average Bit Rate).
  528. If VBR mode is enabled this option is ignored.
  529. @item ar (@emph{-R})
  530. Set audio sampling rate (in Hz).
  531. @item ac (@emph{-c})
  532. Set the number of audio channels.
  533. @item cutoff (@emph{-C})
  534. Set cutoff frequency. If not specified (or explicitly set to 0) it
  535. will use a value automatically computed by the library. Default value
  536. is 0.
  537. @item profile
  538. Set audio profile.
  539. The following profiles are recognized:
  540. @table @samp
  541. @item aac_main
  542. Main AAC (Main)
  543. @item aac_low
  544. Low Complexity AAC (LC)
  545. @item aac_ssr
  546. Scalable Sample Rate (SSR)
  547. @item aac_ltp
  548. Long Term Prediction (LTP)
  549. @end table
  550. If not specified it is set to @samp{aac_low}.
  551. @item flags +qscale
  552. Set constant quality VBR (Variable Bit Rate) mode.
  553. @item global_quality
  554. Set quality in VBR mode as an integer number of lambda units.
  555. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  556. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  557. and used to set the quality value used by libfaac. A reasonable range
  558. for the option value in QP units is [10-500], the higher the value the
  559. higher the quality.
  560. @item q (@emph{-q})
  561. Enable VBR mode when set to a non-negative value, and set constant
  562. quality value as a double floating point value in QP units.
  563. The value sets the quality value used by libfaac. A reasonable range
  564. for the option value is [10-500], the higher the value the higher the
  565. quality.
  566. This option is valid only using the @command{ffmpeg} command-line
  567. tool. For library interface users, use @option{global_quality}.
  568. @end table
  569. @subsection Examples
  570. @itemize
  571. @item
  572. Use @command{ffmpeg} to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
  573. container:
  574. @example
  575. ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
  576. @end example
  577. @item
  578. Use @command{ffmpeg} to convert an audio file to VBR AAC, using the
  579. LTP AAC profile:
  580. @example
  581. ffmpeg -i input.wav -c:a libfaac -profile:a aac_ltp -q:a 100 output.m4a
  582. @end example
  583. @end itemize
  584. @anchor{libfdk-aac-enc}
  585. @section libfdk_aac
  586. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  587. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  588. the Android project.
  589. Requires the presence of the libfdk-aac headers and library during
  590. configuration. You need to explicitly configure the build with
  591. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  592. so if you allow the use of GPL, you should configure with
  593. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  594. This encoder is considered to produce output on par or worse at 128kbps to the
  595. @ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better
  596. sounding audio at identical or lower bitrates and has support for the
  597. AAC-HE profiles.
  598. VBR encoding, enabled through the @option{vbr} or @option{flags
  599. +qscale} options, is experimental and only works with some
  600. combinations of parameters.
  601. Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  602. higher.
  603. For more information see the fdk-aac project at
  604. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  605. @subsection Options
  606. The following options are mapped on the shared FFmpeg codec options.
  607. @table @option
  608. @item b
  609. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  610. is automatically set to a suitable value depending on the selected
  611. profile.
  612. In case VBR mode is enabled the option is ignored.
  613. @item ar
  614. Set audio sampling rate (in Hz).
  615. @item channels
  616. Set the number of audio channels.
  617. @item flags +qscale
  618. Enable fixed quality, VBR (Variable Bit Rate) mode.
  619. Note that VBR is implicitly enabled when the @option{vbr} value is
  620. positive.
  621. @item cutoff
  622. Set cutoff frequency. If not specified (or explicitly set to 0) it
  623. will use a value automatically computed by the library. Default value
  624. is 0.
  625. @item profile
  626. Set audio profile.
  627. The following profiles are recognized:
  628. @table @samp
  629. @item aac_low
  630. Low Complexity AAC (LC)
  631. @item aac_he
  632. High Efficiency AAC (HE-AAC)
  633. @item aac_he_v2
  634. High Efficiency AAC version 2 (HE-AACv2)
  635. @item aac_ld
  636. Low Delay AAC (LD)
  637. @item aac_eld
  638. Enhanced Low Delay AAC (ELD)
  639. @end table
  640. If not specified it is set to @samp{aac_low}.
  641. @end table
  642. The following are private options of the libfdk_aac encoder.
  643. @table @option
  644. @item afterburner
  645. Enable afterburner feature if set to 1, disabled if set to 0. This
  646. improves the quality but also the required processing power.
  647. Default value is 1.
  648. @item eld_sbr
  649. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  650. if set to 0.
  651. Default value is 0.
  652. @item signaling
  653. Set SBR/PS signaling style.
  654. It can assume one of the following values:
  655. @table @samp
  656. @item default
  657. choose signaling implicitly (explicit hierarchical by default,
  658. implicit if global header is disabled)
  659. @item implicit
  660. implicit backwards compatible signaling
  661. @item explicit_sbr
  662. explicit SBR, implicit PS signaling
  663. @item explicit_hierarchical
  664. explicit hierarchical signaling
  665. @end table
  666. Default value is @samp{default}.
  667. @item latm
  668. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  669. Default value is 0.
  670. @item header_period
  671. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  672. in-band configuration buffers within LATM/LOAS transport layer.
  673. Must be a 16-bits non-negative integer.
  674. Default value is 0.
  675. @item vbr
  676. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  677. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  678. (Constant Bit Rate) is enabled.
  679. Currently only the @samp{aac_low} profile supports VBR encoding.
  680. VBR modes 1-5 correspond to roughly the following average bit rates:
  681. @table @samp
  682. @item 1
  683. 32 kbps/channel
  684. @item 2
  685. 40 kbps/channel
  686. @item 3
  687. 48-56 kbps/channel
  688. @item 4
  689. 64 kbps/channel
  690. @item 5
  691. about 80-96 kbps/channel
  692. @end table
  693. Default value is 0.
  694. @end table
  695. @subsection Examples
  696. @itemize
  697. @item
  698. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  699. container:
  700. @example
  701. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  702. @end example
  703. @item
  704. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  705. High-Efficiency AAC profile:
  706. @example
  707. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  708. @end example
  709. @end itemize
  710. @anchor{libmp3lame}
  711. @section libmp3lame
  712. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  713. Requires the presence of the libmp3lame headers and library during
  714. configuration. You need to explicitly configure the build with
  715. @code{--enable-libmp3lame}.
  716. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  717. lower quality.
  718. @subsection Options
  719. The following options are supported by the libmp3lame wrapper. The
  720. @command{lame}-equivalent of the options are listed in parentheses.
  721. @table @option
  722. @item b (@emph{-b})
  723. Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
  724. expressed in kilobits/s.
  725. @item q (@emph{-V})
  726. Set constant quality setting for VBR. This option is valid only
  727. using the @command{ffmpeg} command-line tool. For library interface
  728. users, use @option{global_quality}.
  729. @item compression_level (@emph{-q})
  730. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  731. with 0 meaning highest quality but slowest, and 9 meaning fastest
  732. while producing the worst quality.
  733. @item reservoir
  734. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  735. has this enabled by default, but can be overridden by use
  736. @option{--nores} option.
  737. @item joint_stereo (@emph{-m j})
  738. Enable the encoder to use (on a frame by frame basis) either L/R
  739. stereo or mid/side stereo. Default value is 1.
  740. @item abr (@emph{--abr})
  741. Enable the encoder to use ABR when set to 1. The @command{lame}
  742. @option{--abr} sets the target bitrate, while this options only
  743. tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
  744. @end table
  745. @section libopencore-amrnb
  746. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  747. Requires the presence of the libopencore-amrnb headers and library during
  748. configuration. You need to explicitly configure the build with
  749. @code{--enable-libopencore-amrnb --enable-version3}.
  750. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  751. but you can override it by setting @option{strict} to @samp{unofficial} or
  752. lower.
  753. @subsection Options
  754. @table @option
  755. @item b
  756. Set bitrate in bits per second. Only the following bitrates are supported,
  757. otherwise libavcodec will round to the nearest valid bitrate.
  758. @table @option
  759. @item 4750
  760. @item 5150
  761. @item 5900
  762. @item 6700
  763. @item 7400
  764. @item 7950
  765. @item 10200
  766. @item 12200
  767. @end table
  768. @item dtx
  769. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  770. default value is 0 (disabled).
  771. @end table
  772. @anchor{libshine}
  773. @section libshine
  774. Shine Fixed-Point MP3 encoder wrapper.
  775. Shine is a fixed-point MP3 encoder. It has a far better performance on
  776. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  777. However, as it is more targeted on performance than quality, it is not on par
  778. with LAME and other production-grade encoders quality-wise. Also, according to
  779. the project's homepage, this encoder may not be free of bugs as the code was
  780. written a long time ago and the project was dead for at least 5 years.
  781. This encoder only supports stereo and mono input. This is also CBR-only.
  782. The original project (last updated in early 2007) is at
  783. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  784. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  785. Requires the presence of the libshine headers and library during
  786. configuration. You need to explicitly configure the build with
  787. @code{--enable-libshine}.
  788. See also @ref{libmp3lame}.
  789. @subsection Options
  790. The following options are supported by the libshine wrapper. The
  791. @command{shineenc}-equivalent of the options are listed in parentheses.
  792. @table @option
  793. @item b (@emph{-b})
  794. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  795. is expressed in kilobits/s.
  796. @end table
  797. @section libtwolame
  798. TwoLAME MP2 encoder wrapper.
  799. Requires the presence of the libtwolame headers and library during
  800. configuration. You need to explicitly configure the build with
  801. @code{--enable-libtwolame}.
  802. @subsection Options
  803. The following options are supported by the libtwolame wrapper. The
  804. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  805. parentheses.
  806. @table @option
  807. @item b (@emph{-b})
  808. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  809. option is expressed in kilobits/s. Default value is 128k.
  810. @item q (@emph{-V})
  811. Set quality for experimental VBR support. Maximum value range is
  812. from -50 to 50, useful range is from -10 to 10. The higher the
  813. value, the better the quality. This option is valid only using the
  814. @command{ffmpeg} command-line tool. For library interface users,
  815. use @option{global_quality}.
  816. @item mode (@emph{--mode})
  817. Set the mode of the resulting audio. Possible values:
  818. @table @samp
  819. @item auto
  820. Choose mode automatically based on the input. This is the default.
  821. @item stereo
  822. Stereo
  823. @item joint_stereo
  824. Joint stereo
  825. @item dual_channel
  826. Dual channel
  827. @item mono
  828. Mono
  829. @end table
  830. @item psymodel (@emph{--psyc-mode})
  831. Set psychoacoustic model to use in encoding. The argument must be
  832. an integer between -1 and 4, inclusive. The higher the value, the
  833. better the quality. The default value is 3.
  834. @item energy_levels (@emph{--energy})
  835. Enable energy levels extensions when set to 1. The default value is
  836. 0 (disabled).
  837. @item error_protection (@emph{--protect})
  838. Enable CRC error protection when set to 1. The default value is 0
  839. (disabled).
  840. @item copyright (@emph{--copyright})
  841. Set MPEG audio copyright flag when set to 1. The default value is 0
  842. (disabled).
  843. @item original (@emph{--original})
  844. Set MPEG audio original flag when set to 1. The default value is 0
  845. (disabled).
  846. @end table
  847. @section libvo-amrwbenc
  848. VisualOn Adaptive Multi-Rate Wideband encoder.
  849. Requires the presence of the libvo-amrwbenc headers and library during
  850. configuration. You need to explicitly configure the build with
  851. @code{--enable-libvo-amrwbenc --enable-version3}.
  852. This is a mono-only encoder. Officially it only supports 16000Hz sample
  853. rate, but you can override it by setting @option{strict} to
  854. @samp{unofficial} or lower.
  855. @subsection Options
  856. @table @option
  857. @item b
  858. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  859. libavcodec will round to the nearest valid bitrate.
  860. @table @samp
  861. @item 6600
  862. @item 8850
  863. @item 12650
  864. @item 14250
  865. @item 15850
  866. @item 18250
  867. @item 19850
  868. @item 23050
  869. @item 23850
  870. @end table
  871. @item dtx
  872. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  873. default value is 0 (disabled).
  874. @end table
  875. @section libopus
  876. libopus Opus Interactive Audio Codec encoder wrapper.
  877. Requires the presence of the libopus headers and library during
  878. configuration. You need to explicitly configure the build with
  879. @code{--enable-libopus}.
  880. @subsection Option Mapping
  881. Most libopus options are modelled after the @command{opusenc} utility from
  882. opus-tools. The following is an option mapping chart describing options
  883. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  884. in parentheses.
  885. @table @option
  886. @item b (@emph{bitrate})
  887. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  888. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  889. kilobits/s.
  890. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  891. Set VBR mode. The FFmpeg @option{vbr} option has the following
  892. valid arguments, with the @command{opusenc} equivalent options
  893. in parentheses:
  894. @table @samp
  895. @item off (@emph{hard-cbr})
  896. Use constant bit rate encoding.
  897. @item on (@emph{vbr})
  898. Use variable bit rate encoding (the default).
  899. @item constrained (@emph{cvbr})
  900. Use constrained variable bit rate encoding.
  901. @end table
  902. @item compression_level (@emph{comp})
  903. Set encoding algorithm complexity. Valid options are integers in
  904. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  905. gives the highest quality but slowest encoding. The default is 10.
  906. @item frame_duration (@emph{framesize})
  907. Set maximum frame size, or duration of a frame in milliseconds. The
  908. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  909. frame sizes achieve lower latency but less quality at a given bitrate.
  910. Sizes greater than 20ms are only interesting at fairly low bitrates.
  911. The default is 20ms.
  912. @item packet_loss (@emph{expect-loss})
  913. Set expected packet loss percentage. The default is 0.
  914. @item application (N.A.)
  915. Set intended application type. Valid options are listed below:
  916. @table @samp
  917. @item voip
  918. Favor improved speech intelligibility.
  919. @item audio
  920. Favor faithfulness to the input (the default).
  921. @item lowdelay
  922. Restrict to only the lowest delay modes.
  923. @end table
  924. @item cutoff (N.A.)
  925. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  926. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  927. narrowband, mediumband, wideband, super wideband, and fullband
  928. respectively. The default is 0 (cutoff disabled).
  929. @end table
  930. @section libvorbis
  931. libvorbis encoder wrapper.
  932. Requires the presence of the libvorbisenc headers and library during
  933. configuration. You need to explicitly configure the build with
  934. @code{--enable-libvorbis}.
  935. @subsection Options
  936. The following options are supported by the libvorbis wrapper. The
  937. @command{oggenc}-equivalent of the options are listed in parentheses.
  938. To get a more accurate and extensive documentation of the libvorbis
  939. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  940. See @url{http://xiph.org/vorbis/},
  941. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  942. @table @option
  943. @item b (@emph{-b})
  944. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  945. expressed in kilobits/s.
  946. @item q (@emph{-q})
  947. Set constant quality setting for VBR. The value should be a float
  948. number in the range of -1.0 to 10.0. The higher the value, the better
  949. the quality. The default value is @samp{3.0}.
  950. This option is valid only using the @command{ffmpeg} command-line tool.
  951. For library interface users, use @option{global_quality}.
  952. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  953. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  954. related option is expressed in kHz. The default value is @samp{0} (cutoff
  955. disabled).
  956. @item minrate (@emph{-m})
  957. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  958. expressed in kilobits/s.
  959. @item maxrate (@emph{-M})
  960. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  961. expressed in kilobits/s. This only has effect on ABR mode.
  962. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  963. Set noise floor bias for impulse blocks. The value is a float number from
  964. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  965. to the crispness of transients in the encoded audio. The tradeoff for better
  966. transient response is a higher bitrate.
  967. @end table
  968. @anchor{libwavpack}
  969. @section libwavpack
  970. A wrapper providing WavPack encoding through libwavpack.
  971. Only lossless mode using 32-bit integer samples is supported currently.
  972. Requires the presence of the libwavpack headers and library during
  973. configuration. You need to explicitly configure the build with
  974. @code{--enable-libwavpack}.
  975. Note that a libavcodec-native encoder for the WavPack codec exists so users can
  976. encode audios with this codec without using this encoder. See @ref{wavpackenc}.
  977. @subsection Options
  978. @command{wavpack} command line utility's corresponding options are listed in
  979. parentheses, if any.
  980. @table @option
  981. @item frame_size (@emph{--blocksize})
  982. Default is 32768.
  983. @item compression_level
  984. Set speed vs. compression tradeoff. Acceptable arguments are listed below:
  985. @table @samp
  986. @item 0 (@emph{-f})
  987. Fast mode.
  988. @item 1
  989. Normal (default) settings.
  990. @item 2 (@emph{-h})
  991. High quality.
  992. @item 3 (@emph{-hh})
  993. Very high quality.
  994. @item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
  995. Same as @samp{3}, but with extra processing enabled.
  996. @samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
  997. @end table
  998. @end table
  999. @anchor{wavpackenc}
  1000. @section wavpack
  1001. WavPack lossless audio encoder.
  1002. This is a libavcodec-native WavPack encoder. There is also an encoder based on
  1003. libwavpack, but there is virtually no reason to use that encoder.
  1004. See also @ref{libwavpack}.
  1005. @subsection Options
  1006. The equivalent options for @command{wavpack} command line utility are listed in
  1007. parentheses.
  1008. @subsubsection Shared options
  1009. The following shared options are effective for this encoder. Only special notes
  1010. about this particular encoder will be documented here. For the general meaning
  1011. of the options, see @ref{codec-options,,the Codec Options chapter}.
  1012. @table @option
  1013. @item frame_size (@emph{--blocksize})
  1014. For this encoder, the range for this option is between 128 and 131072. Default
  1015. is automatically decided based on sample rate and number of channel.
  1016. For the complete formula of calculating default, see
  1017. @file{libavcodec/wavpackenc.c}.
  1018. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
  1019. This option's syntax is consistent with @ref{libwavpack}'s.
  1020. @end table
  1021. @subsubsection Private options
  1022. @table @option
  1023. @item joint_stereo (@emph{-j})
  1024. Set whether to enable joint stereo. Valid values are:
  1025. @table @samp
  1026. @item on (@emph{1})
  1027. Force mid/side audio encoding.
  1028. @item off (@emph{0})
  1029. Force left/right audio encoding.
  1030. @item auto
  1031. Let the encoder decide automatically.
  1032. @end table
  1033. @item optimize_mono
  1034. Set whether to enable optimization for mono. This option is only effective for
  1035. non-mono streams. Available values:
  1036. @table @samp
  1037. @item on
  1038. enabled
  1039. @item off
  1040. disabled
  1041. @end table
  1042. @end table
  1043. @c man end AUDIO ENCODERS
  1044. @chapter Video Encoders
  1045. @c man begin VIDEO ENCODERS
  1046. A description of some of the currently available video encoders
  1047. follows.
  1048. @section libopenh264
  1049. Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  1050. This encoder requires the presence of the libopenh264 headers and
  1051. library during configuration. You need to explicitly configure the
  1052. build with @code{--enable-libopenh264}. The library is detected using
  1053. @command{pkg-config}.
  1054. For more information about the library see
  1055. @url{http://www.openh264.org}.
  1056. @subsection Options
  1057. The following FFmpeg global options affect the configurations of the
  1058. libopenh264 encoder.
  1059. @table @option
  1060. @item b
  1061. Set the bitrate (as a number of bits per second).
  1062. @item g
  1063. Set the GOP size.
  1064. @item maxrate
  1065. Set the max bitrate (as a number of bits per second).
  1066. @item flags +global_header
  1067. Set global header in the bitstream.
  1068. @item slices
  1069. Set the number of slices, used in parallelized encoding. Default value
  1070. is 0. This is only used when @option{slice_mode} is set to
  1071. @samp{fixed}.
  1072. @item slice_mode
  1073. Set slice mode. Can assume one of the follwing possible values:
  1074. @table @samp
  1075. @item fixed
  1076. a fixed number of slices
  1077. @item rowmb
  1078. one slice per row of macroblocks
  1079. @item auto
  1080. automatic number of slices according to number of threads
  1081. @item dyn
  1082. dynamic slicing
  1083. @end table
  1084. Default value is @samp{auto}.
  1085. @item loopfilter
  1086. Enable loop filter, if set to 1 (automatically enabled). To disable
  1087. set a value of 0.
  1088. @item profile
  1089. Set profile restrictions. If set to the value of @samp{main} enable
  1090. CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
  1091. @item max_nal_size
  1092. Set maximum NAL size in bytes.
  1093. @item allow_skip_frames
  1094. Allow skipping frames to hit the target bitrate if set to 1.
  1095. @end table
  1096. @section jpeg2000
  1097. The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
  1098. option can be used to set the encoding quality. Lossless encoding
  1099. can be selected with @code{-pred 1}.
  1100. @subsection Options
  1101. @table @option
  1102. @item format
  1103. Can be set to either @code{j2k} or @code{jp2} (the default) that
  1104. makes it possible to store non-rgb pix_fmts.
  1105. @end table
  1106. @section snow
  1107. @subsection Options
  1108. @table @option
  1109. @item iterative_dia_size
  1110. dia size for the iterative motion estimation
  1111. @end table
  1112. @section libtheora
  1113. libtheora Theora encoder wrapper.
  1114. Requires the presence of the libtheora headers and library during
  1115. configuration. You need to explicitly configure the build with
  1116. @code{--enable-libtheora}.
  1117. For more information about the libtheora project see
  1118. @url{http://www.theora.org/}.
  1119. @subsection Options
  1120. The following global options are mapped to internal libtheora options
  1121. which affect the quality and the bitrate of the encoded stream.
  1122. @table @option
  1123. @item b
  1124. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  1125. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  1126. @item flags
  1127. Used to enable constant quality mode (VBR) encoding through the
  1128. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  1129. modes.
  1130. @item g
  1131. Set the GOP size.
  1132. @item global_quality
  1133. Set the global quality as an integer in lambda units.
  1134. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  1135. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  1136. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  1137. value in the native libtheora range [0-63]. A higher value corresponds
  1138. to a higher quality.
  1139. @item q
  1140. Enable VBR mode when set to a non-negative value, and set constant
  1141. quality value as a double floating point value in QP units.
  1142. The value is clipped in the [0-10] range, and then multiplied by 6.3
  1143. to get a value in the native libtheora range [0-63].
  1144. This option is valid only using the @command{ffmpeg} command-line
  1145. tool. For library interface users, use @option{global_quality}.
  1146. @end table
  1147. @subsection Examples
  1148. @itemize
  1149. @item
  1150. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  1151. @example
  1152. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  1153. @end example
  1154. @item
  1155. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  1156. @example
  1157. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  1158. @end example
  1159. @end itemize
  1160. @section libvpx
  1161. VP8/VP9 format supported through libvpx.
  1162. Requires the presence of the libvpx headers and library during configuration.
  1163. You need to explicitly configure the build with @code{--enable-libvpx}.
  1164. @subsection Options
  1165. The following options are supported by the libvpx wrapper. The
  1166. @command{vpxenc}-equivalent options or values are listed in parentheses
  1167. for easy migration.
  1168. To reduce the duplication of documentation, only the private options
  1169. and some others requiring special attention are documented here. For
  1170. the documentation of the undocumented generic options, see
  1171. @ref{codec-options,,the Codec Options chapter}.
  1172. To get more documentation of the libvpx options, invoke the command
  1173. @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
  1174. @command{vpxenc --help}. Further information is available in the libvpx API
  1175. documentation.
  1176. @table @option
  1177. @item b (@emph{target-bitrate})
  1178. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1179. expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
  1180. kilobits/s.
  1181. @item g (@emph{kf-max-dist})
  1182. @item keyint_min (@emph{kf-min-dist})
  1183. @item qmin (@emph{min-q})
  1184. @item qmax (@emph{max-q})
  1185. @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
  1186. Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
  1187. specified in milliseconds, the libvpx wrapper converts this value as follows:
  1188. @code{buf-sz = bufsize * 1000 / bitrate},
  1189. @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
  1190. @item rc_init_occupancy (@emph{buf-initial-sz})
  1191. Set number of bits which should be loaded into the rc buffer before decoding
  1192. starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
  1193. wrapper converts this value as follows:
  1194. @code{rc_init_occupancy * 1000 / bitrate}.
  1195. @item undershoot-pct
  1196. Set datarate undershoot (min) percentage of the target bitrate.
  1197. @item overshoot-pct
  1198. Set datarate overshoot (max) percentage of the target bitrate.
  1199. @item skip_threshold (@emph{drop-frame})
  1200. @item qcomp (@emph{bias-pct})
  1201. @item maxrate (@emph{maxsection-pct})
  1202. Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1203. percentage of the target bitrate, the libvpx wrapper converts this value as
  1204. follows: @code{(maxrate * 100 / bitrate)}.
  1205. @item minrate (@emph{minsection-pct})
  1206. Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1207. percentage of the target bitrate, the libvpx wrapper converts this value as
  1208. follows: @code{(minrate * 100 / bitrate)}.
  1209. @item minrate, maxrate, b @emph{end-usage=cbr}
  1210. @code{(minrate == maxrate == bitrate)}.
  1211. @item crf (@emph{end-usage=cq}, @emph{cq-level})
  1212. @item tune (@emph{tune})
  1213. @table @samp
  1214. @item psnr (@emph{psnr})
  1215. @item ssim (@emph{ssim})
  1216. @end table
  1217. @item quality, deadline (@emph{deadline})
  1218. @table @samp
  1219. @item best
  1220. Use best quality deadline. Poorly named and quite slow, this option should be
  1221. avoided as it may give worse quality output than good.
  1222. @item good
  1223. Use good quality deadline. This is a good trade-off between speed and quality
  1224. when used with the @option{cpu-used} option.
  1225. @item realtime
  1226. Use realtime quality deadline.
  1227. @end table
  1228. @item speed, cpu-used (@emph{cpu-used})
  1229. Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  1230. of quality.
  1231. @item nr (@emph{noise-sensitivity})
  1232. @item static-thresh
  1233. Set a change threshold on blocks below which they will be skipped by the
  1234. encoder.
  1235. @item slices (@emph{token-parts})
  1236. Note that FFmpeg's @option{slices} option gives the total number of partitions,
  1237. while @command{vpxenc}'s @option{token-parts} is given as
  1238. @code{log2(partitions)}.
  1239. @item max-intra-rate
  1240. Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  1241. means unlimited.
  1242. @item force_key_frames
  1243. @code{VPX_EFLAG_FORCE_KF}
  1244. @item Alternate reference frame related
  1245. @table @option
  1246. @item auto-alt-ref
  1247. Enable use of alternate reference frames (2-pass only).
  1248. @item arnr-max-frames
  1249. Set altref noise reduction max frame count.
  1250. @item arnr-type
  1251. Set altref noise reduction filter type: backward, forward, centered.
  1252. @item arnr-strength
  1253. Set altref noise reduction filter strength.
  1254. @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
  1255. Set number of frames to look ahead for frametype and ratecontrol.
  1256. @end table
  1257. @item error-resilient
  1258. Enable error resiliency features.
  1259. @item VP9-specific options
  1260. @table @option
  1261. @item lossless
  1262. Enable lossless mode.
  1263. @item tile-columns
  1264. Set number of tile columns to use. Note this is given as
  1265. @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
  1266. setting the @option{tile-columns} option to 3.
  1267. @item tile-rows
  1268. Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
  1269. For example, 4 tile rows would be requested by setting the @option{tile-rows}
  1270. option to 2.
  1271. @item frame-parallel
  1272. Enable frame parallel decodability features.
  1273. @item aq-mode
  1274. Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  1275. cyclic refresh).
  1276. @item colorspace @emph{color-space}
  1277. Set input color space. The VP9 bitstream supports signaling the following
  1278. colorspaces:
  1279. @table @option
  1280. @item @samp{rgb} @emph{sRGB}
  1281. @item @samp{bt709} @emph{bt709}
  1282. @item @samp{unspecified} @emph{unknown}
  1283. @item @samp{bt470bg} @emph{bt601}
  1284. @item @samp{smpte170m} @emph{smpte170}
  1285. @item @samp{smpte240m} @emph{smpte240}
  1286. @item @samp{bt2020_ncl} @emph{bt2020}
  1287. @end table
  1288. @end table
  1289. @end table
  1290. For more information about libvpx see:
  1291. @url{http://www.webmproject.org/}
  1292. @section libwebp
  1293. libwebp WebP Image encoder wrapper
  1294. libwebp is Google's official encoder for WebP images. It can encode in either
  1295. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  1296. frame. Lossless images are a separate codec developed by Google.
  1297. @subsection Pixel Format
  1298. Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  1299. to limitations of the format and libwebp. Alpha is supported for either mode.
  1300. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  1301. passed in for encoding lossless, the pixel format will automatically be
  1302. converted using functions from libwebp. This is not ideal and is done only for
  1303. convenience.
  1304. @subsection Options
  1305. @table @option
  1306. @item -lossless @var{boolean}
  1307. Enables/Disables use of lossless mode. Default is 0.
  1308. @item -compression_level @var{integer}
  1309. For lossy, this is a quality/speed tradeoff. Higher values give better quality
  1310. for a given size at the cost of increased encoding time. For lossless, this is
  1311. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  1312. encoding time. More specifically, it controls the number of extra algorithms
  1313. and compression tools used, and varies the combination of these tools. This
  1314. maps to the @var{method} option in libwebp. The valid range is 0 to 6.
  1315. Default is 4.
  1316. @item -qscale @var{float}
  1317. For lossy encoding, this controls image quality, 0 to 100. For lossless
  1318. encoding, this controls the effort and time spent at compressing more. The
  1319. default value is 75. Note that for usage via libavcodec, this option is called
  1320. @var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
  1321. @item -preset @var{type}
  1322. Configuration preset. This does some automatic settings based on the general
  1323. type of the image.
  1324. @table @option
  1325. @item none
  1326. Do not use a preset.
  1327. @item default
  1328. Use the encoder default.
  1329. @item picture
  1330. Digital picture, like portrait, inner shot
  1331. @item photo
  1332. Outdoor photograph, with natural lighting
  1333. @item drawing
  1334. Hand or line drawing, with high-contrast details
  1335. @item icon
  1336. Small-sized colorful images
  1337. @item text
  1338. Text-like
  1339. @end table
  1340. @end table
  1341. @section libx264, libx264rgb
  1342. x264 H.264/MPEG-4 AVC encoder wrapper.
  1343. This encoder requires the presence of the libx264 headers and library
  1344. during configuration. You need to explicitly configure the build with
  1345. @code{--enable-libx264}.
  1346. libx264 supports an impressive number of features, including 8x8 and
  1347. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1348. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1349. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1350. Many libx264 encoder options are mapped to FFmpeg global codec
  1351. options, while unique encoder options are provided through private
  1352. options. Additionally the @option{x264opts} and @option{x264-params}
  1353. private options allows one to pass a list of key=value tuples as accepted
  1354. by the libx264 @code{x264_param_parse} function.
  1355. The x264 project website is at
  1356. @url{http://www.videolan.org/developers/x264.html}.
  1357. The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  1358. pixel formats as input instead of YUV.
  1359. @subsection Supported Pixel Formats
  1360. x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  1361. x264's configure time. FFmpeg only supports one bit depth in one particular
  1362. build. In other words, it is not possible to build one FFmpeg with multiple
  1363. versions of x264 with different bit depths.
  1364. @subsection Options
  1365. The following options are supported by the libx264 wrapper. The
  1366. @command{x264}-equivalent options or values are listed in parentheses
  1367. for easy migration.
  1368. To reduce the duplication of documentation, only the private options
  1369. and some others requiring special attention are documented here. For
  1370. the documentation of the undocumented generic options, see
  1371. @ref{codec-options,,the Codec Options chapter}.
  1372. To get a more accurate and extensive documentation of the libx264
  1373. options, invoke the command @command{x264 --full-help} or consult
  1374. the libx264 documentation.
  1375. @table @option
  1376. @item b (@emph{bitrate})
  1377. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1378. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1379. kilobits/s.
  1380. @item bf (@emph{bframes})
  1381. @item g (@emph{keyint})
  1382. @item qmin (@emph{qpmin})
  1383. Minimum quantizer scale.
  1384. @item qmax (@emph{qpmax})
  1385. Maximum quantizer scale.
  1386. @item qdiff (@emph{qpstep})
  1387. Maximum difference between quantizer scales.
  1388. @item qblur (@emph{qblur})
  1389. Quantizer curve blur
  1390. @item qcomp (@emph{qcomp})
  1391. Quantizer curve compression factor
  1392. @item refs (@emph{ref})
  1393. Number of reference frames each P-frame can use. The range is from @var{0-16}.
  1394. @item sc_threshold (@emph{scenecut})
  1395. Sets the threshold for the scene change detection.
  1396. @item trellis (@emph{trellis})
  1397. Performs Trellis quantization to increase efficiency. Enabled by default.
  1398. @item nr (@emph{nr})
  1399. @item me_range (@emph{merange})
  1400. Maximum range of the motion search in pixels.
  1401. @item me_method (@emph{me})
  1402. Set motion estimation method. Possible values in the decreasing order
  1403. of speed:
  1404. @table @samp
  1405. @item dia (@emph{dia})
  1406. @item epzs (@emph{dia})
  1407. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1408. @samp{dia}.
  1409. @item hex (@emph{hex})
  1410. Hexagonal search with radius 2.
  1411. @item umh (@emph{umh})
  1412. Uneven multi-hexagon search.
  1413. @item esa (@emph{esa})
  1414. Exhaustive search.
  1415. @item tesa (@emph{tesa})
  1416. Hadamard exhaustive search (slowest).
  1417. @end table
  1418. @item subq (@emph{subme})
  1419. Sub-pixel motion estimation method.
  1420. @item b_strategy (@emph{b-adapt})
  1421. Adaptive B-frame placement decision algorithm. Use only on first-pass.
  1422. @item keyint_min (@emph{min-keyint})
  1423. Minimum GOP size.
  1424. @item coder
  1425. Set entropy encoder. Possible values:
  1426. @table @samp
  1427. @item ac
  1428. Enable CABAC.
  1429. @item vlc
  1430. Enable CAVLC and disable CABAC. It generates the same effect as
  1431. @command{x264}'s @option{--no-cabac} option.
  1432. @end table
  1433. @item cmp
  1434. Set full pixel motion estimation comparation algorithm. Possible values:
  1435. @table @samp
  1436. @item chroma
  1437. Enable chroma in motion estimation.
  1438. @item sad
  1439. Ignore chroma in motion estimation. It generates the same effect as
  1440. @command{x264}'s @option{--no-chroma-me} option.
  1441. @end table
  1442. @item threads (@emph{threads})
  1443. Number of encoding threads.
  1444. @item thread_type
  1445. Set multithreading technique. Possible values:
  1446. @table @samp
  1447. @item slice
  1448. Slice-based multithreading. It generates the same effect as
  1449. @command{x264}'s @option{--sliced-threads} option.
  1450. @item frame
  1451. Frame-based multithreading.
  1452. @end table
  1453. @item flags
  1454. Set encoding flags. It can be used to disable closed GOP and enable
  1455. open GOP by setting it to @code{-cgop}. The result is similar to
  1456. the behavior of @command{x264}'s @option{--open-gop} option.
  1457. @item rc_init_occupancy (@emph{vbv-init})
  1458. @item preset (@emph{preset})
  1459. Set the encoding preset.
  1460. @item tune (@emph{tune})
  1461. Set tuning of the encoding params.
  1462. @item profile (@emph{profile})
  1463. Set profile restrictions.
  1464. @item fastfirstpass
  1465. Enable fast settings when encoding first pass, when set to 1. When set
  1466. to 0, it has the same effect of @command{x264}'s
  1467. @option{--slow-firstpass} option.
  1468. @item crf (@emph{crf})
  1469. Set the quality for constant quality mode.
  1470. @item crf_max (@emph{crf-max})
  1471. In CRF mode, prevents VBV from lowering quality beyond this point.
  1472. @item qp (@emph{qp})
  1473. Set constant quantization rate control method parameter.
  1474. @item aq-mode (@emph{aq-mode})
  1475. Set AQ method. Possible values:
  1476. @table @samp
  1477. @item none (@emph{0})
  1478. Disabled.
  1479. @item variance (@emph{1})
  1480. Variance AQ (complexity mask).
  1481. @item autovariance (@emph{2})
  1482. Auto-variance AQ (experimental).
  1483. @end table
  1484. @item aq-strength (@emph{aq-strength})
  1485. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1486. @item psy
  1487. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1488. same effect as @command{x264}'s @option{--no-psy} option.
  1489. @item psy-rd (@emph{psy-rd})
  1490. Set strength of psychovisual optimization, in
  1491. @var{psy-rd}:@var{psy-trellis} format.
  1492. @item rc-lookahead (@emph{rc-lookahead})
  1493. Set number of frames to look ahead for frametype and ratecontrol.
  1494. @item weightb
  1495. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1496. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1497. @item weightp (@emph{weightp})
  1498. Set weighted prediction method for P-frames. Possible values:
  1499. @table @samp
  1500. @item none (@emph{0})
  1501. Disabled
  1502. @item simple (@emph{1})
  1503. Enable only weighted refs
  1504. @item smart (@emph{2})
  1505. Enable both weighted refs and duplicates
  1506. @end table
  1507. @item ssim (@emph{ssim})
  1508. Enable calculation and printing SSIM stats after the encoding.
  1509. @item intra-refresh (@emph{intra-refresh})
  1510. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1511. to 1.
  1512. @item avcintra-class (@emph{class})
  1513. Configure the encoder to generate AVC-Intra.
  1514. Valid values are 50,100 and 200
  1515. @item bluray-compat (@emph{bluray-compat})
  1516. Configure the encoder to be compatible with the bluray standard.
  1517. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  1518. @item b-bias (@emph{b-bias})
  1519. Set the influence on how often B-frames are used.
  1520. @item b-pyramid (@emph{b-pyramid})
  1521. Set method for keeping of some B-frames as references. Possible values:
  1522. @table @samp
  1523. @item none (@emph{none})
  1524. Disabled.
  1525. @item strict (@emph{strict})
  1526. Strictly hierarchical pyramid.
  1527. @item normal (@emph{normal})
  1528. Non-strict (not Blu-ray compatible).
  1529. @end table
  1530. @item mixed-refs
  1531. Enable the use of one reference per partition, as opposed to one
  1532. reference per macroblock when set to 1. When set to 0, it has the
  1533. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  1534. @item 8x8dct
  1535. Enable adaptive spatial transform (high profile 8x8 transform)
  1536. when set to 1. When set to 0, it has the same effect as
  1537. @command{x264}'s @option{--no-8x8dct} option.
  1538. @item fast-pskip
  1539. Enable early SKIP detection on P-frames when set to 1. When set
  1540. to 0, it has the same effect as @command{x264}'s
  1541. @option{--no-fast-pskip} option.
  1542. @item aud (@emph{aud})
  1543. Enable use of access unit delimiters when set to 1.
  1544. @item mbtree
  1545. Enable use macroblock tree ratecontrol when set to 1. When set
  1546. to 0, it has the same effect as @command{x264}'s
  1547. @option{--no-mbtree} option.
  1548. @item deblock (@emph{deblock})
  1549. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  1550. @item cplxblur (@emph{cplxblur})
  1551. Set fluctuations reduction in QP (before curve compression).
  1552. @item partitions (@emph{partitions})
  1553. Set partitions to consider as a comma-separated list of. Possible
  1554. values in the list:
  1555. @table @samp
  1556. @item p8x8
  1557. 8x8 P-frame partition.
  1558. @item p4x4
  1559. 4x4 P-frame partition.
  1560. @item b8x8
  1561. 4x4 B-frame partition.
  1562. @item i8x8
  1563. 8x8 I-frame partition.
  1564. @item i4x4
  1565. 4x4 I-frame partition.
  1566. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  1567. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  1568. option) to be enabled.)
  1569. @item none (@emph{none})
  1570. Do not consider any partitions.
  1571. @item all (@emph{all})
  1572. Consider every partition.
  1573. @end table
  1574. @item direct-pred (@emph{direct})
  1575. Set direct MV prediction mode. Possible values:
  1576. @table @samp
  1577. @item none (@emph{none})
  1578. Disable MV prediction.
  1579. @item spatial (@emph{spatial})
  1580. Enable spatial predicting.
  1581. @item temporal (@emph{temporal})
  1582. Enable temporal predicting.
  1583. @item auto (@emph{auto})
  1584. Automatically decided.
  1585. @end table
  1586. @item slice-max-size (@emph{slice-max-size})
  1587. Set the limit of the size of each slice in bytes. If not specified
  1588. but RTP payload size (@option{ps}) is specified, that is used.
  1589. @item stats (@emph{stats})
  1590. Set the file name for multi-pass stats.
  1591. @item nal-hrd (@emph{nal-hrd})
  1592. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  1593. Possible values:
  1594. @table @samp
  1595. @item none (@emph{none})
  1596. Disable HRD information signaling.
  1597. @item vbr (@emph{vbr})
  1598. Variable bit rate.
  1599. @item cbr (@emph{cbr})
  1600. Constant bit rate (not allowed in MP4 container).
  1601. @end table
  1602. @item x264opts (N.A.)
  1603. Set any x264 option, see @command{x264 --fullhelp} for a list.
  1604. Argument is a list of @var{key}=@var{value} couples separated by
  1605. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  1606. themselves, use "," instead. They accept it as well since long ago but this
  1607. is kept undocumented for some reason.
  1608. For example to specify libx264 encoding options with @command{ffmpeg}:
  1609. @example
  1610. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  1611. @end example
  1612. @item a53cc @var{boolean}
  1613. Import closed captions (which must be ATSC compatible format) into output.
  1614. Only the mpeg2 and h264 decoders provide these. Default is 0 (off).
  1615. @item x264-params (N.A.)
  1616. Override the x264 configuration using a :-separated list of key=value
  1617. parameters.
  1618. This option is functionally the same as the @option{x264opts}, but is
  1619. duplicated for compatibility with the Libav fork.
  1620. For example to specify libx264 encoding options with @command{ffmpeg}:
  1621. @example
  1622. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  1623. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  1624. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  1625. @end example
  1626. @end table
  1627. Encoding ffpresets for common usages are provided so they can be used with the
  1628. general presets system (e.g. passing the @option{pre} option).
  1629. @section libx265
  1630. x265 H.265/HEVC encoder wrapper.
  1631. This encoder requires the presence of the libx265 headers and library
  1632. during configuration. You need to explicitly configure the build with
  1633. @option{--enable-libx265}.
  1634. @subsection Options
  1635. @table @option
  1636. @item preset
  1637. Set the x265 preset.
  1638. @item tune
  1639. Set the x265 tune parameter.
  1640. @item x265-params
  1641. Set x265 options using a list of @var{key}=@var{value} couples separated
  1642. by ":". See @command{x265 --help} for a list of options.
  1643. For example to specify libx265 encoding options with @option{-x265-params}:
  1644. @example
  1645. ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  1646. @end example
  1647. @end table
  1648. @section libxvid
  1649. Xvid MPEG-4 Part 2 encoder wrapper.
  1650. This encoder requires the presence of the libxvidcore headers and library
  1651. during configuration. You need to explicitly configure the build with
  1652. @code{--enable-libxvid --enable-gpl}.
  1653. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  1654. users can encode to this format without this library.
  1655. @subsection Options
  1656. The following options are supported by the libxvid wrapper. Some of
  1657. the following options are listed but are not documented, and
  1658. correspond to shared codec options. See @ref{codec-options,,the Codec
  1659. Options chapter} for their documentation. The other shared options
  1660. which are not listed have no effect for the libxvid encoder.
  1661. @table @option
  1662. @item b
  1663. @item g
  1664. @item qmin
  1665. @item qmax
  1666. @item mpeg_quant
  1667. @item threads
  1668. @item bf
  1669. @item b_qfactor
  1670. @item b_qoffset
  1671. @item flags
  1672. Set specific encoding flags. Possible values:
  1673. @table @samp
  1674. @item mv4
  1675. Use four motion vector by macroblock.
  1676. @item aic
  1677. Enable high quality AC prediction.
  1678. @item gray
  1679. Only encode grayscale.
  1680. @item gmc
  1681. Enable the use of global motion compensation (GMC).
  1682. @item qpel
  1683. Enable quarter-pixel motion compensation.
  1684. @item cgop
  1685. Enable closed GOP.
  1686. @item global_header
  1687. Place global headers in extradata instead of every keyframe.
  1688. @end table
  1689. @item trellis
  1690. @item me_method
  1691. Set motion estimation method. Possible values in decreasing order of
  1692. speed and increasing order of quality:
  1693. @table @samp
  1694. @item zero
  1695. Use no motion estimation (default).
  1696. @item phods
  1697. @item x1
  1698. @item log
  1699. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  1700. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  1701. @samp{phods}.
  1702. @item epzs
  1703. Enable all of the things described above, plus advanced diamond zonal
  1704. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  1705. estimation on chroma planes.
  1706. @item full
  1707. Enable all of the things described above, plus extended 16x16 and 8x8
  1708. blocks search.
  1709. @end table
  1710. @item mbd
  1711. Set macroblock decision algorithm. Possible values in the increasing
  1712. order of quality:
  1713. @table @samp
  1714. @item simple
  1715. Use macroblock comparing function algorithm (default).
  1716. @item bits
  1717. Enable rate distortion-based half pixel and quarter pixel refinement for
  1718. 16x16 blocks.
  1719. @item rd
  1720. Enable all of the things described above, plus rate distortion-based
  1721. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  1722. distortion-based search using square pattern.
  1723. @end table
  1724. @item lumi_aq
  1725. Enable lumi masking adaptive quantization when set to 1. Default is 0
  1726. (disabled).
  1727. @item variance_aq
  1728. Enable variance adaptive quantization when set to 1. Default is 0
  1729. (disabled).
  1730. When combined with @option{lumi_aq}, the resulting quality will not
  1731. be better than any of the two specified individually. In other
  1732. words, the resulting quality will be the worse one of the two
  1733. effects.
  1734. @item ssim
  1735. Set structural similarity (SSIM) displaying method. Possible values:
  1736. @table @samp
  1737. @item off
  1738. Disable displaying of SSIM information.
  1739. @item avg
  1740. Output average SSIM at the end of encoding to stdout. The format of
  1741. showing the average SSIM is:
  1742. @example
  1743. Average SSIM: %f
  1744. @end example
  1745. For users who are not familiar with C, %f means a float number, or
  1746. a decimal (e.g. 0.939232).
  1747. @item frame
  1748. Output both per-frame SSIM data during encoding and average SSIM at
  1749. the end of encoding to stdout. The format of per-frame information
  1750. is:
  1751. @example
  1752. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  1753. @end example
  1754. For users who are not familiar with C, %1.3f means a float number
  1755. rounded to 3 digits after the dot (e.g. 0.932).
  1756. @end table
  1757. @item ssim_acc
  1758. Set SSIM accuracy. Valid options are integers within the range of
  1759. 0-4, while 0 gives the most accurate result and 4 computes the
  1760. fastest.
  1761. @end table
  1762. @section mpeg2
  1763. MPEG-2 video encoder.
  1764. @subsection Options
  1765. @table @option
  1766. @item seq_disp_ext @var{integer}
  1767. Specifies if the encoder should write a sequence_display_extension to the
  1768. output.
  1769. @table @option
  1770. @item -1
  1771. @itemx auto
  1772. Decide automatically to write it or not (this is the default) by checking if
  1773. the data to be written is different from the default or unspecified values.
  1774. @item 0
  1775. @itemx never
  1776. Never write it.
  1777. @item 1
  1778. @itemx always
  1779. Always write it.
  1780. @end table
  1781. @end table
  1782. @section png
  1783. PNG image encoder.
  1784. @subsection Private options
  1785. @table @option
  1786. @item dpi @var{integer}
  1787. Set physical density of pixels, in dots per inch, unset by default
  1788. @item dpm @var{integer}
  1789. Set physical density of pixels, in dots per meter, unset by default
  1790. @end table
  1791. @section ProRes
  1792. Apple ProRes encoder.
  1793. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  1794. The used encoder can be chosen with the @code{-vcodec} option.
  1795. @subsection Private Options for prores-ks
  1796. @table @option
  1797. @item profile @var{integer}
  1798. Select the ProRes profile to encode
  1799. @table @samp
  1800. @item proxy
  1801. @item lt
  1802. @item standard
  1803. @item hq
  1804. @item 4444
  1805. @end table
  1806. @item quant_mat @var{integer}
  1807. Select quantization matrix.
  1808. @table @samp
  1809. @item auto
  1810. @item default
  1811. @item proxy
  1812. @item lt
  1813. @item standard
  1814. @item hq
  1815. @end table
  1816. If set to @var{auto}, the matrix matching the profile will be picked.
  1817. If not set, the matrix providing the highest quality, @var{default}, will be
  1818. picked.
  1819. @item bits_per_mb @var{integer}
  1820. How many bits to allot for coding one macroblock. Different profiles use
  1821. between 200 and 2400 bits per macroblock, the maximum is 8000.
  1822. @item mbs_per_slice @var{integer}
  1823. Number of macroblocks in each slice (1-8); the default value (8)
  1824. should be good in almost all situations.
  1825. @item vendor @var{string}
  1826. Override the 4-byte vendor ID.
  1827. A custom vendor ID like @var{apl0} would claim the stream was produced by
  1828. the Apple encoder.
  1829. @item alpha_bits @var{integer}
  1830. Specify number of bits for alpha component.
  1831. Possible values are @var{0}, @var{8} and @var{16}.
  1832. Use @var{0} to disable alpha plane coding.
  1833. @end table
  1834. @subsection Speed considerations
  1835. In the default mode of operation the encoder has to honor frame constraints
  1836. (i.e. not produce frames with size bigger than requested) while still making
  1837. output picture as good as possible.
  1838. A frame containing a lot of small details is harder to compress and the encoder
  1839. would spend more time searching for appropriate quantizers for each slice.
  1840. Setting a higher @option{bits_per_mb} limit will improve the speed.
  1841. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  1842. recommended value) and do not set a size constraint.
  1843. @section libkvazaar
  1844. Kvazaar H.265/HEVC encoder.
  1845. Requires the presence of the libkvazaar headers and library during
  1846. configuration. You need to explicitly configure the build with
  1847. @option{--enable-libkvazaar}.
  1848. @subsection Options
  1849. @table @option
  1850. @item b
  1851. Set target video bitrate in bit/s and enable rate control.
  1852. @item kvazaar-params
  1853. Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
  1854. by commas (,). See kvazaar documentation for a list of options.
  1855. @end table
  1856. @section QSV encoders
  1857. The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC)
  1858. The ratecontrol method is selected as follows:
  1859. @itemize @bullet
  1860. @item
  1861. When @option{global_quality} is specified, a quality-based mode is used.
  1862. Specifically this means either
  1863. @itemize @minus
  1864. @item
  1865. @var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
  1866. also set (the @option{-qscale} ffmpeg option).
  1867. @item
  1868. @var{LA_ICQ} - intelligent constant quality with lookahead, when the
  1869. @option{look_ahead} option is also set.
  1870. @item
  1871. @var{ICQ} -- intelligent constant quality otherwise.
  1872. @end itemize
  1873. @item
  1874. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  1875. least the desired average bitrate with the @option{b} option.
  1876. @itemize @minus
  1877. @item
  1878. @var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
  1879. @item
  1880. @var{VCM} - video conferencing mode, when the @option{vcm} option is set.
  1881. @item
  1882. @var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
  1883. the average bitrate.
  1884. @item
  1885. @var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
  1886. than the average bitrate.
  1887. @item
  1888. @var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
  1889. is further configured by the @option{avbr_accuracy} and
  1890. @option{avbr_convergence} options.
  1891. @end itemize
  1892. @end itemize
  1893. Note that depending on your system, a different mode than the one you specified
  1894. may be selected by the encoder. Set the verbosity level to @var{verbose} or
  1895. higher to see the actual settings used by the QSV runtime.
  1896. Additional libavcodec global options are mapped to MSDK options as follows:
  1897. @itemize
  1898. @item
  1899. @option{g/gop_size} -> @option{GopPicSize}
  1900. @item
  1901. @option{bf/max_b_frames}+1 -> @option{GopRefDist}
  1902. @item
  1903. @option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
  1904. @option{InitialDelayInKB}
  1905. @item
  1906. @option{slices} -> @option{NumSlice}
  1907. @item
  1908. @option{refs} -> @option{NumRefFrame}
  1909. @item
  1910. @option{b_strategy/b_frame_strategy} -> @option{BRefType}
  1911. @item
  1912. @option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
  1913. @item
  1914. For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
  1915. @option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
  1916. and @var{QPP} and @var{QPB} respectively.
  1917. @item
  1918. Setting the @option{coder} option to the value @var{vlc} will make the H.264
  1919. encoder use CAVLC instead of CABAC.
  1920. @end itemize
  1921. @section vc2
  1922. SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  1923. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  1924. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  1925. other tasks which require low overhead and low compression (like screen
  1926. recording).
  1927. @subsection Options
  1928. @table @option
  1929. @item b
  1930. Sets target video bitrate. Usually that's around 1:6 of the uncompressed
  1931. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
  1932. values (close to the uncompressed bitrate) turn on lossless compression mode.
  1933. @item field_order
  1934. Enables field coding when set (e.g. to tt - top field first) for interlaced
  1935. inputs. Should increase compression with interlaced content as it splits the
  1936. fields and encodes each separately.
  1937. @item wavelet_depth
  1938. Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  1939. Lower values reduce compression and quality. Less capable decoders may not be
  1940. able to handle values of @option{wavelet_depth} over 3.
  1941. @item wavelet_type
  1942. Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
  1943. (Deslauriers-Dubuc)
  1944. are implemented, with 9_7 being the one with better compression and thus
  1945. is the default.
  1946. @item slice_width
  1947. @item slice_height
  1948. Sets the slice size for each slice. Larger values result in better compression.
  1949. For compatibility with other more limited decoders use @option{slice_width} of
  1950. 32 and @option{slice_height} of 8.
  1951. @item tolerance
  1952. Sets the undershoot tolerance of the rate control system in percent. This is
  1953. to prevent an expensive search from being run.
  1954. @item qm
  1955. Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
  1956. is set to 5
  1957. @itemize @minus
  1958. @item
  1959. @var{default}
  1960. Uses the default quantization matrix from the specifications, extended with
  1961. values for the fifth level. This provides a good balance between keeping detail
  1962. and omitting artifacts.
  1963. @item
  1964. @var{flat}
  1965. Use a completely zeroed out quantization matrix. This increases PSNR but might
  1966. reduce perception. Use in bogus benchmarks.
  1967. @item
  1968. @var{color}
  1969. Reduces detail but attempts to preserve color at extremely low bitrates.
  1970. @end itemize
  1971. @end table
  1972. @c man end VIDEO ENCODERS
  1973. @chapter Subtitles Encoders
  1974. @c man begin SUBTITLES ENCODERS
  1975. @section dvdsub
  1976. This codec encodes the bitmap subtitle format that is used in DVDs.
  1977. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  1978. and they can also be used in Matroska files.
  1979. @subsection Options
  1980. @table @option
  1981. @item even_rows_fix
  1982. When set to 1, enable a work-around that makes the number of pixel rows
  1983. even in all subtitles. This fixes a problem with some players that
  1984. cut off the bottom row if the number is odd. The work-around just adds
  1985. a fully transparent row if needed. The overhead is low, typically
  1986. one byte per subtitle on average.
  1987. By default, this work-around is disabled.
  1988. @end table
  1989. @c man end SUBTITLES ENCODERS