Replace aom-av1 with svt-av1 for saving webm videos, use preset 6 + yuv420p10le pixel format #7736
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
adds support for saving .webm outputs using codec svt-av1 and adds an options for using yuv420p10le pixel formatswitches aom-av1 codec for svt-av1 + yuv420p10le pixel format.svt-av1 is significantly faster at encoding compared to libaom-av1 and yuv420p10le provides higher quality av1 output without size increase.
Note: av added support for libsvtav1 in v14.1.0, the requirements.txt are upped to reflect this.
Comparison
before (5d0d4ee)
Took 407s to save an 81 frame wan webm using libaom-av1, crf 10.
1.8MB, VMAF 96.9885 vs an animated png output.
pr code with svt-av1 & yuv420p10le selected
Took 1s with libsvtav1 (preset 6, crf 10).
2.3MB, VMAF 97.23115 (note pixel format provides better quality vs aom at yuv420)
preset time & quality
I've set preset 6 for svt-av1, would be straightforward to make this configurable (perhaps later).
vs webp
Result is ~2.3MB vs ~6MB .webp using slowest/quality:90, webp also having visibly lower quality.
Implementation notes
I tried to make this non-breaking so any existing usage of av1 will continue to use aom-av1 + yuv420. However, I would recommend always using svt-av1 and yuv420p10le for any CPU-encoding scenario (which seem best for short videos like this as they are better quality than gpu encoding). So perhaps the aom-av1 option should be phased out or somehow discouraged in future. Maybe renamed "aom-av1 (slow)" or something?