Written by Julian Pössnicker on April 2022
This is a short follow-up blog post on my “Guide for YouTube HDR delivery” part 3 which describes the encoding process with the AV1 codec in FFmpeg.
The AV1 codec is a new codec for encoding high-quality videos. This codec increases the quality of the video with the same size or reduces its size while maintaining the quality in comparison to vp9. It is also supported by YouTube and can therefore also be used to upload the videos. If the YouTube website option is enabled the uploaded AV1 encoded video could be also used for displaying the content.
One of the drawbacks is the encoding time of FFmpeg’s libaom encoder. Depending on the video resolution one frame took nearly 10 seconds to encode. With its new supported SVT-AV1 encoder developed by Intel the encoding times are much faster. The new settings for AV1 encoding are:
ffmpeg -i input.mov -c:v libsvtav1 -b:v 70M -colorspace bt2020nc -color_trc smpte2084 -color_primaries bt2020 output.webm
If the video is encoded with 10bits each channel, FFmpeg should default to a 10bit 4:2:0 subsampling. When ” -pix_fmt yuv420p10le” is added it forces FFmpeg to encode to a 10bit stream if necessary. For more control over the encoding quality, a ” -crf” value can be added. The values range between 0-63. The smaller the value, the higher the quality. The rendering time as well as the resulting file size increases.
The following video shows an HDR AV1 upload with the same setting as above and with a crf value of 2.
For comparison, the following video is encoded with vp9 and the same settings as in the “guide for YouTube HDR delivery”.
The new AV1 codec is a good option for high-quality video uploads with a small file size compared to intermediate codecs such as ProRes or DNxHR. It is also possible to include the right metadata. The encoding to a 10bit signal is possible. This makes it more flexible than the h264 codec which can only go up to 10bits in only a few programs. AV1 also should be more efficient than h264 and vp9.
AV1 ffmpeg h264 HDR HDR10 high dynamic range Metadata Upload VP9 YouTube