encoders.texi 71 KB

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