encoders.texi 119 KB

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