encoders.texi 80 KB

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