encoders.texi 121 KB

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