Target Quality

NameFlagTypeDefault
Target Metric--target-metricTARGET_METRICvmaf
Target Quality--target-qualityFloat
Probes--probesInteger4
Probe Resolution--probe-resString
Probing Rate--probing-rateInteger1
Probing Speed--probing-speedPROBING_SPEED
Probing Statistic--probing-statStringpercentile=1
Probe Slow--probe-slow
Minimum Quantizer--min-qIntegerBased on Encoder
Maximum Quantizer--max-qIntegerBased on Encoder

Target Metric --target-metric

Metric used for Target Quality.

Possible Values

Can be any of the following:

Default

If not specified, vmaf is used.

Examples

  • > av1an -i input.mkv -o output.mkv --target-quality 95 - Target a VMAF score of 95
  • > av1an -i input.mkv -o output.mkv --target-metric ssimulacra2 --target-quality 80 - Target a SSIMULACRA2 score of 80
  • > av1an -i input.mkv -o output.mkv --target-metric butteraugli-3 --target-quality 2 - Target a Butteraugli 3-Norm score of 2
  • > av1an -i input.mkv -o output.mkv --target-metric xpsnr-weighted --target-quality 40 - Target a Weighted XPSNR score of 40

Target Quality --target-quality

Target a metric quality score using the specified --target-metric or VMAF by default. This is the score for encoding.

For each chunk, Target Quality searches for the quantizer/crf needed to achieve a certain metric score. Target Quality mode is much slower than normal encoding, but can improve the consistency of quality in some cases.

Metric score ranges:

  • VMAF and SSIMULACRA2 - 0 as the worst quality, and 100 as the best quality
  • butteraugli("butteraugli-inf" and "butteraugli-3") - 0 as the best quality and increases as quality decreases towards infinity.
  • XPSNR("xpsnr" and "xpsnr-weighted") - 0 as the worst quality and increases as quality increases towards infinity.

Possible Values

Any float value for the specified --target-metric:

  • "vmaf" - 0-100, where 0 is the worst quality and 100 is the best
  • "ssimulacra2" - 0-100, where 0 is the worst quality and 100 is the best
  • "butteraugli-inf" - 0 to any positive value, where 0 is the best quality and increases as quality decreases
  • "butteraugli-3" - 0 to any positive value, where 0 is the best quality and increases as quality decreases
  • "xpsnr" - 0 to any positive value, where 0 is the worst quality, and increases as quality increases
  • "xpsnr-weighted" - 0 to any positive value, where 0 is the worst quality, and increases as quality increases

Examples

  • > av1an -i input.mkv -o output.mkv --target-quality 80 - Target a VMAF score of 80
  • > av1an -i input.mkv -o output.mkv --target-quality 90.5 - Target a VMAF score of 90.5
  • > av1an -i input.mkv -o output.mkv --target-metric ssimulacra2 --target-quality 75 - Target a SSIMULACRA2 score of 75
  • > av1an -i input.mkv -o output.mkv --target-metric butteraugli-inf --target-quality 5.4 - Target a Butteraugli Infinite-Norm score of 5.4
  • > av1an -i input.mkv -o output.mkv --target-metric butteraugli-3 --target-quality 1.5 - Target a Butteraugli 3-Norm score of 1.5
  • > av1an -i input.mkv -o output.mkv --target-metric xpsnr --target-quality 50 - Target a XPSNR score of 40
  • > av1an -i input.mkv -o output.mkv --target-metric xpsnr-weighted --target-quality 40 - Target a Weighted XPSNR score of 40

Probes --probes

Maximum number of probes allowed for Target Quality.

Possible Values

Can be any positive integer.

Default

If not specified, 4 is used.

Probing Rate --probing-rate

Framerate for probes.

Possible Values

Can be any integer from 1 to 4.

Default

If not specified, 1 is used.

Probe Resolution --probe-res

Resolution used for Target Quality probe calculation.

Possible Values

Can be a string in the format of widthxheight where width and height are positive integers.

Default

If not specified, the input resolution is used.

Probing Speed --probing-speed

Speed for probes.

If used with --probe-slow, it overrides the respective speed parameter (eg. --cpu-used, --preset, etc.)

Possible Values

Can be any of the following:

  • veryslow
  • slow
  • medium
  • fast
  • veryfast

Default

If not specified, veryfast is used unless --probe-slow is specified.

Probing Statistic --probing-stat

Statistical method for calculating target quality from sorted probe results.

Possible Values

Can be any of the following:

  • auto - Automatically choose the best method based on the target metric, the probing speed, and the quantizer
  • mean - Arithmetic mean (average)
  • median - Middle value
  • harmonic - Harmonic mean (emphasizes lower scores)
  • root-mean-square - Root mean square (quadratic mean)
  • percentile=<FLOAT> - Percentile of a specified <FLOAT> value, where <FLOAT> is a value between 0.0 and 100.0
  • standard-deviation=<FLOAT> - Standard deviation distance from mean (σ) clamped by the minimum and maximum probe scores of a specified <FLOAT> value, where <FLOAT> can be a positive or negative value
  • mode - Most common integer-rounded value
  • minimum - Lowest value
  • maximum - Highest value

Default

If not specified, auto is used.

Examples

  • > av1an -i input.mkv -o output.mkv --target-quality 80 --probing-statistic mean - Target a VMAF score of 80 using the mean statistic
  • > av1an -i input.mkv -o output.mkv --target-quality 95 --probing-statistic percentile-25 - Target a VMAF score of 95 using the 25th percentile statistic
  • > av1an -i input.mkv -o output.mkv --target-quality 90 --probing-statistic standard-deviation--0.8 - Target a VMAF score of 90 using the value that is 0.8 standard deviations below the mean
  • > av1an -i input.mkv -o output.mkv --target-quality 75 --probing-statistic standard-deviation-2 - Target a VMAF score of 75 using the value that is 2 standard deviations above the mean.

Probe Slow --probe-slow

Use encoding settings for probes specified by --video-params rather than faster, less accurate settings.

Note that this always performs encoding in one-pass mode, regardless of --passes.

Minimum Quantizer --min-q

Lower bound for Target Quality Quantizer-search early exit.

If the minimum quantizer is tested and the probe's quality score is lower than the Target Quality (--target-quality), the Quantizer-search exits early and the minimum quantizer is used for the chunk.

Possible Values

Depends on the encoder.

Default

If not specified, the default value is used (chosen per encoder).

Maximum Quantizer --max-q

Upper bound for Target Quality Quantizer-search early exit.

If the maximum quantizer is tested and the probe's quality score is higher than the Target Quality (--target-quality), the Quantizer-search exits early and the maximum quantizer is used for the chunk.

Possible Values

Depends on the encoder.

Default

If not specified, the default value is used (chosen per encoder).