encoders.texi 73 KB

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