encoders.texi 114 KB

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