encoders.texi 129 KB

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