Target VMAF
The "Target VMAF" feature has a really simple goal, instead of guessing what the CQ value of your encoder will give you in regards to the resulting quality, we set the VMAF score we want to achieve and let the algorithm get the closest CQ value that will result in that score, for each split segment. Which simultaneously achieve 3 things, if compared to usual, single value CQ encode.
- Ensure that complex scenes receive more bit rate to achieve target quality.
- Increase quantizer value for simple scenes, and not going lower than target quality, and save bit rate.
- Yields a lower total bit rate.
From my testing, result size can be 50-80% of compared to usual encode, with great visual quality.
VMAF plotting
Plot contains VMAF score for each individual frame.
Plotting after encode will be performed if flag --vmaf
set, or --vmaf_target
is used.
The plot legend display Mean Average, Lower 1, 25, 75 percentile, which in combination with plot should be insightful enough for judging the quality of the encode instead of a single vmaf value for the whole video.
Example
This is a plot of the encode that was using Target VMAF 96 (don't mind nan in mean, it's fixed at time of this post, but i don't want to reencode:) )
The 1 percentile you can see on this plot shows the likely VMAF score of complex scenes, which usually involves a lot of movement, changes in perspective, zooming in and out and change in video context on every frame.
Usage
To try simply run your default constant quality encoding with --vmaf_target N
, where N is VMAF score you try to achieve, i suggest something in 90-96 area.
--vmaf_target
sets the VMAF score that Av1an will aim for.
--min_cq
- sets the lower boundary for the VMAF probes and limit the minimum cq value at which the video can be encoded. Default is 25.
--max_cq
sets the upper boundary for the VMAF probes and limit the maximum cq value at which the video can be encoded. Default is 50.
--vmaf_steps
- sets the number of probes that are used to get the best CQ value for the target VMAF. Default value is 4. If min-cq
, max_cq
are changed that distance between them increase - make sure to set steps that there is a probe for every ~5 CQ of distance
For more information about previous target VMAF refer to 1.8 release. This is evolution upon that method.
Also need to mention that Target VMAF currently only for reference AV1 encoder
Vmaf Plotting as separate package
VMAF plotting is available as separate package, and only needs VMAF's or ffmpeg's libvmaf result xml file to work.
GITHUB_REPO
Extra splits
-xs
, --extra_splits
will add cuts for every N frames on splits that are longer than N, and spread cuts evenly, intelligently.
This option help split big scenes or files that are long single scene, like camera recording, into splits that paralleled better.
For example:
--extra_splits 400
For a split that goes from frame 14000 to 14900, the distance between cuts is 900, 900/400= 2.25 which rounds to 2.
Av1an will try to find 2 key frames that are closer to frame 14300 and 14600 and place the splits there.
Another split from 0 to 500, Av1an will find key frame closer to 250 and place cut there.
Splits that have less than 400 frames are not affected.