You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1151 lines
31KB

  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{-codecs} 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. @section ac3 and ac3_fixed
  21. AC-3 audio encoders.
  22. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  23. the undocumented RealAudio 3 (a.k.a. dnet).
  24. The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
  25. encoder only uses fixed-point integer math. This does not mean that one is
  26. always faster, just that one or the other may be better suited to a
  27. particular system. The floating-point encoder will generally produce better
  28. quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
  29. default codec for any of the output formats, so it must be specified explicitly
  30. using the option @code{-acodec ac3_fixed} in order to use it.
  31. @subsection AC-3 Metadata
  32. The AC-3 metadata options are used to set parameters that describe the audio,
  33. but in most cases do not affect the audio encoding itself. Some of the options
  34. do directly affect or influence the decoding and playback of the resulting
  35. bitstream, while others are just for informational purposes. A few of the
  36. options will add bits to the output stream that could otherwise be used for
  37. audio data, and will thus affect the quality of the output. Those will be
  38. indicated accordingly with a note in the option list below.
  39. These parameters are described in detail in several publicly-available
  40. documents.
  41. @itemize
  42. @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
  43. @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}
  44. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
  45. @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
  46. @end itemize
  47. @subsubsection Metadata Control Options
  48. @table @option
  49. @item -per_frame_metadata @var{boolean}
  50. Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  51. metadata for each frame.
  52. @table @option
  53. @item 0
  54. The metadata values set at initialization will be used for every frame in the
  55. stream. (default)
  56. @item 1
  57. Metadata values can be changed before encoding each frame.
  58. @end table
  59. @end table
  60. @subsubsection Downmix Levels
  61. @table @option
  62. @item -center_mixlev @var{level}
  63. Center Mix Level. The amount of gain the decoder should apply to the center
  64. channel when downmixing to stereo. This field will only be written to the
  65. bitstream if a center channel is present. The value is specified as a scale
  66. factor. There are 3 valid values:
  67. @table @option
  68. @item 0.707
  69. Apply -3dB gain
  70. @item 0.595
  71. Apply -4.5dB gain (default)
  72. @item 0.500
  73. Apply -6dB gain
  74. @end table
  75. @item -surround_mixlev @var{level}
  76. Surround Mix Level. The amount of gain the decoder should apply to the surround
  77. channel(s) when downmixing to stereo. This field will only be written to the
  78. bitstream if one or more surround channels are present. The value is specified
  79. as a scale factor. There are 3 valid values:
  80. @table @option
  81. @item 0.707
  82. Apply -3dB gain
  83. @item 0.500
  84. Apply -6dB gain (default)
  85. @item 0.000
  86. Silence Surround Channel(s)
  87. @end table
  88. @end table
  89. @subsubsection Audio Production Information
  90. Audio Production Information is optional information describing the mixing
  91. environment. Either none or both of the fields are written to the bitstream.
  92. @table @option
  93. @item -mixing_level @var{number}
  94. Mixing Level. Specifies peak sound pressure level (SPL) in the production
  95. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  96. unknown or not indicated. The default value is -1, but that value cannot be
  97. used if the Audio Production Information is written to the bitstream. Therefore,
  98. if the @code{room_type} option is not the default value, the @code{mixing_level}
  99. option must not be -1.
  100. @item -room_type @var{type}
  101. Room Type. Describes the equalization used during the final mixing session at
  102. the studio or on the dubbing stage. A large room is a dubbing stage with the
  103. industry standard X-curve equalization; a small room has flat equalization.
  104. This field will not be written to the bitstream if both the @code{mixing_level}
  105. option and the @code{room_type} option have the default values.
  106. @table @option
  107. @item 0
  108. @itemx notindicated
  109. Not Indicated (default)
  110. @item 1
  111. @itemx large
  112. Large Room
  113. @item 2
  114. @itemx small
  115. Small Room
  116. @end table
  117. @end table
  118. @subsubsection Other Metadata Options
  119. @table @option
  120. @item -copyright @var{boolean}
  121. Copyright Indicator. Specifies whether a copyright exists for this audio.
  122. @table @option
  123. @item 0
  124. @itemx off
  125. No Copyright Exists (default)
  126. @item 1
  127. @itemx on
  128. Copyright Exists
  129. @end table
  130. @item -dialnorm @var{value}
  131. Dialogue Normalization. Indicates how far the average dialogue level of the
  132. program is below digital 100% full scale (0 dBFS). This parameter determines a
  133. level shift during audio reproduction that sets the average volume of the
  134. dialogue to a preset level. The goal is to match volume level between program
  135. sources. A value of -31dB will result in no volume level change, relative to
  136. the source volume, during audio reproduction. Valid values are whole numbers in
  137. the range -31 to -1, with -31 being the default.
  138. @item -dsur_mode @var{mode}
  139. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  140. (Pro Logic). This field will only be written to the bitstream if the audio
  141. stream is stereo. Using this option does @b{NOT} mean the encoder will actually
  142. apply Dolby Surround processing.
  143. @table @option
  144. @item 0
  145. @itemx notindicated
  146. Not Indicated (default)
  147. @item 1
  148. @itemx off
  149. Not Dolby Surround Encoded
  150. @item 2
  151. @itemx on
  152. Dolby Surround Encoded
  153. @end table
  154. @item -original @var{boolean}
  155. Original Bit Stream Indicator. Specifies whether this audio is from the
  156. original source and not a copy.
  157. @table @option
  158. @item 0
  159. @itemx off
  160. Not Original Source
  161. @item 1
  162. @itemx on
  163. Original Source (default)
  164. @end table
  165. @end table
  166. @subsection Extended Bitstream Information
  167. The extended bitstream options are part of the Alternate Bit Stream Syntax as
  168. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  169. If any one parameter in a group is specified, all values in that group will be
  170. written to the bitstream. Default values are used for those that are written
  171. but have not been specified. If the mixing levels are written, the decoder
  172. will use these values instead of the ones specified in the @code{center_mixlev}
  173. and @code{surround_mixlev} options if it supports the Alternate Bit Stream
  174. Syntax.
  175. @subsubsection Extended Bitstream Information - Part 1
  176. @table @option
  177. @item -dmix_mode @var{mode}
  178. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  179. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  180. @table @option
  181. @item 0
  182. @itemx notindicated
  183. Not Indicated (default)
  184. @item 1
  185. @itemx ltrt
  186. Lt/Rt Downmix Preferred
  187. @item 2
  188. @itemx loro
  189. Lo/Ro Downmix Preferred
  190. @end table
  191. @item -ltrt_cmixlev @var{level}
  192. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  193. center channel when downmixing to stereo in Lt/Rt mode.
  194. @table @option
  195. @item 1.414
  196. Apply +3dB gain
  197. @item 1.189
  198. Apply +1.5dB gain
  199. @item 1.000
  200. Apply 0dB gain
  201. @item 0.841
  202. Apply -1.5dB gain
  203. @item 0.707
  204. Apply -3.0dB gain
  205. @item 0.595
  206. Apply -4.5dB gain (default)
  207. @item 0.500
  208. Apply -6.0dB gain
  209. @item 0.000
  210. Silence Center Channel
  211. @end table
  212. @item -ltrt_surmixlev @var{level}
  213. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  214. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  215. @table @option
  216. @item 0.841
  217. Apply -1.5dB gain
  218. @item 0.707
  219. Apply -3.0dB gain
  220. @item 0.595
  221. Apply -4.5dB gain
  222. @item 0.500
  223. Apply -6.0dB gain (default)
  224. @item 0.000
  225. Silence Surround Channel(s)
  226. @end table
  227. @item -loro_cmixlev @var{level}
  228. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  229. center channel when downmixing to stereo in Lo/Ro mode.
  230. @table @option
  231. @item 1.414
  232. Apply +3dB gain
  233. @item 1.189
  234. Apply +1.5dB gain
  235. @item 1.000
  236. Apply 0dB gain
  237. @item 0.841
  238. Apply -1.5dB gain
  239. @item 0.707
  240. Apply -3.0dB gain
  241. @item 0.595
  242. Apply -4.5dB gain (default)
  243. @item 0.500
  244. Apply -6.0dB gain
  245. @item 0.000
  246. Silence Center Channel
  247. @end table
  248. @item -loro_surmixlev @var{level}
  249. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  250. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  251. @table @option
  252. @item 0.841
  253. Apply -1.5dB gain
  254. @item 0.707
  255. Apply -3.0dB gain
  256. @item 0.595
  257. Apply -4.5dB gain
  258. @item 0.500
  259. Apply -6.0dB gain (default)
  260. @item 0.000
  261. Silence Surround Channel(s)
  262. @end table
  263. @end table
  264. @subsubsection Extended Bitstream Information - Part 2
  265. @table @option
  266. @item -dsurex_mode @var{mode}
  267. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  268. (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
  269. apply Dolby Surround EX processing.
  270. @table @option
  271. @item 0
  272. @itemx notindicated
  273. Not Indicated (default)
  274. @item 1
  275. @itemx on
  276. Dolby Surround EX Off
  277. @item 2
  278. @itemx off
  279. Dolby Surround EX On
  280. @end table
  281. @item -dheadphone_mode @var{mode}
  282. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  283. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  284. option does @b{NOT} mean the encoder will actually apply Dolby Headphone
  285. processing.
  286. @table @option
  287. @item 0
  288. @itemx notindicated
  289. Not Indicated (default)
  290. @item 1
  291. @itemx on
  292. Dolby Headphone Off
  293. @item 2
  294. @itemx off
  295. Dolby Headphone On
  296. @end table
  297. @item -ad_conv_type @var{type}
  298. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  299. conversion.
  300. @table @option
  301. @item 0
  302. @itemx standard
  303. Standard A/D Converter (default)
  304. @item 1
  305. @itemx hdcd
  306. HDCD A/D Converter
  307. @end table
  308. @end table
  309. @subsection Other AC-3 Encoding Options
  310. @table @option
  311. @item -stereo_rematrixing @var{boolean}
  312. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  313. is an optional AC-3 feature that increases quality by selectively encoding
  314. the left/right channels as mid/side. This option is enabled by default, and it
  315. is highly recommended that it be left as enabled except for testing purposes.
  316. @end table
  317. @subsection Floating-Point-Only AC-3 Encoding Options
  318. These options are only valid for the floating-point encoder and do not exist
  319. for the fixed-point encoder due to the corresponding features not being
  320. implemented in fixed-point.
  321. @table @option
  322. @item -channel_coupling @var{boolean}
  323. Enables/Disables use of channel coupling, which is an optional AC-3 feature
  324. that increases quality by combining high frequency information from multiple
  325. channels into a single channel. The per-channel high frequency information is
  326. sent with less accuracy in both the frequency and time domains. This allows
  327. more bits to be used for lower frequencies while preserving enough information
  328. to reconstruct the high frequencies. This option is enabled by default for the
  329. floating-point encoder and should generally be left as enabled except for
  330. testing purposes or to increase encoding speed.
  331. @table @option
  332. @item -1
  333. @itemx auto
  334. Selected by Encoder (default)
  335. @item 0
  336. @itemx off
  337. Disable Channel Coupling
  338. @item 1
  339. @itemx on
  340. Enable Channel Coupling
  341. @end table
  342. @item -cpl_start_band @var{number}
  343. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  344. value higher than the bandwidth is used, it will be reduced to 1 less than the
  345. coupling end band. If @var{auto} is used, the start band will be determined by
  346. the encoder based on the bit rate, sample rate, and channel layout. This option
  347. has no effect if channel coupling is disabled.
  348. @table @option
  349. @item -1
  350. @itemx auto
  351. Selected by Encoder (default)
  352. @end table
  353. @end table
  354. @section libmp3lame
  355. LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
  356. Requires the presence of the libmp3lame headers and library during
  357. configuration. You need to explicitly configure the build with
  358. @code{--enable-libmp3lame}.
  359. @subsection Option Mapping
  360. The following options are supported by the libmp3lame wrapper,
  361. the LAME-equivalent options follow the FFmpeg ones.
  362. @multitable @columnfractions .2 .2
  363. @item FFmpeg @tab LAME
  364. @item b @tab b
  365. Set bitrate expressed in bits/s, LAME @code{bitrate} is expressed in
  366. kilobits/s.
  367. @item q @tab V
  368. Set quality setting for VBR.
  369. @item compression_level @tab q
  370. Set algorithm quality. Valid arguments are integers in the 0-9 range.
  371. @item reservoir @tab N.A.
  372. Enable use of bit reservoir. LAME has this enabled by default.
  373. @item joint_stereo @tab -m j
  374. Enable the encoder to use (on a frame by frame basis) either L/R
  375. stereo or mid/side stereo.
  376. @end multitable
  377. @section libopencore-amrnb
  378. OpenCORE Adaptive Multi-Rate Narrowband encoder.
  379. Requires the presence of the libopencore-amrnb headers and library during
  380. configuration. You need to explicitly configure the build with
  381. @code{--enable-libopencore-amrnb --enable-version3}.
  382. This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  383. but you can override it by setting @option{strict} to @samp{unofficial} or
  384. lower.
  385. @subsection Options
  386. @table @option
  387. @item b
  388. Set bitrate in bits per second. Only the following bitrates are supported,
  389. otherwise libavcodec will round to the nearest valid bitrate.
  390. @table @option
  391. @item 4750
  392. @item 5150
  393. @item 5900
  394. @item 6700
  395. @item 7400
  396. @item 7950
  397. @item 10200
  398. @item 12200
  399. @end table
  400. @item dtx
  401. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  402. default value is 0 (disabled).
  403. @end table
  404. @section libtwolame
  405. TwoLAME MP2 encoder wrapper.
  406. Requires the presence of the libtwolame headers and library during
  407. configuration. You need to explicitly configure the build with
  408. @code{--enable-libtwolame}.
  409. @subsection Options Mapping
  410. The following options are supported by the libtwolame wrapper. The
  411. TwoLAME-equivalent options follow the FFmpeg ones and are in
  412. parentheses.
  413. @table @option
  414. @item b
  415. (b) Set bitrate in bits/s. Note that FFmpeg @code{b} option is
  416. expressed in bits/s, twolame @code{b} in kilobits/s. The default
  417. value is 128k.
  418. @item q
  419. (V) Set quality for experimental VBR support. Maximum value range is
  420. from -50 to 50, useful range is from -10 to 10.
  421. @item mode
  422. (mode) Set MPEG mode. Possible values:
  423. @table @samp
  424. @item auto
  425. Choose mode automatically based on the input. This is the default.
  426. @item stereo
  427. Stereo
  428. @item joint_stereo
  429. Joint stereo
  430. @item dual_channel
  431. Dual channel
  432. @item mono
  433. Mono
  434. @end table
  435. @item psymodel
  436. (psyc-mode) Set psychoacoustic model to use in encoding. The argument
  437. must be an integer between -1 and 4, inclusive. The higher the value,
  438. the better the quality. The default value is 3.
  439. @item energy_levels
  440. (energy) Enable energy levels extensions when set to 1. The default
  441. value is 0 (disabled).
  442. @item error_protection
  443. (protect) Enable CRC error protection when set to 1. The default value
  444. is 0 (disabled).
  445. @item copyright
  446. (copyright) Set MPEG audio copyright flag when set to 1. The default
  447. value is 0 (disabled).
  448. @item original
  449. (original) Set MPEG audio original flag when set to 1. The default
  450. value is 0 (disabled).
  451. @end table
  452. @section libvo-aacenc
  453. VisualOn AAC encoder.
  454. Requires the presence of the libvo-aacenc headers and library during
  455. configuration. You need to explicitly configure the build with
  456. @code{--enable-libvo-aacenc --enable-version3}.
  457. @subsection Options
  458. The VisualOn AAC encoder only support encoding AAC-LC and up to 2
  459. channels. It is also CBR-only. It is considered to be worse than the
  460. native experimental FFmpeg AAC encoder.
  461. @table @option
  462. @item b
  463. Bitrate.
  464. @end table
  465. @section libvo-amrwbenc
  466. VisualOn Adaptive Multi-Rate Wideband encoder.
  467. Requires the presence of the libvo-amrwbenc headers and library during
  468. configuration. You need to explicitly configure the build with
  469. @code{--enable-libvo-amrwbenc --enable-version3}.
  470. This is a mono-only encoder. Officially it only supports 16000Hz sample
  471. rate, but you can override it by setting @option{strict} to
  472. @samp{unofficial} or lower.
  473. @subsection Options
  474. @table @option
  475. @item b
  476. Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  477. libavcodec will round to the nearest valid bitrate.
  478. @table @samp
  479. @item 6600
  480. @item 8850
  481. @item 12650
  482. @item 14250
  483. @item 15850
  484. @item 18250
  485. @item 19850
  486. @item 23050
  487. @item 23850
  488. @end table
  489. @item dtx
  490. Allow discontinuous transmission (generate comfort noise) when set to 1. The
  491. default value is 0 (disabled).
  492. @end table
  493. @section libopus
  494. libopus Opus Interactive Audio Codec encoder wrapper.
  495. Requires the presence of the libopus headers and library during
  496. configuration. You need to explicitly configure the build with
  497. @code{--enable-libopus}.
  498. @subsection Option Mapping
  499. Most libopus options are modeled after the @command{opusenc} utility from
  500. opus-tools. The following is an option mapping chart describing options
  501. supported by the libopus wrapper, and their @command{opusenc}-equivalent
  502. in parentheses.
  503. @table @option
  504. @item b (@emph{bitrate})
  505. Set the bit rate in bits/s. FFmpeg's @option{b} option is
  506. expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
  507. kilobits/s.
  508. @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
  509. Set VBR mode. The FFmpeg @option{vbr} option has the following
  510. valid arguments, with the their @command{opusenc} equivalent options
  511. in parentheses:
  512. @table @samp
  513. @item off (@emph{hard-cbr})
  514. Use constant bit rate encoding.
  515. @item on (@emph{vbr})
  516. Use variable bit rate encoding (the default).
  517. @item constrained (@emph{cvbr})
  518. Use constrained variable bit rate encoding.
  519. @end table
  520. @item compression_level (@emph{comp})
  521. Set encoding algorithm complexity. Valid options are integers in
  522. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  523. gives the highest quality but slowest encoding. The default is 10.
  524. @item frame_duration (@emph{framesize})
  525. Set maximum frame size, or duration of a frame in milliseconds. The
  526. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  527. frame sizes achieve lower latency but less quality at a given bitrate.
  528. Sizes greater than 20ms are only interesting at fairly low bitrates.
  529. The default of FFmpeg is 10ms, but is 20ms in @command{opusenc}.
  530. @item packet_loss (@emph{expect-loss})
  531. Set expected packet loss percentage. The default is 0.
  532. @item application (N.A.)
  533. Set intended application type. Valid options are listed below:
  534. @table @samp
  535. @item voip
  536. Favor improved speech intelligibility.
  537. @item audio
  538. Favor faithfulness to the input (the default).
  539. @item lowdelay
  540. Restrict to only the lowest delay modes.
  541. @end table
  542. @item cutoff (N.A.)
  543. Set cutoff bandwidth in Hz. The argument must be exactly one of the
  544. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  545. narrowband, mediumband, wideband, super wideband, and fullband
  546. respectively. The default is 0 (cutoff disabled).
  547. @end table
  548. @section libwavpack
  549. A wrapper providing WavPack encoding through libwavpack.
  550. Only lossless mode using 32-bit integer samples is supported currently.
  551. The @option{compression_level} option can be used to control speed vs.
  552. compression tradeoff, with the values mapped to libwavpack as follows:
  553. @table @option
  554. @item 0
  555. Fast mode - corresponding to the wavpack @option{-f} option.
  556. @item 1
  557. Normal (default) settings.
  558. @item 2
  559. High quality - corresponding to the wavpack @option{-h} option.
  560. @item 3
  561. Very high quality - corresponding to the wavpack @option{-hh} option.
  562. @item 4-8
  563. Same as 3, but with extra processing enabled - corresponding to the wavpack
  564. @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
  565. @option{-x6}.
  566. @end table
  567. @c man end AUDIO ENCODERS
  568. @chapter Video Encoders
  569. @c man begin VIDEO ENCODERS
  570. A description of some of the currently available video encoders
  571. follows.
  572. @section libtheora
  573. Theora format supported through libtheora.
  574. Requires the presence of the libtheora headers and library during
  575. configuration. You need to explicitly configure the build with
  576. @code{--enable-libtheora}.
  577. @subsection Options
  578. The following global options are mapped to internal libtheora options
  579. which affect the quality and the bitrate of the encoded stream.
  580. @table @option
  581. @item b
  582. Set the video bitrate, only works if the @code{qscale} flag in
  583. @option{flags} is not enabled.
  584. @item flags
  585. Used to enable constant quality mode encoding through the
  586. @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
  587. modes.
  588. @item g
  589. Set the GOP size.
  590. @item global_quality
  591. Set the global quality in lambda units, only works if the
  592. @code{qscale} flag in @option{flags} is enabled. The value is clipped
  593. in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
  594. to get a value in the native libtheora range [0-63]. A higher value
  595. corresponds to a higher quality.
  596. For example, to set maximum constant quality encoding with
  597. @command{ffmpeg}:
  598. @example
  599. ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
  600. @end example
  601. @end table
  602. @section libvpx
  603. VP8 format supported through libvpx.
  604. Requires the presence of the libvpx headers and library during configuration.
  605. You need to explicitly configure the build with @code{--enable-libvpx}.
  606. @subsection Options
  607. Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
  608. @table @option
  609. @item threads
  610. g_threads
  611. @item profile
  612. g_profile
  613. @item vb
  614. rc_target_bitrate
  615. @item g
  616. kf_max_dist
  617. @item keyint_min
  618. kf_min_dist
  619. @item qmin
  620. rc_min_quantizer
  621. @item qmax
  622. rc_max_quantizer
  623. @item bufsize, vb
  624. rc_buf_sz
  625. @code{(bufsize * 1000 / vb)}
  626. rc_buf_optimal_sz
  627. @code{(bufsize * 1000 / vb * 5 / 6)}
  628. @item rc_init_occupancy, vb
  629. rc_buf_initial_sz
  630. @code{(rc_init_occupancy * 1000 / vb)}
  631. @item rc_buffer_aggressivity
  632. rc_undershoot_pct
  633. @item skip_threshold
  634. rc_dropframe_thresh
  635. @item qcomp
  636. rc_2pass_vbr_bias_pct
  637. @item maxrate, vb
  638. rc_2pass_vbr_maxsection_pct
  639. @code{(maxrate * 100 / vb)}
  640. @item minrate, vb
  641. rc_2pass_vbr_minsection_pct
  642. @code{(minrate * 100 / vb)}
  643. @item minrate, maxrate, vb
  644. @code{VPX_CBR}
  645. @code{(minrate == maxrate == vb)}
  646. @item crf
  647. @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
  648. @item quality
  649. @table @option
  650. @item @var{best}
  651. @code{VPX_DL_BEST_QUALITY}
  652. @item @var{good}
  653. @code{VPX_DL_GOOD_QUALITY}
  654. @item @var{realtime}
  655. @code{VPX_DL_REALTIME}
  656. @end table
  657. @item speed
  658. @code{VP8E_SET_CPUUSED}
  659. @item nr
  660. @code{VP8E_SET_NOISE_SENSITIVITY}
  661. @item mb_threshold
  662. @code{VP8E_SET_STATIC_THRESHOLD}
  663. @item slices
  664. @code{VP8E_SET_TOKEN_PARTITIONS}
  665. @item max-intra-rate
  666. @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
  667. @item force_key_frames
  668. @code{VPX_EFLAG_FORCE_KF}
  669. @item Alternate reference frame related
  670. @table @option
  671. @item vp8flags altref
  672. @code{VP8E_SET_ENABLEAUTOALTREF}
  673. @item @var{arnr_max_frames}
  674. @code{VP8E_SET_ARNR_MAXFRAMES}
  675. @item @var{arnr_type}
  676. @code{VP8E_SET_ARNR_TYPE}
  677. @item @var{arnr_strength}
  678. @code{VP8E_SET_ARNR_STRENGTH}
  679. @item @var{rc_lookahead}
  680. g_lag_in_frames
  681. @end table
  682. @item vp8flags error_resilient
  683. g_error_resilient
  684. @end table
  685. For more information about libvpx see:
  686. @url{http://www.webmproject.org/}
  687. @section libx264
  688. x264 H.264/MPEG-4 AVC encoder wrapper.
  689. Requires the presence of the libx264 headers and library during
  690. configuration. You need to explicitly configure the build with
  691. @code{--enable-libx264}.
  692. x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
  693. spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
  694. interlacing (MBAFF), lossless mode, psy optimizations for detail retention
  695. (adaptive quantization, psy-RD, psy-trellis).
  696. The FFmpeg wrapper provides a mapping for most of them using global options
  697. that match those of the encoders and provides private options for the unique
  698. encoder options. Additionally an expert override is provided to directly pass
  699. a list of key=value tuples as accepted by x264_param_parse.
  700. @subsection Option Mapping
  701. The following options are supported by the x264 wrapper, the x264-equivalent
  702. options follow the FFmpeg ones.
  703. @multitable @columnfractions .2 .2
  704. @item b @tab bitrate
  705. FFmpeg @code{b} option is expressed in bits/s, x264 @code{bitrate} in kilobits/s.
  706. @item bf @tab bframes
  707. Maximum number of B-frames.
  708. @item g @tab keyint
  709. Maximum GOP size.
  710. @item qmin @tab qpmin
  711. @item qmax @tab qpmax
  712. @item qdiff @tab qpstep
  713. @item qblur @tab qblur
  714. @item qcomp @tab qcomp
  715. @item refs @tab ref
  716. @item sc_threshold @tab scenecut
  717. @item trellis @tab trellis
  718. @item nr @tab nr
  719. Noise reduction.
  720. @item me_range @tab merange
  721. @item me_method @tab me
  722. @item subq @tab subme
  723. @item b_strategy @tab b-adapt
  724. @item keyint_min @tab keyint-min
  725. @item coder @tab cabac
  726. Set coder to @code{ac} to use CABAC.
  727. @item cmp @tab chroma-me
  728. Set to @code{chroma} to use chroma motion estimation.
  729. @item threads @tab threads
  730. @item thread_type @tab sliced_threads
  731. Set to @code{slice} to use sliced threading instead of frame threading.
  732. @item flags -cgop @tab open-gop
  733. Set @code{-cgop} to use recovery points to close GOPs.
  734. @item rc_init_occupancy @tab vbv-init
  735. Initial buffer occupancy.
  736. @end multitable
  737. @subsection Private Options
  738. @table @option
  739. @item -preset @var{string}
  740. Set the encoding preset (cf. x264 --fullhelp).
  741. @item -tune @var{string}
  742. Tune the encoding params (cf. x264 --fullhelp).
  743. @item -profile @var{string}
  744. Set profile restrictions (cf. x264 --fullhelp).
  745. @item -fastfirstpass @var{integer}
  746. Use fast settings when encoding first pass.
  747. @item -crf @var{float}
  748. Select the quality for constant quality mode.
  749. @item -crf_max @var{float}
  750. In CRF mode, prevents VBV from lowering quality beyond this point.
  751. @item -qp @var{integer}
  752. Constant quantization parameter rate control method.
  753. @item -aq-mode @var{integer}
  754. AQ method
  755. Possible values:
  756. @table @samp
  757. @item none
  758. @item variance
  759. Variance AQ (complexity mask).
  760. @item autovariance
  761. Auto-variance AQ (experimental).
  762. @end table
  763. @item -aq-strength @var{float}
  764. AQ strength, reduces blocking and blurring in flat and textured areas.
  765. @item -psy @var{integer}
  766. Use psychovisual optimizations.
  767. @item -psy-rd @var{string}
  768. Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.
  769. @item -rc-lookahead @var{integer}
  770. Number of frames to look ahead for frametype and ratecontrol.
  771. @item -weightb @var{integer}
  772. Weighted prediction for B-frames.
  773. @item -weightp @var{integer}
  774. Weighted prediction analysis method.
  775. Possible values:
  776. @table @samp
  777. @item none
  778. @item simple
  779. @item smart
  780. @end table
  781. @item -ssim @var{integer}
  782. Calculate and print SSIM stats.
  783. @item -intra-refresh @var{integer}
  784. Use Periodic Intra Refresh instead of IDR frames.
  785. @item -b-bias @var{integer}
  786. Influences how often B-frames are used.
  787. @item -b-pyramid @var{integer}
  788. Keep some B-frames as references.
  789. Possible values:
  790. @table @samp
  791. @item none
  792. @item strict
  793. Strictly hierarchical pyramid.
  794. @item normal
  795. Non-strict (not Blu-ray compatible).
  796. @end table
  797. @item -mixed-refs @var{integer}
  798. One reference per partition, as opposed to one reference per macroblock.
  799. @item -8x8dct @var{integer}
  800. High profile 8x8 transform.
  801. @item -fast-pskip @var{integer}
  802. @item -aud @var{integer}
  803. Use access unit delimiters.
  804. @item -mbtree @var{integer}
  805. Use macroblock tree ratecontrol.
  806. @item -deblock @var{string}
  807. Loop filter parameters, in <alpha:beta> form.
  808. @item -cplxblur @var{float}
  809. Reduce fluctuations in QP (before curve compression).
  810. @item -partitions @var{string}
  811. A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
  812. @item -direct-pred @var{integer}
  813. Direct MV prediction mode
  814. Possible values:
  815. @table @samp
  816. @item none
  817. @item spatial
  818. @item temporal
  819. @item auto
  820. @end table
  821. @item -slice-max-size @var{integer}
  822. Limit the size of each slice in bytes.
  823. @item -stats @var{string}
  824. Filename for 2 pass stats.
  825. @item -nal-hrd @var{integer}
  826. Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
  827. Possible values:
  828. @table @samp
  829. @item none
  830. @item vbr
  831. @item cbr
  832. @end table
  833. @item x264opts @var{options}
  834. Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
  835. @var{options} is a list of @var{key}=@var{value} couples separated by
  836. ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
  837. themselves, use "," instead. They accept it as well since long ago but this
  838. is kept undocumented for some reason.
  839. For example to specify libx264 encoding options with @command{ffmpeg}:
  840. @example
  841. ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  842. @end example
  843. For more information about libx264 and the supported options see:
  844. @url{http://www.videolan.org/developers/x264.html}
  845. @item -x264-params @var{string}
  846. Override the x264 configuration using a :-separated list of key=value parameters.
  847. @example
  848. -x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0
  849. @end example
  850. @end table
  851. Encoding avpresets for common usages are provided so they can be used with the
  852. general presets system (e.g. passing the @code{-pre} option).
  853. @section png
  854. PNG image encoder.
  855. @subsection Private options
  856. @table @option
  857. @item dpi @var{integer}
  858. Set physical density of pixels, in dots per inch, unset by default
  859. @item dpm @var{integer}
  860. Set physical density of pixels, in dots per meter, unset by default
  861. @end table
  862. @section ProRes
  863. Apple ProRes encoder.
  864. FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  865. The used encoder can be choosen with the @code{-vcodec} option.
  866. @subsection Private Options for prores-ks
  867. @table @option
  868. @item profile @var{integer}
  869. Select the ProRes profile to encode
  870. @table @samp
  871. @item proxy
  872. @item lt
  873. @item standard
  874. @item hq
  875. @item 4444
  876. @end table
  877. @item quant_mat @var{integer}
  878. Select quantization matrix.
  879. @table @samp
  880. @item auto
  881. @item default
  882. @item proxy
  883. @item lt
  884. @item standard
  885. @item hq
  886. @end table
  887. If set to @var{auto}, the matrix matching the profile will be picked.
  888. If not set, the matrix providing the highest quality, @var{default}, will be
  889. picked.
  890. @item bits_per_mb @var{integer}
  891. How many bits to allot for coding one macroblock. Different profiles use
  892. between 200 and 2400 bits per macroblock, the maximum is 8000.
  893. @item mbs_per_slice @var{integer}
  894. Number of macroblocks in each slice (1-8); the default value (8)
  895. should be good in almost all situations.
  896. @item vendor @var{string}
  897. Override the 4-byte vendor ID.
  898. A custom vendor ID like @var{apl0} would claim the stream was produced by
  899. the Apple encoder.
  900. @item alpha_bits @var{integer}
  901. Specify number of bits for alpha component.
  902. Possible values are @var{0}, @var{8} and @var{16}.
  903. Use @var{0} to disable alpha plane coding.
  904. @end table
  905. @subsection Speed considerations
  906. In the default mode of operation the encoder has to honor frame constraints
  907. (i.e. not produc frames with size bigger than requested) while still making
  908. output picture as good as possible.
  909. A frame containing a lot of small details is harder to compress and the encoder
  910. would spend more time searching for appropriate quantizers for each slice.
  911. Setting a higher @option{bits_per_mb} limit will improve the speed.
  912. For the fastest encoding speed set the @option{qscale} parameter (4 is the
  913. recommended value) and do not set a size constraint.
  914. @c man end VIDEO ENCODERS