encoders.texi 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212
  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.
  24. @subsection Options
  25. @table @option
  26. @item b
  27. Set bit rate in bits/s. Setting this automatically activates constant bit rate
  28. (CBR) mode. If this option is unspecified it is set to 128kbps.
  29. @item q
  30. Set quality for variable bit rate (VBR) mode. This option is valid only using
  31. the @command{ffmpeg} command-line tool. For library interface users, use
  32. @option{global_quality}.
  33. @item cutoff
  34. Set cutoff frequency. If unspecified will allow the encoder to dynamically
  35. adjust the cutoff to improve clarity on low bitrates.
  36. @item aac_coder
  37. Set AAC encoder coding method. Possible values:
  38. @table @samp
  39. @item twoloop
  40. Two loop searching (TLS) method. This is the default method.
  41. This method first sets quantizers depending on band thresholds and then tries
  42. to find an optimal combination by adding or subtracting a specific value from
  43. all quantizers and adjusting some individual quantizer a little. Will tune
  44. itself based on whether @option{aac_is}, @option{aac_ms} and @option{aac_pns}
  45. are enabled.
  46. @item anmr
  47. Average noise to mask ratio (ANMR) trellis-based solution.
  48. This is an experimental coder which currently produces a lower quality, is more
  49. unstable and is slower than the default twoloop coder but has potential.
  50. Currently has no support for the @option{aac_is} or @option{aac_pns} options.
  51. Not currently recommended.
  52. @item fast
  53. Constant quantizer method.
  54. Uses a cheaper version of twoloop algorithm that doesn't try to do as many
  55. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  56. and much faster at higher bitrates.
  57. @end table
  58. @item aac_ms
  59. Sets mid/side coding mode. The default value of "auto" will automatically use
  60. M/S with bands which will benefit from such coding. Can be forced for all bands
  61. using the value "enable", which is mainly useful for debugging or disabled using
  62. "disable".
  63. @item aac_is
  64. Sets intensity stereo coding tool usage. By default, it's enabled and will
  65. automatically toggle IS for similar pairs of stereo bands if it's beneficial.
  66. Can be disabled for debugging by setting the value to "disable".
  67. @item aac_pns
  68. Uses perceptual noise substitution to replace low entropy high frequency bands
  69. with imperceptible white noise during the decoding process. By default, it's
  70. enabled, but can be disabled for debugging purposes by using "disable".
  71. @item aac_tns
  72. Enables the use of a multitap FIR filter which spans through the high frequency
  73. bands to hide quantization noise during the encoding process and is reverted
  74. by the decoder. As well as decreasing unpleasant artifacts in the high range
  75. this also reduces the entropy in the high bands and allows for more bits to
  76. be used by the mid-low bands. By default it's enabled but can be disabled for
  77. debugging by setting the option to "disable".
  78. @item aac_ltp
  79. Enables the use of the long term prediction extension which increases coding
  80. efficiency in very low bandwidth situations such as encoding of voice or
  81. solo piano music by extending constant harmonic peaks in bands throughout
  82. frames. This option is implied by profile:a aac_low and is incompatible with
  83. aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
  84. @item aac_pred
  85. Enables the use of a more traditional style of prediction where the spectral
  86. coefficients transmitted are replaced by the difference of the current
  87. coefficients minus the previous "predicted" coefficients. In theory and sometimes
  88. in practice this can improve quality for low to mid bitrate audio.
  89. This option implies the aac_main profile and is incompatible with aac_ltp.
  90. @item profile
  91. Sets the encoding profile, possible values:
  92. @table @samp
  93. @item aac_low
  94. The default, AAC "Low-complexity" profile. Is the most compatible and produces
  95. decent quality.
  96. @item mpeg2_aac_low
  97. Equivalent to @code{-profile:a aac_low -aac_pns 0}. PNS was introduced with the
  98. MPEG4 specifications.
  99. @item aac_ltp
  100. Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
  101. option. Introduced in MPEG4.
  102. @item aac_main
  103. Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
  104. option. Introduced in MPEG2.
  105. @end table
  106. If this option is unspecified it is set to @samp{aac_low}.
  107. @end table
  108. @section ac3 and ac3_fixed
  109. AC-3 audio encoders.
  110. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  111. the undocumented RealAudio 3 (a.k.a. dnet).
  112. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  113. encoder only uses fixed-point integer math. This does not mean that one is
  114. always faster, just that one or the other may be better suited to a
  115. particular system. The @var{ac3_fixed} encoder is not the default codec for
  116. any of the output formats, so it must be specified explicitly using the option
  117. @code{-acodec ac3_fixed} in order to use it.
  118. @subsection AC-3 Metadata
  119. The AC-3 metadata options are used to set parameters that describe the audio,
  120. but in most cases do not affect the audio encoding itself. Some of the options
  121. do directly affect or influence the decoding and playback of the resulting
  122. bitstream, while others are just for informational purposes. A few of the
  123. options will add bits to the output stream that could otherwise be used for
  124. audio data, and will thus affect the quality of the output. Those will be
  125. indicated accordingly with a note in the option list below.
  126. These parameters are described in detail in several publicly-available
  127. documents.
  128. @itemize
  129. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  130. @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}
  131. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  132. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  133. @end itemize
  134. @subsubsection Metadata Control Options
  135. @table @option
  136. @item -per_frame_metadata @var{boolean}
  137. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  138. metadata for each frame.
  139. @table @option
  140. @item 0
  141. The metadata values set at initialization will be used for every frame in the
  142. stream. (default)
  143. @item 1
  144. Metadata values can be changed before encoding each frame.
  145. @end table
  146. @end table
  147. @subsubsection Downmix Levels
  148. @table @option
  149. @item -center_mixlev @var{level}
  150. Center Mix Level. The amount of gain the decoder should apply to the center
  151. channel when downmixing to stereo. This field will only be written to the
  152. bitstream if a center channel is present. The value is specified as a scale
  153. factor. There are 3 valid values:
  154. @table @option
  155. @item 0.707
  156. Apply -3dB gain
  157. @item 0.595
  158. Apply -4.5dB gain (default)
  159. @item 0.500
  160. Apply -6dB gain
  161. @end table
  162. @item -surround_mixlev @var{level}
  163. Surround Mix Level. The amount of gain the decoder should apply to the surround
  164. channel(s) when downmixing to stereo. This field will only be written to the
  165. bitstream if one or more surround channels are present. The value is specified
  166. as a scale factor. There are 3 valid values:
  167. @table @option
  168. @item 0.707
  169. Apply -3dB gain
  170. @item 0.500
  171. Apply -6dB gain (default)
  172. @item 0.000
  173. Silence Surround Channel(s)
  174. @end table
  175. @end table
  176. @subsubsection Audio Production Information
  177. Audio Production Information is optional information describing the mixing
  178. environment. Either none or both of the fields are written to the bitstream.
  179. @table @option
  180. @item -mixing_level @var{number}
  181. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  182. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  183. unknown or not indicated. The default value is -1, but that value cannot be
  184. used if the Audio Production Information is written to the bitstream. Therefore,
  185. if the @code{room_type} option is not the default value, the @code{mixing_level}
  186. option must not be -1.
  187. @item -room_type @var{type}
  188. Room Type. Describes the equalization used during the final mixing session at
  189. the studio or on the dubbing stage. A large room is a dubbing stage with the
  190. industry standard X-curve equalization; a small room has flat equalization.
  191. This field will not be written to the bitstream if both the @code{mixing_level}
  192. option and the @code{room_type} option have the default values.
  193. @table @option
  194. @item 0
  195. @itemx notindicated
  196. Not Indicated (default)
  197. @item 1
  198. @itemx large
  199. Large Room
  200. @item 2
  201. @itemx small
  202. Small Room
  203. @end table
  204. @end table
  205. @subsubsection Other Metadata Options
  206. @table @option
  207. @item -copyright @var{boolean}
  208. Copyright Indicator. Specifies whether a copyright exists for this audio.
  209. @table @option
  210. @item 0
  211. @itemx off
  212. No Copyright Exists (default)
  213. @item 1
  214. @itemx on
  215. Copyright Exists
  216. @end table
  217. @item -dialnorm @var{value}
  218. Dialogue Normalization. Indicates how far the average dialogue level of the
  219. program is below digital 100% full scale (0 dBFS). This parameter determines a
  220. level shift during audio reproduction that sets the average volume of the
  221. dialogue to a preset level. The goal is to match volume level between program
  222. sources. A value of -31dB will result in no volume level change, relative to
  223. the source volume, during audio reproduction. Valid values are whole numbers in
  224. the range -31 to -1, with -31 being the default.
  225. @item -dsur_mode @var{mode}
  226. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  227. (Pro Logic). This field will only be written to the bitstream if the audio
  228. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  229. apply Dolby Surround processing.
  230. @table @option
  231. @item 0
  232. @itemx notindicated
  233. Not Indicated (default)
  234. @item 1
  235. @itemx off
  236. Not Dolby Surround Encoded
  237. @item 2
  238. @itemx on
  239. Dolby Surround Encoded
  240. @end table
  241. @item -original @var{boolean}
  242. Original Bit Stream Indicator. Specifies whether this audio is from the
  243. original source and not a copy.
  244. @table @option
  245. @item 0
  246. @itemx off
  247. Not Original Source
  248. @item 1
  249. @itemx on
  250. Original Source (default)
  251. @end table
  252. @end table
  253. @subsection Extended Bitstream Information
  254. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  255. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  256. If any one parameter in a group is specified, all values in that group will be
  257. written to the bitstream. Default values are used for those that are written
  258. but have not been specified. If the mixing levels are written, the decoder
  259. will use these values instead of the ones specified in the @code{center_mixlev}
  260. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  261. Syntax.
  262. @subsubsection Extended Bitstream Information - Part 1
  263. @table @option
  264. @item -dmix_mode @var{mode}
  265. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  266. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  267. @table @option
  268. @item 0
  269. @itemx notindicated
  270. Not Indicated (default)
  271. @item 1
  272. @itemx ltrt
  273. Lt/Rt Downmix Preferred
  274. @item 2
  275. @itemx loro
  276. Lo/Ro Downmix Preferred
  277. @end table
  278. @item -ltrt_cmixlev @var{level}
  279. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  280. center channel when downmixing to stereo in Lt/Rt mode.
  281. @table @option
  282. @item 1.414
  283. Apply +3dB gain
  284. @item 1.189
  285. Apply +1.5dB gain
  286. @item 1.000
  287. Apply 0dB gain
  288. @item 0.841
  289. Apply -1.5dB gain
  290. @item 0.707
  291. Apply -3.0dB gain
  292. @item 0.595
  293. Apply -4.5dB gain (default)
  294. @item 0.500
  295. Apply -6.0dB gain
  296. @item 0.000
  297. Silence Center Channel
  298. @end table
  299. @item -ltrt_surmixlev @var{level}
  300. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  301. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  302. @table @option
  303. @item 0.841
  304. Apply -1.5dB gain
  305. @item 0.707
  306. Apply -3.0dB gain
  307. @item 0.595
  308. Apply -4.5dB gain
  309. @item 0.500
  310. Apply -6.0dB gain (default)
  311. @item 0.000
  312. Silence Surround Channel(s)
  313. @end table
  314. @item -loro_cmixlev @var{level}
  315. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  316. center channel when downmixing to stereo in Lo/Ro mode.
  317. @table @option
  318. @item 1.414
  319. Apply +3dB gain
  320. @item 1.189
  321. Apply +1.5dB gain
  322. @item 1.000
  323. Apply 0dB gain
  324. @item 0.841
  325. Apply -1.5dB gain
  326. @item 0.707
  327. Apply -3.0dB gain
  328. @item 0.595
  329. Apply -4.5dB gain (default)
  330. @item 0.500
  331. Apply -6.0dB gain
  332. @item 0.000
  333. Silence Center Channel
  334. @end table
  335. @item -loro_surmixlev @var{level}
  336. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  337. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  338. @table @option
  339. @item 0.841
  340. Apply -1.5dB gain
  341. @item 0.707
  342. Apply -3.0dB gain
  343. @item 0.595
  344. Apply -4.5dB gain
  345. @item 0.500
  346. Apply -6.0dB gain (default)
  347. @item 0.000
  348. Silence Surround Channel(s)
  349. @end table
  350. @end table
  351. @subsubsection Extended Bitstream Information - Part 2
  352. @table @option
  353. @item -dsurex_mode @var{mode}
  354. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  355. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  356. apply Dolby Surround EX processing.
  357. @table @option
  358. @item 0
  359. @itemx notindicated
  360. Not Indicated (default)
  361. @item 1
  362. @itemx on
  363. Dolby Surround EX Off
  364. @item 2
  365. @itemx off
  366. Dolby Surround EX On
  367. @end table
  368. @item -dheadphone_mode @var{mode}
  369. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  370. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  371. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  372. processing.
  373. @table @option
  374. @item 0
  375. @itemx notindicated
  376. Not Indicated (default)
  377. @item 1
  378. @itemx on
  379. Dolby Headphone Off
  380. @item 2
  381. @itemx off
  382. Dolby Headphone On
  383. @end table
  384. @item -ad_conv_type @var{type}
  385. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  386. conversion.
  387. @table @option
  388. @item 0
  389. @itemx standard
  390. Standard A/D Converter (default)
  391. @item 1
  392. @itemx hdcd
  393. HDCD A/D Converter
  394. @end table
  395. @end table
  396. @subsection Other AC-3 Encoding Options
  397. @table @option
  398. @item -stereo_rematrixing @var{boolean}
  399. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  400. is an optional AC-3 feature that increases quality by selectively encoding
  401. the left/right channels as mid/side. This option is enabled by default, and it
  402. is highly recommended that it be left as enabled except for testing purposes.
  403. @item cutoff @var{frequency}
  404. Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  405. determined by various other encoding parameters.
  406. @end table
  407. @subsection Floating-Point-Only AC-3 Encoding Options
  408. These options are only valid for the floating-point encoder and do not exist
  409. for the fixed-point encoder due to the corresponding features not being
  410. implemented in fixed-point.
  411. @table @option
  412. @item -channel_coupling @var{boolean}
  413. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  414. that increases quality by combining high frequency information from multiple
  415. channels into a single channel. The per-channel high frequency information is
  416. sent with less accuracy in both the frequency and time domains. This allows
  417. more bits to be used for lower frequencies while preserving enough information
  418. to reconstruct the high frequencies. This option is enabled by default for the
  419. floating-point encoder and should generally be left as enabled except for
  420. testing purposes or to increase encoding speed.
  421. @table @option
  422. @item -1
  423. @itemx auto
  424. Selected by Encoder (default)
  425. @item 0
  426. @itemx off
  427. Disable Channel Coupling
  428. @item 1
  429. @itemx on
  430. Enable Channel Coupling
  431. @end table
  432. @item -cpl_start_band @var{number}
  433. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  434. value higher than the bandwidth is used, it will be reduced to 1 less than the
  435. coupling end band. If @var{auto} is used, the start band will be determined by
  436. the encoder based on the bit rate, sample rate, and channel layout. This option
  437. has no effect if channel coupling is disabled.
  438. @table @option
  439. @item -1
  440. @itemx auto
  441. Selected by Encoder (default)
  442. @end table
  443. @end table
  444. @anchor{flac}
  445. @section flac
  446. FLAC (Free Lossless Audio Codec) Encoder
  447. @subsection Options
  448. The following options are supported by FFmpeg's flac encoder.
  449. @table @option
  450. @item compression_level
  451. Sets the compression level, which chooses defaults for many other options
  452. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  453. default.
  454. @item frame_size
  455. Sets the size of the frames in samples per channel.
  456. @item lpc_coeff_precision
  457. Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  458. default.
  459. @item lpc_type
  460. Sets the first stage LPC algorithm
  461. @table @samp
  462. @item none
  463. LPC is not used
  464. @item fixed
  465. fixed LPC coefficients
  466. @item levinson
  467. @item cholesky
  468. @end table
  469. @item lpc_passes
  470. Number of passes to use for Cholesky factorization during LPC analysis
  471. @item min_partition_order
  472. The minimum partition order
  473. @item max_partition_order
  474. The maximum partition order
  475. @item prediction_order_method
  476. @table @samp
  477. @item estimation
  478. @item 2level
  479. @item 4level
  480. @item 8level
  481. @item search
  482. Bruteforce search
  483. @item log
  484. @end table
  485. @item ch_mode
  486. Channel mode
  487. @table @samp
  488. @item auto
  489. The mode is chosen automatically for each frame
  490. @item indep
  491. Channels are independently coded
  492. @item left_side
  493. @item right_side
  494. @item mid_side
  495. @end table
  496. @item exact_rice_parameters
  497. Chooses if rice parameters are calculated exactly or approximately.
  498. if set to 1 then they are chosen exactly, which slows the code down slightly and
  499. improves compression slightly.
  500. @item multi_dim_quant
  501. Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  502. applied after the first stage to finetune the coefficients. This is quite slow
  503. and slightly improves compression.
  504. @end table
  505. @anchor{opusenc}
  506. @section opus
  507. Opus encoder.
  508. This is a native FFmpeg encoder for the Opus format. Currently its in development and
  509. only implements the CELT part of the codec. Its quality is usually worse and at best
  510. is equal to the libopus encoder.
  511. @subsection Options
  512. @table @option
  513. @item b
  514. Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  515. to make a good guess.
  516. @item opus_delay
  517. Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  518. decrease quality.
  519. @end table
  520. @anchor{libfdk-aac-enc}
  521. @section libfdk_aac
  522. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  523. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  524. the Android project.
  525. Requires the presence of the libfdk-aac headers and library during
  526. configuration. You need to explicitly configure the build with
  527. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  528. so if you allow the use of GPL, you should configure with
  529. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  530. This encoder has support for the AAC-HE profiles.
  531. VBR encoding, enabled through the @option{vbr} or @option{flags
  532. +qscale} options, is experimental and only works with some
  533. combinations of parameters.
  534. Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  535. higher.
  536. For more information see the fdk-aac project at
  537. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  538. @subsection Options
  539. The following options are mapped on the shared FFmpeg codec options.
  540. @table @option
  541. @item b
  542. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  543. is automatically set to a suitable value depending on the selected
  544. profile.
  545. In case VBR mode is enabled the option is ignored.
  546. @item ar
  547. Set audio sampling rate (in Hz).
  548. @item channels
  549. Set the number of audio channels.
  550. @item flags +qscale
  551. Enable fixed quality, VBR (Variable Bit Rate) mode.
  552. Note that VBR is implicitly enabled when the @option{vbr} value is
  553. positive.
  554. @item cutoff
  555. Set cutoff frequency. If not specified (or explicitly set to 0) it
  556. will use a value automatically computed by the library. Default value
  557. is 0.
  558. @item profile
  559. Set audio profile.
  560. The following profiles are recognized:
  561. @table @samp
  562. @item aac_low
  563. Low Complexity AAC (LC)
  564. @item aac_he
  565. High Efficiency AAC (HE-AAC)
  566. @item aac_he_v2
  567. High Efficiency AAC version 2 (HE-AACv2)
  568. @item aac_ld
  569. Low Delay AAC (LD)
  570. @item aac_eld
  571. Enhanced Low Delay AAC (ELD)
  572. @end table
  573. If not specified it is set to @samp{aac_low}.
  574. @end table
  575. The following are private options of the libfdk_aac encoder.
  576. @table @option
  577. @item afterburner
  578. Enable afterburner feature if set to 1, disabled if set to 0. This
  579. improves the quality but also the required processing power.
  580. Default value is 1.
  581. @item eld_sbr
  582. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  583. if set to 0.
  584. Default value is 0.
  585. @item eld_v2
  586. Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  587. disabled if set to 0.
  588. Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
  589. Default value is 0.
  590. @item signaling
  591. Set SBR/PS signaling style.
  592. It can assume one of the following values:
  593. @table @samp
  594. @item default
  595. choose signaling implicitly (explicit hierarchical by default,
  596. implicit if global header is disabled)
  597. @item implicit
  598. implicit backwards compatible signaling
  599. @item explicit_sbr
  600. explicit SBR, implicit PS signaling
  601. @item explicit_hierarchical
  602. explicit hierarchical signaling
  603. @end table
  604. Default value is @samp{default}.
  605. @item latm
  606. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  607. Default value is 0.
  608. @item header_period
  609. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  610. in-band configuration buffers within LATM/LOAS transport layer.
  611. Must be a 16-bits non-negative integer.
  612. Default value is 0.
  613. @item vbr
  614. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  615. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  616. (Constant Bit Rate) is enabled.
  617. Currently only the @samp{aac_low} profile supports VBR encoding.
  618. VBR modes 1-5 correspond to roughly the following average bit rates:
  619. @table @samp
  620. @item 1
  621. 32 kbps/channel
  622. @item 2
  623. 40 kbps/channel
  624. @item 3
  625. 48-56 kbps/channel
  626. @item 4
  627. 64 kbps/channel
  628. @item 5
  629. about 80-96 kbps/channel
  630. @end table
  631. Default value is 0.
  632. @end table
  633. @subsection Examples
  634. @itemize
  635. @item
  636. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  637. container:
  638. @example
  639. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  640. @end example
  641. @item
  642. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  643. High-Efficiency AAC profile:
  644. @example
  645. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  646. @end example
  647. @end itemize
  648. @anchor{libmp3lame}
  649. @section libmp3lame
  650. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  651. Requires the presence of the libmp3lame headers and library during
  652. configuration. You need to explicitly configure the build with
  653. @code{--enable-libmp3lame}.
  654. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  655. lower quality.
  656. @subsection Options
  657. The following options are supported by the libmp3lame wrapper. The
  658. @command{lame}-equivalent of the options are listed in parentheses.
  659. @table @option
  660. @item b (@emph{-b})
  661. Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
  662. expressed in kilobits/s.
  663. @item q (@emph{-V})
  664. Set constant quality setting for VBR. This option is valid only
  665. using the @command{ffmpeg} command-line tool. For library interface
  666. users, use @option{global_quality}.
  667. @item compression_level (@emph{-q})
  668. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  669. with 0 meaning highest quality but slowest, and 9 meaning fastest
  670. while producing the worst quality.
  671. @item cutoff (@emph{--lowpass})
  672. Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  673. adjusts the cutoff.
  674. @item reservoir
  675. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  676. has this enabled by default, but can be overridden by use
  677. @option{--nores} option.
  678. @item joint_stereo (@emph{-m j})
  679. Enable the encoder to use (on a frame by frame basis) either L/R
  680. stereo or mid/side stereo. Default value is 1.
  681. @item abr (@emph{--abr})
  682. Enable the encoder to use ABR when set to 1. The @command{lame}
  683. @option{--abr} sets the target bitrate, while this options only
  684. tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
  685. @end table
  686. @section libopencore-amrnb
  687. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  688. Requires the presence of the libopencore-amrnb headers and library during
  689. configuration. You need to explicitly configure the build with
  690. @code{--enable-libopencore-amrnb --enable-version3}.
  691. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  692. but you can override it by setting @option{strict} to @samp{unofficial} or
  693. lower.
  694. @subsection Options
  695. @table @option
  696. @item b
  697. Set bitrate in bits per second. Only the following bitrates are supported,
  698. otherwise libavcodec will round to the nearest valid bitrate.
  699. @table @option
  700. @item 4750
  701. @item 5150
  702. @item 5900
  703. @item 6700
  704. @item 7400
  705. @item 7950
  706. @item 10200
  707. @item 12200
  708. @end table
  709. @item dtx
  710. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  711. default value is 0 (disabled).
  712. @end table
  713. @section libopus
  714. libopus Opus Interactive Audio Codec encoder wrapper.
  715. Requires the presence of the libopus headers and library during
  716. configuration. You need to explicitly configure the build with
  717. @code{--enable-libopus}.
  718. @subsection Option Mapping
  719. Most libopus options are modelled after the @command{opusenc} utility from
  720. opus-tools. The following is an option mapping chart describing options
  721. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  722. in parentheses.
  723. @table @option
  724. @item b (@emph{bitrate})
  725. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  726. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  727. kilobits/s.
  728. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  729. Set VBR mode. The FFmpeg @option{vbr} option has the following
  730. valid arguments, with the @command{opusenc} equivalent options
  731. in parentheses:
  732. @table @samp
  733. @item off (@emph{hard-cbr})
  734. Use constant bit rate encoding.
  735. @item on (@emph{vbr})
  736. Use variable bit rate encoding (the default).
  737. @item constrained (@emph{cvbr})
  738. Use constrained variable bit rate encoding.
  739. @end table
  740. @item compression_level (@emph{comp})
  741. Set encoding algorithm complexity. Valid options are integers in
  742. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  743. gives the highest quality but slowest encoding. The default is 10.
  744. @item frame_duration (@emph{framesize})
  745. Set maximum frame size, or duration of a frame in milliseconds. The
  746. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  747. frame sizes achieve lower latency but less quality at a given bitrate.
  748. Sizes greater than 20ms are only interesting at fairly low bitrates.
  749. The default is 20ms.
  750. @item packet_loss (@emph{expect-loss})
  751. Set expected packet loss percentage. The default is 0.
  752. @item fec (@emph{n/a})
  753. Enable inband forward error correction. @option{packet_loss} must be non-zero
  754. to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss.
  755. Default is disabled.
  756. @item application (N.A.)
  757. Set intended application type. Valid options are listed below:
  758. @table @samp
  759. @item voip
  760. Favor improved speech intelligibility.
  761. @item audio
  762. Favor faithfulness to the input (the default).
  763. @item lowdelay
  764. Restrict to only the lowest delay modes.
  765. @end table
  766. @item cutoff (N.A.)
  767. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  768. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  769. narrowband, mediumband, wideband, super wideband, and fullband
  770. respectively. The default is 0 (cutoff disabled).
  771. @item mapping_family (@emph{mapping_family})
  772. Set channel mapping family to be used by the encoder. The default value of -1
  773. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  774. otherwise. The default also disables the surround masking and LFE bandwidth
  775. optimzations in libopus, and requires that the input contains 8 channels or
  776. fewer.
  777. Other values include 0 for mono and stereo, 1 for surround sound with masking
  778. and LFE bandwidth optimizations, and 255 for independent streams with an
  779. unspecified channel layout.
  780. @item apply_phase_inv (N.A.) (requires libopus >= 1.2)
  781. If set to 0, disables the use of phase inversion for intensity stereo,
  782. improving the quality of mono downmixes, but slightly reducing normal stereo
  783. quality. The default is 1 (phase inversion enabled).
  784. @end table
  785. @anchor{libshine}
  786. @section libshine
  787. Shine Fixed-Point MP3 encoder wrapper.
  788. Shine is a fixed-point MP3 encoder. It has a far better performance on
  789. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  790. However, as it is more targeted on performance than quality, it is not on par
  791. with LAME and other production-grade encoders quality-wise. Also, according to
  792. the project's homepage, this encoder may not be free of bugs as the code was
  793. written a long time ago and the project was dead for at least 5 years.
  794. This encoder only supports stereo and mono input. This is also CBR-only.
  795. The original project (last updated in early 2007) is at
  796. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  797. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  798. Requires the presence of the libshine headers and library during
  799. configuration. You need to explicitly configure the build with
  800. @code{--enable-libshine}.
  801. See also @ref{libmp3lame}.
  802. @subsection Options
  803. The following options are supported by the libshine wrapper. The
  804. @command{shineenc}-equivalent of the options are listed in parentheses.
  805. @table @option
  806. @item b (@emph{-b})
  807. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  808. is expressed in kilobits/s.
  809. @end table
  810. @section libtwolame
  811. TwoLAME MP2 encoder wrapper.
  812. Requires the presence of the libtwolame headers and library during
  813. configuration. You need to explicitly configure the build with
  814. @code{--enable-libtwolame}.
  815. @subsection Options
  816. The following options are supported by the libtwolame wrapper. The
  817. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  818. parentheses.
  819. @table @option
  820. @item b (@emph{-b})
  821. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  822. option is expressed in kilobits/s. Default value is 128k.
  823. @item q (@emph{-V})
  824. Set quality for experimental VBR support. Maximum value range is
  825. from -50 to 50, useful range is from -10 to 10. The higher the
  826. value, the better the quality. This option is valid only using the
  827. @command{ffmpeg} command-line tool. For library interface users,
  828. use @option{global_quality}.
  829. @item mode (@emph{--mode})
  830. Set the mode of the resulting audio. Possible values:
  831. @table @samp
  832. @item auto
  833. Choose mode automatically based on the input. This is the default.
  834. @item stereo
  835. Stereo
  836. @item joint_stereo
  837. Joint stereo
  838. @item dual_channel
  839. Dual channel
  840. @item mono
  841. Mono
  842. @end table
  843. @item psymodel (@emph{--psyc-mode})
  844. Set psychoacoustic model to use in encoding. The argument must be
  845. an integer between -1 and 4, inclusive. The higher the value, the
  846. better the quality. The default value is 3.
  847. @item energy_levels (@emph{--energy})
  848. Enable energy levels extensions when set to 1. The default value is
  849. 0 (disabled).
  850. @item error_protection (@emph{--protect})
  851. Enable CRC error protection when set to 1. The default value is 0
  852. (disabled).
  853. @item copyright (@emph{--copyright})
  854. Set MPEG audio copyright flag when set to 1. The default value is 0
  855. (disabled).
  856. @item original (@emph{--original})
  857. Set MPEG audio original flag when set to 1. The default value is 0
  858. (disabled).
  859. @end table
  860. @section libvo-amrwbenc
  861. VisualOn Adaptive Multi-Rate Wideband encoder.
  862. Requires the presence of the libvo-amrwbenc headers and library during
  863. configuration. You need to explicitly configure the build with
  864. @code{--enable-libvo-amrwbenc --enable-version3}.
  865. This is a mono-only encoder. Officially it only supports 16000Hz sample
  866. rate, but you can override it by setting @option{strict} to
  867. @samp{unofficial} or lower.
  868. @subsection Options
  869. @table @option
  870. @item b
  871. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  872. libavcodec will round to the nearest valid bitrate.
  873. @table @samp
  874. @item 6600
  875. @item 8850
  876. @item 12650
  877. @item 14250
  878. @item 15850
  879. @item 18250
  880. @item 19850
  881. @item 23050
  882. @item 23850
  883. @end table
  884. @item dtx
  885. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  886. default value is 0 (disabled).
  887. @end table
  888. @section libvorbis
  889. libvorbis encoder wrapper.
  890. Requires the presence of the libvorbisenc headers and library during
  891. configuration. You need to explicitly configure the build with
  892. @code{--enable-libvorbis}.
  893. @subsection Options
  894. The following options are supported by the libvorbis wrapper. The
  895. @command{oggenc}-equivalent of the options are listed in parentheses.
  896. To get a more accurate and extensive documentation of the libvorbis
  897. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  898. See @url{http://xiph.org/vorbis/},
  899. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  900. @table @option
  901. @item b (@emph{-b})
  902. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  903. expressed in kilobits/s.
  904. @item q (@emph{-q})
  905. Set constant quality setting for VBR. The value should be a float
  906. number in the range of -1.0 to 10.0. The higher the value, the better
  907. the quality. The default value is @samp{3.0}.
  908. This option is valid only using the @command{ffmpeg} command-line tool.
  909. For library interface users, use @option{global_quality}.
  910. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  911. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  912. related option is expressed in kHz. The default value is @samp{0} (cutoff
  913. disabled).
  914. @item minrate (@emph{-m})
  915. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  916. expressed in kilobits/s.
  917. @item maxrate (@emph{-M})
  918. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  919. expressed in kilobits/s. This only has effect on ABR mode.
  920. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  921. Set noise floor bias for impulse blocks. The value is a float number from
  922. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  923. to the crispness of transients in the encoded audio. The tradeoff for better
  924. transient response is a higher bitrate.
  925. @end table
  926. @anchor{mjpegenc}
  927. @section mjpeg
  928. Motion JPEG encoder.
  929. @subsection Options
  930. @table @option
  931. @item huffman
  932. Set the huffman encoding strategy. Possible values:
  933. @table @samp
  934. @item default
  935. Use the default huffman tables. This is the default strategy.
  936. @item optimal
  937. Compute and use optimal huffman tables.
  938. @end table
  939. @end table
  940. @anchor{wavpackenc}
  941. @section wavpack
  942. WavPack lossless audio encoder.
  943. @subsection Options
  944. The equivalent options for @command{wavpack} command line utility are listed in
  945. parentheses.
  946. @subsubsection Shared options
  947. The following shared options are effective for this encoder. Only special notes
  948. about this particular encoder will be documented here. For the general meaning
  949. of the options, see @ref{codec-options,,the Codec Options chapter}.
  950. @table @option
  951. @item frame_size (@emph{--blocksize})
  952. For this encoder, the range for this option is between 128 and 131072. Default
  953. is automatically decided based on sample rate and number of channel.
  954. For the complete formula of calculating default, see
  955. @file{libavcodec/wavpackenc.c}.
  956. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
  957. @end table
  958. @subsubsection Private options
  959. @table @option
  960. @item joint_stereo (@emph{-j})
  961. Set whether to enable joint stereo. Valid values are:
  962. @table @samp
  963. @item on (@emph{1})
  964. Force mid/side audio encoding.
  965. @item off (@emph{0})
  966. Force left/right audio encoding.
  967. @item auto
  968. Let the encoder decide automatically.
  969. @end table
  970. @item optimize_mono
  971. Set whether to enable optimization for mono. This option is only effective for
  972. non-mono streams. Available values:
  973. @table @samp
  974. @item on
  975. enabled
  976. @item off
  977. disabled
  978. @end table
  979. @end table
  980. @c man end AUDIO ENCODERS
  981. @chapter Video Encoders
  982. @c man begin VIDEO ENCODERS
  983. A description of some of the currently available video encoders
  984. follows.
  985. @section a64_multi, a64_multi5
  986. A64 / Commodore 64 multicolor charset encoder. @code{a64_multi5} is extended with 5th color (colram).
  987. @section Cinepak
  988. Cinepak aka CVID encoder.
  989. Compatible with Windows 3.1 and vintage MacOS.
  990. @subsection Options
  991. @table @option
  992. @item g @var{integer}
  993. Keyframe interval.
  994. A keyframe is inserted at least every @code{-g} frames, sometimes sooner.
  995. @item q:v @var{integer}
  996. Quality factor. Lower is better. Higher gives lower bitrate.
  997. The following table lists bitrates when encoding akiyo_cif.y4m for various values of @code{-q:v} with @code{-g 100}:
  998. @table @option
  999. @item @code{-q:v 1} 1918 kb/s
  1000. @item @code{-q:v 2} 1735 kb/s
  1001. @item @code{-q:v 4} 1500 kb/s
  1002. @item @code{-q:v 10} 1041 kb/s
  1003. @item @code{-q:v 20} 826 kb/s
  1004. @item @code{-q:v 40} 553 kb/s
  1005. @item @code{-q:v 100} 394 kb/s
  1006. @item @code{-q:v 200} 312 kb/s
  1007. @item @code{-q:v 400} 266 kb/s
  1008. @item @code{-q:v 1000} 237 kb/s
  1009. @end table
  1010. @item max_extra_cb_iterations @var{integer}
  1011. Max extra codebook recalculation passes, more is better and slower.
  1012. @item skip_empty_cb @var{boolean}
  1013. Avoid wasting bytes, ignore vintage MacOS decoder.
  1014. @item max_strips @var{integer}
  1015. @itemx min_strips @var{integer}
  1016. The minimum and maximum number of strips to use.
  1017. Wider range sometimes improves quality.
  1018. More strips is generally better quality but costs more bits.
  1019. Fewer strips tend to yield more keyframes.
  1020. Vintage compatible is 1..3.
  1021. @item strip_number_adaptivity @var{integer}
  1022. How much number of strips is allowed to change between frames.
  1023. Higher is better but slower.
  1024. @end table
  1025. @section GIF
  1026. GIF image/animation encoder.
  1027. @subsection Options
  1028. @table @option
  1029. @item gifflags @var{integer}
  1030. Sets the flags used for GIF encoding.
  1031. @table @option
  1032. @item offsetting
  1033. Enables picture offsetting.
  1034. Default is enabled.
  1035. @item transdiff
  1036. Enables transparency detection between frames.
  1037. Default is enabled.
  1038. @end table
  1039. @item gifimage @var{integer}
  1040. Enables encoding one full GIF image per frame, rather than an animated GIF.
  1041. Default value is @option{0}.
  1042. @item global_palette @var{integer}
  1043. Writes a palette to the global GIF header where feasible.
  1044. If disabled, every frame will always have a palette written, even if there
  1045. is a global palette supplied.
  1046. Default value is @option{1}.
  1047. @end table
  1048. @section Hap
  1049. Vidvox Hap video encoder.
  1050. @subsection Options
  1051. @table @option
  1052. @item format @var{integer}
  1053. Specifies the Hap format to encode.
  1054. @table @option
  1055. @item hap
  1056. @item hap_alpha
  1057. @item hap_q
  1058. @end table
  1059. Default value is @option{hap}.
  1060. @item chunks @var{integer}
  1061. Specifies the number of chunks to split frames into, between 1 and 64. This
  1062. permits multithreaded decoding of large frames, potentially at the cost of
  1063. data-rate. The encoder may modify this value to divide frames evenly.
  1064. Default value is @var{1}.
  1065. @item compressor @var{integer}
  1066. Specifies the second-stage compressor to use. If set to @option{none},
  1067. @option{chunks} will be limited to 1, as chunked uncompressed frames offer no
  1068. benefit.
  1069. @table @option
  1070. @item none
  1071. @item snappy
  1072. @end table
  1073. Default value is @option{snappy}.
  1074. @end table
  1075. @section jpeg2000
  1076. The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
  1077. option can be used to set the encoding quality. Lossless encoding
  1078. can be selected with @code{-pred 1}.
  1079. @subsection Options
  1080. @table @option
  1081. @item format @var{integer}
  1082. Can be set to either @code{j2k} or @code{jp2} (the default) that
  1083. makes it possible to store non-rgb pix_fmts.
  1084. @item tile_width @var{integer}
  1085. Sets tile width. Range is 1 to 1073741824. Default is 256.
  1086. @item tile_height @var{integer}
  1087. Sets tile height. Range is 1 to 1073741824. Default is 256.
  1088. @item pred @var{integer}
  1089. Allows setting the discrete wavelet transform (DWT) type
  1090. @table @option
  1091. @item dwt97int (Lossy)
  1092. @item dwt53 (Lossless)
  1093. @end table
  1094. Default is @code{dwt97int}
  1095. @item sop @var{boolean}
  1096. Enable this to add SOP marker at the start of each packet. Disabled by default.
  1097. @item eph @var{boolean}
  1098. Enable this to add EPH marker at the end of each packet header. Disabled by default.
  1099. @item prog @var{integer}
  1100. Sets the progression order to be used by the encoder.
  1101. Possible values are:
  1102. @table @option
  1103. @item lrcp
  1104. @item rlcp
  1105. @item rpcl
  1106. @item pcrl
  1107. @item cprl
  1108. @end table
  1109. Set to @code{lrcp} by default.
  1110. @item layer_rates @var{string}
  1111. By default, when this option is not used, compression is done using the quality metric.
  1112. This option allows for compression using compression ratio. The compression ratio for each
  1113. level could be specified. The compression ratio of a layer @code{l} species the what ratio of
  1114. total file size is contained in the first @code{l} layers.
  1115. Example usage:
  1116. @example
  1117. ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
  1118. @end example
  1119. This would compress the image to contain 3 layers, where the data contained in the
  1120. first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
  1121. and shall contain all data while using all 3 layers.
  1122. @end table
  1123. @section librav1e
  1124. rav1e AV1 encoder wrapper.
  1125. Requires the presence of the rav1e headers and library during configuration.
  1126. You need to explicitly configure the build with @code{--enable-librav1e}.
  1127. @subsection Options
  1128. @table @option
  1129. @item qmax
  1130. Sets the maximum quantizer to use when using bitrate mode.
  1131. @item qmin
  1132. Sets the minimum quantizer to use when using bitrate mode.
  1133. @item qp
  1134. Uses quantizer mode to encode at the given quantizer (0-255).
  1135. @item speed
  1136. Selects the speed preset (0-10) to encode with.
  1137. @item tiles
  1138. Selects how many tiles to encode with.
  1139. @item tile-rows
  1140. Selects how many rows of tiles to encode with.
  1141. @item tile-columns
  1142. Selects how many columns of tiles to encode with.
  1143. @item rav1e-params
  1144. Set rav1e options using a list of @var{key}=@var{value} pairs separated
  1145. by ":". See @command{rav1e --help} for a list of options.
  1146. For example to specify librav1e encoding options with @option{-rav1e-params}:
  1147. @example
  1148. ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  1149. @end example
  1150. @end table
  1151. @section libaom-av1
  1152. libaom AV1 encoder wrapper.
  1153. Requires the presence of the libaom headers and library during
  1154. configuration. You need to explicitly configure the build with
  1155. @code{--enable-libaom}.
  1156. @subsection Options
  1157. The wrapper supports the following standard libavcodec options:
  1158. @table @option
  1159. @item b
  1160. Set bitrate target in bits/second. By default this will use
  1161. variable-bitrate mode. If @option{maxrate} and @option{minrate} are
  1162. also set to the same value then it will use constant-bitrate mode,
  1163. otherwise if @option{crf} is set as well then it will use
  1164. constrained-quality mode.
  1165. @item g keyint_min
  1166. Set key frame placement. The GOP size sets the maximum distance between
  1167. key frames; if zero the output stream will be intra-only. The minimum
  1168. distance is ignored unless it is the same as the GOP size, in which case
  1169. key frames will always appear at a fixed interval. Not set by default,
  1170. so without this option the library has completely free choice about
  1171. where to place key frames.
  1172. @item qmin qmax
  1173. Set minimum/maximum quantisation values. Valid range is from 0 to 63
  1174. (warning: this does not match the quantiser values actually used by AV1
  1175. - divide by four to map real quantiser values to this range). Defaults
  1176. to min/max (no constraint).
  1177. @item minrate maxrate bufsize rc_init_occupancy
  1178. Set rate control buffering parameters. Not used if not set - defaults
  1179. to unconstrained variable bitrate.
  1180. @item threads
  1181. Set the number of threads to use while encoding. This may require the
  1182. @option{tiles} or @option{row-mt} options to also be set to actually
  1183. use the specified number of threads fully. Defaults to the number of
  1184. hardware threads supported by the host machine.
  1185. @item profile
  1186. Set the encoding profile. Defaults to using the profile which matches
  1187. the bit depth and chroma subsampling of the input.
  1188. @end table
  1189. The wrapper also has some specific options:
  1190. @table @option
  1191. @item cpu-used
  1192. Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  1193. higher numbers indicating greater speed and lower quality. The default
  1194. value is 1, which will be slow and high quality.
  1195. @item auto-alt-ref
  1196. Enable use of alternate reference frames. Defaults to the internal
  1197. default of the library.
  1198. @item arnr-max-frames (@emph{frames})
  1199. Set altref noise reduction max frame count. Default is -1.
  1200. @item arnr-strength (@emph{strength})
  1201. Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  1202. @item aq-mode (@emph{aq-mode})
  1203. Set adaptive quantization mode. Possible values:
  1204. @table @samp
  1205. @item none (@emph{0})
  1206. Disabled.
  1207. @item variance (@emph{1})
  1208. Variance-based.
  1209. @item complexity (@emph{2})
  1210. Complexity-based.
  1211. @item cyclic (@emph{3})
  1212. Cyclic refresh.
  1213. @end table
  1214. @item tune (@emph{tune})
  1215. Set the distortion metric the encoder is tuned with. Default is @code{psnr}.
  1216. @table @samp
  1217. @item psnr (@emph{0})
  1218. @item ssim (@emph{1})
  1219. @end table
  1220. @item lag-in-frames
  1221. Set the maximum number of frames which the encoder may keep in flight
  1222. at any one time for lookahead purposes. Defaults to the internal
  1223. default of the library.
  1224. @item error-resilience
  1225. Enable error resilience features:
  1226. @table @option
  1227. @item default
  1228. Improve resilience against losses of whole frames.
  1229. @end table
  1230. Not enabled by default.
  1231. @item crf
  1232. Set the quality/size tradeoff for constant-quality (no bitrate target)
  1233. and constrained-quality (with maximum bitrate target) modes. Valid
  1234. range is 0 to 63, higher numbers indicating lower quality and smaller
  1235. output size. Only used if set; by default only the bitrate target is
  1236. used.
  1237. @item static-thresh
  1238. Set a change threshold on blocks below which they will be skipped by
  1239. the encoder. Defined in arbitrary units as a nonnegative integer,
  1240. defaulting to zero (no blocks are skipped).
  1241. @item drop-threshold
  1242. Set a threshold for dropping frames when close to rate control bounds.
  1243. Defined as a percentage of the target buffer - when the rate control
  1244. buffer falls below this percentage, frames will be dropped until it
  1245. has refilled above the threshold. Defaults to zero (no frames are
  1246. dropped).
  1247. @item denoise-noise-level (@emph{level})
  1248. Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  1249. this option is not set or set to 0.
  1250. @item denoise-block-size (@emph{pixels})
  1251. Block size used for denoising for grain synthesis. If not set, AV1 codec
  1252. uses the default value of 32.
  1253. @item undershoot-pct (@emph{pct})
  1254. Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  1255. Default is -1.
  1256. @item overshoot-pct (@emph{pct})
  1257. Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  1258. Default is -1.
  1259. @item minsection-pct (@emph{pct})
  1260. Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  1261. is not set, the libaomenc wrapper computes it as follows: @code{(minrate * 100 / bitrate)}.
  1262. Range is -1 to 100. Default is -1 (unset).
  1263. @item maxsection-pct (@emph{pct})
  1264. Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  1265. is not set, the libaomenc wrapper computes it as follows: @code{(maxrate * 100 / bitrate)}.
  1266. Range is -1 to 5000. Default is -1 (unset).
  1267. @item frame-parallel (@emph{boolean})
  1268. Enable frame parallel decodability features. Default is true.
  1269. @item tiles
  1270. Set the number of tiles to encode the input video with, as columns x
  1271. rows. Larger numbers allow greater parallelism in both encoding and
  1272. decoding, but may decrease coding efficiency. Defaults to the minimum
  1273. number of tiles required by the size of the input video (this is 1x1
  1274. (that is, a single tile) for sizes up to and including 4K).
  1275. @item tile-columns tile-rows
  1276. Set the number of tiles as log2 of the number of tile rows and columns.
  1277. Provided for compatibility with libvpx/VP9.
  1278. @item row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
  1279. Enable row based multi-threading. Disabled by default.
  1280. @item enable-cdef (@emph{boolean})
  1281. Enable Constrained Directional Enhancement Filter. The libaom-av1
  1282. encoder enables CDEF by default.
  1283. @item enable-restoration (@emph{boolean})
  1284. Enable Loop Restoration Filter. Default is true for libaom-av1.
  1285. @item enable-global-motion (@emph{boolean})
  1286. Enable the use of global motion for block prediction. Default is true.
  1287. @item enable-intrabc (@emph{boolean})
  1288. Enable block copy mode for intra block prediction. This mode is
  1289. useful for screen content. Default is true.
  1290. @item enable-rect-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
  1291. Enable rectangular partitions. Default is true.
  1292. @item enable-1to4-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
  1293. Enable 1:4/4:1 partitions. Default is true.
  1294. @item enable-ab-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
  1295. Enable AB shape partitions. Default is true.
  1296. @item enable-angle-delta (@emph{boolean}) (Requires libaom >= v2.0.0)
  1297. Enable angle delta intra prediction. Default is true.
  1298. @item enable-cfl-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1299. Enable chroma predicted from luma intra prediction. Default is true.
  1300. @item enable-filter-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1301. Enable filter intra predictor. Default is true.
  1302. @item enable-intra-edge-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
  1303. Enable intra edge filter. Default is true.
  1304. @item enable-smooth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1305. Enable smooth intra prediction mode. Default is true.
  1306. @item enable-paeth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1307. Enable paeth predictor in intra prediction. Default is true.
  1308. @item enable-palette (@emph{boolean}) (Requires libaom >= v2.0.0)
  1309. Enable palette prediction mode. Default is true.
  1310. @item enable-flip-idtx (@emph{boolean}) (Requires libaom >= v2.0.0)
  1311. Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
  1312. FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
  1313. V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
  1314. @item enable-tx64 (@emph{boolean}) (Requires libaom >= v2.0.0)
  1315. Enable 64-pt transform. Default is true.
  1316. @item reduced-tx-type-set (@emph{boolean}) (Requires libaom >= v2.0.0)
  1317. Use reduced set of transform types. Default is false.
  1318. @item use-intra-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
  1319. Use DCT only for INTRA modes. Default is false.
  1320. @item use-inter-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
  1321. Use DCT only for INTER modes. Default is false.
  1322. @item use-intra-default-tx-only (@emph{boolean}) (Requires libaom >= v2.0.0)
  1323. Use Default-transform only for INTRA modes. Default is false.
  1324. @item enable-ref-frame-mvs (@emph{boolean}) (Requires libaom >= v2.0.0)
  1325. Enable temporal mv prediction. Default is true.
  1326. @item enable-reduced-reference-set (@emph{boolean}) (Requires libaom >= v2.0.0)
  1327. Use reduced set of single and compound references. Default is false.
  1328. @item enable-obmc (@emph{boolean}) (Requires libaom >= v2.0.0)
  1329. Enable obmc. Default is true.
  1330. @item enable-dual-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
  1331. Enable dual filter. Default is true.
  1332. @item enable-diff-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1333. Enable difference-weighted compound. Default is true.
  1334. @item enable-dist-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1335. Enable distance-weighted compound. Default is true.
  1336. @item enable-onesided-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1337. Enable one sided compound. Default is true.
  1338. @item enable-interinter-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
  1339. Enable interinter wedge compound. Default is true.
  1340. @item enable-interintra-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
  1341. Enable interintra wedge compound. Default is true.
  1342. @item enable-masked-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1343. Enable masked compound. Default is true.
  1344. @item enable-interintra-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
  1345. Enable interintra compound. Default is true.
  1346. @item enable-smooth-interintra (@emph{boolean}) (Requires libaom >= v2.0.0)
  1347. Enable smooth interintra mode. Default is true.
  1348. @item aom-params
  1349. Set libaom options using a list of @var{key}=@var{value} pairs separated
  1350. by ":". For a list of supported options, see @command{aomenc --help} under the
  1351. section "AV1 Specific Options".
  1352. For example to specify libaom encoding options with @option{-aom-params}:
  1353. @example
  1354. ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
  1355. @end example
  1356. @end table
  1357. @section libsvtav1
  1358. SVT-AV1 encoder wrapper.
  1359. Requires the presence of the SVT-AV1 headers and library during configuration.
  1360. You need to explicitly configure the build with @code{--enable-libsvtav1}.
  1361. @subsection Options
  1362. @table @option
  1363. @item profile
  1364. Set the encoding profile.
  1365. @table @samp
  1366. @item main
  1367. @item high
  1368. @item professional
  1369. @end table
  1370. @item level
  1371. Set the operating point level. For example: '4.0'
  1372. @item hielevel
  1373. Set the Hierarchical prediction levels.
  1374. @table @samp
  1375. @item 3level
  1376. @item 4level
  1377. This is the default.
  1378. @end table
  1379. @item tier
  1380. Set the operating point tier.
  1381. @table @samp
  1382. @item main
  1383. This is the default.
  1384. @item high
  1385. @end table
  1386. @item qmax
  1387. Set the maximum quantizer to use when using a bitrate mode.
  1388. @item qmin
  1389. Set the minimum quantizer to use when using a bitrate mode.
  1390. @item crf
  1391. Constant rate factor value used in crf rate control mode (0-63).
  1392. @item qp
  1393. Set the quantizer used in cqp rate control mode (0-63).
  1394. @item sc_detection
  1395. Enable scene change detection.
  1396. @item la_depth
  1397. Set number of frames to look ahead (0-120).
  1398. @item preset
  1399. Set the quality-speed tradeoff, in the range 0 to 13. Higher values are
  1400. faster but lower quality.
  1401. @item tile_rows
  1402. Set log2 of the number of rows of tiles to use (0-6).
  1403. @item tile_columns
  1404. Set log2 of the number of columns of tiles to use (0-4).
  1405. @item svtav1-params
  1406. Set SVT-AV1 options using a list of @var{key}=@var{value} pairs separated
  1407. by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters.
  1408. @end table
  1409. @section libjxl
  1410. libjxl JPEG XL encoder wrapper.
  1411. Requires the presence of the libjxl headers and library during
  1412. configuration. You need to explicitly configure the build with
  1413. @code{--enable-libjxl}.
  1414. @subsection Options
  1415. The libjxl wrapper supports the following options:
  1416. @table @option
  1417. @item distance
  1418. Set the target Butteraugli distance. This is a quality setting: lower
  1419. distance yields higher quality, with distance=1.0 roughly comparable to
  1420. libjpeg Quality 90 for photographic content. Setting distance=0.0 yields
  1421. true lossless encoding. Valid values range between 0.0 and 15.0, and sane
  1422. values rarely exceed 5.0. Setting distance=0.1 usually attains
  1423. transparency for most input. The default is 1.0.
  1424. @item effort
  1425. Set the encoding effort used. Higher effort values produce more consistent
  1426. quality and usually produces a better quality/bpp curve, at the cost of
  1427. more CPU time required. Valid values range from 1 to 9, and the default is 7.
  1428. @item modular
  1429. Force the encoder to use Modular mode instead of choosing automatically. The
  1430. default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT
  1431. is generally superior to Modular for lossy encoding but does not support
  1432. lossless encoding.
  1433. @end table
  1434. @section libkvazaar
  1435. Kvazaar H.265/HEVC encoder.
  1436. Requires the presence of the libkvazaar headers and library during
  1437. configuration. You need to explicitly configure the build with
  1438. @option{--enable-libkvazaar}.
  1439. @subsection Options
  1440. @table @option
  1441. @item b
  1442. Set target video bitrate in bit/s and enable rate control.
  1443. @item kvazaar-params
  1444. Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
  1445. by commas (,). See kvazaar documentation for a list of options.
  1446. @end table
  1447. @section libopenh264
  1448. Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  1449. This encoder requires the presence of the libopenh264 headers and
  1450. library during configuration. You need to explicitly configure the
  1451. build with @code{--enable-libopenh264}. The library is detected using
  1452. @command{pkg-config}.
  1453. For more information about the library see
  1454. @url{http://www.openh264.org}.
  1455. @subsection Options
  1456. The following FFmpeg global options affect the configurations of the
  1457. libopenh264 encoder.
  1458. @table @option
  1459. @item b
  1460. Set the bitrate (as a number of bits per second).
  1461. @item g
  1462. Set the GOP size.
  1463. @item maxrate
  1464. Set the max bitrate (as a number of bits per second).
  1465. @item flags +global_header
  1466. Set global header in the bitstream.
  1467. @item slices
  1468. Set the number of slices, used in parallelized encoding. Default value
  1469. is 0. This is only used when @option{slice_mode} is set to
  1470. @samp{fixed}.
  1471. @item slice_mode
  1472. Set slice mode. Can assume one of the following possible values:
  1473. @table @samp
  1474. @item fixed
  1475. a fixed number of slices
  1476. @item rowmb
  1477. one slice per row of macroblocks
  1478. @item auto
  1479. automatic number of slices according to number of threads
  1480. @item dyn
  1481. dynamic slicing
  1482. @end table
  1483. Default value is @samp{auto}.
  1484. @item loopfilter
  1485. Enable loop filter, if set to 1 (automatically enabled). To disable
  1486. set a value of 0.
  1487. @item profile
  1488. Set profile restrictions. If set to the value of @samp{main} enable
  1489. CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
  1490. @item max_nal_size
  1491. Set maximum NAL size in bytes.
  1492. @item allow_skip_frames
  1493. Allow skipping frames to hit the target bitrate if set to 1.
  1494. @end table
  1495. @section libtheora
  1496. libtheora Theora encoder wrapper.
  1497. Requires the presence of the libtheora headers and library during
  1498. configuration. You need to explicitly configure the build with
  1499. @code{--enable-libtheora}.
  1500. For more information about the libtheora project see
  1501. @url{http://www.theora.org/}.
  1502. @subsection Options
  1503. The following global options are mapped to internal libtheora options
  1504. which affect the quality and the bitrate of the encoded stream.
  1505. @table @option
  1506. @item b
  1507. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  1508. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  1509. @item flags
  1510. Used to enable constant quality mode (VBR) encoding through the
  1511. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  1512. modes.
  1513. @item g
  1514. Set the GOP size.
  1515. @item global_quality
  1516. Set the global quality as an integer in lambda units.
  1517. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  1518. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  1519. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  1520. value in the native libtheora range [0-63]. A higher value corresponds
  1521. to a higher quality.
  1522. @item q
  1523. Enable VBR mode when set to a non-negative value, and set constant
  1524. quality value as a double floating point value in QP units.
  1525. The value is clipped in the [0-10] range, and then multiplied by 6.3
  1526. to get a value in the native libtheora range [0-63].
  1527. This option is valid only using the @command{ffmpeg} command-line
  1528. tool. For library interface users, use @option{global_quality}.
  1529. @end table
  1530. @subsection Examples
  1531. @itemize
  1532. @item
  1533. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  1534. @example
  1535. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  1536. @end example
  1537. @item
  1538. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  1539. @example
  1540. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  1541. @end example
  1542. @end itemize
  1543. @section libvpx
  1544. VP8/VP9 format supported through libvpx.
  1545. Requires the presence of the libvpx headers and library during configuration.
  1546. You need to explicitly configure the build with @code{--enable-libvpx}.
  1547. @subsection Options
  1548. The following options are supported by the libvpx wrapper. The
  1549. @command{vpxenc}-equivalent options or values are listed in parentheses
  1550. for easy migration.
  1551. To reduce the duplication of documentation, only the private options
  1552. and some others requiring special attention are documented here. For
  1553. the documentation of the undocumented generic options, see
  1554. @ref{codec-options,,the Codec Options chapter}.
  1555. To get more documentation of the libvpx options, invoke the command
  1556. @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
  1557. @command{vpxenc --help}. Further information is available in the libvpx API
  1558. documentation.
  1559. @table @option
  1560. @item b (@emph{target-bitrate})
  1561. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1562. expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
  1563. kilobits/s.
  1564. @item g (@emph{kf-max-dist})
  1565. @item keyint_min (@emph{kf-min-dist})
  1566. @item qmin (@emph{min-q})
  1567. Minimum (Best Quality) Quantizer.
  1568. @item qmax (@emph{max-q})
  1569. Maximum (Worst Quality) Quantizer.
  1570. Can be changed per-frame.
  1571. @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
  1572. Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
  1573. specified in milliseconds, the libvpx wrapper converts this value as follows:
  1574. @code{buf-sz = bufsize * 1000 / bitrate},
  1575. @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
  1576. @item rc_init_occupancy (@emph{buf-initial-sz})
  1577. Set number of bits which should be loaded into the rc buffer before decoding
  1578. starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
  1579. wrapper converts this value as follows:
  1580. @code{rc_init_occupancy * 1000 / bitrate}.
  1581. @item undershoot-pct
  1582. Set datarate undershoot (min) percentage of the target bitrate.
  1583. @item overshoot-pct
  1584. Set datarate overshoot (max) percentage of the target bitrate.
  1585. @item skip_threshold (@emph{drop-frame})
  1586. @item qcomp (@emph{bias-pct})
  1587. @item maxrate (@emph{maxsection-pct})
  1588. Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1589. percentage of the target bitrate, the libvpx wrapper converts this value as
  1590. follows: @code{(maxrate * 100 / bitrate)}.
  1591. @item minrate (@emph{minsection-pct})
  1592. Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
  1593. percentage of the target bitrate, the libvpx wrapper converts this value as
  1594. follows: @code{(minrate * 100 / bitrate)}.
  1595. @item minrate, maxrate, b @emph{end-usage=cbr}
  1596. @code{(minrate == maxrate == bitrate)}.
  1597. @item crf (@emph{end-usage=cq}, @emph{cq-level})
  1598. @item tune (@emph{tune})
  1599. @table @samp
  1600. @item psnr (@emph{psnr})
  1601. @item ssim (@emph{ssim})
  1602. @end table
  1603. @item quality, deadline (@emph{deadline})
  1604. @table @samp
  1605. @item best
  1606. Use best quality deadline. Poorly named and quite slow, this option should be
  1607. avoided as it may give worse quality output than good.
  1608. @item good
  1609. Use good quality deadline. This is a good trade-off between speed and quality
  1610. when used with the @option{cpu-used} option.
  1611. @item realtime
  1612. Use realtime quality deadline.
  1613. @end table
  1614. @item speed, cpu-used (@emph{cpu-used})
  1615. Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  1616. of quality.
  1617. @item nr (@emph{noise-sensitivity})
  1618. @item static-thresh
  1619. Set a change threshold on blocks below which they will be skipped by the
  1620. encoder.
  1621. @item slices (@emph{token-parts})
  1622. Note that FFmpeg's @option{slices} option gives the total number of partitions,
  1623. while @command{vpxenc}'s @option{token-parts} is given as
  1624. @code{log2(partitions)}.
  1625. @item max-intra-rate
  1626. Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  1627. means unlimited.
  1628. @item force_key_frames
  1629. @code{VPX_EFLAG_FORCE_KF}
  1630. @item Alternate reference frame related
  1631. @table @option
  1632. @item auto-alt-ref
  1633. Enable use of alternate reference frames (2-pass only).
  1634. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  1635. @item arnr-maxframes
  1636. Set altref noise reduction max frame count.
  1637. @item arnr-type
  1638. Set altref noise reduction filter type: backward, forward, centered.
  1639. @item arnr-strength
  1640. Set altref noise reduction filter strength.
  1641. @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
  1642. Set number of frames to look ahead for frametype and ratecontrol.
  1643. @item min-gf-interval
  1644. Set minimum golden/alternate reference frame interval (VP9 only).
  1645. @end table
  1646. @item error-resilient
  1647. Enable error resiliency features.
  1648. @item sharpness @var{integer}
  1649. Increase sharpness at the expense of lower PSNR.
  1650. The valid range is [0, 7].
  1651. @item ts-parameters
  1652. Sets the temporal scalability configuration using a :-separated list of
  1653. key=value pairs. For example, to specify temporal scalability parameters
  1654. with @code{ffmpeg}:
  1655. @example
  1656. ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  1657. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  1658. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  1659. @end example
  1660. Below is a brief explanation of each of the parameters, please
  1661. refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
  1662. details.
  1663. @table @option
  1664. @item ts_number_layers
  1665. Number of temporal coding layers.
  1666. @item ts_target_bitrate
  1667. Target bitrate for each temporal layer (in kbps).
  1668. (bitrate should be inclusive of the lower temporal layer).
  1669. @item ts_rate_decimator
  1670. Frame rate decimation factor for each temporal layer.
  1671. @item ts_periodicity
  1672. Length of the sequence defining frame temporal layer membership.
  1673. @item ts_layer_id
  1674. Template defining the membership of frames to temporal layers.
  1675. @item ts_layering_mode
  1676. (optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  1677. Currently supports the following options.
  1678. @table @option
  1679. @item 0
  1680. No temporal layering flags are provided internally,
  1681. relies on flags being passed in using @code{metadata} field in @code{AVFrame}
  1682. with following keys.
  1683. @table @option
  1684. @item vp8-flags
  1685. Sets the flags passed into the encoder to indicate the referencing scheme for
  1686. the current frame.
  1687. Refer to function @code{vpx_codec_encode} in @code{vpx/vpx_encoder.h} for more
  1688. details.
  1689. @item temporal_id
  1690. Explicitly sets the temporal id of the current frame to encode.
  1691. @end table
  1692. @item 2
  1693. Two temporal layers. 0-1...
  1694. @item 3
  1695. Three temporal layers. 0-2-1-2...; with single reference frame.
  1696. @item 4
  1697. Same as option "3", except there is a dependency between
  1698. the two temporal layer 2 frames within the temporal period.
  1699. @end table
  1700. @end table
  1701. @item VP9-specific options
  1702. @table @option
  1703. @item lossless
  1704. Enable lossless mode.
  1705. @item tile-columns
  1706. Set number of tile columns to use. Note this is given as
  1707. @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
  1708. setting the @option{tile-columns} option to 3.
  1709. @item tile-rows
  1710. Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
  1711. For example, 4 tile rows would be requested by setting the @option{tile-rows}
  1712. option to 2.
  1713. @item frame-parallel
  1714. Enable frame parallel decodability features.
  1715. @item aq-mode
  1716. Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  1717. cyclic refresh, 4: equator360).
  1718. @item colorspace @emph{color-space}
  1719. Set input color space. The VP9 bitstream supports signaling the following
  1720. colorspaces:
  1721. @table @option
  1722. @item @samp{rgb} @emph{sRGB}
  1723. @item @samp{bt709} @emph{bt709}
  1724. @item @samp{unspecified} @emph{unknown}
  1725. @item @samp{bt470bg} @emph{bt601}
  1726. @item @samp{smpte170m} @emph{smpte170}
  1727. @item @samp{smpte240m} @emph{smpte240}
  1728. @item @samp{bt2020_ncl} @emph{bt2020}
  1729. @end table
  1730. @item row-mt @var{boolean}
  1731. Enable row based multi-threading.
  1732. @item tune-content
  1733. Set content type: default (0), screen (1), film (2).
  1734. @item corpus-complexity
  1735. Corpus VBR mode is a variant of standard VBR where the complexity distribution
  1736. midpoint is passed in rather than calculated for a specific clip or chunk.
  1737. The valid range is [0, 10000]. 0 (default) uses standard VBR.
  1738. @item enable-tpl @var{boolean}
  1739. Enable temporal dependency model.
  1740. @item ref-frame-config
  1741. Using per-frame metadata, set members of the structure @code{vpx_svc_ref_frame_config_t} in @code{vpx/vp8cx.h} to fine-control referencing schemes and frame buffer management.
  1742. @*Use a :-separated list of key=value pairs.
  1743. For example,
  1744. @example
  1745. av_dict_set(&av_frame->metadata, "ref-frame-config", \
  1746. "rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
  1747. @end example
  1748. @table @option
  1749. @item rfc_update_buffer_slot
  1750. Indicates the buffer slot number to update
  1751. @item rfc_update_last
  1752. Indicates whether to update the LAST frame
  1753. @item rfc_update_golden
  1754. Indicates whether to update GOLDEN frame
  1755. @item rfc_update_alt_ref
  1756. Indicates whether to update ALT_REF frame
  1757. @item rfc_lst_fb_idx
  1758. LAST frame buffer index
  1759. @item rfc_gld_fb_idx
  1760. GOLDEN frame buffer index
  1761. @item rfc_alt_fb_idx
  1762. ALT_REF frame buffer index
  1763. @item rfc_reference_last
  1764. Indicates whether to reference LAST frame
  1765. @item rfc_reference_golden
  1766. Indicates whether to reference GOLDEN frame
  1767. @item rfc_reference_alt_ref
  1768. Indicates whether to reference ALT_REF frame
  1769. @item rfc_reference_duration
  1770. Indicates frame duration
  1771. @end table
  1772. @end table
  1773. @end table
  1774. For more information about libvpx see:
  1775. @url{http://www.webmproject.org/}
  1776. @section libwebp
  1777. libwebp WebP Image encoder wrapper
  1778. libwebp is Google's official encoder for WebP images. It can encode in either
  1779. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  1780. frame. Lossless images are a separate codec developed by Google.
  1781. @subsection Pixel Format
  1782. Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  1783. to limitations of the format and libwebp. Alpha is supported for either mode.
  1784. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  1785. passed in for encoding lossless, the pixel format will automatically be
  1786. converted using functions from libwebp. This is not ideal and is done only for
  1787. convenience.
  1788. @subsection Options
  1789. @table @option
  1790. @item -lossless @var{boolean}
  1791. Enables/Disables use of lossless mode. Default is 0.
  1792. @item -compression_level @var{integer}
  1793. For lossy, this is a quality/speed tradeoff. Higher values give better quality
  1794. for a given size at the cost of increased encoding time. For lossless, this is
  1795. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  1796. encoding time. More specifically, it controls the number of extra algorithms
  1797. and compression tools used, and varies the combination of these tools. This
  1798. maps to the @var{method} option in libwebp. The valid range is 0 to 6.
  1799. Default is 4.
  1800. @item -quality @var{float}
  1801. For lossy encoding, this controls image quality. For lossless encoding, this
  1802. controls the effort and time spent in compression.
  1803. Range is 0 to 100. Default is 75.
  1804. @item -preset @var{type}
  1805. Configuration preset. This does some automatic settings based on the general
  1806. type of the image.
  1807. @table @option
  1808. @item none
  1809. Do not use a preset.
  1810. @item default
  1811. Use the encoder default.
  1812. @item picture
  1813. Digital picture, like portrait, inner shot
  1814. @item photo
  1815. Outdoor photograph, with natural lighting
  1816. @item drawing
  1817. Hand or line drawing, with high-contrast details
  1818. @item icon
  1819. Small-sized colorful images
  1820. @item text
  1821. Text-like
  1822. @end table
  1823. @end table
  1824. @section libx264, libx264rgb
  1825. x264 H.264/MPEG-4 AVC encoder wrapper.
  1826. This encoder requires the presence of the libx264 headers and library
  1827. during configuration. You need to explicitly configure the build with
  1828. @code{--enable-libx264}.
  1829. libx264 supports an impressive number of features, including 8x8 and
  1830. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1831. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1832. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1833. Many libx264 encoder options are mapped to FFmpeg global codec
  1834. options, while unique encoder options are provided through private
  1835. options. Additionally the @option{x264opts} and @option{x264-params}
  1836. private options allows one to pass a list of key=value tuples as accepted
  1837. by the libx264 @code{x264_param_parse} function.
  1838. The x264 project website is at
  1839. @url{http://www.videolan.org/developers/x264.html}.
  1840. The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  1841. pixel formats as input instead of YUV.
  1842. @subsection Supported Pixel Formats
  1843. x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  1844. x264's configure time.
  1845. @subsection Options
  1846. The following options are supported by the libx264 wrapper. The
  1847. @command{x264}-equivalent options or values are listed in parentheses
  1848. for easy migration.
  1849. To reduce the duplication of documentation, only the private options
  1850. and some others requiring special attention are documented here. For
  1851. the documentation of the undocumented generic options, see
  1852. @ref{codec-options,,the Codec Options chapter}.
  1853. To get a more accurate and extensive documentation of the libx264
  1854. options, invoke the command @command{x264 --fullhelp} or consult
  1855. the libx264 documentation.
  1856. @table @option
  1857. @item b (@emph{bitrate})
  1858. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1859. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1860. kilobits/s.
  1861. @item bf (@emph{bframes})
  1862. @item g (@emph{keyint})
  1863. @item qmin (@emph{qpmin})
  1864. Minimum quantizer scale.
  1865. @item qmax (@emph{qpmax})
  1866. Maximum quantizer scale.
  1867. @item qdiff (@emph{qpstep})
  1868. Maximum difference between quantizer scales.
  1869. @item qblur (@emph{qblur})
  1870. Quantizer curve blur
  1871. @item qcomp (@emph{qcomp})
  1872. Quantizer curve compression factor
  1873. @item refs (@emph{ref})
  1874. Number of reference frames each P-frame can use. The range is from @var{0-16}.
  1875. @item sc_threshold (@emph{scenecut})
  1876. Sets the threshold for the scene change detection.
  1877. @item trellis (@emph{trellis})
  1878. Performs Trellis quantization to increase efficiency. Enabled by default.
  1879. @item nr (@emph{nr})
  1880. @item me_range (@emph{merange})
  1881. Maximum range of the motion search in pixels.
  1882. @item me_method (@emph{me})
  1883. Set motion estimation method. Possible values in the decreasing order
  1884. of speed:
  1885. @table @samp
  1886. @item dia (@emph{dia})
  1887. @item epzs (@emph{dia})
  1888. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1889. @samp{dia}.
  1890. @item hex (@emph{hex})
  1891. Hexagonal search with radius 2.
  1892. @item umh (@emph{umh})
  1893. Uneven multi-hexagon search.
  1894. @item esa (@emph{esa})
  1895. Exhaustive search.
  1896. @item tesa (@emph{tesa})
  1897. Hadamard exhaustive search (slowest).
  1898. @end table
  1899. @item forced-idr
  1900. Normally, when forcing a I-frame type, the encoder can select any type
  1901. of I-frame. This option forces it to choose an IDR-frame.
  1902. @item subq (@emph{subme})
  1903. Sub-pixel motion estimation method.
  1904. @item b_strategy (@emph{b-adapt})
  1905. Adaptive B-frame placement decision algorithm. Use only on first-pass.
  1906. @item keyint_min (@emph{min-keyint})
  1907. Minimum GOP size.
  1908. @item coder
  1909. Set entropy encoder. Possible values:
  1910. @table @samp
  1911. @item ac
  1912. Enable CABAC.
  1913. @item vlc
  1914. Enable CAVLC and disable CABAC. It generates the same effect as
  1915. @command{x264}'s @option{--no-cabac} option.
  1916. @end table
  1917. @item cmp
  1918. Set full pixel motion estimation comparison algorithm. Possible values:
  1919. @table @samp
  1920. @item chroma
  1921. Enable chroma in motion estimation.
  1922. @item sad
  1923. Ignore chroma in motion estimation. It generates the same effect as
  1924. @command{x264}'s @option{--no-chroma-me} option.
  1925. @end table
  1926. @item threads (@emph{threads})
  1927. Number of encoding threads.
  1928. @item thread_type
  1929. Set multithreading technique. Possible values:
  1930. @table @samp
  1931. @item slice
  1932. Slice-based multithreading. It generates the same effect as
  1933. @command{x264}'s @option{--sliced-threads} option.
  1934. @item frame
  1935. Frame-based multithreading.
  1936. @end table
  1937. @item flags
  1938. Set encoding flags. It can be used to disable closed GOP and enable
  1939. open GOP by setting it to @code{-cgop}. The result is similar to
  1940. the behavior of @command{x264}'s @option{--open-gop} option.
  1941. @item rc_init_occupancy (@emph{vbv-init})
  1942. @item preset (@emph{preset})
  1943. Set the encoding preset.
  1944. @item tune (@emph{tune})
  1945. Set tuning of the encoding params.
  1946. @item profile (@emph{profile})
  1947. Set profile restrictions.
  1948. @item fastfirstpass
  1949. Enable fast settings when encoding first pass, when set to 1. When set
  1950. to 0, it has the same effect of @command{x264}'s
  1951. @option{--slow-firstpass} option.
  1952. @item crf (@emph{crf})
  1953. Set the quality for constant quality mode.
  1954. @item crf_max (@emph{crf-max})
  1955. In CRF mode, prevents VBV from lowering quality beyond this point.
  1956. @item qp (@emph{qp})
  1957. Set constant quantization rate control method parameter.
  1958. @item aq-mode (@emph{aq-mode})
  1959. Set AQ method. Possible values:
  1960. @table @samp
  1961. @item none (@emph{0})
  1962. Disabled.
  1963. @item variance (@emph{1})
  1964. Variance AQ (complexity mask).
  1965. @item autovariance (@emph{2})
  1966. Auto-variance AQ (experimental).
  1967. @end table
  1968. @item aq-strength (@emph{aq-strength})
  1969. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1970. @item psy
  1971. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1972. same effect as @command{x264}'s @option{--no-psy} option.
  1973. @item psy-rd (@emph{psy-rd})
  1974. Set strength of psychovisual optimization, in
  1975. @var{psy-rd}:@var{psy-trellis} format.
  1976. @item rc-lookahead (@emph{rc-lookahead})
  1977. Set number of frames to look ahead for frametype and ratecontrol.
  1978. @item weightb
  1979. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1980. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1981. @item weightp (@emph{weightp})
  1982. Set weighted prediction method for P-frames. Possible values:
  1983. @table @samp
  1984. @item none (@emph{0})
  1985. Disabled
  1986. @item simple (@emph{1})
  1987. Enable only weighted refs
  1988. @item smart (@emph{2})
  1989. Enable both weighted refs and duplicates
  1990. @end table
  1991. @item ssim (@emph{ssim})
  1992. Enable calculation and printing SSIM stats after the encoding.
  1993. @item intra-refresh (@emph{intra-refresh})
  1994. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1995. to 1.
  1996. @item avcintra-class (@emph{class})
  1997. Configure the encoder to generate AVC-Intra.
  1998. Valid values are 50,100 and 200
  1999. @item bluray-compat (@emph{bluray-compat})
  2000. Configure the encoder to be compatible with the bluray standard.
  2001. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  2002. @item b-bias (@emph{b-bias})
  2003. Set the influence on how often B-frames are used.
  2004. @item b-pyramid (@emph{b-pyramid})
  2005. Set method for keeping of some B-frames as references. Possible values:
  2006. @table @samp
  2007. @item none (@emph{none})
  2008. Disabled.
  2009. @item strict (@emph{strict})
  2010. Strictly hierarchical pyramid.
  2011. @item normal (@emph{normal})
  2012. Non-strict (not Blu-ray compatible).
  2013. @end table
  2014. @item mixed-refs
  2015. Enable the use of one reference per partition, as opposed to one
  2016. reference per macroblock when set to 1. When set to 0, it has the
  2017. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  2018. @item 8x8dct
  2019. Enable adaptive spatial transform (high profile 8x8 transform)
  2020. when set to 1. When set to 0, it has the same effect as
  2021. @command{x264}'s @option{--no-8x8dct} option.
  2022. @item fast-pskip
  2023. Enable early SKIP detection on P-frames when set to 1. When set
  2024. to 0, it has the same effect as @command{x264}'s
  2025. @option{--no-fast-pskip} option.
  2026. @item aud (@emph{aud})
  2027. Enable use of access unit delimiters when set to 1.
  2028. @item mbtree
  2029. Enable use macroblock tree ratecontrol when set to 1. When set
  2030. to 0, it has the same effect as @command{x264}'s
  2031. @option{--no-mbtree} option.
  2032. @item deblock (@emph{deblock})
  2033. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  2034. @item cplxblur (@emph{cplxblur})
  2035. Set fluctuations reduction in QP (before curve compression).
  2036. @item partitions (@emph{partitions})
  2037. Set partitions to consider as a comma-separated list of. Possible
  2038. values in the list:
  2039. @table @samp
  2040. @item p8x8
  2041. 8x8 P-frame partition.
  2042. @item p4x4
  2043. 4x4 P-frame partition.
  2044. @item b8x8
  2045. 4x4 B-frame partition.
  2046. @item i8x8
  2047. 8x8 I-frame partition.
  2048. @item i4x4
  2049. 4x4 I-frame partition.
  2050. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  2051. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  2052. option) to be enabled.)
  2053. @item none (@emph{none})
  2054. Do not consider any partitions.
  2055. @item all (@emph{all})
  2056. Consider every partition.
  2057. @end table
  2058. @item direct-pred (@emph{direct})
  2059. Set direct MV prediction mode. Possible values:
  2060. @table @samp
  2061. @item none (@emph{none})
  2062. Disable MV prediction.
  2063. @item spatial (@emph{spatial})
  2064. Enable spatial predicting.
  2065. @item temporal (@emph{temporal})
  2066. Enable temporal predicting.
  2067. @item auto (@emph{auto})
  2068. Automatically decided.
  2069. @end table
  2070. @item slice-max-size (@emph{slice-max-size})
  2071. Set the limit of the size of each slice in bytes. If not specified
  2072. but RTP payload size (@option{ps}) is specified, that is used.
  2073. @item stats (@emph{stats})
  2074. Set the file name for multi-pass stats.
  2075. @item nal-hrd (@emph{nal-hrd})
  2076. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  2077. Possible values:
  2078. @table @samp
  2079. @item none (@emph{none})
  2080. Disable HRD information signaling.
  2081. @item vbr (@emph{vbr})
  2082. Variable bit rate.
  2083. @item cbr (@emph{cbr})
  2084. Constant bit rate (not allowed in MP4 container).
  2085. @end table
  2086. @item x264opts (N.A.)
  2087. Set any x264 option, see @command{x264 --fullhelp} for a list.
  2088. Argument is a list of @var{key}=@var{value} couples separated by
  2089. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  2090. themselves, use "," instead. They accept it as well since long ago but this
  2091. is kept undocumented for some reason.
  2092. For example to specify libx264 encoding options with @command{ffmpeg}:
  2093. @example
  2094. ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  2095. @end example
  2096. @item a53cc @var{boolean}
  2097. Import closed captions (which must be ATSC compatible format) into output.
  2098. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  2099. @item udu_sei @var{boolean}
  2100. Import user data unregistered SEI if available into output. Default is 0 (off).
  2101. @item x264-params (N.A.)
  2102. Override the x264 configuration using a :-separated list of key=value
  2103. parameters.
  2104. This option is functionally the same as the @option{x264opts}, but is
  2105. duplicated for compatibility with the Libav fork.
  2106. For example to specify libx264 encoding options with @command{ffmpeg}:
  2107. @example
  2108. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  2109. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  2110. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  2111. @end example
  2112. @end table
  2113. Encoding ffpresets for common usages are provided so they can be used with the
  2114. general presets system (e.g. passing the @option{pre} option).
  2115. @section libx265
  2116. x265 H.265/HEVC encoder wrapper.
  2117. This encoder requires the presence of the libx265 headers and library
  2118. during configuration. You need to explicitly configure the build with
  2119. @option{--enable-libx265}.
  2120. @subsection Options
  2121. @table @option
  2122. @item b
  2123. Sets target video bitrate.
  2124. @item bf
  2125. @item g
  2126. Set the GOP size.
  2127. @item keyint_min
  2128. Minimum GOP size.
  2129. @item refs
  2130. Number of reference frames each P-frame can use. The range is from @var{1-16}.
  2131. @item preset
  2132. Set the x265 preset.
  2133. @item tune
  2134. Set the x265 tune parameter.
  2135. @item profile
  2136. Set profile restrictions.
  2137. @item crf
  2138. Set the quality for constant quality mode.
  2139. @item qp
  2140. Set constant quantization rate control method parameter.
  2141. @item qmin
  2142. Minimum quantizer scale.
  2143. @item qmax
  2144. Maximum quantizer scale.
  2145. @item qdiff
  2146. Maximum difference between quantizer scales.
  2147. @item qblur
  2148. Quantizer curve blur
  2149. @item qcomp
  2150. Quantizer curve compression factor
  2151. @item i_qfactor
  2152. @item b_qfactor
  2153. @item forced-idr
  2154. Normally, when forcing a I-frame type, the encoder can select any type
  2155. of I-frame. This option forces it to choose an IDR-frame.
  2156. @item udu_sei @var{boolean}
  2157. Import user data unregistered SEI if available into output. Default is 0 (off).
  2158. @item x265-params
  2159. Set x265 options using a list of @var{key}=@var{value} couples separated
  2160. by ":". See @command{x265 --help} for a list of options.
  2161. For example to specify libx265 encoding options with @option{-x265-params}:
  2162. @example
  2163. ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  2164. @end example
  2165. @end table
  2166. @section libxavs2
  2167. xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  2168. This encoder requires the presence of the libxavs2 headers and library
  2169. during configuration. You need to explicitly configure the build with
  2170. @option{--enable-libxavs2}.
  2171. The following standard libavcodec options are used:
  2172. @itemize
  2173. @item
  2174. @option{b} / @option{bit_rate}
  2175. @item
  2176. @option{g} / @option{gop_size}
  2177. @item
  2178. @option{bf} / @option{max_b_frames}
  2179. @end itemize
  2180. The encoder also has its own specific options:
  2181. @subsection Options
  2182. @table @option
  2183. @item lcu_row_threads
  2184. Set the number of parallel threads for rows from 1 to 8 (default 5).
  2185. @item initial_qp
  2186. Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  2187. used to set the initial qp for the first frame.
  2188. @item qp
  2189. Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  2190. used to set the qp value under constant-QP mode.
  2191. @item max_qp
  2192. Set the max qp for rate control from 1 to 63 (default 55).
  2193. @item min_qp
  2194. Set the min qp for rate control from 1 to 63 (default 20).
  2195. @item speed_level
  2196. Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  2197. @item log_level
  2198. Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  2199. 1: warning, 2: info, 3: debug.
  2200. @item xavs2-params
  2201. Set xavs2 options using a list of @var{key}=@var{value} couples separated
  2202. by ":".
  2203. For example to specify libxavs2 encoding options with @option{-xavs2-params}:
  2204. @example
  2205. ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  2206. @end example
  2207. @end table
  2208. @section libxvid
  2209. Xvid MPEG-4 Part 2 encoder wrapper.
  2210. This encoder requires the presence of the libxvidcore headers and library
  2211. during configuration. You need to explicitly configure the build with
  2212. @code{--enable-libxvid --enable-gpl}.
  2213. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  2214. users can encode to this format without this library.
  2215. @subsection Options
  2216. The following options are supported by the libxvid wrapper. Some of
  2217. the following options are listed but are not documented, and
  2218. correspond to shared codec options. See @ref{codec-options,,the Codec
  2219. Options chapter} for their documentation. The other shared options
  2220. which are not listed have no effect for the libxvid encoder.
  2221. @table @option
  2222. @item b
  2223. @item g
  2224. @item qmin
  2225. @item qmax
  2226. @item mpeg_quant
  2227. @item threads
  2228. @item bf
  2229. @item b_qfactor
  2230. @item b_qoffset
  2231. @item flags
  2232. Set specific encoding flags. Possible values:
  2233. @table @samp
  2234. @item mv4
  2235. Use four motion vector by macroblock.
  2236. @item aic
  2237. Enable high quality AC prediction.
  2238. @item gray
  2239. Only encode grayscale.
  2240. @item gmc
  2241. Enable the use of global motion compensation (GMC).
  2242. @item qpel
  2243. Enable quarter-pixel motion compensation.
  2244. @item cgop
  2245. Enable closed GOP.
  2246. @item global_header
  2247. Place global headers in extradata instead of every keyframe.
  2248. @end table
  2249. @item trellis
  2250. @item me_method
  2251. Set motion estimation method. Possible values in decreasing order of
  2252. speed and increasing order of quality:
  2253. @table @samp
  2254. @item zero
  2255. Use no motion estimation (default).
  2256. @item phods
  2257. @item x1
  2258. @item log
  2259. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  2260. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  2261. @samp{phods}.
  2262. @item epzs
  2263. Enable all of the things described above, plus advanced diamond zonal
  2264. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  2265. estimation on chroma planes.
  2266. @item full
  2267. Enable all of the things described above, plus extended 16x16 and 8x8
  2268. blocks search.
  2269. @end table
  2270. @item mbd
  2271. Set macroblock decision algorithm. Possible values in the increasing
  2272. order of quality:
  2273. @table @samp
  2274. @item simple
  2275. Use macroblock comparing function algorithm (default).
  2276. @item bits
  2277. Enable rate distortion-based half pixel and quarter pixel refinement for
  2278. 16x16 blocks.
  2279. @item rd
  2280. Enable all of the things described above, plus rate distortion-based
  2281. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  2282. distortion-based search using square pattern.
  2283. @end table
  2284. @item lumi_aq
  2285. Enable lumi masking adaptive quantization when set to 1. Default is 0
  2286. (disabled).
  2287. @item variance_aq
  2288. Enable variance adaptive quantization when set to 1. Default is 0
  2289. (disabled).
  2290. When combined with @option{lumi_aq}, the resulting quality will not
  2291. be better than any of the two specified individually. In other
  2292. words, the resulting quality will be the worse one of the two
  2293. effects.
  2294. @item ssim
  2295. Set structural similarity (SSIM) displaying method. Possible values:
  2296. @table @samp
  2297. @item off
  2298. Disable displaying of SSIM information.
  2299. @item avg
  2300. Output average SSIM at the end of encoding to stdout. The format of
  2301. showing the average SSIM is:
  2302. @example
  2303. Average SSIM: %f
  2304. @end example
  2305. For users who are not familiar with C, %f means a float number, or
  2306. a decimal (e.g. 0.939232).
  2307. @item frame
  2308. Output both per-frame SSIM data during encoding and average SSIM at
  2309. the end of encoding to stdout. The format of per-frame information
  2310. is:
  2311. @example
  2312. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  2313. @end example
  2314. For users who are not familiar with C, %1.3f means a float number
  2315. rounded to 3 digits after the dot (e.g. 0.932).
  2316. @end table
  2317. @item ssim_acc
  2318. Set SSIM accuracy. Valid options are integers within the range of
  2319. 0-4, while 0 gives the most accurate result and 4 computes the
  2320. fastest.
  2321. @end table
  2322. @section MediaFoundation
  2323. This provides wrappers to encoders (both audio and video) in the
  2324. MediaFoundation framework. It can access both SW and HW encoders.
  2325. Video encoders can take input in either of nv12 or yuv420p form
  2326. (some encoders support both, some support only either - in practice,
  2327. nv12 is the safer choice, especially among HW encoders).
  2328. @section mpeg2
  2329. MPEG-2 video encoder.
  2330. @subsection Options
  2331. @table @option
  2332. @item profile
  2333. Select the mpeg2 profile to encode:
  2334. @table @samp
  2335. @item 422
  2336. @item high
  2337. @item ss
  2338. Spatially Scalable
  2339. @item snr
  2340. SNR Scalable
  2341. @item main
  2342. @item simple
  2343. @end table
  2344. @item level
  2345. Select the mpeg2 level to encode:
  2346. @table @samp
  2347. @item high
  2348. @item high1440
  2349. @item main
  2350. @item low
  2351. @end table
  2352. @item seq_disp_ext @var{integer}
  2353. Specifies if the encoder should write a sequence_display_extension to the
  2354. output.
  2355. @table @option
  2356. @item -1
  2357. @itemx auto
  2358. Decide automatically to write it or not (this is the default) by checking if
  2359. the data to be written is different from the default or unspecified values.
  2360. @item 0
  2361. @itemx never
  2362. Never write it.
  2363. @item 1
  2364. @itemx always
  2365. Always write it.
  2366. @end table
  2367. @item video_format @var{integer}
  2368. Specifies the video_format written into the sequence display extension
  2369. indicating the source of the video pictures. The default is @samp{unspecified},
  2370. can be @samp{component}, @samp{pal}, @samp{ntsc}, @samp{secam} or @samp{mac}.
  2371. For maximum compatibility, use @samp{component}.
  2372. @item a53cc @var{boolean}
  2373. Import closed captions (which must be ATSC compatible format) into output.
  2374. Default is 1 (on).
  2375. @end table
  2376. @section png
  2377. PNG image encoder.
  2378. @subsection Private options
  2379. @table @option
  2380. @item dpi @var{integer}
  2381. Set physical density of pixels, in dots per inch, unset by default
  2382. @item dpm @var{integer}
  2383. Set physical density of pixels, in dots per meter, unset by default
  2384. @end table
  2385. @section ProRes
  2386. Apple ProRes encoder.
  2387. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  2388. The used encoder can be chosen with the @code{-vcodec} option.
  2389. @subsection Private Options for prores-ks
  2390. @table @option
  2391. @item profile @var{integer}
  2392. Select the ProRes profile to encode
  2393. @table @samp
  2394. @item proxy
  2395. @item lt
  2396. @item standard
  2397. @item hq
  2398. @item 4444
  2399. @item 4444xq
  2400. @end table
  2401. @item quant_mat @var{integer}
  2402. Select quantization matrix.
  2403. @table @samp
  2404. @item auto
  2405. @item default
  2406. @item proxy
  2407. @item lt
  2408. @item standard
  2409. @item hq
  2410. @end table
  2411. If set to @var{auto}, the matrix matching the profile will be picked.
  2412. If not set, the matrix providing the highest quality, @var{default}, will be
  2413. picked.
  2414. @item bits_per_mb @var{integer}
  2415. How many bits to allot for coding one macroblock. Different profiles use
  2416. between 200 and 2400 bits per macroblock, the maximum is 8000.
  2417. @item mbs_per_slice @var{integer}
  2418. Number of macroblocks in each slice (1-8); the default value (8)
  2419. should be good in almost all situations.
  2420. @item vendor @var{string}
  2421. Override the 4-byte vendor ID.
  2422. A custom vendor ID like @var{apl0} would claim the stream was produced by
  2423. the Apple encoder.
  2424. @item alpha_bits @var{integer}
  2425. Specify number of bits for alpha component.
  2426. Possible values are @var{0}, @var{8} and @var{16}.
  2427. Use @var{0} to disable alpha plane coding.
  2428. @end table
  2429. @subsection Speed considerations
  2430. In the default mode of operation the encoder has to honor frame constraints
  2431. (i.e. not produce frames with size bigger than requested) while still making
  2432. output picture as good as possible.
  2433. A frame containing a lot of small details is harder to compress and the encoder
  2434. would spend more time searching for appropriate quantizers for each slice.
  2435. Setting a higher @option{bits_per_mb} limit will improve the speed.
  2436. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  2437. recommended value) and do not set a size constraint.
  2438. @section QSV Encoders
  2439. The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG
  2440. and VP9)
  2441. @subsection Ratecontrol Method
  2442. The ratecontrol method is selected as follows:
  2443. @itemize @bullet
  2444. @item
  2445. When @option{global_quality} is specified, a quality-based mode is used.
  2446. Specifically this means either
  2447. @itemize @minus
  2448. @item
  2449. @var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
  2450. also set (the @option{-qscale} ffmpeg option).
  2451. @item
  2452. @var{LA_ICQ} - intelligent constant quality with lookahead, when the
  2453. @option{look_ahead} option is also set.
  2454. @item
  2455. @var{ICQ} -- intelligent constant quality otherwise. For the ICQ modes, global
  2456. quality range is 1 to 51, with 1 being the best quality.
  2457. @end itemize
  2458. @item
  2459. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  2460. least the desired average bitrate with the @option{b} option.
  2461. @itemize @minus
  2462. @item
  2463. @var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
  2464. @item
  2465. @var{VCM} - video conferencing mode, when the @option{vcm} option is set.
  2466. @item
  2467. @var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
  2468. the average bitrate.
  2469. @item
  2470. @var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
  2471. than the average bitrate.
  2472. @item
  2473. @var{AVBR} - average VBR mode, when @option{maxrate} is not specified, both
  2474. @option{avbr_accuracy} and @option{avbr_convergence} are set to non-zero. This
  2475. mode is available for H264 and HEVC on Windows.
  2476. @end itemize
  2477. @end itemize
  2478. Note that depending on your system, a different mode than the one you specified
  2479. may be selected by the encoder. Set the verbosity level to @var{verbose} or
  2480. higher to see the actual settings used by the QSV runtime.
  2481. @subsection Global Options -> MSDK Options
  2482. Additional libavcodec global options are mapped to MSDK options as follows:
  2483. @itemize
  2484. @item
  2485. @option{g/gop_size} -> @option{GopPicSize}
  2486. @item
  2487. @option{bf/max_b_frames}+1 -> @option{GopRefDist}
  2488. @item
  2489. @option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
  2490. @option{InitialDelayInKB}
  2491. @item
  2492. @option{slices} -> @option{NumSlice}
  2493. @item
  2494. @option{refs} -> @option{NumRefFrame}
  2495. @item
  2496. @option{b_strategy/b_frame_strategy} -> @option{BRefType}
  2497. @item
  2498. @option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
  2499. @item
  2500. For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
  2501. @option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
  2502. and @var{QPP} and @var{QPB} respectively.
  2503. @item
  2504. Setting the @option{coder} option to the value @var{vlc} will make the H.264
  2505. encoder use CAVLC instead of CABAC.
  2506. @end itemize
  2507. @subsection Common Options
  2508. Following options are used by all qsv encoders.
  2509. @table @option
  2510. @item @var{async_depth}
  2511. Specifies how many asynchronous operations an application performs
  2512. before the application explicitly synchronizes the result. If zero,
  2513. the value is not specified.
  2514. @item @var{preset}
  2515. This option itemizes a range of choices from veryfast (best speed) to veryslow
  2516. (best quality).
  2517. @table @samp
  2518. @item veryfast
  2519. @item faster
  2520. @item fast
  2521. @item medium
  2522. @item slow
  2523. @item slower
  2524. @item veryslow
  2525. @end table
  2526. @item @var{forced_idr}
  2527. Forcing I frames as IDR frames.
  2528. @item @var{low_power}
  2529. For encoders set this flag to ON to reduce power consumption and GPU usage.
  2530. @end table
  2531. @subsection Runtime Options
  2532. Following options can be used durning qsv encoding.
  2533. @table @option
  2534. @item @var{global_quality}
  2535. @item @var{i_quant_factor}
  2536. @item @var{i_quant_offset}
  2537. @item @var{b_quant_factor}
  2538. @item @var{b_quant_offset}
  2539. Supported in h264_qsv and hevc_qsv.
  2540. Change these value to reset qsv codec's qp configuration.
  2541. @item @var{max_frame_size}
  2542. Supported in h264_qsv and hevc_qsv.
  2543. Change this value to reset qsv codec's MaxFrameSize configuration.
  2544. @item @var{gop_size}
  2545. Change this value to reset qsv codec's gop configuration.
  2546. @item @var{int_ref_type}
  2547. @item @var{int_ref_cycle_size}
  2548. @item @var{int_ref_qp_delta}
  2549. @item @var{int_ref_cycle_dist}
  2550. Supported in h264_qsv and hevc_qsv.
  2551. Change these value to reset qsv codec's Intra Refresh configuration.
  2552. @item @var{qmax}
  2553. @item @var{qmin}
  2554. @item @var{max_qp_i}
  2555. @item @var{min_qp_i}
  2556. @item @var{max_qp_p}
  2557. @item @var{min_qp_p}
  2558. @item @var{max_qp_b}
  2559. @item @var{min_qp_b}
  2560. Supported in h264_qsv.
  2561. Change these value to reset qsv codec's max/min qp configuration.
  2562. @item @var{low_delay_brc}
  2563. Supported in h264_qsv and hevc_qsv.
  2564. Change this value to reset qsv codec's low_delay_brc configuration.
  2565. @item @var{framerate}
  2566. Change this value to reset qsv codec's framerate configuration.
  2567. @item @var{bit_rate}
  2568. @item @var{rc_buffer_size}
  2569. @item @var{rc_initial_buffer_occupancy}
  2570. @item @var{rc_max_rate}
  2571. Change these value to reset qsv codec's bitrate control configuration.
  2572. @item @var{pic_timing_sei}
  2573. Supported in h264_qsv and hevc_qsv.
  2574. Change this value to reset qsv codec's pic_timing_sei configuration.
  2575. @end table
  2576. @subsection H264 options
  2577. These options are used by h264_qsv
  2578. @table @option
  2579. @item @var{extbrc}
  2580. Extended bitrate control.
  2581. @item @var{recovery_point_sei}
  2582. Set this flag to insert the recovery point SEI message at the beginning of every
  2583. intra refresh cycle.
  2584. @item @var{rdo}
  2585. Enable rate distortion optimization.
  2586. @item @var{max_frame_size}
  2587. Maximum encoded frame size in bytes.
  2588. @item @var{max_frame_size_i}
  2589. Maximum encoded frame size for I frames in bytes. If this value is set as larger
  2590. than zero, then for I frames the value set by max_frame_size is ignored.
  2591. @item @var{max_frame_size_p}
  2592. Maximum encoded frame size for P frames in bytes. If this value is set as larger
  2593. than zero, then for P frames the value set by max_frame_size is ignored.
  2594. @item @var{max_slice_size}
  2595. Maximum encoded slice size in bytes.
  2596. @item @var{bitrate_limit}
  2597. Toggle bitrate limitations.
  2598. Modifies bitrate to be in the range imposed by the QSV encoder. Setting this
  2599. flag off may lead to violation of HRD conformance. Mind that specifying bitrate
  2600. below the QSV encoder range might significantly affect quality. If on this
  2601. option takes effect in non CQP modes: if bitrate is not in the range imposed
  2602. by the QSV encoder, it will be changed to be in the range.
  2603. @item @var{mbbrc}
  2604. Setting this flag enables macroblock level bitrate control that generally
  2605. improves subjective visual quality. Enabling this flag may have negative impact
  2606. on performance and objective visual quality metric.
  2607. @item @var{low_delay_brc}
  2608. Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
  2609. more accurate bitrate control to minimize the variance of bitstream size frame
  2610. by frame. Value: -1-default 0-off 1-on
  2611. @item @var{adaptive_i}
  2612. This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  2613. to allow changing of frame type from P and B to I.
  2614. @item @var{adaptive_b}
  2615. This flag controls changing of frame type from B to P.
  2616. @item @var{p_strategy}
  2617. Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
  2618. @item @var{b_strategy}
  2619. This option controls usage of B frames as reference.
  2620. @item @var{dblk_idc}
  2621. This option disable deblocking. It has value in range 0~2.
  2622. @item @var{cavlc}
  2623. If set, CAVLC is used; if unset, CABAC is used for encoding.
  2624. @item @var{vcm}
  2625. Video conferencing mode, please see ratecontrol method.
  2626. @item @var{idr_interval}
  2627. Distance (in I-frames) between IDR frames.
  2628. @item @var{pic_timing_sei}
  2629. Insert picture timing SEI with pic_struct_syntax element.
  2630. @item @var{single_sei_nal_unit}
  2631. Put all the SEI messages into one NALU.
  2632. @item @var{max_dec_frame_buffering}
  2633. Maximum number of frames buffered in the DPB.
  2634. @item @var{look_ahead}
  2635. Use VBR algorithm with look ahead.
  2636. @item @var{look_ahead_depth}
  2637. Depth of look ahead in number frames.
  2638. @item @var{look_ahead_downsampling}
  2639. Downscaling factor for the frames saved for the lookahead analysis.
  2640. @table @samp
  2641. @item unknown
  2642. @item auto
  2643. @item off
  2644. @item 2x
  2645. @item 4x
  2646. @end table
  2647. @item @var{int_ref_type}
  2648. Specifies intra refresh type. The major goal of intra refresh is improvement of
  2649. error resilience without significant impact on encoded bitstream size caused by
  2650. I frames. The SDK encoder achieves this by encoding part of each frame in
  2651. refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means
  2652. vertical refresh, by column of MBs. @var{horizontal} means horizontal refresh,
  2653. by rows of MBs. @var{slice} means horizontal refresh by slices without
  2654. overlapping. In case of @var{slice}, in_ref_cycle_size is ignored. To enable
  2655. intra refresh, B frame should be set to 0.
  2656. @item @var{int_ref_cycle_size}
  2657. Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
  2658. invalid values.
  2659. @item @var{int_ref_qp_delta}
  2660. Specifies QP difference for inserted intra MBs. This is signed value in
  2661. [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
  2662. range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
  2663. @item @var{int_ref_cycle_dist}
  2664. Distance between the beginnings of the intra-refresh cycles in frames.
  2665. @item @var{profile}
  2666. @table @samp
  2667. @item unknown
  2668. @item baseline
  2669. @item main
  2670. @item high
  2671. @end table
  2672. @item @var{a53cc}
  2673. Use A53 Closed Captions (if available).
  2674. @item @var{aud}
  2675. Insert the Access Unit Delimiter NAL.
  2676. @item @var{mfmode}
  2677. Multi-Frame Mode.
  2678. @table @samp
  2679. @item off
  2680. @item auto
  2681. @end table
  2682. @item @var{repeat_pps}
  2683. Repeat pps for every frame.
  2684. @item @var{max_qp_i}
  2685. Maximum video quantizer scale for I frame.
  2686. @item @var{min_qp_i}
  2687. Minimum video quantizer scale for I frame.
  2688. @item @var{max_qp_p}
  2689. Maximum video quantizer scale for P frame.
  2690. @item @var{min_qp_p}
  2691. Minimum video quantizer scale for P frame.
  2692. @item @var{max_qp_b}
  2693. Maximum video quantizer scale for B frame.
  2694. @item @var{min_qp_b}
  2695. Minimum video quantizer scale for B frame.
  2696. @item @var{scenario}
  2697. Provides a hint to encoder about the scenario for the encoding session.
  2698. @table @samp
  2699. @item unknown
  2700. @item displayremoting
  2701. @item videoconference
  2702. @item archive
  2703. @item livestreaming
  2704. @item cameracapture
  2705. @item videosurveillance
  2706. @item gamestreaming
  2707. @item remotegaming
  2708. @end table
  2709. @item @var{avbr_accuracy}
  2710. Accuracy of the AVBR ratecontrol (unit of tenth of percent).
  2711. @item @var{avbr_convergence}
  2712. Convergence of the AVBR ratecontrol (unit of 100 frames)
  2713. The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the
  2714. average variable bitrate control (AVBR) algorithm.
  2715. The algorithm focuses on overall encoding quality while meeting the specified
  2716. bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy},
  2717. after a @var{avbr_Convergence} period. This method does not follow HRD and the
  2718. instant bitrate is not capped or padded.
  2719. @item @var{skip_frame}
  2720. Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option
  2721. defines the usage of this metadata.
  2722. @table @samp
  2723. @item no_skip
  2724. Frame skipping is disabled.
  2725. @item insert_dummy
  2726. Encoder inserts into bitstream frame where all macroblocks are encoded as
  2727. skipped.
  2728. @item insert_nothing
  2729. Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
  2730. frames are still used in brc. For example, gop still include skipped frames, and
  2731. the frames after skipped frames will be larger in size.
  2732. @item brc_only
  2733. skip_frame metadata indicates the number of missed frames before the current
  2734. frame.
  2735. @end table
  2736. @end table
  2737. @subsection HEVC Options
  2738. These options are used by hevc_qsv
  2739. @table @option
  2740. @item @var{extbrc}
  2741. Extended bitrate control.
  2742. @item @var{recovery_point_sei}
  2743. Set this flag to insert the recovery point SEI message at the beginning of every
  2744. intra refresh cycle.
  2745. @item @var{rdo}
  2746. Enable rate distortion optimization.
  2747. @item @var{max_frame_size}
  2748. Maximum encoded frame size in bytes.
  2749. @item @var{max_frame_size_i}
  2750. Maximum encoded frame size for I frames in bytes. If this value is set as larger
  2751. than zero, then for I frames the value set by max_frame_size is ignored.
  2752. @item @var{max_frame_size_p}
  2753. Maximum encoded frame size for P frames in bytes. If this value is set as larger
  2754. than zero, then for P frames the value set by max_frame_size is ignored.
  2755. @item @var{max_slice_size}
  2756. Maximum encoded slice size in bytes.
  2757. @item @var{mbbrc}
  2758. Setting this flag enables macroblock level bitrate control that generally
  2759. improves subjective visual quality. Enabling this flag may have negative impact
  2760. on performance and objective visual quality metric.
  2761. @item @var{low_delay_brc}
  2762. Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
  2763. more accurate bitrate control to minimize the variance of bitstream size frame
  2764. by frame. Value: -1-default 0-off 1-on
  2765. @item @var{adaptive_i}
  2766. This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  2767. to allow changing of frame type from P and B to I.
  2768. @item @var{adaptive_b}
  2769. This flag controls changing of frame type from B to P.
  2770. @item @var{p_strategy}
  2771. Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
  2772. @item @var{b_strategy}
  2773. This option controls usage of B frames as reference.
  2774. @item @var{dblk_idc}
  2775. This option disable deblocking. It has value in range 0~2.
  2776. @item @var{idr_interval}
  2777. Distance (in I-frames) between IDR frames.
  2778. @table @samp
  2779. @item begin_only
  2780. Output an IDR-frame only at the beginning of the stream.
  2781. @end table
  2782. @item @var{load_plugin}
  2783. A user plugin to load in an internal session.
  2784. @table @samp
  2785. @item none
  2786. @item hevc_sw
  2787. @item hevc_hw
  2788. @end table
  2789. @item @var{load_plugins}
  2790. A :-separate list of hexadecimal plugin UIDs to load in
  2791. an internal session.
  2792. @item @var{look_ahead_depth}
  2793. Depth of look ahead in number frames, available when extbrc option is enabled.
  2794. @item @var{profile}
  2795. Set the encoding profile (scc requires libmfx >= 1.32).
  2796. @table @samp
  2797. @item unknown
  2798. @item main
  2799. @item main10
  2800. @item mainsp
  2801. @item rext
  2802. @item scc
  2803. @end table
  2804. @item @var{tier}
  2805. Set the encoding tier (only level >= 4 can support high tier).
  2806. This option only takes effect when the level option is specified.
  2807. @table @samp
  2808. @item main
  2809. @item high
  2810. @end table
  2811. @item @var{gpb}
  2812. 1: GPB (generalized P/B frame)
  2813. 0: regular P frame.
  2814. @item @var{tile_cols}
  2815. Number of columns for tiled encoding.
  2816. @item @var{tile_rows}
  2817. Number of rows for tiled encoding.
  2818. @item @var{aud}
  2819. Insert the Access Unit Delimiter NAL.
  2820. @item @var{pic_timing_sei}
  2821. Insert picture timing SEI with pic_struct_syntax element.
  2822. @item @var{transform_skip}
  2823. Turn this option ON to enable transformskip. It is supported on platform equal
  2824. or newer than ICL.
  2825. @item @var{int_ref_type}
  2826. Specifies intra refresh type. The major goal of intra refresh is improvement of
  2827. error resilience without significant impact on encoded bitstream size caused by
  2828. I frames. The SDK encoder achieves this by encoding part of each frame in
  2829. refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means
  2830. vertical refresh, by column of MBs. @var{horizontal} means horizontal refresh,
  2831. by rows of MBs. @var{slice} means horizontal refresh by slices without
  2832. overlapping. In case of @var{slice}, in_ref_cycle_size is ignored. To enable
  2833. intra refresh, B frame should be set to 0.
  2834. @item @var{int_ref_cycle_size}
  2835. Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
  2836. invalid values.
  2837. @item @var{int_ref_qp_delta}
  2838. Specifies QP difference for inserted intra MBs. This is signed value in
  2839. [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
  2840. range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
  2841. @item @var{int_ref_cycle_dist}
  2842. Distance between the beginnings of the intra-refresh cycles in frames.
  2843. @item @var{max_qp_i}
  2844. Maximum video quantizer scale for I frame.
  2845. @item @var{min_qp_i}
  2846. Minimum video quantizer scale for I frame.
  2847. @item @var{max_qp_p}
  2848. Maximum video quantizer scale for P frame.
  2849. @item @var{min_qp_p}
  2850. Minimum video quantizer scale for P frame.
  2851. @item @var{max_qp_b}
  2852. Maximum video quantizer scale for B frame.
  2853. @item @var{min_qp_b}
  2854. Minimum video quantizer scale for B frame.
  2855. @item @var{scenario}
  2856. Provides a hint to encoder about the scenario for the encoding session.
  2857. @table @samp
  2858. @item unknown
  2859. @item displayremoting
  2860. @item videoconference
  2861. @item archive
  2862. @item livestreaming
  2863. @item cameracapture
  2864. @item videosurveillance
  2865. @item gamestreaming
  2866. @item remotegaming
  2867. @end table
  2868. @item @var{avbr_accuracy}
  2869. Accuracy of the AVBR ratecontrol (unit of tenth of percent).
  2870. @item @var{avbr_convergence}
  2871. Convergence of the AVBR ratecontrol (unit of 100 frames)
  2872. The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the
  2873. average variable bitrate control (AVBR) algorithm.
  2874. The algorithm focuses on overall encoding quality while meeting the specified
  2875. bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy},
  2876. after a @var{avbr_Convergence} period. This method does not follow HRD and the
  2877. instant bitrate is not capped or padded.
  2878. @item @var{skip_frame}
  2879. Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option
  2880. defines the usage of this metadata.
  2881. @table @samp
  2882. @item no_skip
  2883. Frame skipping is disabled.
  2884. @item insert_dummy
  2885. Encoder inserts into bitstream frame where all macroblocks are encoded as
  2886. skipped.
  2887. @item insert_nothing
  2888. Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
  2889. frames are still used in brc. For example, gop still include skipped frames, and
  2890. the frames after skipped frames will be larger in size.
  2891. @item brc_only
  2892. skip_frame metadata indicates the number of missed frames before the current
  2893. frame.
  2894. @end table
  2895. @end table
  2896. @subsection MPEG2 Options
  2897. These options are used by mpeg2_qsv
  2898. @table @option
  2899. @item @var{profile}
  2900. @table @samp
  2901. @item unknown
  2902. @item simple
  2903. @item main
  2904. @item high
  2905. @end table
  2906. @end table
  2907. @subsection VP9 Options
  2908. These options are used by vp9_qsv
  2909. @table @option
  2910. @item @var{profile}
  2911. @table @samp
  2912. @item unknown
  2913. @item profile0
  2914. @item profile1
  2915. @item profile2
  2916. @item profile3
  2917. @end table
  2918. @item @var{tile_cols}
  2919. Number of columns for tiled encoding (requires libmfx >= 1.29).
  2920. @item @var{tile_rows}
  2921. Number of rows for tiled encoding (requires libmfx >= 1.29).
  2922. @end table
  2923. @subsection AV1 Options
  2924. These options are used by av1_qsv (requires libvpl).
  2925. @table @option
  2926. @item @var{profile}
  2927. @table @samp
  2928. @item unknown
  2929. @item main
  2930. @end table
  2931. @item @var{tile_cols}
  2932. Number of columns for tiled encoding.
  2933. @item @var{tile_rows}
  2934. Number of rows for tiled encoding.
  2935. @item @var{adaptive_i}
  2936. This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  2937. to allow changing of frame type from P and B to I.
  2938. @item @var{adaptive_b}
  2939. This flag controls changing of frame type from B to P.
  2940. @item @var{b_strategy}
  2941. This option controls usage of B frames as reference.
  2942. @item @var{extbrc}
  2943. Extended bitrate control.
  2944. @item @var{look_ahead_depth}
  2945. Depth of look ahead in number frames, available when extbrc option is enabled.
  2946. @item @var{low_delay_brc}
  2947. Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
  2948. more accurate bitrate control to minimize the variance of bitstream size frame
  2949. by frame. Value: -1-default 0-off 1-on
  2950. @item max_frame_size
  2951. Set the allowed max size in bytes for each frame. If the frame size exceeds
  2952. the limitation, encoder will adjust the QP value to control the frame size.
  2953. Invalid in CQP rate control mode.
  2954. @end table
  2955. @section snow
  2956. @subsection Options
  2957. @table @option
  2958. @item iterative_dia_size
  2959. dia size for the iterative motion estimation
  2960. @end table
  2961. @section VAAPI encoders
  2962. Wrappers for hardware encoders accessible via VAAPI.
  2963. These encoders only accept input in VAAPI hardware surfaces. If you have input
  2964. in software frames, use the @option{hwupload} filter to upload them to the GPU.
  2965. The following standard libavcodec options are used:
  2966. @itemize
  2967. @item
  2968. @option{g} / @option{gop_size}
  2969. @item
  2970. @option{bf} / @option{max_b_frames}
  2971. @item
  2972. @option{profile}
  2973. If not set, this will be determined automatically from the format of the input
  2974. frames and the profiles supported by the driver.
  2975. @item
  2976. @option{level}
  2977. @item
  2978. @option{b} / @option{bit_rate}
  2979. @item
  2980. @option{maxrate} / @option{rc_max_rate}
  2981. @item
  2982. @option{bufsize} / @option{rc_buffer_size}
  2983. @item
  2984. @option{rc_init_occupancy} / @option{rc_initial_buffer_occupancy}
  2985. @item
  2986. @option{compression_level}
  2987. Speed / quality tradeoff: higher values are faster / worse quality.
  2988. @item
  2989. @option{q} / @option{global_quality}
  2990. Size / quality tradeoff: higher values are smaller / worse quality.
  2991. @item
  2992. @option{qmin}
  2993. @item
  2994. @option{qmax}
  2995. @item
  2996. @option{i_qfactor} / @option{i_quant_factor}
  2997. @item
  2998. @option{i_qoffset} / @option{i_quant_offset}
  2999. @item
  3000. @option{b_qfactor} / @option{b_quant_factor}
  3001. @item
  3002. @option{b_qoffset} / @option{b_quant_offset}
  3003. @item
  3004. @option{slices}
  3005. @end itemize
  3006. All encoders support the following options:
  3007. @table @option
  3008. @item low_power
  3009. Some drivers/platforms offer a second encoder for some codecs intended to use
  3010. less power than the default encoder; setting this option will attempt to use
  3011. that encoder. Note that it may support a reduced feature set, so some other
  3012. options may not be available in this mode.
  3013. @item idr_interval
  3014. Set the number of normal intra frames between full-refresh (IDR) frames in
  3015. open-GOP mode. The intra frames are still IRAPs, but will not include global
  3016. headers and may have non-decodable leading pictures.
  3017. @item b_depth
  3018. Set the B-frame reference depth. When set to one (the default), all B-frames
  3019. will refer only to P- or I-frames. When set to greater values multiple layers
  3020. of B-frames will be present, frames in each layer only referring to frames in
  3021. higher layers.
  3022. @item async_depth
  3023. Maximum processing parallelism. Increase this to improve single channel
  3024. performance. This option doesn't work if driver doesn't implement vaSyncBuffer
  3025. function. Please make sure there are enough hw_frames allocated if a large
  3026. number of async_depth is used.
  3027. @item max_frame_size
  3028. Set the allowed max size in bytes for each frame. If the frame size exceeds
  3029. the limitation, encoder will adjust the QP value to control the frame size.
  3030. Invalid in CQP rate control mode.
  3031. @item rc_mode
  3032. Set the rate control mode to use. A given driver may only support a subset of
  3033. modes.
  3034. Possible modes:
  3035. @table @option
  3036. @item auto
  3037. Choose the mode automatically based on driver support and the other options.
  3038. This is the default.
  3039. @item CQP
  3040. Constant-quality.
  3041. @item CBR
  3042. Constant-bitrate.
  3043. @item VBR
  3044. Variable-bitrate.
  3045. @item ICQ
  3046. Intelligent constant-quality.
  3047. @item QVBR
  3048. Quality-defined variable-bitrate.
  3049. @item AVBR
  3050. Average variable bitrate.
  3051. @end table
  3052. @end table
  3053. Each encoder also has its own specific options:
  3054. @table @option
  3055. @item h264_vaapi
  3056. @option{profile} sets the value of @emph{profile_idc} and the @emph{constraint_set*_flag}s.
  3057. @option{level} sets the value of @emph{level_idc}.
  3058. @table @option
  3059. @item coder
  3060. Set entropy encoder (default is @emph{cabac}). Possible values:
  3061. @table @samp
  3062. @item ac
  3063. @item cabac
  3064. Use CABAC.
  3065. @item vlc
  3066. @item cavlc
  3067. Use CAVLC.
  3068. @end table
  3069. @item aud
  3070. Include access unit delimiters in the stream (not included by default).
  3071. @item sei
  3072. Set SEI message types to include.
  3073. Some combination of the following values:
  3074. @table @samp
  3075. @item identifier
  3076. Include a @emph{user_data_unregistered} message containing information about
  3077. the encoder.
  3078. @item timing
  3079. Include picture timing parameters (@emph{buffering_period} and
  3080. @emph{pic_timing} messages).
  3081. @item recovery_point
  3082. Include recovery points where appropriate (@emph{recovery_point} messages).
  3083. @end table
  3084. @end table
  3085. @item hevc_vaapi
  3086. @option{profile} and @option{level} set the values of
  3087. @emph{general_profile_idc} and @emph{general_level_idc} respectively.
  3088. @table @option
  3089. @item aud
  3090. Include access unit delimiters in the stream (not included by default).
  3091. @item tier
  3092. Set @emph{general_tier_flag}. This may affect the level chosen for the stream
  3093. if it is not explicitly specified.
  3094. @item sei
  3095. Set SEI message types to include.
  3096. Some combination of the following values:
  3097. @table @samp
  3098. @item hdr
  3099. Include HDR metadata if the input frames have it
  3100. (@emph{mastering_display_colour_volume} and @emph{content_light_level}
  3101. messages).
  3102. @end table
  3103. @item tiles
  3104. Set the number of tiles to encode the input video with, as columns x rows.
  3105. Larger numbers allow greater parallelism in both encoding and decoding, but
  3106. may decrease coding efficiency.
  3107. @end table
  3108. @item mjpeg_vaapi
  3109. Only baseline DCT encoding is supported. The encoder always uses the standard
  3110. quantisation and huffman tables - @option{global_quality} scales the standard
  3111. quantisation table (range 1-100).
  3112. For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  3113. supported, and will create an RGB JPEG.
  3114. @table @option
  3115. @item jfif
  3116. Include JFIF header in each frame (not included by default).
  3117. @item huffman
  3118. Include standard huffman tables (on by default). Turning this off will save
  3119. a few hundred bytes in each output frame, but may lose compatibility with some
  3120. JPEG decoders which don't fully handle MJPEG.
  3121. @end table
  3122. @item mpeg2_vaapi
  3123. @option{profile} and @option{level} set the value of @emph{profile_and_level_indication}.
  3124. @item vp8_vaapi
  3125. B-frames are not supported.
  3126. @option{global_quality} sets the @emph{q_idx} used for non-key frames (range 0-127).
  3127. @table @option
  3128. @item loop_filter_level
  3129. @item loop_filter_sharpness
  3130. Manually set the loop filter parameters.
  3131. @end table
  3132. @item vp9_vaapi
  3133. @option{global_quality} sets the @emph{q_idx} used for P-frames (range 0-255).
  3134. @table @option
  3135. @item loop_filter_level
  3136. @item loop_filter_sharpness
  3137. Manually set the loop filter parameters.
  3138. @end table
  3139. B-frames are supported, but the output stream is always in encode order rather than display
  3140. order. If B-frames are enabled, it may be necessary to use the @option{vp9_raw_reorder}
  3141. bitstream filter to modify the output stream to display frames in the correct order.
  3142. Only normal frames are produced - the @option{vp9_superframe} bitstream filter may be
  3143. required to produce a stream usable with all decoders.
  3144. @end table
  3145. @section vbn
  3146. Vizrt Binary Image encoder.
  3147. This format is used by the broadcast vendor Vizrt for quick texture streaming.
  3148. Advanced features of the format such as LZW compression of texture data or
  3149. generation of mipmaps are not supported.
  3150. @subsection Options
  3151. @table @option
  3152. @item format @var{string}
  3153. Sets the texture compression used by the VBN file. Can be @var{dxt1},
  3154. @var{dxt5} or @var{raw}. Default is @var{dxt5}.
  3155. @end table
  3156. @section vc2
  3157. SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  3158. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  3159. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  3160. other tasks which require low overhead and low compression (like screen
  3161. recording).
  3162. @subsection Options
  3163. @table @option
  3164. @item b
  3165. Sets target video bitrate. Usually that's around 1:6 of the uncompressed
  3166. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
  3167. values (close to the uncompressed bitrate) turn on lossless compression mode.
  3168. @item field_order
  3169. Enables field coding when set (e.g. to tt - top field first) for interlaced
  3170. inputs. Should increase compression with interlaced content as it splits the
  3171. fields and encodes each separately.
  3172. @item wavelet_depth
  3173. Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  3174. Lower values reduce compression and quality. Less capable decoders may not be
  3175. able to handle values of @option{wavelet_depth} over 3.
  3176. @item wavelet_type
  3177. Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
  3178. (Deslauriers-Dubuc)
  3179. are implemented, with 9_7 being the one with better compression and thus
  3180. is the default.
  3181. @item slice_width
  3182. @item slice_height
  3183. Sets the slice size for each slice. Larger values result in better compression.
  3184. For compatibility with other more limited decoders use @option{slice_width} of
  3185. 32 and @option{slice_height} of 8.
  3186. @item tolerance
  3187. Sets the undershoot tolerance of the rate control system in percent. This is
  3188. to prevent an expensive search from being run.
  3189. @item qm
  3190. Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
  3191. is set to 5
  3192. @itemize @minus
  3193. @item
  3194. @var{default}
  3195. Uses the default quantization matrix from the specifications, extended with
  3196. values for the fifth level. This provides a good balance between keeping detail
  3197. and omitting artifacts.
  3198. @item
  3199. @var{flat}
  3200. Use a completely zeroed out quantization matrix. This increases PSNR but might
  3201. reduce perception. Use in bogus benchmarks.
  3202. @item
  3203. @var{color}
  3204. Reduces detail but attempts to preserve color at extremely low bitrates.
  3205. @end itemize
  3206. @end table
  3207. @c man end VIDEO ENCODERS
  3208. @chapter Subtitles Encoders
  3209. @c man begin SUBTITLES ENCODERS
  3210. @section dvdsub
  3211. This codec encodes the bitmap subtitle format that is used in DVDs.
  3212. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  3213. and they can also be used in Matroska files.
  3214. @subsection Options
  3215. @table @option
  3216. @item palette
  3217. Specify the global palette used by the bitmaps.
  3218. The format for this option is a string containing 16 24-bits hexadecimal
  3219. numbers (without 0x prefix) separated by commas, for example @code{0d00ee,
  3220. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  3221. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
  3222. @item even_rows_fix
  3223. When set to 1, enable a work-around that makes the number of pixel rows
  3224. even in all subtitles. This fixes a problem with some players that
  3225. cut off the bottom row if the number is odd. The work-around just adds
  3226. a fully transparent row if needed. The overhead is low, typically
  3227. one byte per subtitle on average.
  3228. By default, this work-around is disabled.
  3229. @end table
  3230. @c man end SUBTITLES ENCODERS