encoders.texi 128 KB

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