encoders.texi 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176
  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 an experimental FFmpeg-native AAC encoder. Currently only the
  24. low complexity (AAC-LC) profile is supported. To use this encoder, you must set
  25. @option{strict} option to @samp{experimental} or lower.
  26. As this encoder is experimental, unexpected behavior may exist from time to
  27. time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
  28. that it has a worse quality reported by some users.
  29. @c todo @ref{libaacplus}
  30. See also @ref{libfdk-aac-enc,,libfdk_aac} and @ref{libfaac}.
  31. @subsection Options
  32. @table @option
  33. @item b
  34. Set bit rate in bits/s. Setting this automatically activates constant bit rate
  35. (CBR) mode.
  36. @item q
  37. Set quality for variable bit rate (VBR) mode. This option is valid only using
  38. the @command{ffmpeg} command-line tool. For library interface users, use
  39. @option{global_quality}.
  40. @item stereo_mode
  41. Set stereo encoding mode. Possible values:
  42. @table @samp
  43. @item auto
  44. Automatically selected by the encoder.
  45. @item ms_off
  46. Disable middle/side encoding. This is the default.
  47. @item ms_force
  48. Force middle/side encoding.
  49. @end table
  50. @item aac_coder
  51. Set AAC encoder coding method. Possible values:
  52. @table @samp
  53. @item faac
  54. FAAC-inspired method.
  55. This method is a simplified reimplementation of the method used in FAAC, which
  56. sets thresholds proportional to the band energies, and then decreases all the
  57. thresholds with quantizer steps to find the appropriate quantization with
  58. distortion below threshold band by band.
  59. The quality of this method is comparable to the two loop searching method
  60. described below, but somewhat a little better and slower.
  61. @item anmr
  62. Average noise to mask ratio (ANMR) trellis-based solution.
  63. This has a theoretic best quality out of all the coding methods, but at the
  64. cost of the slowest speed.
  65. @item twoloop
  66. Two loop searching (TLS) method.
  67. This method first sets quantizers depending on band thresholds and then tries
  68. to find an optimal combination by adding or subtracting a specific value from
  69. all quantizers and adjusting some individual quantizer a little.
  70. This method produces similar quality with the FAAC method and is the default.
  71. @item fast
  72. Constant quantizer method.
  73. This method sets a constant quantizer for all bands. This is the fastest of all
  74. the methods, yet produces the worst quality.
  75. @end table
  76. @end table
  77. @section ac3 and ac3_fixed
  78. AC-3 audio encoders.
  79. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  80. the undocumented RealAudio 3 (a.k.a. dnet).
  81. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  82. encoder only uses fixed-point integer math. This does not mean that one is
  83. always faster, just that one or the other may be better suited to a
  84. particular system. The floating-point encoder will generally produce better
  85. quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
  86. default codec for any of the output formats, so it must be specified explicitly
  87. using the option @code{-acodec ac3_fixed} in order to use it.
  88. @subsection AC-3 Metadata
  89. The AC-3 metadata options are used to set parameters that describe the audio,
  90. but in most cases do not affect the audio encoding itself. Some of the options
  91. do directly affect or influence the decoding and playback of the resulting
  92. bitstream, while others are just for informational purposes. A few of the
  93. options will add bits to the output stream that could otherwise be used for
  94. audio data, and will thus affect the quality of the output. Those will be
  95. indicated accordingly with a note in the option list below.
  96. These parameters are described in detail in several publicly-available
  97. documents.
  98. @itemize
  99. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  100. @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}
  101. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  102. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  103. @end itemize
  104. @subsubsection Metadata Control Options
  105. @table @option
  106. @item -per_frame_metadata @var{boolean}
  107. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  108. metadata for each frame.
  109. @table @option
  110. @item 0
  111. The metadata values set at initialization will be used for every frame in the
  112. stream. (default)
  113. @item 1
  114. Metadata values can be changed before encoding each frame.
  115. @end table
  116. @end table
  117. @subsubsection Downmix Levels
  118. @table @option
  119. @item -center_mixlev @var{level}
  120. Center Mix Level. The amount of gain the decoder should apply to the center
  121. channel when downmixing to stereo. This field will only be written to the
  122. bitstream if a center channel is present. The value is specified as a scale
  123. factor. There are 3 valid values:
  124. @table @option
  125. @item 0.707
  126. Apply -3dB gain
  127. @item 0.595
  128. Apply -4.5dB gain (default)
  129. @item 0.500
  130. Apply -6dB gain
  131. @end table
  132. @item -surround_mixlev @var{level}
  133. Surround Mix Level. The amount of gain the decoder should apply to the surround
  134. channel(s) when downmixing to stereo. This field will only be written to the
  135. bitstream if one or more surround channels are present. The value is specified
  136. as a scale factor. There are 3 valid values:
  137. @table @option
  138. @item 0.707
  139. Apply -3dB gain
  140. @item 0.500
  141. Apply -6dB gain (default)
  142. @item 0.000
  143. Silence Surround Channel(s)
  144. @end table
  145. @end table
  146. @subsubsection Audio Production Information
  147. Audio Production Information is optional information describing the mixing
  148. environment. Either none or both of the fields are written to the bitstream.
  149. @table @option
  150. @item -mixing_level @var{number}
  151. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  152. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  153. unknown or not indicated. The default value is -1, but that value cannot be
  154. used if the Audio Production Information is written to the bitstream. Therefore,
  155. if the @code{room_type} option is not the default value, the @code{mixing_level}
  156. option must not be -1.
  157. @item -room_type @var{type}
  158. Room Type. Describes the equalization used during the final mixing session at
  159. the studio or on the dubbing stage. A large room is a dubbing stage with the
  160. industry standard X-curve equalization; a small room has flat equalization.
  161. This field will not be written to the bitstream if both the @code{mixing_level}
  162. option and the @code{room_type} option have the default values.
  163. @table @option
  164. @item 0
  165. @itemx notindicated
  166. Not Indicated (default)
  167. @item 1
  168. @itemx large
  169. Large Room
  170. @item 2
  171. @itemx small
  172. Small Room
  173. @end table
  174. @end table
  175. @subsubsection Other Metadata Options
  176. @table @option
  177. @item -copyright @var{boolean}
  178. Copyright Indicator. Specifies whether a copyright exists for this audio.
  179. @table @option
  180. @item 0
  181. @itemx off
  182. No Copyright Exists (default)
  183. @item 1
  184. @itemx on
  185. Copyright Exists
  186. @end table
  187. @item -dialnorm @var{value}
  188. Dialogue Normalization. Indicates how far the average dialogue level of the
  189. program is below digital 100% full scale (0 dBFS). This parameter determines a
  190. level shift during audio reproduction that sets the average volume of the
  191. dialogue to a preset level. The goal is to match volume level between program
  192. sources. A value of -31dB will result in no volume level change, relative to
  193. the source volume, during audio reproduction. Valid values are whole numbers in
  194. the range -31 to -1, with -31 being the default.
  195. @item -dsur_mode @var{mode}
  196. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  197. (Pro Logic). This field will only be written to the bitstream if the audio
  198. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  199. apply Dolby Surround processing.
  200. @table @option
  201. @item 0
  202. @itemx notindicated
  203. Not Indicated (default)
  204. @item 1
  205. @itemx off
  206. Not Dolby Surround Encoded
  207. @item 2
  208. @itemx on
  209. Dolby Surround Encoded
  210. @end table
  211. @item -original @var{boolean}
  212. Original Bit Stream Indicator. Specifies whether this audio is from the
  213. original source and not a copy.
  214. @table @option
  215. @item 0
  216. @itemx off
  217. Not Original Source
  218. @item 1
  219. @itemx on
  220. Original Source (default)
  221. @end table
  222. @end table
  223. @subsection Extended Bitstream Information
  224. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  225. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  226. If any one parameter in a group is specified, all values in that group will be
  227. written to the bitstream. Default values are used for those that are written
  228. but have not been specified. If the mixing levels are written, the decoder
  229. will use these values instead of the ones specified in the @code{center_mixlev}
  230. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  231. Syntax.
  232. @subsubsection Extended Bitstream Information - Part 1
  233. @table @option
  234. @item -dmix_mode @var{mode}
  235. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  236. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  237. @table @option
  238. @item 0
  239. @itemx notindicated
  240. Not Indicated (default)
  241. @item 1
  242. @itemx ltrt
  243. Lt/Rt Downmix Preferred
  244. @item 2
  245. @itemx loro
  246. Lo/Ro Downmix Preferred
  247. @end table
  248. @item -ltrt_cmixlev @var{level}
  249. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  250. center channel when downmixing to stereo in Lt/Rt mode.
  251. @table @option
  252. @item 1.414
  253. Apply +3dB gain
  254. @item 1.189
  255. Apply +1.5dB gain
  256. @item 1.000
  257. Apply 0dB gain
  258. @item 0.841
  259. Apply -1.5dB gain
  260. @item 0.707
  261. Apply -3.0dB gain
  262. @item 0.595
  263. Apply -4.5dB gain (default)
  264. @item 0.500
  265. Apply -6.0dB gain
  266. @item 0.000
  267. Silence Center Channel
  268. @end table
  269. @item -ltrt_surmixlev @var{level}
  270. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  271. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  272. @table @option
  273. @item 0.841
  274. Apply -1.5dB gain
  275. @item 0.707
  276. Apply -3.0dB gain
  277. @item 0.595
  278. Apply -4.5dB gain
  279. @item 0.500
  280. Apply -6.0dB gain (default)
  281. @item 0.000
  282. Silence Surround Channel(s)
  283. @end table
  284. @item -loro_cmixlev @var{level}
  285. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  286. center channel when downmixing to stereo in Lo/Ro mode.
  287. @table @option
  288. @item 1.414
  289. Apply +3dB gain
  290. @item 1.189
  291. Apply +1.5dB gain
  292. @item 1.000
  293. Apply 0dB gain
  294. @item 0.841
  295. Apply -1.5dB gain
  296. @item 0.707
  297. Apply -3.0dB gain
  298. @item 0.595
  299. Apply -4.5dB gain (default)
  300. @item 0.500
  301. Apply -6.0dB gain
  302. @item 0.000
  303. Silence Center Channel
  304. @end table
  305. @item -loro_surmixlev @var{level}
  306. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  307. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  308. @table @option
  309. @item 0.841
  310. Apply -1.5dB gain
  311. @item 0.707
  312. Apply -3.0dB gain
  313. @item 0.595
  314. Apply -4.5dB gain
  315. @item 0.500
  316. Apply -6.0dB gain (default)
  317. @item 0.000
  318. Silence Surround Channel(s)
  319. @end table
  320. @end table
  321. @subsubsection Extended Bitstream Information - Part 2
  322. @table @option
  323. @item -dsurex_mode @var{mode}
  324. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  325. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  326. apply Dolby Surround EX processing.
  327. @table @option
  328. @item 0
  329. @itemx notindicated
  330. Not Indicated (default)
  331. @item 1
  332. @itemx on
  333. Dolby Surround EX Off
  334. @item 2
  335. @itemx off
  336. Dolby Surround EX On
  337. @end table
  338. @item -dheadphone_mode @var{mode}
  339. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  340. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  341. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  342. processing.
  343. @table @option
  344. @item 0
  345. @itemx notindicated
  346. Not Indicated (default)
  347. @item 1
  348. @itemx on
  349. Dolby Headphone Off
  350. @item 2
  351. @itemx off
  352. Dolby Headphone On
  353. @end table
  354. @item -ad_conv_type @var{type}
  355. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  356. conversion.
  357. @table @option
  358. @item 0
  359. @itemx standard
  360. Standard A/D Converter (default)
  361. @item 1
  362. @itemx hdcd
  363. HDCD A/D Converter
  364. @end table
  365. @end table
  366. @subsection Other AC-3 Encoding Options
  367. @table @option
  368. @item -stereo_rematrixing @var{boolean}
  369. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  370. is an optional AC-3 feature that increases quality by selectively encoding
  371. the left/right channels as mid/side. This option is enabled by default, and it
  372. is highly recommended that it be left as enabled except for testing purposes.
  373. @end table
  374. @subsection Floating-Point-Only AC-3 Encoding Options
  375. These options are only valid for the floating-point encoder and do not exist
  376. for the fixed-point encoder due to the corresponding features not being
  377. implemented in fixed-point.
  378. @table @option
  379. @item -channel_coupling @var{boolean}
  380. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  381. that increases quality by combining high frequency information from multiple
  382. channels into a single channel. The per-channel high frequency information is
  383. sent with less accuracy in both the frequency and time domains. This allows
  384. more bits to be used for lower frequencies while preserving enough information
  385. to reconstruct the high frequencies. This option is enabled by default for the
  386. floating-point encoder and should generally be left as enabled except for
  387. testing purposes or to increase encoding speed.
  388. @table @option
  389. @item -1
  390. @itemx auto
  391. Selected by Encoder (default)
  392. @item 0
  393. @itemx off
  394. Disable Channel Coupling
  395. @item 1
  396. @itemx on
  397. Enable Channel Coupling
  398. @end table
  399. @item -cpl_start_band @var{number}
  400. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  401. value higher than the bandwidth is used, it will be reduced to 1 less than the
  402. coupling end band. If @var{auto} is used, the start band will be determined by
  403. the encoder based on the bit rate, sample rate, and channel layout. This option
  404. has no effect if channel coupling is disabled.
  405. @table @option
  406. @item -1
  407. @itemx auto
  408. Selected by Encoder (default)
  409. @end table
  410. @end table
  411. @anchor{libfaac}
  412. @section libfaac
  413. libfaac AAC (Advanced Audio Coding) encoder wrapper.
  414. Requires the presence of the libfaac headers and library during
  415. configuration. You need to explicitly configure the build with
  416. @code{--enable-libfaac --enable-nonfree}.
  417. This encoder is considered to be of higher quality with respect to the
  418. @ref{aacenc,,the native experimental FFmpeg AAC encoder}.
  419. For more information see the libfaac project at
  420. @url{http://www.audiocoding.com/faac.html/}.
  421. @subsection Options
  422. The following shared FFmpeg codec options are recognized.
  423. The following options are supported by the libfaac wrapper. The
  424. @command{faac}-equivalent of the options are listed in parentheses.
  425. @table @option
  426. @item b (@emph{-b})
  427. Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
  428. is not explicitly specified, it is automatically set to a suitable
  429. value depending on the selected profile. @command{faac} bitrate is
  430. expressed in kilobits/s.
  431. Note that libfaac does not support CBR (Constant Bit Rate) but only
  432. ABR (Average Bit Rate).
  433. If VBR mode is enabled this option is ignored.
  434. @item ar (@emph{-R})
  435. Set audio sampling rate (in Hz).
  436. @item ac (@emph{-c})
  437. Set the number of audio channels.
  438. @item cutoff (@emph{-C})
  439. Set cutoff frequency. If not specified (or explicitly set to 0) it
  440. will use a value automatically computed by the library. Default value
  441. is 0.
  442. @item profile
  443. Set audio profile.
  444. The following profiles are recognized:
  445. @table @samp
  446. @item aac_main
  447. Main AAC (Main)
  448. @item aac_low
  449. Low Complexity AAC (LC)
  450. @item aac_ssr
  451. Scalable Sample Rate (SSR)
  452. @item aac_ltp
  453. Long Term Prediction (LTP)
  454. @end table
  455. If not specified it is set to @samp{aac_low}.
  456. @item flags +qscale
  457. Set constant quality VBR (Variable Bit Rate) mode.
  458. @item global_quality
  459. Set quality in VBR mode as an integer number of lambda units.
  460. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  461. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  462. and used to set the quality value used by libfaac. A reasonable range
  463. for the option value in QP units is [10-500], the higher the value the
  464. higher the quality.
  465. @item q (@emph{-q})
  466. Enable VBR mode when set to a non-negative value, and set constant
  467. quality value as a double floating point value in QP units.
  468. The value sets the quality value used by libfaac. A reasonable range
  469. for the option value is [10-500], the higher the value the higher the
  470. quality.
  471. This option is valid only using the @command{ffmpeg} command-line
  472. tool. For library interface users, use @option{global_quality}.
  473. @end table
  474. @subsection Examples
  475. @itemize
  476. @item
  477. Use @command{ffmpeg} to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
  478. container:
  479. @example
  480. ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
  481. @end example
  482. @item
  483. Use @command{ffmpeg} to convert an audio file to VBR AAC, using the
  484. LTP AAC profile:
  485. @example
  486. ffmpeg -i input.wav -c:a libfaac -profile:a aac_ltp -q:a 100 output.m4a
  487. @end example
  488. @end itemize
  489. @anchor{libfdk-aac-enc}
  490. @section libfdk_aac
  491. libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  492. The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  493. the Android project.
  494. Requires the presence of the libfdk-aac headers and library during
  495. configuration. You need to explicitly configure the build with
  496. @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
  497. so if you allow the use of GPL, you should configure with
  498. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
  499. This encoder is considered to be of higher quality with respect to
  500. both @ref{aacenc,,the native experimental FFmpeg AAC encoder} and
  501. @ref{libfaac}.
  502. VBR encoding, enabled through the @option{vbr} or @option{flags
  503. +qscale} options, is experimental and only works with some
  504. combinations of parameters.
  505. Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  506. higher.
  507. For more information see the fdk-aac project at
  508. @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
  509. @subsection Options
  510. The following options are mapped on the shared FFmpeg codec options.
  511. @table @option
  512. @item b
  513. Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  514. is automatically set to a suitable value depending on the selected
  515. profile.
  516. In case VBR mode is enabled the option is ignored.
  517. @item ar
  518. Set audio sampling rate (in Hz).
  519. @item channels
  520. Set the number of audio channels.
  521. @item flags +qscale
  522. Enable fixed quality, VBR (Variable Bit Rate) mode.
  523. Note that VBR is implicitly enabled when the @option{vbr} value is
  524. positive.
  525. @item cutoff
  526. Set cutoff frequency. If not specified (or explicitly set to 0) it
  527. will use a value automatically computed by the library. Default value
  528. is 0.
  529. @item profile
  530. Set audio profile.
  531. The following profiles are recognized:
  532. @table @samp
  533. @item aac_low
  534. Low Complexity AAC (LC)
  535. @item aac_he
  536. High Efficiency AAC (HE-AAC)
  537. @item aac_he_v2
  538. High Efficiency AAC version 2 (HE-AACv2)
  539. @item aac_ld
  540. Low Delay AAC (LD)
  541. @item aac_eld
  542. Enhanced Low Delay AAC (ELD)
  543. @end table
  544. If not specified it is set to @samp{aac_low}.
  545. @end table
  546. The following are private options of the libfdk_aac encoder.
  547. @table @option
  548. @item afterburner
  549. Enable afterburner feature if set to 1, disabled if set to 0. This
  550. improves the quality but also the required processing power.
  551. Default value is 1.
  552. @item eld_sbr
  553. Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  554. if set to 0.
  555. Default value is 0.
  556. @item signaling
  557. Set SBR/PS signaling style.
  558. It can assume one of the following values:
  559. @table @samp
  560. @item default
  561. choose signaling implicitly (explicit hierarchical by default,
  562. implicit if global header is disabled)
  563. @item implicit
  564. implicit backwards compatible signaling
  565. @item explicit_sbr
  566. explicit SBR, implicit PS signaling
  567. @item explicit_hierarchical
  568. explicit hierarchical signaling
  569. @end table
  570. Default value is @samp{default}.
  571. @item latm
  572. Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  573. Default value is 0.
  574. @item header_period
  575. Set StreamMuxConfig and PCE repetition period (in frames) for sending
  576. in-band configuration buffers within LATM/LOAS transport layer.
  577. Must be a 16-bits non-negative integer.
  578. Default value is 0.
  579. @item vbr
  580. Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  581. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  582. (Constant Bit Rate) is enabled.
  583. Currently only the @samp{aac_low} profile supports VBR encoding.
  584. VBR modes 1-5 correspond to roughly the following average bit rates:
  585. @table @samp
  586. @item 1
  587. 32 kbps/channel
  588. @item 2
  589. 40 kbps/channel
  590. @item 3
  591. 48-56 kbps/channel
  592. @item 4
  593. 64 kbps/channel
  594. @item 5
  595. about 80-96 kbps/channel
  596. @end table
  597. Default value is 0.
  598. @end table
  599. @subsection Examples
  600. @itemize
  601. @item
  602. Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
  603. container:
  604. @example
  605. ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  606. @end example
  607. @item
  608. Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
  609. High-Efficiency AAC profile:
  610. @example
  611. ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  612. @end example
  613. @end itemize
  614. @anchor{libmp3lame}
  615. @section libmp3lame
  616. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  617. Requires the presence of the libmp3lame headers and library during
  618. configuration. You need to explicitly configure the build with
  619. @code{--enable-libmp3lame}.
  620. See @ref{libshine} for a fixed-point MP3 encoder, although with a
  621. lower quality.
  622. @subsection Options
  623. The following options are supported by the libmp3lame wrapper. The
  624. @command{lame}-equivalent of the options are listed in parentheses.
  625. @table @option
  626. @item b (@emph{-b})
  627. Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
  628. expressed in kilobits/s.
  629. @item q (@emph{-V})
  630. Set constant quality setting for VBR. This option is valid only
  631. using the @command{ffmpeg} command-line tool. For library interface
  632. users, use @option{global_quality}.
  633. @item compression_level (@emph{-q})
  634. Set algorithm quality. Valid arguments are integers in the 0-9 range,
  635. with 0 meaning highest quality but slowest, and 9 meaning fastest
  636. while producing the worst quality.
  637. @item reservoir
  638. Enable use of bit reservoir when set to 1. Default value is 1. LAME
  639. has this enabled by default, but can be overridden by use
  640. @option{--nores} option.
  641. @item joint_stereo (@emph{-m j})
  642. Enable the encoder to use (on a frame by frame basis) either L/R
  643. stereo or mid/side stereo. Default value is 1.
  644. @item abr (@emph{--abr})
  645. Enable the encoder to use ABR when set to 1. The @command{lame}
  646. @option{--abr} sets the target bitrate, while this options only
  647. tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
  648. @end table
  649. @section libopencore-amrnb
  650. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  651. Requires the presence of the libopencore-amrnb headers and library during
  652. configuration. You need to explicitly configure the build with
  653. @code{--enable-libopencore-amrnb --enable-version3}.
  654. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  655. but you can override it by setting @option{strict} to @samp{unofficial} or
  656. lower.
  657. @subsection Options
  658. @table @option
  659. @item b
  660. Set bitrate in bits per second. Only the following bitrates are supported,
  661. otherwise libavcodec will round to the nearest valid bitrate.
  662. @table @option
  663. @item 4750
  664. @item 5150
  665. @item 5900
  666. @item 6700
  667. @item 7400
  668. @item 7950
  669. @item 10200
  670. @item 12200
  671. @end table
  672. @item dtx
  673. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  674. default value is 0 (disabled).
  675. @end table
  676. @anchor{libshine}
  677. @section libshine
  678. Shine Fixed-Point MP3 encoder wrapper.
  679. Shine is a fixed-point MP3 encoder. It has a far better performance on
  680. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  681. However, as it is more targeted on performance than quality, it is not on par
  682. with LAME and other production-grade encoders quality-wise. Also, according to
  683. the project's homepage, this encoder may not be free of bugs as the code was
  684. written a long time ago and the project was dead for at least 5 years.
  685. This encoder only supports stereo and mono input. This is also CBR-only.
  686. The original project (last updated in early 2007) is at
  687. @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
  688. updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
  689. Requires the presence of the libshine headers and library during
  690. configuration. You need to explicitly configure the build with
  691. @code{--enable-libshine}.
  692. See also @ref{libmp3lame}.
  693. @subsection Options
  694. The following options are supported by the libshine wrapper. The
  695. @command{shineenc}-equivalent of the options are listed in parentheses.
  696. @table @option
  697. @item b (@emph{-b})
  698. Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
  699. is expressed in kilobits/s.
  700. @end table
  701. @section libtwolame
  702. TwoLAME MP2 encoder wrapper.
  703. Requires the presence of the libtwolame headers and library during
  704. configuration. You need to explicitly configure the build with
  705. @code{--enable-libtwolame}.
  706. @subsection Options
  707. The following options are supported by the libtwolame wrapper. The
  708. @command{twolame}-equivalent options follow the FFmpeg ones and are in
  709. parentheses.
  710. @table @option
  711. @item b (@emph{-b})
  712. Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
  713. option is expressed in kilobits/s. Default value is 128k.
  714. @item q (@emph{-V})
  715. Set quality for experimental VBR support. Maximum value range is
  716. from -50 to 50, useful range is from -10 to 10. The higher the
  717. value, the better the quality. This option is valid only using the
  718. @command{ffmpeg} command-line tool. For library interface users,
  719. use @option{global_quality}.
  720. @item mode (@emph{--mode})
  721. Set the mode of the resulting audio. Possible values:
  722. @table @samp
  723. @item auto
  724. Choose mode automatically based on the input. This is the default.
  725. @item stereo
  726. Stereo
  727. @item joint_stereo
  728. Joint stereo
  729. @item dual_channel
  730. Dual channel
  731. @item mono
  732. Mono
  733. @end table
  734. @item psymodel (@emph{--psyc-mode})
  735. Set psychoacoustic model to use in encoding. The argument must be
  736. an integer between -1 and 4, inclusive. The higher the value, the
  737. better the quality. The default value is 3.
  738. @item energy_levels (@emph{--energy})
  739. Enable energy levels extensions when set to 1. The default value is
  740. 0 (disabled).
  741. @item error_protection (@emph{--protect})
  742. Enable CRC error protection when set to 1. The default value is 0
  743. (disabled).
  744. @item copyright (@emph{--copyright})
  745. Set MPEG audio copyright flag when set to 1. The default value is 0
  746. (disabled).
  747. @item original (@emph{--original})
  748. Set MPEG audio original flag when set to 1. The default value is 0
  749. (disabled).
  750. @end table
  751. @anchor{libvo-aacenc}
  752. @section libvo-aacenc
  753. VisualOn AAC encoder.
  754. Requires the presence of the libvo-aacenc headers and library during
  755. configuration. You need to explicitly configure the build with
  756. @code{--enable-libvo-aacenc --enable-version3}.
  757. This encoder is considered to be worse than the
  758. @ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
  759. multiple sources.
  760. @subsection Options
  761. The VisualOn AAC encoder only support encoding AAC-LC and up to 2
  762. channels. It is also CBR-only.
  763. @table @option
  764. @item b
  765. Set bit rate in bits/s.
  766. @end table
  767. @section libvo-amrwbenc
  768. VisualOn Adaptive Multi-Rate Wideband encoder.
  769. Requires the presence of the libvo-amrwbenc headers and library during
  770. configuration. You need to explicitly configure the build with
  771. @code{--enable-libvo-amrwbenc --enable-version3}.
  772. This is a mono-only encoder. Officially it only supports 16000Hz sample
  773. rate, but you can override it by setting @option{strict} to
  774. @samp{unofficial} or lower.
  775. @subsection Options
  776. @table @option
  777. @item b
  778. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  779. libavcodec will round to the nearest valid bitrate.
  780. @table @samp
  781. @item 6600
  782. @item 8850
  783. @item 12650
  784. @item 14250
  785. @item 15850
  786. @item 18250
  787. @item 19850
  788. @item 23050
  789. @item 23850
  790. @end table
  791. @item dtx
  792. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  793. default value is 0 (disabled).
  794. @end table
  795. @section libopus
  796. libopus Opus Interactive Audio Codec encoder wrapper.
  797. Requires the presence of the libopus headers and library during
  798. configuration. You need to explicitly configure the build with
  799. @code{--enable-libopus}.
  800. @subsection Option Mapping
  801. Most libopus options are modelled after the @command{opusenc} utility from
  802. opus-tools. The following is an option mapping chart describing options
  803. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  804. in parentheses.
  805. @table @option
  806. @item b (@emph{bitrate})
  807. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  808. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  809. kilobits/s.
  810. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  811. Set VBR mode. The FFmpeg @option{vbr} option has the following
  812. valid arguments, with the their @command{opusenc} equivalent options
  813. in parentheses:
  814. @table @samp
  815. @item off (@emph{hard-cbr})
  816. Use constant bit rate encoding.
  817. @item on (@emph{vbr})
  818. Use variable bit rate encoding (the default).
  819. @item constrained (@emph{cvbr})
  820. Use constrained variable bit rate encoding.
  821. @end table
  822. @item compression_level (@emph{comp})
  823. Set encoding algorithm complexity. Valid options are integers in
  824. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  825. gives the highest quality but slowest encoding. The default is 10.
  826. @item frame_duration (@emph{framesize})
  827. Set maximum frame size, or duration of a frame in milliseconds. The
  828. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  829. frame sizes achieve lower latency but less quality at a given bitrate.
  830. Sizes greater than 20ms are only interesting at fairly low bitrates.
  831. The default is 20ms.
  832. @item packet_loss (@emph{expect-loss})
  833. Set expected packet loss percentage. The default is 0.
  834. @item application (N.A.)
  835. Set intended application type. Valid options are listed below:
  836. @table @samp
  837. @item voip
  838. Favor improved speech intelligibility.
  839. @item audio
  840. Favor faithfulness to the input (the default).
  841. @item lowdelay
  842. Restrict to only the lowest delay modes.
  843. @end table
  844. @item cutoff (N.A.)
  845. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  846. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  847. narrowband, mediumband, wideband, super wideband, and fullband
  848. respectively. The default is 0 (cutoff disabled).
  849. @end table
  850. @section libvorbis
  851. libvorbis encoder wrapper.
  852. Requires the presence of the libvorbisenc headers and library during
  853. configuration. You need to explicitly configure the build with
  854. @code{--enable-libvorbis}.
  855. @subsection Options
  856. The following options are supported by the libvorbis wrapper. The
  857. @command{oggenc}-equivalent of the options are listed in parentheses.
  858. To get a more accurate and extensive documentation of the libvorbis
  859. options, consult the libvorbisenc's and @command{oggenc}'s documentations.
  860. See @url{http://xiph.org/vorbis/},
  861. @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
  862. @table @option
  863. @item b (@emph{-b})
  864. Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
  865. expressed in kilobits/s.
  866. @item q (@emph{-q})
  867. Set constant quality setting for VBR. The value should be a float
  868. number in the range of -1.0 to 10.0. The higher the value, the better
  869. the quality. The default value is @samp{3.0}.
  870. This option is valid only using the @command{ffmpeg} command-line tool.
  871. For library interface users, use @option{global_quality}.
  872. @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
  873. Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
  874. related option is expressed in kHz. The default value is @samp{0} (cutoff
  875. disabled).
  876. @item minrate (@emph{-m})
  877. Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
  878. expressed in kilobits/s.
  879. @item maxrate (@emph{-M})
  880. Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
  881. expressed in kilobits/s. This only has effect on ABR mode.
  882. @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
  883. Set noise floor bias for impulse blocks. The value is a float number from
  884. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  885. to the crispness of transients in the encoded audio. The tradeoff for better
  886. transient response is a higher bitrate.
  887. @end table
  888. @anchor{libwavpack}
  889. @section libwavpack
  890. A wrapper providing WavPack encoding through libwavpack.
  891. Only lossless mode using 32-bit integer samples is supported currently.
  892. Requires the presence of the libwavpack headers and library during
  893. configuration. You need to explicitly configure the build with
  894. @code{--enable-libwavpack}.
  895. Note that a libavcodec-native encoder for the WavPack codec exists so users can
  896. encode audios with this codec without using this encoder. See @ref{wavpackenc}.
  897. @subsection Options
  898. @command{wavpack} command line utility's corresponding options are listed in
  899. parentheses, if any.
  900. @table @option
  901. @item frame_size (@emph{--blocksize})
  902. Default is 32768.
  903. @item compression_level
  904. Set speed vs. compression tradeoff. Acceptable arguments are listed below:
  905. @table @samp
  906. @item 0 (@emph{-f})
  907. Fast mode.
  908. @item 1
  909. Normal (default) settings.
  910. @item 2 (@emph{-h})
  911. High quality.
  912. @item 3 (@emph{-hh})
  913. Very high quality.
  914. @item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
  915. Same as @samp{3}, but with extra processing enabled.
  916. @samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
  917. @end table
  918. @end table
  919. @anchor{wavpackenc}
  920. @section wavpack
  921. WavPack lossless audio encoder.
  922. This is a libavcodec-native WavPack encoder. There is also an encoder based on
  923. libwavpack, but there is virtually no reason to use that encoder.
  924. See also @ref{libwavpack}.
  925. @subsection Options
  926. The equivalent options for @command{wavpack} command line utility are listed in
  927. parentheses.
  928. @subsubsection Shared options
  929. The following shared options are effective for this encoder. Only special notes
  930. about this particular encoder will be documented here. For the general meaning
  931. of the options, see @ref{codec-options,,the Codec Options chapter}.
  932. @table @option
  933. @item frame_size (@emph{--blocksize})
  934. For this encoder, the range for this option is between 128 and 131072. Default
  935. is automatically decided based on sample rate and number of channel.
  936. For the complete formula of calculating default, see
  937. @file{libavcodec/wavpackenc.c}.
  938. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
  939. This option's syntax is consistent with @ref{libwavpack}'s.
  940. @end table
  941. @subsubsection Private options
  942. @table @option
  943. @item joint_stereo (@emph{-j})
  944. Set whether to enable joint stereo. Valid values are:
  945. @table @samp
  946. @item on (@emph{1})
  947. Force mid/side audio encoding.
  948. @item off (@emph{0})
  949. Force left/right audio encoding.
  950. @item auto
  951. Let the encoder decide automatically.
  952. @end table
  953. @item optimize_mono
  954. Set whether to enable optimization for mono. This option is only effective for
  955. non-mono streams. Available values:
  956. @table @samp
  957. @item on
  958. enabled
  959. @item off
  960. disabled
  961. @end table
  962. @end table
  963. @c man end AUDIO ENCODERS
  964. @chapter Video Encoders
  965. @c man begin VIDEO ENCODERS
  966. A description of some of the currently available video encoders
  967. follows.
  968. @section libtheora
  969. libtheora Theora encoder wrapper.
  970. Requires the presence of the libtheora headers and library during
  971. configuration. You need to explicitly configure the build with
  972. @code{--enable-libtheora}.
  973. For more information about the libtheora project see
  974. @url{http://www.theora.org/}.
  975. @subsection Options
  976. The following global options are mapped to internal libtheora options
  977. which affect the quality and the bitrate of the encoded stream.
  978. @table @option
  979. @item b
  980. Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  981. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  982. @item flags
  983. Used to enable constant quality mode (VBR) encoding through the
  984. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  985. modes.
  986. @item g
  987. Set the GOP size.
  988. @item global_quality
  989. Set the global quality as an integer in lambda units.
  990. Only relevant when VBR mode is enabled with @code{flags +qscale}. The
  991. value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
  992. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  993. value in the native libtheora range [0-63]. A higher value corresponds
  994. to a higher quality.
  995. @item q
  996. Enable VBR mode when set to a non-negative value, and set constant
  997. quality value as a double floating point value in QP units.
  998. The value is clipped in the [0-10] range, and then multiplied by 6.3
  999. to get a value in the native libtheora range [0-63].
  1000. This option is valid only using the @command{ffmpeg} command-line
  1001. tool. For library interface users, use @option{global_quality}.
  1002. @end table
  1003. @subsection Examples
  1004. @itemize
  1005. @item
  1006. Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
  1007. @example
  1008. ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  1009. @end example
  1010. @item
  1011. Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
  1012. @example
  1013. ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  1014. @end example
  1015. @end itemize
  1016. @section libvpx
  1017. VP8/VP9 format supported through libvpx.
  1018. Requires the presence of the libvpx headers and library during configuration.
  1019. You need to explicitly configure the build with @code{--enable-libvpx}.
  1020. @subsection Options
  1021. Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
  1022. @table @option
  1023. @item threads
  1024. g_threads
  1025. @item profile
  1026. g_profile
  1027. @item vb
  1028. rc_target_bitrate
  1029. @item g
  1030. kf_max_dist
  1031. @item keyint_min
  1032. kf_min_dist
  1033. @item qmin
  1034. rc_min_quantizer
  1035. @item qmax
  1036. rc_max_quantizer
  1037. @item bufsize, vb
  1038. rc_buf_sz
  1039. @code{(bufsize * 1000 / vb)}
  1040. rc_buf_optimal_sz
  1041. @code{(bufsize * 1000 / vb * 5 / 6)}
  1042. @item rc_init_occupancy, vb
  1043. rc_buf_initial_sz
  1044. @code{(rc_init_occupancy * 1000 / vb)}
  1045. @item rc_buffer_aggressivity
  1046. rc_undershoot_pct
  1047. @item skip_threshold
  1048. rc_dropframe_thresh
  1049. @item qcomp
  1050. rc_2pass_vbr_bias_pct
  1051. @item maxrate, vb
  1052. rc_2pass_vbr_maxsection_pct
  1053. @code{(maxrate * 100 / vb)}
  1054. @item minrate, vb
  1055. rc_2pass_vbr_minsection_pct
  1056. @code{(minrate * 100 / vb)}
  1057. @item minrate, maxrate, vb
  1058. @code{VPX_CBR}
  1059. @code{(minrate == maxrate == vb)}
  1060. @item crf
  1061. @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
  1062. @item quality
  1063. @table @option
  1064. @item @var{best}
  1065. @code{VPX_DL_BEST_QUALITY}
  1066. @item @var{good}
  1067. @code{VPX_DL_GOOD_QUALITY}
  1068. @item @var{realtime}
  1069. @code{VPX_DL_REALTIME}
  1070. @end table
  1071. @item speed
  1072. @code{VP8E_SET_CPUUSED}
  1073. @item nr
  1074. @code{VP8E_SET_NOISE_SENSITIVITY}
  1075. @item mb_threshold
  1076. @code{VP8E_SET_STATIC_THRESHOLD}
  1077. @item slices
  1078. @code{VP8E_SET_TOKEN_PARTITIONS}
  1079. @item max-intra-rate
  1080. @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
  1081. @item force_key_frames
  1082. @code{VPX_EFLAG_FORCE_KF}
  1083. @item Alternate reference frame related
  1084. @table @option
  1085. @item vp8flags altref
  1086. @code{VP8E_SET_ENABLEAUTOALTREF}
  1087. @item @var{arnr_max_frames}
  1088. @code{VP8E_SET_ARNR_MAXFRAMES}
  1089. @item @var{arnr_type}
  1090. @code{VP8E_SET_ARNR_TYPE}
  1091. @item @var{arnr_strength}
  1092. @code{VP8E_SET_ARNR_STRENGTH}
  1093. @item @var{rc_lookahead}
  1094. g_lag_in_frames
  1095. @end table
  1096. @item vp8flags error_resilient
  1097. g_error_resilient
  1098. @item aq_mode
  1099. @code{VP9E_SET_AQ_MODE}
  1100. @end table
  1101. For more information about libvpx see:
  1102. @url{http://www.webmproject.org/}
  1103. @section libwebp
  1104. libwebp WebP Image encoder wrapper
  1105. libwebp is Google's official encoder for WebP images. It can encode in either
  1106. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  1107. frame. Lossless images are a separate codec developed by Google.
  1108. @subsection Pixel Format
  1109. Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  1110. to limitations of the format and libwebp. Alpha is supported for either mode.
  1111. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  1112. passed in for encoding lossless, the pixel format will automatically be
  1113. converted using functions from libwebp. This is not ideal and is done only for
  1114. convenience.
  1115. @subsection Options
  1116. @table @option
  1117. @item -lossless @var{boolean}
  1118. Enables/Disables use of lossless mode. Default is 0.
  1119. @item -compression_level @var{integer}
  1120. For lossy, this is a quality/speed tradeoff. Higher values give better quality
  1121. for a given size at the cost of increased encoding time. For lossless, this is
  1122. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  1123. encoding time. More specifically, it controls the number of extra algorithms
  1124. and compression tools used, and varies the combination of these tools. This
  1125. maps to the @var{method} option in libwebp. The valid range is 0 to 6.
  1126. Default is 4.
  1127. @item -qscale @var{float}
  1128. For lossy encoding, this controls image quality, 0 to 100. For lossless
  1129. encoding, this controls the effort and time spent at compressing more. The
  1130. default value is 75. Note that for usage via libavcodec, this option is called
  1131. @var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
  1132. @item -preset @var{type}
  1133. Configuration preset. This does some automatic settings based on the general
  1134. type of the image.
  1135. @table @option
  1136. @item none
  1137. Do not use a preset.
  1138. @item default
  1139. Use the encoder default.
  1140. @item picture
  1141. Digital picture, like portrait, inner shot
  1142. @item photo
  1143. Outdoor photograph, with natural lighting
  1144. @item drawing
  1145. Hand or line drawing, with high-contrast details
  1146. @item icon
  1147. Small-sized colorful images
  1148. @item text
  1149. Text-like
  1150. @end table
  1151. @end table
  1152. @section libx264, libx264rgb
  1153. x264 H.264/MPEG-4 AVC encoder wrapper.
  1154. This encoder requires the presence of the libx264 headers and library
  1155. during configuration. You need to explicitly configure the build with
  1156. @code{--enable-libx264}.
  1157. libx264 supports an impressive number of features, including 8x8 and
  1158. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  1159. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  1160. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  1161. Many libx264 encoder options are mapped to FFmpeg global codec
  1162. options, while unique encoder options are provided through private
  1163. options. Additionally the @option{x264opts} and @option{x264-params}
  1164. private options allows one to pass a list of key=value tuples as accepted
  1165. by the libx264 @code{x264_param_parse} function.
  1166. The x264 project website is at
  1167. @url{http://www.videolan.org/developers/x264.html}.
  1168. The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  1169. pixel formats as input instead of YUV.
  1170. @subsection Supported Pixel Formats
  1171. x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  1172. x264's configure time. FFmpeg only supports one bit depth in one particular
  1173. build. In other words, it is not possible to build one FFmpeg with multiple
  1174. versions of x264 with different bit depths.
  1175. @subsection Options
  1176. The following options are supported by the libx264 wrapper. The
  1177. @command{x264}-equivalent options or values are listed in parentheses
  1178. for easy migration.
  1179. To reduce the duplication of documentation, only the private options
  1180. and some others requiring special attention are documented here. For
  1181. the documentation of the undocumented generic options, see
  1182. @ref{codec-options,,the Codec Options chapter}.
  1183. To get a more accurate and extensive documentation of the libx264
  1184. options, invoke the command @command{x264 --full-help} or consult
  1185. the libx264 documentation.
  1186. @table @option
  1187. @item b (@emph{bitrate})
  1188. Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
  1189. expressed in bits/s, while @command{x264}'s @option{bitrate} is in
  1190. kilobits/s.
  1191. @item bf (@emph{bframes})
  1192. @item g (@emph{keyint})
  1193. @item qmin (@emph{qpmin})
  1194. Minimum quantizer scale.
  1195. @item qmax (@emph{qpmax})
  1196. Maximum quantizer scale.
  1197. @item qdiff (@emph{qpstep})
  1198. Maximum difference between quantizer scales.
  1199. @item qblur (@emph{qblur})
  1200. Quantizer curve blur
  1201. @item qcomp (@emph{qcomp})
  1202. Quantizer curve compression factor
  1203. @item refs (@emph{ref})
  1204. Number of reference frames each P-frame can use. The range is from @var{0-16}.
  1205. @item sc_threshold (@emph{scenecut})
  1206. Sets the threshold for the scene change detection.
  1207. @item trellis (@emph{trellis})
  1208. Performs Trellis quantization to increase efficiency. Enabled by default.
  1209. @item nr (@emph{nr})
  1210. @item me_range (@emph{merange})
  1211. Maximum range of the motion search in pixels.
  1212. @item me_method (@emph{me})
  1213. Set motion estimation method. Possible values in the decreasing order
  1214. of speed:
  1215. @table @samp
  1216. @item dia (@emph{dia})
  1217. @item epzs (@emph{dia})
  1218. Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
  1219. @samp{dia}.
  1220. @item hex (@emph{hex})
  1221. Hexagonal search with radius 2.
  1222. @item umh (@emph{umh})
  1223. Uneven multi-hexagon search.
  1224. @item esa (@emph{esa})
  1225. Exhaustive search.
  1226. @item tesa (@emph{tesa})
  1227. Hadamard exhaustive search (slowest).
  1228. @end table
  1229. @item subq (@emph{subme})
  1230. Sub-pixel motion estimation method.
  1231. @item b_strategy (@emph{b-adapt})
  1232. Adaptive B-frame placement decision algorithm. Use only on first-pass.
  1233. @item keyint_min (@emph{min-keyint})
  1234. Minimum GOP size.
  1235. @item coder
  1236. Set entropy encoder. Possible values:
  1237. @table @samp
  1238. @item ac
  1239. Enable CABAC.
  1240. @item vlc
  1241. Enable CAVLC and disable CABAC. It generates the same effect as
  1242. @command{x264}'s @option{--no-cabac} option.
  1243. @end table
  1244. @item cmp
  1245. Set full pixel motion estimation comparation algorithm. Possible values:
  1246. @table @samp
  1247. @item chroma
  1248. Enable chroma in motion estimation.
  1249. @item sad
  1250. Ignore chroma in motion estimation. It generates the same effect as
  1251. @command{x264}'s @option{--no-chroma-me} option.
  1252. @end table
  1253. @item threads (@emph{threads})
  1254. Number of encoding threads.
  1255. @item thread_type
  1256. Set multithreading technique. Possible values:
  1257. @table @samp
  1258. @item slice
  1259. Slice-based multithreading. It generates the same effect as
  1260. @command{x264}'s @option{--sliced-threads} option.
  1261. @item frame
  1262. Frame-based multithreading.
  1263. @end table
  1264. @item flags
  1265. Set encoding flags. It can be used to disable closed GOP and enable
  1266. open GOP by setting it to @code{-cgop}. The result is similar to
  1267. the behavior of @command{x264}'s @option{--open-gop} option.
  1268. @item rc_init_occupancy (@emph{vbv-init})
  1269. @item preset (@emph{preset})
  1270. Set the encoding preset.
  1271. @item tune (@emph{tune})
  1272. Set tuning of the encoding params.
  1273. @item profile (@emph{profile})
  1274. Set profile restrictions.
  1275. @item fastfirstpass
  1276. Enable fast settings when encoding first pass, when set to 1. When set
  1277. to 0, it has the same effect of @command{x264}'s
  1278. @option{--slow-firstpass} option.
  1279. @item crf (@emph{crf})
  1280. Set the quality for constant quality mode.
  1281. @item crf_max (@emph{crf-max})
  1282. In CRF mode, prevents VBV from lowering quality beyond this point.
  1283. @item qp (@emph{qp})
  1284. Set constant quantization rate control method parameter.
  1285. @item aq-mode (@emph{aq-mode})
  1286. Set AQ method. Possible values:
  1287. @table @samp
  1288. @item none (@emph{0})
  1289. Disabled.
  1290. @item variance (@emph{1})
  1291. Variance AQ (complexity mask).
  1292. @item autovariance (@emph{2})
  1293. Auto-variance AQ (experimental).
  1294. @end table
  1295. @item aq-strength (@emph{aq-strength})
  1296. Set AQ strength, reduce blocking and blurring in flat and textured areas.
  1297. @item psy
  1298. Use psychovisual optimizations when set to 1. When set to 0, it has the
  1299. same effect as @command{x264}'s @option{--no-psy} option.
  1300. @item psy-rd (@emph{psy-rd})
  1301. Set strength of psychovisual optimization, in
  1302. @var{psy-rd}:@var{psy-trellis} format.
  1303. @item rc-lookahead (@emph{rc-lookahead})
  1304. Set number of frames to look ahead for frametype and ratecontrol.
  1305. @item weightb
  1306. Enable weighted prediction for B-frames when set to 1. When set to 0,
  1307. it has the same effect as @command{x264}'s @option{--no-weightb} option.
  1308. @item weightp (@emph{weightp})
  1309. Set weighted prediction method for P-frames. Possible values:
  1310. @table @samp
  1311. @item none (@emph{0})
  1312. Disabled
  1313. @item simple (@emph{1})
  1314. Enable only weighted refs
  1315. @item smart (@emph{2})
  1316. Enable both weighted refs and duplicates
  1317. @end table
  1318. @item ssim (@emph{ssim})
  1319. Enable calculation and printing SSIM stats after the encoding.
  1320. @item intra-refresh (@emph{intra-refresh})
  1321. Enable the use of Periodic Intra Refresh instead of IDR frames when set
  1322. to 1.
  1323. @item bluray-compat (@emph{bluray-compat})
  1324. Configure the encoder to be compatible with the bluray standard.
  1325. It is a shorthand for setting "bluray-compat=1 force-cfr=1".
  1326. @item b-bias (@emph{b-bias})
  1327. Set the influence on how often B-frames are used.
  1328. @item b-pyramid (@emph{b-pyramid})
  1329. Set method for keeping of some B-frames as references. Possible values:
  1330. @table @samp
  1331. @item none (@emph{none})
  1332. Disabled.
  1333. @item strict (@emph{strict})
  1334. Strictly hierarchical pyramid.
  1335. @item normal (@emph{normal})
  1336. Non-strict (not Blu-ray compatible).
  1337. @end table
  1338. @item mixed-refs
  1339. Enable the use of one reference per partition, as opposed to one
  1340. reference per macroblock when set to 1. When set to 0, it has the
  1341. same effect as @command{x264}'s @option{--no-mixed-refs} option.
  1342. @item 8x8dct
  1343. Enable adaptive spatial transform (high profile 8x8 transform)
  1344. when set to 1. When set to 0, it has the same effect as
  1345. @command{x264}'s @option{--no-8x8dct} option.
  1346. @item fast-pskip
  1347. Enable early SKIP detection on P-frames when set to 1. When set
  1348. to 0, it has the same effect as @command{x264}'s
  1349. @option{--no-fast-pskip} option.
  1350. @item aud (@emph{aud})
  1351. Enable use of access unit delimiters when set to 1.
  1352. @item mbtree
  1353. Enable use macroblock tree ratecontrol when set to 1. When set
  1354. to 0, it has the same effect as @command{x264}'s
  1355. @option{--no-mbtree} option.
  1356. @item deblock (@emph{deblock})
  1357. Set loop filter parameters, in @var{alpha}:@var{beta} form.
  1358. @item cplxblur (@emph{cplxblur})
  1359. Set fluctuations reduction in QP (before curve compression).
  1360. @item partitions (@emph{partitions})
  1361. Set partitions to consider as a comma-separated list of. Possible
  1362. values in the list:
  1363. @table @samp
  1364. @item p8x8
  1365. 8x8 P-frame partition.
  1366. @item p4x4
  1367. 4x4 P-frame partition.
  1368. @item b8x8
  1369. 4x4 B-frame partition.
  1370. @item i8x8
  1371. 8x8 I-frame partition.
  1372. @item i4x4
  1373. 4x4 I-frame partition.
  1374. (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
  1375. @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
  1376. option) to be enabled.)
  1377. @item none (@emph{none})
  1378. Do not consider any partitions.
  1379. @item all (@emph{all})
  1380. Consider every partition.
  1381. @end table
  1382. @item direct-pred (@emph{direct})
  1383. Set direct MV prediction mode. Possible values:
  1384. @table @samp
  1385. @item none (@emph{none})
  1386. Disable MV prediction.
  1387. @item spatial (@emph{spatial})
  1388. Enable spatial predicting.
  1389. @item temporal (@emph{temporal})
  1390. Enable temporal predicting.
  1391. @item auto (@emph{auto})
  1392. Automatically decided.
  1393. @end table
  1394. @item slice-max-size (@emph{slice-max-size})
  1395. Set the limit of the size of each slice in bytes. If not specified
  1396. but RTP payload size (@option{ps}) is specified, that is used.
  1397. @item stats (@emph{stats})
  1398. Set the file name for multi-pass stats.
  1399. @item nal-hrd (@emph{nal-hrd})
  1400. Set signal HRD information (requires @option{vbv-bufsize} to be set).
  1401. Possible values:
  1402. @table @samp
  1403. @item none (@emph{none})
  1404. Disable HRD information signaling.
  1405. @item vbr (@emph{vbr})
  1406. Variable bit rate.
  1407. @item cbr (@emph{cbr})
  1408. Constant bit rate (not allowed in MP4 container).
  1409. @end table
  1410. @item x264opts (N.A.)
  1411. Set any x264 option, see @command{x264 --fullhelp} for a list.
  1412. Argument is a list of @var{key}=@var{value} couples separated by
  1413. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  1414. themselves, use "," instead. They accept it as well since long ago but this
  1415. is kept undocumented for some reason.
  1416. For example to specify libx264 encoding options with @command{ffmpeg}:
  1417. @example
  1418. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  1419. @end example
  1420. @item x264-params (N.A.)
  1421. Override the x264 configuration using a :-separated list of key=value
  1422. parameters.
  1423. This option is functionally the same as the @option{x264opts}, but is
  1424. duplicated for compatibility with the Libav fork.
  1425. For example to specify libx264 encoding options with @command{ffmpeg}:
  1426. @example
  1427. ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  1428. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  1429. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  1430. @end example
  1431. @end table
  1432. Encoding ffpresets for common usages are provided so they can be used with the
  1433. general presets system (e.g. passing the @option{pre} option).
  1434. @section libxvid
  1435. Xvid MPEG-4 Part 2 encoder wrapper.
  1436. This encoder requires the presence of the libxvidcore headers and library
  1437. during configuration. You need to explicitly configure the build with
  1438. @code{--enable-libxvid --enable-gpl}.
  1439. The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
  1440. users can encode to this format without this library.
  1441. @subsection Options
  1442. The following options are supported by the libxvid wrapper. Some of
  1443. the following options are listed but are not documented, and
  1444. correspond to shared codec options. See @ref{codec-options,,the Codec
  1445. Options chapter} for their documentation. The other shared options
  1446. which are not listed have no effect for the libxvid encoder.
  1447. @table @option
  1448. @item b
  1449. @item g
  1450. @item qmin
  1451. @item qmax
  1452. @item mpeg_quant
  1453. @item threads
  1454. @item bf
  1455. @item b_qfactor
  1456. @item b_qoffset
  1457. @item flags
  1458. Set specific encoding flags. Possible values:
  1459. @table @samp
  1460. @item mv4
  1461. Use four motion vector by macroblock.
  1462. @item aic
  1463. Enable high quality AC prediction.
  1464. @item gray
  1465. Only encode grayscale.
  1466. @item gmc
  1467. Enable the use of global motion compensation (GMC).
  1468. @item qpel
  1469. Enable quarter-pixel motion compensation.
  1470. @item cgop
  1471. Enable closed GOP.
  1472. @item global_header
  1473. Place global headers in extradata instead of every keyframe.
  1474. @end table
  1475. @item trellis
  1476. @item me_method
  1477. Set motion estimation method. Possible values in decreasing order of
  1478. speed and increasing order of quality:
  1479. @table @samp
  1480. @item zero
  1481. Use no motion estimation (default).
  1482. @item phods
  1483. @item x1
  1484. @item log
  1485. Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  1486. refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
  1487. @samp{phods}.
  1488. @item epzs
  1489. Enable all of the things described above, plus advanced diamond zonal
  1490. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  1491. estimation on chroma planes.
  1492. @item full
  1493. Enable all of the things described above, plus extended 16x16 and 8x8
  1494. blocks search.
  1495. @end table
  1496. @item mbd
  1497. Set macroblock decision algorithm. Possible values in the increasing
  1498. order of quality:
  1499. @table @samp
  1500. @item simple
  1501. Use macroblock comparing function algorithm (default).
  1502. @item bits
  1503. Enable rate distortion-based half pixel and quarter pixel refinement for
  1504. 16x16 blocks.
  1505. @item rd
  1506. Enable all of the things described above, plus rate distortion-based
  1507. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  1508. distortion-based search using square pattern.
  1509. @end table
  1510. @item lumi_aq
  1511. Enable lumi masking adaptive quantization when set to 1. Default is 0
  1512. (disabled).
  1513. @item variance_aq
  1514. Enable variance adaptive quantization when set to 1. Default is 0
  1515. (disabled).
  1516. When combined with @option{lumi_aq}, the resulting quality will not
  1517. be better than any of the two specified individually. In other
  1518. words, the resulting quality will be the worse one of the two
  1519. effects.
  1520. @item ssim
  1521. Set structural similarity (SSIM) displaying method. Possible values:
  1522. @table @samp
  1523. @item off
  1524. Disable displaying of SSIM information.
  1525. @item avg
  1526. Output average SSIM at the end of encoding to stdout. The format of
  1527. showing the average SSIM is:
  1528. @example
  1529. Average SSIM: %f
  1530. @end example
  1531. For users who are not familiar with C, %f means a float number, or
  1532. a decimal (e.g. 0.939232).
  1533. @item frame
  1534. Output both per-frame SSIM data during encoding and average SSIM at
  1535. the end of encoding to stdout. The format of per-frame information
  1536. is:
  1537. @example
  1538. SSIM: avg: %1.3f min: %1.3f max: %1.3f
  1539. @end example
  1540. For users who are not familiar with C, %1.3f means a float number
  1541. rounded to 3 digits after the dot (e.g. 0.932).
  1542. @end table
  1543. @item ssim_acc
  1544. Set SSIM accuracy. Valid options are integers within the range of
  1545. 0-4, while 0 gives the most accurate result and 4 computes the
  1546. fastest.
  1547. @end table
  1548. @section mpeg2
  1549. MPEG-2 video encoder.
  1550. @subsection Options
  1551. @table @option
  1552. @item seq_disp_ext @var{integer}
  1553. Specifies if the encoder should write a sequence_display_extension to the
  1554. output.
  1555. @table @option
  1556. @item -1
  1557. @itemx auto
  1558. Decide automatically to write it or not (this is the default) by checking if
  1559. the data to be written is different from the default or unspecified values.
  1560. @item 0
  1561. @itemx never
  1562. Never write it.
  1563. @item 1
  1564. @itemx always
  1565. Always write it.
  1566. @end table
  1567. @end table
  1568. @section png
  1569. PNG image encoder.
  1570. @subsection Private options
  1571. @table @option
  1572. @item dpi @var{integer}
  1573. Set physical density of pixels, in dots per inch, unset by default
  1574. @item dpm @var{integer}
  1575. Set physical density of pixels, in dots per meter, unset by default
  1576. @end table
  1577. @section ProRes
  1578. Apple ProRes encoder.
  1579. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  1580. The used encoder can be chosen with the @code{-vcodec} option.
  1581. @subsection Private Options for prores-ks
  1582. @table @option
  1583. @item profile @var{integer}
  1584. Select the ProRes profile to encode
  1585. @table @samp
  1586. @item proxy
  1587. @item lt
  1588. @item standard
  1589. @item hq
  1590. @item 4444
  1591. @end table
  1592. @item quant_mat @var{integer}
  1593. Select quantization matrix.
  1594. @table @samp
  1595. @item auto
  1596. @item default
  1597. @item proxy
  1598. @item lt
  1599. @item standard
  1600. @item hq
  1601. @end table
  1602. If set to @var{auto}, the matrix matching the profile will be picked.
  1603. If not set, the matrix providing the highest quality, @var{default}, will be
  1604. picked.
  1605. @item bits_per_mb @var{integer}
  1606. How many bits to allot for coding one macroblock. Different profiles use
  1607. between 200 and 2400 bits per macroblock, the maximum is 8000.
  1608. @item mbs_per_slice @var{integer}
  1609. Number of macroblocks in each slice (1-8); the default value (8)
  1610. should be good in almost all situations.
  1611. @item vendor @var{string}
  1612. Override the 4-byte vendor ID.
  1613. A custom vendor ID like @var{apl0} would claim the stream was produced by
  1614. the Apple encoder.
  1615. @item alpha_bits @var{integer}
  1616. Specify number of bits for alpha component.
  1617. Possible values are @var{0}, @var{8} and @var{16}.
  1618. Use @var{0} to disable alpha plane coding.
  1619. @end table
  1620. @subsection Speed considerations
  1621. In the default mode of operation the encoder has to honor frame constraints
  1622. (i.e. not produc frames with size bigger than requested) while still making
  1623. output picture as good as possible.
  1624. A frame containing a lot of small details is harder to compress and the encoder
  1625. would spend more time searching for appropriate quantizers for each slice.
  1626. Setting a higher @option{bits_per_mb} limit will improve the speed.
  1627. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  1628. recommended value) and do not set a size constraint.
  1629. @c man end VIDEO ENCODERS
  1630. @chapter Subtitles Encoders
  1631. @c man begin SUBTITLES ENCODERS
  1632. @section dvdsub
  1633. This codec encodes the bitmap subtitle format that is used in DVDs.
  1634. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  1635. and they can also be used in Matroska files.
  1636. @subsection Options
  1637. @table @option
  1638. @item even_rows_fix
  1639. When set to 1, enable a work-around that makes the number of pixel rows
  1640. even in all subtitles. This fixes a problem with some players that
  1641. cut off the bottom row if the number is odd. The work-around just adds
  1642. a fully transparent row if needed. The overhead is low, typically
  1643. one byte per subtitle on average.
  1644. By default, this work-around is disabled.
  1645. @end table
  1646. @c man end SUBTITLES ENCODERS