libvpx
VP8/VP9 format supported through libvpx.
Requires the presence of the libvpx headers and library during configuration. You need to explicitly configure the build with --enable-libvpx
.
Options
The following options are supported by the libvpx wrapper. The vpxenc
-equivalent options or values are listed in parentheses for easy migration.
To reduce the duplication of documentation, only the private options and some others requiring special attention are documented here. For the documentation of the undocumented generic options, see the Codec Options chapter.
To get more documentation of the libvpx options, invoke the command ffmpeg -h encoder=libvpx
, ffmpeg -h encoder=libvpx-vp9
or vpxenc --help
. Further information is available in the libvpx API documentation.
- 'b (target-bitrate)'
-
Set bitrate in bits/s. Note that FFmpeg's 'b' option is expressed in bits/s, while
vpxenc
's 'target-bitrate' is in kilobits/s. - 'g (kf-max-dist)'
- 'keyint_min (kf-min-dist)'
- 'qmin (min-q)'
- 'qmax (max-q)'
- 'bufsize (buf-sz, buf-optimal-sz)'
- 'keyint_min (kf-min-dist)'
-
Set ratecontrol buffer size (in bits). Note
vpxenc
's options are specified in milliseconds, the libvpx wrapper converts this value as follows:buf-sz = bufsize * 1000 / bitrate
,buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6
. - 'rc_init_occupancy (buf-initial-sz)'
-
Set number of bits which should be loaded into the rc buffer before decoding starts. Note
vpxenc
's option is specified in milliseconds, the libvpx wrapper converts this value as follows:rc_init_occupancy * 1000 / bitrate
. - 'undershoot-pct'
-
Set datarate undershoot (min) percentage of the target bitrate.
- 'overshoot-pct'
-
Set datarate overshoot (max) percentage of the target bitrate.
- 'skip_threshold (drop-frame)'
- 'qcomp (bias-pct)'
- 'maxrate (maxsection-pct)'
- 'qcomp (bias-pct)'
-
Set GOP max bitrate in bits/s. Note
vpxenc
's option is specified as a percentage of the target bitrate, the libvpx wrapper converts this value as follows:(maxrate * 100 / bitrate)
. - 'minrate (minsection-pct)'
-
Set GOP min bitrate in bits/s. Note
vpxenc
's option is specified as a percentage of the target bitrate, the libvpx wrapper converts this value as follows:(minrate * 100 / bitrate)
. - 'minrate, maxrate, b end-usage=cbr'
-
(minrate == maxrate == bitrate)
. - 'crf (end-usage=cq, cq-level)'
- 'tune (tune)'
-
- 'psnr (psnr)'
- 'ssim (ssim)'
- 'psnr (psnr)'
- 'quality, deadline (deadline)'
-
- 'best'
-
Use best quality deadline. Poorly named and quite slow, this option should be avoided as it may give worse quality output than good.
- 'good'
-
Use good quality deadline. This is a good trade-off between speed and quality when used with the 'cpu-used' option.
- 'realtime'
-
Use realtime quality deadline.
- 'speed, cpu-used (cpu-used)'
-
Set quality/speed ratio modifier. Higher values speed up the encode at the cost of quality.
- 'nr (noise-sensitivity)'
- 'static-thresh'
-
Set a change threshold on blocks below which they will be skipped by the encoder.
- 'slices (token-parts)'
-
Note that FFmpeg's 'slices' option gives the total number of partitions, while
vpxenc
's 'token-parts' is given aslog2(partitions)
. - 'max-intra-rate'
-
Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0 means unlimited.
- 'force_key_frames'
-
VPX_EFLAG_FORCE_KF
- 'Alternate reference frame related'
-
- 'auto-alt-ref'
-
Enable use of alternate reference frames (2-pass only). Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
- 'arnr-maxframes'
-
Set altref noise reduction max frame count.
- 'arnr-type'
-
Set altref noise reduction filter type: backward, forward, centered.
- 'arnr-strength'
-
Set altref noise reduction filter strength.
- 'rc-lookahead, lag-in-frames (lag-in-frames)'
-
Set number of frames to look ahead for frametype and ratecontrol.
- 'error-resilient'
-
Enable error resiliency features.
- 'sharpness integer'
-
Increase sharpness at the expense of lower PSNR. The valid range is [0, 7].
- 'VP8-specific options'
-
- 'ts-parameters'
-
Sets the temporal scalability configuration using a :-separated list of key=value pairs. For example, to specify temporal scalability parameters with
ffmpeg
:ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\ ts_target_bitrate=250000,500000,1000000:ts_rate_decimator=4,2,1:\ ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
Below is a brief explanation of each of the parameters, please refer to
struct vpx_codec_enc_cfg
invpx/vpx_encoder.h
for more details.- 'ts_number_layers'
-
Number of temporal coding layers.
- 'ts_target_bitrate'
-
Target bitrate for each temporal layer.
- 'ts_rate_decimator'
-
Frame rate decimation factor for each temporal layer.
- 'ts_periodicity'
-
Length of the sequence defining frame temporal layer membership.
- 'ts_layer_id'
-
Template defining the membership of frames to temporal layers.
- 'VP9-specific options'
-
- 'lossless'
-
Enable lossless mode.
- 'tile-columns'
-
Set number of tile columns to use. Note this is given as
log2(tile_columns)
. For example, 8 tile columns would be requested by setting the 'tile-columns' option to 3. - 'tile-rows'
-
Set number of tile rows to use. Note this is given as
log2(tile_rows)
. For example, 4 tile rows would be requested by setting the 'tile-rows' option to 2. - 'frame-parallel'
-
Enable frame parallel decodability features.
- 'aq-mode'
-
Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3: cyclic refresh, 4: equator360).
- 'colorspace color-space'
-
Set input color space. The VP9 bitstream supports signaling the following colorspaces:
- ''rgb' sRGB'
- ''bt709' bt709'
- ''unspecified' unknown'
- ''bt470bg' bt601'
- ''smpte170m' smpte170'
- ''smpte240m' smpte240'
- ''bt2020_ncl' bt2020'
- ''bt709' bt709'
- ''rgb' sRGB'
- 'row-mt boolean'
-
Enable row based multi-threading.
- 'tune-content'
-
Set content type: default (0), screen (1), film (2).
- 'corpus-complexity'
-
Corpus VBR mode is a variant of standard VBR where the complexity distribution midpoint is passed in rather than calculated for a specific clip or chunk.
The valid range is [0, 10000]. 0 (default) uses standard VBR.
- 'enable-tpl boolean'
-
Enable temporal dependency model.
For more information about libvpx see: http://www.webmproject.org/