encoders.texi 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129
  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. Will tune
  48. itself based on whether @option{aac_is}, @option{aac_ms} and @option{aac_pns}
  49. are enabled.
  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. Uses a cheaper version of twoloop algorithm that doesn't try to do as many
  59. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  60. and much faster at higher bitrates.
  61. This is the default choice for a coder
  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 beneficial.
  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 imperceptible 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 @code{-profile:a aac_low -aac_pns 0}. PNS was introduced with the
  103. MPEG4 specifications.
  104. @item aac_ltp
  105. Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
  106. option. Introduced in MPEG4.
  107. @item aac_main
  108. Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
  109. option. Introduced in MPEG2.
  110. @end table
  111. If this option is unspecified it is set to @samp{aac_low}.
  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. @item cutoff @var{frequency}
  410. Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  411. determined by various other encoding parameters.
  412. @end table
  413. @subsection Floating-Point-Only AC-3 Encoding Options
  414. These options are only valid for the floating-point encoder and do not exist
  415. for the fixed-point encoder due to the corresponding features not being
  416. implemented in fixed-point.
  417. @table @option
  418. @item -channel_coupling @var{boolean}
  419. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  420. that increases quality by combining high frequency information from multiple
  421. channels into a single channel. The per-channel high frequency information is
  422. sent with less accuracy in both the frequency and time domains. This allows
  423. more bits to be used for lower frequencies while preserving enough information
  424. to reconstruct the high frequencies. This option is enabled by default for the
  425. floating-point encoder and should generally be left as enabled except for
  426. testing purposes or to increase encoding speed.
  427. @table @option
  428. @item -1
  429. @itemx auto
  430. Selected by Encoder (default)
  431. @item 0
  432. @itemx off
  433. Disable Channel Coupling
  434. @item 1
  435. @itemx on
  436. Enable Channel Coupling
  437. @end table
  438. @item -cpl_start_band @var{number}
  439. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  440. value higher than the bandwidth is used, it will be reduced to 1 less than the
  441. coupling end band. If @var{auto} is used, the start band will be determined by
  442. the encoder based on the bit rate, sample rate, and channel layout. This option
  443. has no effect if channel coupling is disabled.
  444. @table @option
  445. @item -1
  446. @itemx auto
  447. Selected by Encoder (default)
  448. @end table
  449. @end table
  450. @anchor{flac}
  451. @section flac
  452. FLAC (Free Lossless Audio Codec) Encoder
  453. @subsection Options
  454. The following options are supported by FFmpeg's flac encoder.
  455. @table @option
  456. @item compression_level
  457. Sets the compression level, which chooses defaults for many other options
  458. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  459. default.
  460. @item frame_size
  461. Sets the size of the frames in samples per channel.
  462. @item lpc_coeff_precision
  463. Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  464. default.
  465. @item lpc_type
  466. Sets the first stage LPC algorithm
  467. @table @samp
  468. @item none
  469. LPC is not used
  470. @item fixed
  471. fixed LPC coefficients
  472. @item levinson
  473. @item cholesky
  474. @end table
  475. @item lpc_passes
  476. Number of passes to use for Cholesky factorization during LPC analysis
  477. @item min_partition_order
  478. The minimum partition order
  479. @item max_partition_order
  480. The maximum partition order
  481. @item prediction_order_method
  482. @table @samp
  483. @item estimation
  484. @item 2level
  485. @item 4level
  486. @item 8level
  487. @item search
  488. Bruteforce search
  489. @item log
  490. @end table
  491. @item ch_mode
  492. Channel mode
  493. @table @samp
  494. @item auto
  495. The mode is chosen automatically for each frame
  496. @item indep
  497. Channels are independently coded
  498. @item left_side
  499. @item right_side
  500. @item mid_side
  501. @end table
  502. @item exact_rice_parameters
  503. Chooses if rice parameters are calculated exactly or approximately.
  504. if set to 1 then they are chosen exactly, which slows the code down slightly and
  505. improves compression slightly.
  506. @item multi_dim_quant
  507. Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  508. applied after the first stage to finetune the coefficients. This is quite slow
  509. and slightly improves compression.
  510. @end table
  511. @anchor{opusenc}
  512. @section opus
  513. Opus encoder.
  514. This is a native FFmpeg encoder for the Opus format. Currently its in development and
  515. only implements the CELT part of the codec. Its quality is usually worse and at best
  516. is equal to the libopus encoder.
  517. @subsection Options
  518. @table @option
  519. @item b
  520. Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  521. to make a good guess.
  522. @item opus_delay
  523. Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  524. decrease quality.
  525. @end table
  526. @anchor{libfdk-aac-enc}
  527. @section libfdk_aac
  528. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  529. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  530. the Android project.
  531. Requires the presence of the libfdk-aac headers and library during
  532. configuration. You need to explicitly configure the build with
  533. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  534. so if you allow the use of GPL, you should configure with
  535. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  536. This encoder is considered to produce output on par or worse at 128kbps to the
  537. @ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better
  538. sounding audio at identical or lower bitrates and has support for the
  539. AAC-HE profiles.
  540. VBR encoding, enabled through the @option{vbr} or @option{flags
  541. +qscale} options, is experimental and only works with some
  542. combinations of parameters.
  543. Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  544. higher.
  545. For more information see the fdk-aac project at
  546. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  547. @subsection Options
  548. The following options are mapped on the shared FFmpeg codec options.
  549. @table @option
  550. @item b
  551. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  552. is automatically set to a suitable value depending on the selected
  553. profile.
  554. In case VBR mode is enabled the option is ignored.
  555. @item ar
  556. Set audio sampling rate (in Hz).
  557. @item channels
  558. Set the number of audio channels.
  559. @item flags +qscale
  560. Enable fixed quality, VBR (Variable Bit Rate) mode.
  561. Note that VBR is implicitly enabled when the @option{vbr} value is
  562. positive.
  563. @item cutoff
  564. Set cutoff frequency. If not specified (or explicitly set to 0) it
  565. will use a value automatically computed by the library. Default value
  566. is 0.
  567. @item profile
  568. Set audio profile.
  569. The following profiles are recognized:
  570. @table @samp
  571. @item aac_low
  572. Low Complexity AAC (LC)
  573. @item aac_he
  574. High Efficiency AAC (HE-AAC)
  575. @item aac_he_v2
  576. High Efficiency AAC version 2 (HE-AACv2)
  577. @item aac_ld
  578. Low Delay AAC (LD)
  579. @item aac_eld
  580. Enhanced Low Delay AAC (ELD)
  581. @end table
  582. If not specified it is set to @samp{aac_low}.
  583. @end table
  584. The following are private options of the libfdk_aac encoder.
  585. @table @option
  586. @item afterburner
  587. Enable afterburner feature if set to 1, disabled if set to 0. This
  588. improves the quality but also the required processing power.
  589. Default value is 1.
  590. @item eld_sbr
  591. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  592. if set to 0.
  593. Default value is 0.
  594. @item eld_v2
  595. Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  596. disabled if set to 0.
  597. Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
  598. Default value is 0.
  599. @item signaling
  600. Set SBR/PS signaling style.
  601. It can assume one of the following values:
  602. @table @samp
  603. @item default
  604. choose signaling implicitly (explicit hierarchical by default,
  605. implicit if global header is disabled)
  606. @item implicit
  607. implicit backwards compatible signaling
  608. @item explicit_sbr
  609. explicit SBR, implicit PS signaling
  610. @item explicit_hierarchical
  611. explicit hierarchical signaling
  612. @end table
  613. Default value is @samp{default}.
  614. @item latm
  615. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  616. Default value is 0.
  617. @item header_period
  618. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  619. in-band configuration buffers within LATM/LOAS transport layer.
  620. Must be a 16-bits non-negative integer.
  621. Default value is 0.
  622. @item vbr
  623. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  624. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  625. (Constant Bit Rate) is enabled.
  626. Currently only the @samp{aac_low} profile supports VBR encoding.
  627. VBR modes 1-5 correspond to roughly the following average bit rates:
  628. @table @samp
  629. @item 1
  630. 32 kbps/channel
  631. @item 2
  632. 40 kbps/channel
  633. @item 3
  634. 48-56 kbps/channel
  635. @item 4
  636. 64 kbps/channel
  637. @item 5
  638. about 80-96 kbps/channel
  639. @end table
  640. Default value is 0.
  641. @end table
  642. @subsection Examples
  643. @itemize
  644. @item
  645. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  646. container:
  647. @example
  648. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  649. @end example
  650. @item
  651. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  652. High-Efficiency AAC profile:
  653. @example
  654. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  655. @end example
  656. @end itemize
  657. @anchor{libmp3lame}
  658. @section libmp3lame
  659. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  660. Requires the presence of the libmp3lame headers and library during
  661. configuration. You need to explicitly configure the build with
  662. @code{--enable-libmp3lame}.
  663. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  664. lower quality.
  665. @subsection Options
  666. The following options are supported by the libmp3lame wrapper. The
  667. @command{lame}-equivalent of the options are listed in parentheses.
  668. @table @option
  669. @item b (@emph{-b})
  670. Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
  671. expressed in kilobits/s.
  672. @item q (@emph{-V})
  673. Set constant quality setting for VBR. This option is valid only
  674. using the @command{ffmpeg} command-line tool. For library interface
  675. users, use @option{global_quality}.
  676. @item compression_level (@emph{-q})
  677. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  678. with 0 meaning highest quality but slowest, and 9 meaning fastest
  679. while producing the worst quality.
  680. @item cutoff (@emph{--lowpass})
  681. Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  682. adjusts the cutoff.
  683. @item reservoir
  684. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  685. has this enabled by default, but can be overridden by use
  686. @option{--nores} option.
  687. @item joint_stereo (@emph{-m j})
  688. Enable the encoder to use (on a frame by frame basis) either L/R
  689. stereo or mid/side stereo. Default value is 1.
  690. @item abr (@emph{--abr})
  691. Enable the encoder to use ABR when set to 1. The @command{lame}
  692. @option{--abr} sets the target bitrate, while this options only
  693. tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
  694. @end table
  695. @section libopencore-amrnb
  696. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  697. Requires the presence of the libopencore-amrnb headers and library during
  698. configuration. You need to explicitly configure the build with
  699. @code{--enable-libopencore-amrnb --enable-version3}.
  700. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  701. but you can override it by setting @option{strict} to @samp{unofficial} or
  702. lower.
  703. @subsection Options
  704. @table @option
  705. @item b
  706. Set bitrate in bits per second. Only the following bitrates are supported,
  707. otherwise libavcodec will round to the nearest valid bitrate.
  708. @table @option
  709. @item 4750
  710. @item 5150
  711. @item 5900
  712. @item 6700
  713. @item 7400
  714. @item 7950
  715. @item 10200
  716. @item 12200
  717. @end table
  718. @item dtx
  719. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  720. default value is 0 (disabled).
  721. @end table
  722. @section libopus
  723. libopus Opus Interactive Audio Codec encoder wrapper.
  724. Requires the presence of the libopus headers and library during
  725. configuration. You need to explicitly configure the build with
  726. @code{--enable-libopus}.
  727. @subsection Option Mapping
  728. Most libopus options are modelled after the @command{opusenc} utility from
  729. opus-tools. The following is an option mapping chart describing options
  730. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  731. in parentheses.
  732. @table @option
  733. @item b (@emph{bitrate})
  734. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  735. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  736. kilobits/s.
  737. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  738. Set VBR mode. The FFmpeg @option{vbr} option has the following
  739. valid arguments, with the @command{opusenc} equivalent options
  740. in parentheses:
  741. @table @samp
  742. @item off (@emph{hard-cbr})
  743. Use constant bit rate encoding.
  744. @item on (@emph{vbr})
  745. Use variable bit rate encoding (the default).
  746. @item constrained (@emph{cvbr})
  747. Use constrained variable bit rate encoding.
  748. @end table
  749. @item compression_level (@emph{comp})
  750. Set encoding algorithm complexity. Valid options are integers in
  751. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  752. gives the highest quality but slowest encoding. The default is 10.
  753. @item frame_duration (@emph{framesize})
  754. Set maximum frame size, or duration of a frame in milliseconds. The
  755. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  756. frame sizes achieve lower latency but less quality at a given bitrate.
  757. Sizes greater than 20ms are only interesting at fairly low bitrates.
  758. The default is 20ms.
  759. @item packet_loss (@emph{expect-loss})
  760. Set expected packet loss percentage. The default is 0.
  761. @item application (N.A.)
  762. Set intended application type. Valid options are listed below:
  763. @table @samp
  764. @item voip
  765. Favor improved speech intelligibility.
  766. @item audio
  767. Favor faithfulness to the input (the default).
  768. @item lowdelay
  769. Restrict to only the lowest delay modes.
  770. @end table
  771. @item cutoff (N.A.)
  772. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  773. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  774. narrowband, mediumband, wideband, super wideband, and fullband
  775. respectively. The default is 0 (cutoff disabled).
  776. @item mapping_family (@emph{mapping_family})
  777. Set channel mapping family to be used by the encoder. The default value of -1
  778. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  779. otherwise. The default also disables the surround masking and LFE bandwidth
  780. optimzations in libopus, and requires that the input contains 8 channels or
  781. fewer.
  782. Other values include 0 for mono and stereo, 1 for surround sound with masking
  783. and LFE bandwidth optimizations, and 255 for independent streams with an
  784. unspecified channel layout.
  785. @item apply_phase_inv (N.A.) (requires libopus >= 1.2)
  786. If set to 0, disables the use of phase inversion for intensity stereo,
  787. improving the quality of mono downmixes, but slightly reducing normal stereo
  788. quality. The default is 1 (phase inversion enabled).
  789. @end table
  790. @anchor{libshine}
  791. @section libshine
  792. Shine Fixed-Point MP3 encoder wrapper.
  793. Shine is a fixed-point MP3 encoder. It has a far better performance on
  794. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  795. However, as it is more targeted on performance than quality, it is not on par
  796. with LAME and other production-grade encoders quality-wise. Also, according to
  797. the project's homepage, this encoder may not be free of bugs as the code was
  798. written a long time ago and the project was dead for at least 5 years.
  799. This encoder only supports stereo and mono input. This is also CBR-only.
  800. The original project (last updated in early 2007) is at
  801. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  802. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  803. Requires the presence of the libshine headers and library during
  804. configuration. You need to explicitly configure the build with
  805. @code{--enable-libshine}.
  806. See also @ref{libmp3lame}.
  807. @subsection Options
  808. The following options are supported by the libshine wrapper. The
  809. @command{shineenc}-equivalent of the options are listed in parentheses.
  810. @table @option
  811. @item b (@emph{-b})
  812. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  813. is expressed in kilobits/s.
  814. @end table
  815. @section libtwolame
  816. TwoLAME MP2 encoder wrapper.
  817. Requires the presence of the libtwolame headers and library during
  818. configuration. You need to explicitly configure the build with
  819. @code{--enable-libtwolame}.
  820. @subsection Options
  821. The following options are supported by the libtwolame wrapper. The
  822. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  823. parentheses.
  824. @table @option
  825. @item b (@emph{-b})
  826. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  827. option is expressed in kilobits/s. Default value is 128k.
  828. @item q (@emph{-V})
  829. Set quality for experimental VBR support. Maximum value range is
  830. from -50 to 50, useful range is from -10 to 10. The higher the
  831. value, the better the quality. This option is valid only using the
  832. @command{ffmpeg} command-line tool. For library interface users,
  833. use @option{global_quality}.
  834. @item mode (@emph{--mode})
  835. Set the mode of the resulting audio. Possible values:
  836. @table @samp
  837. @item auto
  838. Choose mode automatically based on the input. This is the default.
  839. @item stereo
  840. Stereo
  841. @item joint_stereo
  842. Joint stereo
  843. @item dual_channel
  844. Dual channel
  845. @item mono
  846. Mono
  847. @end table
  848. @item psymodel (@emph{--psyc-mode})
  849. Set psychoacoustic model to use in encoding. The argument must be
  850. an integer between -1 and 4, inclusive. The higher the value, the
  851. better the quality. The default value is 3.
  852. @item energy_levels (@emph{--energy})
  853. Enable energy levels extensions when set to 1. The default value is
  854. 0 (disabled).
  855. @item error_protection (@emph{--protect})
  856. Enable CRC error protection when set to 1. The default value is 0
  857. (disabled).
  858. @item copyright (@emph{--copyright})
  859. Set MPEG audio copyright flag when set to 1. The default value is 0
  860. (disabled).
  861. @item original (@emph{--original})
  862. Set MPEG audio original flag when set to 1. The default value is 0
  863. (disabled).
  864. @end table
  865. @section libvo-amrwbenc
  866. VisualOn Adaptive Multi-Rate Wideband encoder.
  867. Requires the presence of the libvo-amrwbenc headers and library during
  868. configuration. You need to explicitly configure the build with
  869. @code{--enable-libvo-amrwbenc --enable-version3}.
  870. This is a mono-only encoder. Officially it only supports 16000Hz sample
  871. rate, but you can override it by setting @option{strict} to
  872. @samp{unofficial} or lower.
  873. @subsection Options
  874. @table @option
  875. @item b
  876. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  877. libavcodec will round to the nearest valid bitrate.
  878. @table @samp
  879. @item 6600
  880. @item 8850
  881. @item 12650
  882. @item 14250
  883. @item 15850
  884. @item 18250
  885. @item 19850
  886. @item 23050
  887. @item 23850
  888. @end table
  889. @item dtx
  890. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  891. default value is 0 (disabled).
  892. @end table
  893. @section libvorbis
  894. libvorbis encoder wrapper.
  895. Requires the presence of the libvorbisenc headers and library during
  896. configuration. You need to explicitly configure the build with
  897. @code{--enable-libvorbis}.
  898. @subsection Options
  899. The following options are supported by the libvorbis wrapper. The
  900. @command{oggenc}-equivalent of the options are listed in parentheses.
  901. To get a more accurate and extensive documentation of the libvorbis
  902. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  903. See @url{http://xiph.org/vorbis/},
  904. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  905. @table @option
  906. @item b (@emph{-b})
  907. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  908. expressed in kilobits/s.
  909. @item q (@emph{-q})
  910. Set constant quality setting for VBR. The value should be a float
  911. number in the range of -1.0 to 10.0. The higher the value, the better
  912. the quality. The default value is @samp{3.0}.
  913. This option is valid only using the @command{ffmpeg} command-line tool.
  914. For library interface users, use @option{global_quality}.
  915. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  916. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  917. related option is expressed in kHz. The default value is @samp{0} (cutoff
  918. disabled).
  919. @item minrate (@emph{-m})
  920. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  921. expressed in kilobits/s.
  922. @item maxrate (@emph{-M})
  923. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  924. expressed in kilobits/s. This only has effect on ABR mode.
  925. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  926. Set noise floor bias for impulse blocks. The value is a float number from
  927. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  928. to the crispness of transients in the encoded audio. The tradeoff for better
  929. transient response is a higher bitrate.
  930. @end table
  931. @anchor{libwavpack}
  932. @section libwavpack
  933. A wrapper providing WavPack encoding through libwavpack.
  934. Only lossless mode using 32-bit integer samples is supported currently.
  935. Requires the presence of the libwavpack headers and library during
  936. configuration. You need to explicitly configure the build with
  937. @code{--enable-libwavpack}.
  938. Note that a libavcodec-native encoder for the WavPack codec exists so users can
  939. encode audios with this codec without using this encoder. See @ref{wavpackenc}.
  940. @subsection Options
  941. @command{wavpack} command line utility's corresponding options are listed in
  942. parentheses, if any.
  943. @table @option
  944. @item frame_size (@emph{--blocksize})
  945. Default is 32768.
  946. @item compression_level
  947. Set speed vs. compression tradeoff. Acceptable arguments are listed below:
  948. @table @samp
  949. @item 0 (@emph{-f})
  950. Fast mode.
  951. @item 1
  952. Normal (default) settings.
  953. @item 2 (@emph{-h})
  954. High quality.
  955. @item 3 (@emph{-hh})
  956. Very high quality.
  957. @item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
  958. Same as @samp{3}, but with extra processing enabled.
  959. @samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
  960. @end table
  961. @end table
  962. @anchor{mjpegenc}
  963. @section mjpeg
  964. Motion JPEG encoder.
  965. @subsection Options
  966. @table @option
  967. @item huffman
  968. Set the huffman encoding strategy. Possible values:
  969. @table @samp
  970. @item default
  971. Use the default huffman tables. This is the default strategy.
  972. @item optimal
  973. Compute and use optimal huffman tables.
  974. @end table
  975. @end table
  976. @anchor{wavpackenc}
  977. @section wavpack
  978. WavPack lossless audio encoder.
  979. This is a libavcodec-native WavPack encoder. There is also an encoder based on
  980. libwavpack, but there is virtually no reason to use that encoder.
  981. See also @ref{libwavpack}.
  982. @subsection Options
  983. The equivalent options for @command{wavpack} command line utility are listed in
  984. parentheses.
  985. @subsubsection Shared options
  986. The following shared options are effective for this encoder. Only special notes
  987. about this particular encoder will be documented here. For the general meaning
  988. of the options, see @ref{codec-options,,the Codec Options chapter}.
  989. @table @option
  990. @item frame_size (@emph{--blocksize})
  991. For this encoder, the range for this option is between 128 and 131072. Default
  992. is automatically decided based on sample rate and number of channel.
  993. For the complete formula of calculating default, see
  994. @file{libavcodec/wavpackenc.c}.
  995. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
  996. This option's syntax is consistent with @ref{libwavpack}'s.
  997. @end table
  998. @subsubsection Private options
  999. @table @option
  1000. @item joint_stereo (@emph{-j})
  1001. Set whether to enable joint stereo. Valid values are:
  1002. @table @samp
  1003. @item on (@emph{1})
  1004. Force mid/side audio encoding.
  1005. @item off (@emph{0})
  1006. Force left/right audio encoding.
  1007. @item auto
  1008. Let the encoder decide automatically.
  1009. @end table
  1010. @item optimize_mono
  1011. Set whether to enable optimization for mono. This option is only effective for
  1012. non-mono streams. Available values:
  1013. @table @samp
  1014. @item on
  1015. enabled
  1016. @item off
  1017. disabled
  1018. @end table
  1019. @end table
  1020. @c man end AUDIO ENCODERS
  1021. @chapter Video Encoders
  1022. @c man begin VIDEO ENCODERS
  1023. A description of some of the currently available video encoders
  1024. follows.
  1025. @section Hap
  1026. Vidvox Hap video encoder.
  1027. @subsection Options
  1028. @table @option
  1029. @item format @var{integer}
  1030. Specifies the Hap format to encode.
  1031. @table @option
  1032. @item hap
  1033. @item hap_alpha
  1034. @item hap_q
  1035. @end table
  1036. Default value is @option{hap}.
  1037. @item chunks @var{integer}
  1038. Specifies the number of chunks to split frames into, between 1 and 64. This
  1039. permits multithreaded decoding of large frames, potentially at the cost of
  1040. data-rate. The encoder may modify this value to divide frames evenly.
  1041. Default value is @var{1}.
  1042. @item compressor @var{integer}
  1043. Specifies the second-stage compressor to use. If set to @option{none},
  1044. @option{chunks} will be limited to 1, as chunked uncompressed frames offer no
  1045. benefit.
  1046. @table @option
  1047. @item none
  1048. @item snappy
  1049. @end table
  1050. Default value is @option{snappy}.
  1051. @end table
  1052. @section jpeg2000
  1053. The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
  1054. option can be used to set the encoding quality. Lossless encoding
  1055. can be selected with @code{-pred 1}.
  1056. @subsection Options
  1057. @table @option
  1058. @item format
  1059. Can be set to either @code{j2k} or @code{jp2} (the default) that
  1060. makes it possible to store non-rgb pix_fmts.
  1061. @end table
  1062. @section libaom-av1
  1063. libaom AV1 encoder wrapper.
  1064. Requires the presence of the libaom headers and library during
  1065. configuration. You need to explicitly configure the build with
  1066. @code{--enable-libaom}.
  1067. @subsection Options
  1068. The wrapper supports the following standard libavcodec options:
  1069. @table @option
  1070. @item b
  1071. Set bitrate target in bits/second. By default this will use
  1072. variable-bitrate mode. If @option{maxrate} and @option{minrate} are
  1073. also set to the same value then it will use constant-bitrate mode,
  1074. otherwise if @option{crf} is set as well then it will use
  1075. constrained-quality mode.
  1076. @item g keyint_min
  1077. Set key frame placement. The GOP size sets the maximum distance between
  1078. key frames; if zero the output stream will be intra-only. The minimum
  1079. distance is ignored unless it is the same as the GOP size, in which case
  1080. key frames will always appear at a fixed interval. Not set by default,
  1081. so without this option the library has completely free choice about
  1082. where to place key frames.
  1083. @item qmin qmax
  1084. Set minimum/maximum quantisation values. Valid range is from 0 to 63
  1085. (warning: this does not match the quantiser values actually used by AV1
  1086. - divide by four to map real quantiser values to this range). Defaults
  1087. to min/max (no constraint).
  1088. @item minrate maxrate bufsize rc_init_occupancy
  1089. Set rate control buffering parameters. Not used if not set - defaults
  1090. to unconstrained variable bitrate.
  1091. @item threads
  1092. Set the number of threads to use while encoding. This may require the
  1093. @option{tiles} or @option{row-mt} options to also be set to actually
  1094. use the specified number of threads fully. Defaults to the number of
  1095. hardware threads supported by the host machine.
  1096. @item profile
  1097. Set the encoding profile. Defaults to using the profile which matches
  1098. the bit depth and chroma subsampling of the input.
  1099. @end table
  1100. The wrapper also has some specific options:
  1101. @table @option
  1102. @item cpu-used
  1103. Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  1104. higher numbers indicating greater speed and lower quality. The default
  1105. value is 1, which will be slow and high quality.
  1106. @item auto-alt-ref
  1107. Enable use of alternate reference frames. Defaults to the internal
  1108. default of the library.
  1109. @item arnr-max-frames (@emph{frames})
  1110. Set altref noise reduction max frame count. Default is -1.
  1111. @item arnr-strength (@emph{strength})
  1112. Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  1113. @item aq-mode (@emph{aq-mode})
  1114. Set adaptive quantization mode. Possible values:
  1115. @table @samp
  1116. @item none (@emph{0})
  1117. Disabled.
  1118. @item variance (@emph{1})
  1119. Variance-based.
  1120. @item complexity (@emph{2})
  1121. Complexity-based.
  1122. @item cyclic (@emph{3})
  1123. Cyclic refresh.
  1124. @end table
  1125. @item lag-in-frames
  1126. Set the maximum number of frames which the encoder may keep in flight
  1127. at any one time for lookahead purposes. Defaults to the internal
  1128. default of the library.
  1129. @item error-resilience
  1130. Enable error resilience features:
  1131. @table @option
  1132. @item default
  1133. Improve resilience against losses of whole frames.
  1134. @end table
  1135. Not enabled by default.
  1136. @item crf
  1137. Set the quality/size tradeoff for constant-quality (no bitrate target)
  1138. and constrained-quality (with maximum bitrate target) modes. Valid
  1139. range is 0 to 63, higher numbers indicating lower quality and smaller
  1140. output size. Only used if set; by default only the bitrate target is
  1141. used.
  1142. @item static-thresh
  1143. Set a change threshold on blocks below which they will be skipped by
  1144. the encoder. Defined in arbitrary units as a nonnegative integer,
  1145. defaulting to zero (no blocks are skipped).
  1146. @item drop-threshold
  1147. Set a threshold for dropping frames when close to rate control bounds.
  1148. Defined as a percentage of the target buffer - when the rate control
  1149. buffer falls below this percentage, frames will be dropped until it
  1150. has refilled above the threshold. Defaults to zero (no frames are
  1151. dropped).
  1152. @item denoise-noise-level (@emph{level})
  1153. Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  1154. this option is not set or set to 0.
  1155. @item denoise-block-size (@emph{pixels})
  1156. Block size used for denoising for grain synthesis. If not set, AV1 codec
  1157. uses the default value of 32.
  1158. @item undershoot-pct (@emph{pct})
  1159. Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  1160. Default is -1.
  1161. @item overshoot-pct (@emph{pct})
  1162. Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  1163. Default is -1.
  1164. @item minsection-pct (@emph{pct})
  1165. Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  1166. is not set, the libaomenc wrapper computes it as follows: @code{(minrate * 100 / bitrate)}.
  1167. Range is -1 to 100. Default is -1 (unset).
  1168. @item maxsection-pct (@emph{pct})
  1169. Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  1170. is not set, the libaomenc wrapper computes it as follows: @code{(maxrate * 100 / bitrate)}.
  1171. Range is -1 to 5000. Default is -1 (unset).
  1172. @item frame-parallel (@emph{boolean})
  1173. Enable frame parallel decodability features. Default is true.
  1174. @item tiles
  1175. Set the number of tiles to encode the input video with, as columns x
  1176. rows. Larger numbers allow greater parallelism in both encoding and
  1177. decoding, but may decrease coding efficiency. Defaults to the minimum
  1178. number of tiles required by the size of the input video (this is 1x1
  1179. (that is, a single tile) for sizes up to and including 4K).
  1180. @item tile-columns tile-rows
  1181. Set the number of tiles as log2 of the number of tile rows and columns.
  1182. Provided for compatibility with libvpx/VP9.
  1183. @item row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
  1184. Enable row based multi-threading. Disabled by default.
  1185. @item enable-cdef (@emph{boolean})
  1186. Enable Constrained Directional Enhancement Filter. The libaom-av1
  1187. encoder enables CDEF by default.
  1188. @item enable-global-motion (@emph{boolean})
  1189. Enable the use of global motion for block prediction. Default is true.
  1190. @item enable-intrabc (@emph{boolean})
  1191. Enable block copy mode for intra block prediction. This mode is
  1192. useful for screen content. Default is true.
  1193. @end table
  1194. @section libkvazaar
  1195. Kvazaar H.265/HEVC encoder.
  1196. Requires the presence of the libkvazaar headers and library during
  1197. configuration. You need to explicitly configure the build with
  1198. @option{--enable-libkvazaar}.
  1199. @subsection Options
  1200. @table @option
  1201. @item b
  1202. Set target video bitrate in bit/s and enable rate control.
  1203. @item kvazaar-params
  1204. Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
  1205. by commas (,). See kvazaar documentation for a list of options.
  1206. @end table
  1207. @section libopenh264
  1208. Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  1209. This encoder requires the presence of the libopenh264 headers and
  1210. library during configuration. You need to explicitly configure the
  1211. build with @code{--enable-libopenh264}. The library is detected using
  1212. @command{pkg-config}.
  1213. For more information about the library see
  1214. @url{http://www.openh264.org}.
  1215. @subsection Options
  1216. The following FFmpeg global options affect the configurations of the
  1217. libopenh264 encoder.
  1218. @table @option
  1219. @item b
  1220. Set the bitrate (as a number of bits per second).
  1221. @item g
  1222. Set the GOP size.
  1223. @item maxrate
  1224. Set the max bitrate (as a number of bits per second).
  1225. @item flags +global_header
  1226. Set global header in the bitstream.
  1227. @item slices
  1228. Set the number of slices, used in parallelized encoding. Default value
  1229. is 0. This is only used when @option{slice_mode} is set to
  1230. @samp{fixed}.
  1231. @item slice_mode
  1232. Set slice mode. Can assume one of the following possible values:
  1233. @table @samp
  1234. @item fixed
  1235. a fixed number of slices
  1236. @item rowmb
  1237. one slice per row of macroblocks
  1238. @item auto
  1239. automatic number of slices according to number of threads
  1240. @item dyn
  1241. dynamic slicing
  1242. @end table
  1243. Default value is @samp{auto}.
  1244. @item loopfilter
  1245. Enable loop filter, if set to 1 (automatically enabled). To disable
  1246. set a value of 0.
  1247. @item profile
  1248. Set profile restrictions. If set to the value of @samp{main} enable
  1249. CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
  1250. @item max_nal_size
  1251. Set maximum NAL size in bytes.
  1252. @item allow_skip_frames
  1253. Allow skipping frames to hit the target bitrate if set to 1.
  1254. @end table
  1255. @section libtheora
  1256. libtheora Theora encoder wrapper.
  1257. Requires the presence of the libtheora headers and library during
  1258. configuration. You need to explicitly configure the build with
  1259. @code{--enable-libtheora}.
  1260. For more information about the libtheora project see
  1261. @url{http://www.theora.org/}.
  1262. @subsection Options
  1263. The following global options are mapped to internal libtheora options
  1264. which affect the quality and the bitrate of the encoded stream.
  1265. @table @option
  1266. @item b
  1267. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  1268. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  1269. @item flags
  1270. Used to enable constant quality mode (VBR) encoding through the
  1271. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  1272. modes.
  1273. @item g
  1274. Set the GOP size.
  1275. @item global_quality
  1276. Set the global quality as an integer in lambda units.
  1277. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  1278. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  1279. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  1280. value in the native libtheora range [0-63]. A higher value corresponds
  1281. to a higher quality.
  1282. @item q
  1283. Enable VBR mode when set to a non-negative value, and set constant
  1284. quality value as a double floating point value in QP units.
  1285. The value is clipped in the [0-10] range, and then multiplied by 6.3
  1286. to get a value in the native libtheora range [0-63].
  1287. This option is valid only using the @command{ffmpeg} command-line
  1288. tool. For library interface users, use @option{global_quality}.
  1289. @end table
  1290. @subsection Examples
  1291. @itemize
  1292. @item
  1293. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  1294. @example
  1295. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  1296. @end example
  1297. @item
  1298. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  1299. @example
  1300. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  1301. @end example
  1302. @end itemize
  1303. @section libvpx
  1304. VP8/VP9 format supported through libvpx.
  1305. Requires the presence of the libvpx headers and library during configuration.
  1306. You need to explicitly configure the build with @code{--enable-libvpx}.
  1307. @subsection Options
  1308. The following options are supported by the libvpx wrapper. The
  1309. @command{vpxenc}-equivalent options or values are listed in parentheses
  1310. for easy migration.
  1311. To reduce the duplication of documentation, only the private options
  1312. and some others requiring special attention are documented here. For
  1313. the documentation of the undocumented generic options, see
  1314. @ref{codec-options,,the Codec Options chapter}.
  1315. To get more documentation of the libvpx options, invoke the command
  1316. @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
  1317. @command{vpxenc --help}. Further information is available in the libvpx API
  1318. documentation.
  1319. @table @option
  1320. @item b (@emph{target-bitrate})
  1321. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1322. expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
  1323. kilobits/s.
  1324. @item g (@emph{kf-max-dist})
  1325. @item keyint_min (@emph{kf-min-dist})
  1326. @item qmin (@emph{min-q})
  1327. @item qmax (@emph{max-q})
  1328. @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
  1329. Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
  1330. specified in milliseconds, the libvpx wrapper converts this value as follows:
  1331. @code{buf-sz = bufsize * 1000 / bitrate},
  1332. @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
  1333. @item rc_init_occupancy (@emph{buf-initial-sz})
  1334. Set number of bits which should be loaded into the rc buffer before decoding
  1335. starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
  1336. wrapper converts this value as follows:
  1337. @code{rc_init_occupancy * 1000 / bitrate}.
  1338. @item undershoot-pct
  1339. Set datarate undershoot (min) percentage of the target bitrate.
  1340. @item overshoot-pct
  1341. Set datarate overshoot (max) percentage of the target bitrate.
  1342. @item skip_threshold (@emph{drop-frame})
  1343. @item qcomp (@emph{bias-pct})
  1344. @item maxrate (@emph{maxsection-pct})
  1345. Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1346. percentage of the target bitrate, the libvpx wrapper converts this value as
  1347. follows: @code{(maxrate * 100 / bitrate)}.
  1348. @item minrate (@emph{minsection-pct})
  1349. Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1350. percentage of the target bitrate, the libvpx wrapper converts this value as
  1351. follows: @code{(minrate * 100 / bitrate)}.
  1352. @item minrate, maxrate, b @emph{end-usage=cbr}
  1353. @code{(minrate == maxrate == bitrate)}.
  1354. @item crf (@emph{end-usage=cq}, @emph{cq-level})
  1355. @item tune (@emph{tune})
  1356. @table @samp
  1357. @item psnr (@emph{psnr})
  1358. @item ssim (@emph{ssim})
  1359. @end table
  1360. @item quality, deadline (@emph{deadline})
  1361. @table @samp
  1362. @item best
  1363. Use best quality deadline. Poorly named and quite slow, this option should be
  1364. avoided as it may give worse quality output than good.
  1365. @item good
  1366. Use good quality deadline. This is a good trade-off between speed and quality
  1367. when used with the @option{cpu-used} option.
  1368. @item realtime
  1369. Use realtime quality deadline.
  1370. @end table
  1371. @item speed, cpu-used (@emph{cpu-used})
  1372. Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  1373. of quality.
  1374. @item nr (@emph{noise-sensitivity})
  1375. @item static-thresh
  1376. Set a change threshold on blocks below which they will be skipped by the
  1377. encoder.
  1378. @item slices (@emph{token-parts})
  1379. Note that FFmpeg's @option{slices} option gives the total number of partitions,
  1380. while @command{vpxenc}'s @option{token-parts} is given as
  1381. @code{log2(partitions)}.
  1382. @item max-intra-rate
  1383. Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  1384. means unlimited.
  1385. @item force_key_frames
  1386. @code{VPX_EFLAG_FORCE_KF}
  1387. @item Alternate reference frame related
  1388. @table @option
  1389. @item auto-alt-ref
  1390. Enable use of alternate reference frames (2-pass only).
  1391. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  1392. @item arnr-maxframes
  1393. Set altref noise reduction max frame count.
  1394. @item arnr-type
  1395. Set altref noise reduction filter type: backward, forward, centered.
  1396. @item arnr-strength
  1397. Set altref noise reduction filter strength.
  1398. @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
  1399. Set number of frames to look ahead for frametype and ratecontrol.
  1400. @end table
  1401. @item error-resilient
  1402. Enable error resiliency features.
  1403. @item sharpness @var{integer}
  1404. Increase sharpness at the expense of lower PSNR.
  1405. The valid range is [0, 7].
  1406. @item VP8-specific options
  1407. @table @option
  1408. @item ts-parameters
  1409. Sets the temporal scalability configuration using a :-separated list of
  1410. key=value pairs. For example, to specify temporal scalability parameters
  1411. with @code{ffmpeg}:
  1412. @example
  1413. ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  1414. ts_target_bitrate=250000,500000,1000000:ts_rate_decimator=4,2,1:\
  1415. ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
  1416. @end example
  1417. Below is a brief explanation of each of the parameters, please
  1418. refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
  1419. details.
  1420. @table @option
  1421. @item ts_number_layers
  1422. Number of temporal coding layers.
  1423. @item ts_target_bitrate
  1424. Target bitrate for each temporal layer.
  1425. @item ts_rate_decimator
  1426. Frame rate decimation factor for each temporal layer.
  1427. @item ts_periodicity
  1428. Length of the sequence defining frame temporal layer membership.
  1429. @item ts_layer_id
  1430. Template defining the membership of frames to temporal layers.
  1431. @end table
  1432. @end table
  1433. @item VP9-specific options
  1434. @table @option
  1435. @item lossless
  1436. Enable lossless mode.
  1437. @item tile-columns
  1438. Set number of tile columns to use. Note this is given as
  1439. @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
  1440. setting the @option{tile-columns} option to 3.
  1441. @item tile-rows
  1442. Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
  1443. For example, 4 tile rows would be requested by setting the @option{tile-rows}
  1444. option to 2.
  1445. @item frame-parallel
  1446. Enable frame parallel decodability features.
  1447. @item aq-mode
  1448. Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  1449. cyclic refresh, 4: equator360).
  1450. @item colorspace @emph{color-space}
  1451. Set input color space. The VP9 bitstream supports signaling the following
  1452. colorspaces:
  1453. @table @option
  1454. @item @samp{rgb} @emph{sRGB}
  1455. @item @samp{bt709} @emph{bt709}
  1456. @item @samp{unspecified} @emph{unknown}
  1457. @item @samp{bt470bg} @emph{bt601}
  1458. @item @samp{smpte170m} @emph{smpte170}
  1459. @item @samp{smpte240m} @emph{smpte240}
  1460. @item @samp{bt2020_ncl} @emph{bt2020}
  1461. @end table
  1462. @item row-mt @var{boolean}
  1463. Enable row based multi-threading.
  1464. @item tune-content
  1465. Set content type: default (0), screen (1), film (2).
  1466. @item corpus-complexity
  1467. Corpus VBR mode is a variant of standard VBR where the complexity distribution
  1468. midpoint is passed in rather than calculated for a specific clip or chunk.
  1469. The valid range is [0, 10000]. 0 (default) uses standard VBR.
  1470. @item enable-tpl @var{boolean}
  1471. Enable temporal dependency model.
  1472. @end table
  1473. @end table
  1474. For more information about libvpx see:
  1475. @url{http://www.webmproject.org/}
  1476. @section libwebp
  1477. libwebp WebP Image encoder wrapper
  1478. libwebp is Google's official encoder for WebP images. It can encode in either
  1479. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  1480. frame. Lossless images are a separate codec developed by Google.
  1481. @subsection Pixel Format
  1482. Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  1483. to limitations of the format and libwebp. Alpha is supported for either mode.
  1484. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  1485. passed in for encoding lossless, the pixel format will automatically be
  1486. converted using functions from libwebp. This is not ideal and is done only for
  1487. convenience.
  1488. @subsection Options
  1489. @table @option
  1490. @item -lossless @var{boolean}
  1491. Enables/Disables use of lossless mode. Default is 0.
  1492. @item -compression_level @var{integer}
  1493. For lossy, this is a quality/speed tradeoff. Higher values give better quality
  1494. for a given size at the cost of increased encoding time. For lossless, this is
  1495. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  1496. encoding time. More specifically, it controls the number of extra algorithms
  1497. and compression tools used, and varies the combination of these tools. This
  1498. maps to the @var{method} option in libwebp. The valid range is 0 to 6.
  1499. Default is 4.
  1500. @item -qscale @var{float}
  1501. For lossy encoding, this controls image quality, 0 to 100. For lossless
  1502. encoding, this controls the effort and time spent at compressing more. The
  1503. default value is 75. Note that for usage via libavcodec, this option is called
  1504. @var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
  1505. @item -preset @var{type}
  1506. Configuration preset. This does some automatic settings based on the general
  1507. type of the image.
  1508. @table @option
  1509. @item none
  1510. Do not use a preset.
  1511. @item default
  1512. Use the encoder default.
  1513. @item picture
  1514. Digital picture, like portrait, inner shot
  1515. @item photo
  1516. Outdoor photograph, with natural lighting
  1517. @item drawing
  1518. Hand or line drawing, with high-contrast details
  1519. @item icon
  1520. Small-sized colorful images
  1521. @item text
  1522. Text-like
  1523. @end table
  1524. @end table
  1525. @section libx264, libx264rgb
  1526. x264 H.264/MPEG-4 AVC encoder wrapper.
  1527. This encoder requires the presence of the libx264 headers and library
  1528. during configuration. You need to explicitly configure the build with
  1529. @code{--enable-libx264}.
  1530. libx264 supports an impressive number of features, including 8x8 and
  1531. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1532. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1533. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1534. Many libx264 encoder options are mapped to FFmpeg global codec
  1535. options, while unique encoder options are provided through private
  1536. options. Additionally the @option{x264opts} and @option{x264-params}
  1537. private options allows one to pass a list of key=value tuples as accepted
  1538. by the libx264 @code{x264_param_parse} function.
  1539. The x264 project website is at
  1540. @url{http://www.videolan.org/developers/x264.html}.
  1541. The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  1542. pixel formats as input instead of YUV.
  1543. @subsection Supported Pixel Formats
  1544. x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  1545. x264's configure time. FFmpeg only supports one bit depth in one particular
  1546. build. In other words, it is not possible to build one FFmpeg with multiple
  1547. versions of x264 with different bit depths.
  1548. @subsection Options
  1549. The following options are supported by the libx264 wrapper. The
  1550. @command{x264}-equivalent options or values are listed in parentheses
  1551. for easy migration.
  1552. To reduce the duplication of documentation, only the private options
  1553. and some others requiring special attention are documented here. For
  1554. the documentation of the undocumented generic options, see
  1555. @ref{codec-options,,the Codec Options chapter}.
  1556. To get a more accurate and extensive documentation of the libx264
  1557. options, invoke the command @command{x264 --fullhelp} or consult
  1558. the libx264 documentation.
  1559. @table @option
  1560. @item b (@emph{bitrate})
  1561. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1562. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1563. kilobits/s.
  1564. @item bf (@emph{bframes})
  1565. @item g (@emph{keyint})
  1566. @item qmin (@emph{qpmin})
  1567. Minimum quantizer scale.
  1568. @item qmax (@emph{qpmax})
  1569. Maximum quantizer scale.
  1570. @item qdiff (@emph{qpstep})
  1571. Maximum difference between quantizer scales.
  1572. @item qblur (@emph{qblur})
  1573. Quantizer curve blur
  1574. @item qcomp (@emph{qcomp})
  1575. Quantizer curve compression factor
  1576. @item refs (@emph{ref})
  1577. Number of reference frames each P-frame can use. The range is from @var{0-16}.
  1578. @item sc_threshold (@emph{scenecut})
  1579. Sets the threshold for the scene change detection.
  1580. @item trellis (@emph{trellis})
  1581. Performs Trellis quantization to increase efficiency. Enabled by default.
  1582. @item nr (@emph{nr})
  1583. @item me_range (@emph{merange})
  1584. Maximum range of the motion search in pixels.
  1585. @item me_method (@emph{me})
  1586. Set motion estimation method. Possible values in the decreasing order
  1587. of speed:
  1588. @table @samp
  1589. @item dia (@emph{dia})
  1590. @item epzs (@emph{dia})
  1591. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1592. @samp{dia}.
  1593. @item hex (@emph{hex})
  1594. Hexagonal search with radius 2.
  1595. @item umh (@emph{umh})
  1596. Uneven multi-hexagon search.
  1597. @item esa (@emph{esa})
  1598. Exhaustive search.
  1599. @item tesa (@emph{tesa})
  1600. Hadamard exhaustive search (slowest).
  1601. @end table
  1602. @item forced-idr
  1603. Normally, when forcing a I-frame type, the encoder can select any type
  1604. of I-frame. This option forces it to choose an IDR-frame.
  1605. @item subq (@emph{subme})
  1606. Sub-pixel motion estimation method.
  1607. @item b_strategy (@emph{b-adapt})
  1608. Adaptive B-frame placement decision algorithm. Use only on first-pass.
  1609. @item keyint_min (@emph{min-keyint})
  1610. Minimum GOP size.
  1611. @item coder
  1612. Set entropy encoder. Possible values:
  1613. @table @samp
  1614. @item ac
  1615. Enable CABAC.
  1616. @item vlc
  1617. Enable CAVLC and disable CABAC. It generates the same effect as
  1618. @command{x264}'s @option{--no-cabac} option.
  1619. @end table
  1620. @item cmp
  1621. Set full pixel motion estimation comparison algorithm. Possible values:
  1622. @table @samp
  1623. @item chroma
  1624. Enable chroma in motion estimation.
  1625. @item sad
  1626. Ignore chroma in motion estimation. It generates the same effect as
  1627. @command{x264}'s @option{--no-chroma-me} option.
  1628. @end table
  1629. @item threads (@emph{threads})
  1630. Number of encoding threads.
  1631. @item thread_type
  1632. Set multithreading technique. Possible values:
  1633. @table @samp
  1634. @item slice
  1635. Slice-based multithreading. It generates the same effect as
  1636. @command{x264}'s @option{--sliced-threads} option.
  1637. @item frame
  1638. Frame-based multithreading.
  1639. @end table
  1640. @item flags
  1641. Set encoding flags. It can be used to disable closed GOP and enable
  1642. open GOP by setting it to @code{-cgop}. The result is similar to
  1643. the behavior of @command{x264}'s @option{--open-gop} option.
  1644. @item rc_init_occupancy (@emph{vbv-init})
  1645. @item preset (@emph{preset})
  1646. Set the encoding preset.
  1647. @item tune (@emph{tune})
  1648. Set tuning of the encoding params.
  1649. @item profile (@emph{profile})
  1650. Set profile restrictions.
  1651. @item fastfirstpass
  1652. Enable fast settings when encoding first pass, when set to 1. When set
  1653. to 0, it has the same effect of @command{x264}'s
  1654. @option{--slow-firstpass} option.
  1655. @item crf (@emph{crf})
  1656. Set the quality for constant quality mode.
  1657. @item crf_max (@emph{crf-max})
  1658. In CRF mode, prevents VBV from lowering quality beyond this point.
  1659. @item qp (@emph{qp})
  1660. Set constant quantization rate control method parameter.
  1661. @item aq-mode (@emph{aq-mode})
  1662. Set AQ method. Possible values:
  1663. @table @samp
  1664. @item none (@emph{0})
  1665. Disabled.
  1666. @item variance (@emph{1})
  1667. Variance AQ (complexity mask).
  1668. @item autovariance (@emph{2})
  1669. Auto-variance AQ (experimental).
  1670. @end table
  1671. @item aq-strength (@emph{aq-strength})
  1672. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1673. @item psy
  1674. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1675. same effect as @command{x264}'s @option{--no-psy} option.
  1676. @item psy-rd (@emph{psy-rd})
  1677. Set strength of psychovisual optimization, in
  1678. @var{psy-rd}:@var{psy-trellis} format.
  1679. @item rc-lookahead (@emph{rc-lookahead})
  1680. Set number of frames to look ahead for frametype and ratecontrol.
  1681. @item weightb
  1682. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1683. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1684. @item weightp (@emph{weightp})
  1685. Set weighted prediction method for P-frames. Possible values:
  1686. @table @samp
  1687. @item none (@emph{0})
  1688. Disabled
  1689. @item simple (@emph{1})
  1690. Enable only weighted refs
  1691. @item smart (@emph{2})
  1692. Enable both weighted refs and duplicates
  1693. @end table
  1694. @item ssim (@emph{ssim})
  1695. Enable calculation and printing SSIM stats after the encoding.
  1696. @item intra-refresh (@emph{intra-refresh})
  1697. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1698. to 1.
  1699. @item avcintra-class (@emph{class})
  1700. Configure the encoder to generate AVC-Intra.
  1701. Valid values are 50,100 and 200
  1702. @item bluray-compat (@emph{bluray-compat})
  1703. Configure the encoder to be compatible with the bluray standard.
  1704. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  1705. @item b-bias (@emph{b-bias})
  1706. Set the influence on how often B-frames are used.
  1707. @item b-pyramid (@emph{b-pyramid})
  1708. Set method for keeping of some B-frames as references. Possible values:
  1709. @table @samp
  1710. @item none (@emph{none})
  1711. Disabled.
  1712. @item strict (@emph{strict})
  1713. Strictly hierarchical pyramid.
  1714. @item normal (@emph{normal})
  1715. Non-strict (not Blu-ray compatible).
  1716. @end table
  1717. @item mixed-refs
  1718. Enable the use of one reference per partition, as opposed to one
  1719. reference per macroblock when set to 1. When set to 0, it has the
  1720. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  1721. @item 8x8dct
  1722. Enable adaptive spatial transform (high profile 8x8 transform)
  1723. when set to 1. When set to 0, it has the same effect as
  1724. @command{x264}'s @option{--no-8x8dct} option.
  1725. @item fast-pskip
  1726. Enable early SKIP detection on P-frames when set to 1. When set
  1727. to 0, it has the same effect as @command{x264}'s
  1728. @option{--no-fast-pskip} option.
  1729. @item aud (@emph{aud})
  1730. Enable use of access unit delimiters when set to 1.
  1731. @item mbtree
  1732. Enable use macroblock tree ratecontrol when set to 1. When set
  1733. to 0, it has the same effect as @command{x264}'s
  1734. @option{--no-mbtree} option.
  1735. @item deblock (@emph{deblock})
  1736. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  1737. @item cplxblur (@emph{cplxblur})
  1738. Set fluctuations reduction in QP (before curve compression).
  1739. @item partitions (@emph{partitions})
  1740. Set partitions to consider as a comma-separated list of. Possible
  1741. values in the list:
  1742. @table @samp
  1743. @item p8x8
  1744. 8x8 P-frame partition.
  1745. @item p4x4
  1746. 4x4 P-frame partition.
  1747. @item b8x8
  1748. 4x4 B-frame partition.
  1749. @item i8x8
  1750. 8x8 I-frame partition.
  1751. @item i4x4
  1752. 4x4 I-frame partition.
  1753. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  1754. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  1755. option) to be enabled.)
  1756. @item none (@emph{none})
  1757. Do not consider any partitions.
  1758. @item all (@emph{all})
  1759. Consider every partition.
  1760. @end table
  1761. @item direct-pred (@emph{direct})
  1762. Set direct MV prediction mode. Possible values:
  1763. @table @samp
  1764. @item none (@emph{none})
  1765. Disable MV prediction.
  1766. @item spatial (@emph{spatial})
  1767. Enable spatial predicting.
  1768. @item temporal (@emph{temporal})
  1769. Enable temporal predicting.
  1770. @item auto (@emph{auto})
  1771. Automatically decided.
  1772. @end table
  1773. @item slice-max-size (@emph{slice-max-size})
  1774. Set the limit of the size of each slice in bytes. If not specified
  1775. but RTP payload size (@option{ps}) is specified, that is used.
  1776. @item stats (@emph{stats})
  1777. Set the file name for multi-pass stats.
  1778. @item nal-hrd (@emph{nal-hrd})
  1779. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  1780. Possible values:
  1781. @table @samp
  1782. @item none (@emph{none})
  1783. Disable HRD information signaling.
  1784. @item vbr (@emph{vbr})
  1785. Variable bit rate.
  1786. @item cbr (@emph{cbr})
  1787. Constant bit rate (not allowed in MP4 container).
  1788. @end table
  1789. @item x264opts (N.A.)
  1790. Set any x264 option, see @command{x264 --fullhelp} for a list.
  1791. Argument is a list of @var{key}=@var{value} couples separated by
  1792. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  1793. themselves, use "," instead. They accept it as well since long ago but this
  1794. is kept undocumented for some reason.
  1795. For example to specify libx264 encoding options with @command{ffmpeg}:
  1796. @example
  1797. ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  1798. @end example
  1799. @item a53cc @var{boolean}
  1800. Import closed captions (which must be ATSC compatible format) into output.
  1801. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  1802. @item x264-params (N.A.)
  1803. Override the x264 configuration using a :-separated list of key=value
  1804. parameters.
  1805. This option is functionally the same as the @option{x264opts}, but is
  1806. duplicated for compatibility with the Libav fork.
  1807. For example to specify libx264 encoding options with @command{ffmpeg}:
  1808. @example
  1809. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  1810. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  1811. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  1812. @end example
  1813. @end table
  1814. Encoding ffpresets for common usages are provided so they can be used with the
  1815. general presets system (e.g. passing the @option{pre} option).
  1816. @section libx265
  1817. x265 H.265/HEVC encoder wrapper.
  1818. This encoder requires the presence of the libx265 headers and library
  1819. during configuration. You need to explicitly configure the build with
  1820. @option{--enable-libx265}.
  1821. @subsection Options
  1822. @table @option
  1823. @item preset
  1824. Set the x265 preset.
  1825. @item tune
  1826. Set the x265 tune parameter.
  1827. @item profile
  1828. Set profile restrictions.
  1829. @item crf
  1830. Set the quality for constant quality mode.
  1831. @item forced-idr
  1832. Normally, when forcing a I-frame type, the encoder can select any type
  1833. of I-frame. This option forces it to choose an IDR-frame.
  1834. @item x265-params
  1835. Set x265 options using a list of @var{key}=@var{value} couples separated
  1836. by ":". See @command{x265 --help} for a list of options.
  1837. For example to specify libx265 encoding options with @option{-x265-params}:
  1838. @example
  1839. ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  1840. @end example
  1841. @end table
  1842. @section libxavs2
  1843. xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  1844. This encoder requires the presence of the libxavs2 headers and library
  1845. during configuration. You need to explicitly configure the build with
  1846. @option{--enable-libxavs2}.
  1847. The following standard libavcodec options are used:
  1848. @itemize
  1849. @item
  1850. @option{b} / @option{bit_rate}
  1851. @item
  1852. @option{g} / @option{gop_size}
  1853. @item
  1854. @option{bf} / @option{max_b_frames}
  1855. @end itemize
  1856. The encoder also has its own specific options:
  1857. @subsection Options
  1858. @table @option
  1859. @item lcu_row_threads
  1860. Set the number of parallel threads for rows from 1 to 8 (default 5).
  1861. @item initial_qp
  1862. Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  1863. used to set the initial qp for the first frame.
  1864. @item qp
  1865. Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  1866. used to set the qp value under constant-QP mode.
  1867. @item max_qp
  1868. Set the max qp for rate control from 1 to 63 (default 55).
  1869. @item min_qp
  1870. Set the min qp for rate control from 1 to 63 (default 20).
  1871. @item speed_level
  1872. Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  1873. @item log_level
  1874. Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  1875. 1: warning, 2: info, 3: debug.
  1876. @item xavs2-params
  1877. Set xavs2 options using a list of @var{key}=@var{value} couples separated
  1878. by ":".
  1879. For example to specify libxavs2 encoding options with @option{-xavs2-params}:
  1880. @example
  1881. ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  1882. @end example
  1883. @end table
  1884. @section libxvid
  1885. Xvid MPEG-4 Part 2 encoder wrapper.
  1886. This encoder requires the presence of the libxvidcore headers and library
  1887. during configuration. You need to explicitly configure the build with
  1888. @code{--enable-libxvid --enable-gpl}.
  1889. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  1890. users can encode to this format without this library.
  1891. @subsection Options
  1892. The following options are supported by the libxvid wrapper. Some of
  1893. the following options are listed but are not documented, and
  1894. correspond to shared codec options. See @ref{codec-options,,the Codec
  1895. Options chapter} for their documentation. The other shared options
  1896. which are not listed have no effect for the libxvid encoder.
  1897. @table @option
  1898. @item b
  1899. @item g
  1900. @item qmin
  1901. @item qmax
  1902. @item mpeg_quant
  1903. @item threads
  1904. @item bf
  1905. @item b_qfactor
  1906. @item b_qoffset
  1907. @item flags
  1908. Set specific encoding flags. Possible values:
  1909. @table @samp
  1910. @item mv4
  1911. Use four motion vector by macroblock.
  1912. @item aic
  1913. Enable high quality AC prediction.
  1914. @item gray
  1915. Only encode grayscale.
  1916. @item gmc
  1917. Enable the use of global motion compensation (GMC).
  1918. @item qpel
  1919. Enable quarter-pixel motion compensation.
  1920. @item cgop
  1921. Enable closed GOP.
  1922. @item global_header
  1923. Place global headers in extradata instead of every keyframe.
  1924. @end table
  1925. @item trellis
  1926. @item me_method
  1927. Set motion estimation method. Possible values in decreasing order of
  1928. speed and increasing order of quality:
  1929. @table @samp
  1930. @item zero
  1931. Use no motion estimation (default).
  1932. @item phods
  1933. @item x1
  1934. @item log
  1935. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  1936. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  1937. @samp{phods}.
  1938. @item epzs
  1939. Enable all of the things described above, plus advanced diamond zonal
  1940. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  1941. estimation on chroma planes.
  1942. @item full
  1943. Enable all of the things described above, plus extended 16x16 and 8x8
  1944. blocks search.
  1945. @end table
  1946. @item mbd
  1947. Set macroblock decision algorithm. Possible values in the increasing
  1948. order of quality:
  1949. @table @samp
  1950. @item simple
  1951. Use macroblock comparing function algorithm (default).
  1952. @item bits
  1953. Enable rate distortion-based half pixel and quarter pixel refinement for
  1954. 16x16 blocks.
  1955. @item rd
  1956. Enable all of the things described above, plus rate distortion-based
  1957. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  1958. distortion-based search using square pattern.
  1959. @end table
  1960. @item lumi_aq
  1961. Enable lumi masking adaptive quantization when set to 1. Default is 0
  1962. (disabled).
  1963. @item variance_aq
  1964. Enable variance adaptive quantization when set to 1. Default is 0
  1965. (disabled).
  1966. When combined with @option{lumi_aq}, the resulting quality will not
  1967. be better than any of the two specified individually. In other
  1968. words, the resulting quality will be the worse one of the two
  1969. effects.
  1970. @item ssim
  1971. Set structural similarity (SSIM) displaying method. Possible values:
  1972. @table @samp
  1973. @item off
  1974. Disable displaying of SSIM information.
  1975. @item avg
  1976. Output average SSIM at the end of encoding to stdout. The format of
  1977. showing the average SSIM is:
  1978. @example
  1979. Average SSIM: %f
  1980. @end example
  1981. For users who are not familiar with C, %f means a float number, or
  1982. a decimal (e.g. 0.939232).
  1983. @item frame
  1984. Output both per-frame SSIM data during encoding and average SSIM at
  1985. the end of encoding to stdout. The format of per-frame information
  1986. is:
  1987. @example
  1988. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  1989. @end example
  1990. For users who are not familiar with C, %1.3f means a float number
  1991. rounded to 3 digits after the dot (e.g. 0.932).
  1992. @end table
  1993. @item ssim_acc
  1994. Set SSIM accuracy. Valid options are integers within the range of
  1995. 0-4, while 0 gives the most accurate result and 4 computes the
  1996. fastest.
  1997. @end table
  1998. @section mpeg2
  1999. MPEG-2 video encoder.
  2000. @subsection Options
  2001. @table @option
  2002. @item seq_disp_ext @var{integer}
  2003. Specifies if the encoder should write a sequence_display_extension to the
  2004. output.
  2005. @table @option
  2006. @item -1
  2007. @itemx auto
  2008. Decide automatically to write it or not (this is the default) by checking if
  2009. the data to be written is different from the default or unspecified values.
  2010. @item 0
  2011. @itemx never
  2012. Never write it.
  2013. @item 1
  2014. @itemx always
  2015. Always write it.
  2016. @end table
  2017. @item video_format @var{integer}
  2018. Specifies the video_format written into the sequence display extension
  2019. indicating the source of the video pictures. The default is @samp{unspecified},
  2020. can be @samp{component}, @samp{pal}, @samp{ntsc}, @samp{secam} or @samp{mac}.
  2021. For maximum compatibility, use @samp{component}.
  2022. @item a53cc @var{boolean}
  2023. Import closed captions (which must be ATSC compatible format) into output.
  2024. Default is 1 (on).
  2025. @end table
  2026. @section png
  2027. PNG image encoder.
  2028. @subsection Private options
  2029. @table @option
  2030. @item dpi @var{integer}
  2031. Set physical density of pixels, in dots per inch, unset by default
  2032. @item dpm @var{integer}
  2033. Set physical density of pixels, in dots per meter, unset by default
  2034. @end table
  2035. @section ProRes
  2036. Apple ProRes encoder.
  2037. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  2038. The used encoder can be chosen with the @code{-vcodec} option.
  2039. @subsection Private Options for prores-ks
  2040. @table @option
  2041. @item profile @var{integer}
  2042. Select the ProRes profile to encode
  2043. @table @samp
  2044. @item proxy
  2045. @item lt
  2046. @item standard
  2047. @item hq
  2048. @item 4444
  2049. @item 4444xq
  2050. @end table
  2051. @item quant_mat @var{integer}
  2052. Select quantization matrix.
  2053. @table @samp
  2054. @item auto
  2055. @item default
  2056. @item proxy
  2057. @item lt
  2058. @item standard
  2059. @item hq
  2060. @end table
  2061. If set to @var{auto}, the matrix matching the profile will be picked.
  2062. If not set, the matrix providing the highest quality, @var{default}, will be
  2063. picked.
  2064. @item bits_per_mb @var{integer}
  2065. How many bits to allot for coding one macroblock. Different profiles use
  2066. between 200 and 2400 bits per macroblock, the maximum is 8000.
  2067. @item mbs_per_slice @var{integer}
  2068. Number of macroblocks in each slice (1-8); the default value (8)
  2069. should be good in almost all situations.
  2070. @item vendor @var{string}
  2071. Override the 4-byte vendor ID.
  2072. A custom vendor ID like @var{apl0} would claim the stream was produced by
  2073. the Apple encoder.
  2074. @item alpha_bits @var{integer}
  2075. Specify number of bits for alpha component.
  2076. Possible values are @var{0}, @var{8} and @var{16}.
  2077. Use @var{0} to disable alpha plane coding.
  2078. @end table
  2079. @subsection Speed considerations
  2080. In the default mode of operation the encoder has to honor frame constraints
  2081. (i.e. not produce frames with size bigger than requested) while still making
  2082. output picture as good as possible.
  2083. A frame containing a lot of small details is harder to compress and the encoder
  2084. would spend more time searching for appropriate quantizers for each slice.
  2085. Setting a higher @option{bits_per_mb} limit will improve the speed.
  2086. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  2087. recommended value) and do not set a size constraint.
  2088. @section QSV encoders
  2089. The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC)
  2090. The ratecontrol method is selected as follows:
  2091. @itemize @bullet
  2092. @item
  2093. When @option{global_quality} is specified, a quality-based mode is used.
  2094. Specifically this means either
  2095. @itemize @minus
  2096. @item
  2097. @var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
  2098. also set (the @option{-qscale} ffmpeg option).
  2099. @item
  2100. @var{LA_ICQ} - intelligent constant quality with lookahead, when the
  2101. @option{look_ahead} option is also set.
  2102. @item
  2103. @var{ICQ} -- intelligent constant quality otherwise.
  2104. @end itemize
  2105. @item
  2106. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  2107. least the desired average bitrate with the @option{b} option.
  2108. @itemize @minus
  2109. @item
  2110. @var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
  2111. @item
  2112. @var{VCM} - video conferencing mode, when the @option{vcm} option is set.
  2113. @item
  2114. @var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
  2115. the average bitrate.
  2116. @item
  2117. @var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
  2118. than the average bitrate.
  2119. @item
  2120. @var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
  2121. is further configured by the @option{avbr_accuracy} and
  2122. @option{avbr_convergence} options.
  2123. @end itemize
  2124. @end itemize
  2125. Note that depending on your system, a different mode than the one you specified
  2126. may be selected by the encoder. Set the verbosity level to @var{verbose} or
  2127. higher to see the actual settings used by the QSV runtime.
  2128. Additional libavcodec global options are mapped to MSDK options as follows:
  2129. @itemize
  2130. @item
  2131. @option{g/gop_size} -> @option{GopPicSize}
  2132. @item
  2133. @option{bf/max_b_frames}+1 -> @option{GopRefDist}
  2134. @item
  2135. @option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
  2136. @option{InitialDelayInKB}
  2137. @item
  2138. @option{slices} -> @option{NumSlice}
  2139. @item
  2140. @option{refs} -> @option{NumRefFrame}
  2141. @item
  2142. @option{b_strategy/b_frame_strategy} -> @option{BRefType}
  2143. @item
  2144. @option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
  2145. @item
  2146. For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
  2147. @option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
  2148. and @var{QPP} and @var{QPB} respectively.
  2149. @item
  2150. Setting the @option{coder} option to the value @var{vlc} will make the H.264
  2151. encoder use CAVLC instead of CABAC.
  2152. @end itemize
  2153. @section snow
  2154. @subsection Options
  2155. @table @option
  2156. @item iterative_dia_size
  2157. dia size for the iterative motion estimation
  2158. @end table
  2159. @section VAAPI encoders
  2160. Wrappers for hardware encoders accessible via VAAPI.
  2161. These encoders only accept input in VAAPI hardware surfaces. If you have input
  2162. in software frames, use the @option{hwupload} filter to upload them to the GPU.
  2163. The following standard libavcodec options are used:
  2164. @itemize
  2165. @item
  2166. @option{g} / @option{gop_size}
  2167. @item
  2168. @option{bf} / @option{max_b_frames}
  2169. @item
  2170. @option{profile}
  2171. If not set, this will be determined automatically from the format of the input
  2172. frames and the profiles supported by the driver.
  2173. @item
  2174. @option{level}
  2175. @item
  2176. @option{b} / @option{bit_rate}
  2177. @item
  2178. @option{maxrate} / @option{rc_max_rate}
  2179. @item
  2180. @option{bufsize} / @option{rc_buffer_size}
  2181. @item
  2182. @option{rc_init_occupancy} / @option{rc_initial_buffer_occupancy}
  2183. @item
  2184. @option{compression_level}
  2185. Speed / quality tradeoff: higher values are faster / worse quality.
  2186. @item
  2187. @option{q} / @option{global_quality}
  2188. Size / quality tradeoff: higher values are smaller / worse quality.
  2189. @item
  2190. @option{qmin}
  2191. @item
  2192. @option{qmax}
  2193. @item
  2194. @option{i_qfactor} / @option{i_quant_factor}
  2195. @item
  2196. @option{i_qoffset} / @option{i_quant_offset}
  2197. @item
  2198. @option{b_qfactor} / @option{b_quant_factor}
  2199. @item
  2200. @option{b_qoffset} / @option{b_quant_offset}
  2201. @item
  2202. @option{slices}
  2203. @end itemize
  2204. All encoders support the following options:
  2205. @table @option
  2206. @item low_power
  2207. Some drivers/platforms offer a second encoder for some codecs intended to use
  2208. less power than the default encoder; setting this option will attempt to use
  2209. that encoder. Note that it may support a reduced feature set, so some other
  2210. options may not be available in this mode.
  2211. @item idr_interval
  2212. Set the number of normal intra frames between full-refresh (IDR) frames in
  2213. open-GOP mode. The intra frames are still IRAPs, but will not include global
  2214. headers and may have non-decodable leading pictures.
  2215. @item b_depth
  2216. Set the B-frame reference depth. When set to one (the default), all B-frames
  2217. will refer only to P- or I-frames. When set to greater values multiple layers
  2218. of B-frames will be present, frames in each layer only referring to frames in
  2219. higher layers.
  2220. @item rc_mode
  2221. Set the rate control mode to use. A given driver may only support a subset of
  2222. modes.
  2223. Possible modes:
  2224. @table @option
  2225. @item auto
  2226. Choose the mode automatically based on driver support and the other options.
  2227. This is the default.
  2228. @item CQP
  2229. Constant-quality.
  2230. @item CBR
  2231. Constant-bitrate.
  2232. @item VBR
  2233. Variable-bitrate.
  2234. @item ICQ
  2235. Intelligent constant-quality.
  2236. @item QVBR
  2237. Quality-defined variable-bitrate.
  2238. @item AVBR
  2239. Average variable bitrate.
  2240. @end table
  2241. @end table
  2242. Each encoder also has its own specific options:
  2243. @table @option
  2244. @item h264_vaapi
  2245. @option{profile} sets the value of @emph{profile_idc} and the @emph{constraint_set*_flag}s.
  2246. @option{level} sets the value of @emph{level_idc}.
  2247. @table @option
  2248. @item coder
  2249. Set entropy encoder (default is @emph{cabac}). Possible values:
  2250. @table @samp
  2251. @item ac
  2252. @item cabac
  2253. Use CABAC.
  2254. @item vlc
  2255. @item cavlc
  2256. Use CAVLC.
  2257. @end table
  2258. @item aud
  2259. Include access unit delimiters in the stream (not included by default).
  2260. @item sei
  2261. Set SEI message types to include.
  2262. Some combination of the following values:
  2263. @table @samp
  2264. @item identifier
  2265. Include a @emph{user_data_unregistered} message containing information about
  2266. the encoder.
  2267. @item timing
  2268. Include picture timing parameters (@emph{buffering_period} and
  2269. @emph{pic_timing} messages).
  2270. @item recovery_point
  2271. Include recovery points where appropriate (@emph{recovery_point} messages).
  2272. @end table
  2273. @end table
  2274. @item hevc_vaapi
  2275. @option{profile} and @option{level} set the values of
  2276. @emph{general_profile_idc} and @emph{general_level_idc} respectively.
  2277. @table @option
  2278. @item aud
  2279. Include access unit delimiters in the stream (not included by default).
  2280. @item tier
  2281. Set @emph{general_tier_flag}. This may affect the level chosen for the stream
  2282. if it is not explicitly specified.
  2283. @item sei
  2284. Set SEI message types to include.
  2285. Some combination of the following values:
  2286. @table @samp
  2287. @item hdr
  2288. Include HDR metadata if the input frames have it
  2289. (@emph{mastering_display_colour_volume} and @emph{content_light_level}
  2290. messages).
  2291. @end table
  2292. @end table
  2293. @item mjpeg_vaapi
  2294. Only baseline DCT encoding is supported. The encoder always uses the standard
  2295. quantisation and huffman tables - @option{global_quality} scales the standard
  2296. quantisation table (range 1-100).
  2297. For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  2298. supported, and will create an RGB JPEG.
  2299. @table @option
  2300. @item jfif
  2301. Include JFIF header in each frame (not included by default).
  2302. @item huffman
  2303. Include standard huffman tables (on by default). Turning this off will save
  2304. a few hundred bytes in each output frame, but may lose compatibility with some
  2305. JPEG decoders which don't fully handle MJPEG.
  2306. @end table
  2307. @item mpeg2_vaapi
  2308. @option{profile} and @option{level} set the value of @emph{profile_and_level_indication}.
  2309. @item vp8_vaapi
  2310. B-frames are not supported.
  2311. @option{global_quality} sets the @emph{q_idx} used for non-key frames (range 0-127).
  2312. @table @option
  2313. @item loop_filter_level
  2314. @item loop_filter_sharpness
  2315. Manually set the loop filter parameters.
  2316. @end table
  2317. @item vp9_vaapi
  2318. @option{global_quality} sets the @emph{q_idx} used for P-frames (range 0-255).
  2319. @table @option
  2320. @item loop_filter_level
  2321. @item loop_filter_sharpness
  2322. Manually set the loop filter parameters.
  2323. @end table
  2324. B-frames are supported, but the output stream is always in encode order rather than display
  2325. order. If B-frames are enabled, it may be necessary to use the @option{vp9_raw_reorder}
  2326. bitstream filter to modify the output stream to display frames in the correct order.
  2327. Only normal frames are produced - the @option{vp9_superframe} bitstream filter may be
  2328. required to produce a stream usable with all decoders.
  2329. @end table
  2330. @section vc2
  2331. SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  2332. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  2333. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  2334. other tasks which require low overhead and low compression (like screen
  2335. recording).
  2336. @subsection Options
  2337. @table @option
  2338. @item b
  2339. Sets target video bitrate. Usually that's around 1:6 of the uncompressed
  2340. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
  2341. values (close to the uncompressed bitrate) turn on lossless compression mode.
  2342. @item field_order
  2343. Enables field coding when set (e.g. to tt - top field first) for interlaced
  2344. inputs. Should increase compression with interlaced content as it splits the
  2345. fields and encodes each separately.
  2346. @item wavelet_depth
  2347. Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  2348. Lower values reduce compression and quality. Less capable decoders may not be
  2349. able to handle values of @option{wavelet_depth} over 3.
  2350. @item wavelet_type
  2351. Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
  2352. (Deslauriers-Dubuc)
  2353. are implemented, with 9_7 being the one with better compression and thus
  2354. is the default.
  2355. @item slice_width
  2356. @item slice_height
  2357. Sets the slice size for each slice. Larger values result in better compression.
  2358. For compatibility with other more limited decoders use @option{slice_width} of
  2359. 32 and @option{slice_height} of 8.
  2360. @item tolerance
  2361. Sets the undershoot tolerance of the rate control system in percent. This is
  2362. to prevent an expensive search from being run.
  2363. @item qm
  2364. Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
  2365. is set to 5
  2366. @itemize @minus
  2367. @item
  2368. @var{default}
  2369. Uses the default quantization matrix from the specifications, extended with
  2370. values for the fifth level. This provides a good balance between keeping detail
  2371. and omitting artifacts.
  2372. @item
  2373. @var{flat}
  2374. Use a completely zeroed out quantization matrix. This increases PSNR but might
  2375. reduce perception. Use in bogus benchmarks.
  2376. @item
  2377. @var{color}
  2378. Reduces detail but attempts to preserve color at extremely low bitrates.
  2379. @end itemize
  2380. @end table
  2381. @c man end VIDEO ENCODERS
  2382. @chapter Subtitles Encoders
  2383. @c man begin SUBTITLES ENCODERS
  2384. @section dvdsub
  2385. This codec encodes the bitmap subtitle format that is used in DVDs.
  2386. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  2387. and they can also be used in Matroska files.
  2388. @subsection Options
  2389. @table @option
  2390. @item even_rows_fix
  2391. When set to 1, enable a work-around that makes the number of pixel rows
  2392. even in all subtitles. This fixes a problem with some players that
  2393. cut off the bottom row if the number is odd. The work-around just adds
  2394. a fully transparent row if needed. The overhead is low, typically
  2395. one byte per subtitle on average.
  2396. By default, this work-around is disabled.
  2397. @end table
  2398. @c man end SUBTITLES ENCODERS