annotate ffmpeg/doc/encoders.texi @ 13:844d341cf643 tip

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