Lately, I’m looking for video codecs. Just because I’m on Linux and ffmpeg VAAPI HEVC somehow generated wrong output.
It can’t handle scaling correctly, then rest these green bar on my output: LizardByte/Sunshine#4314. That’s the beginning.

Background of AV1

The AV1 video coding format was released in 2019 and is becoming more and more common on internet video streaming platforms. Small size and high quality are best for the internet.
That’s how my hardware video accelerator zero load when watching youtube, AMD RX 5700 is strong enough, but kind of old :)

Available Software Codecs

Like OpenH264 and x264, AV1 now have two major software codec: AOM-AV1 and SVT-AV1.

AOM-AV1 is developed by AOMedia(‘A’ in AV1) themselves, but… a little slow. Not the best first impression.

SVT-AV1 is second, developed by Intel and Netflix in 2020. It faster and design for serious applications.

Bitrate Control

In the past, I only know the CBR(constant) and VBR(variable) methods to adjust output size.
But instead, you can use CRF(Constant Rate Factor) to keep image quality across the video, and reduce/increase bitrate on the fly.

Unlike bitrate, CRF is completely defined by codec. If codec say it can be INT_MAX that still correct.

In SVT-AV1, 35 is the default on ffmpeg. The number is more smaller, quality and size are larger.
You may want to try it at around 30 to start. There is a incredible article of this topic:

Comparing SVT-AV1 Presets: Size, Quality, and Speed with CRF Variations

Preset

The second thing after bitrate is preset, which controls how hard to encode/decode the video could be.
You can also see the graphic table about performance in the previous link.

Perceptual Video Evaluation

To evaluate how good a transcoded video and original video are, a method is calculate signal to noise ratio: PSNR. But it can’t perfectly reflect human feel.
Another option is VMAF, developed by Netflix. I would say it more considers how humans perceive video and uses machine-learning for some parts of the algorithm. It’s cool, and accurate.

You can find them implementation at GitHub: Netflix/vmaf
Or download it from your distro repo.

This article knows more and more than me: Making Sense of PSNR, SSIM, VMAF

Can that stuff fix my hardware encoding issue?

Can not.
But set the output resolution as same as my screen resolution can prevent scaling. I think which is the most useful part of these days, haha.