encoders.texi 92 KB

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