AMD AV1 worse than VP9? (actually better)

Here I’m transcoding videos from h.264 → {VP9, aomav1, va-av1}
The va-av1 is hardware accelerated with my 9070.
The rest are cpu.

Here is the same graph but logarithmic axes to help with visibility on the smaller values.

As you can see the va-av1 encoder produces larger files at the same visual fidelity. It is worse at compression compared to a cpu-based VP9.


I always thought that hardware encoding would be ~10% worse, not this bad.

Hopefully I’m wrong and I can get the almost aomav1 file size with 100x speed of the hardware encoder.

Hardware encoding is FAST, not good. If you want a “proper” file, use CPU. If you want it on the fly, in embedded systems or systems with no CPU to speak of or fast in general, GPU encoding “ASIC” is the way to go but you have to limit yourself to not always optimal presets.

4 Likes

I’ve tried to do some hw transcodes to h264 and h265 and av1 on 7900xtx and pretty much gave up immediately.

I dint note down the details, but there were absurd results from seemingly optimal presets in handbrake , like h265 transcode larger and worse looking than original h264.

FAST and LIMITED properties of hw accelerated encoding is pretty succinct observation, whats worse it lack of good documentation and limitations differ across generations and vendors.

Some specific profiles worked without obvious issues, but quality was not good enough for my use. Good enough for streaming, which is probably the primary use case here.

3 Likes

I found 2 parameters that seem to dramatically improve the situation.
Gotta do more testing though.

Good news everyone, good news!


(I didn’t re-compute the datapoints under 100MB, that’s why no log scale)

  1. There is a thing called gop_size that controls how often a frame is recomputed from zero. I don’t care about scrubbing performance, so I just set it at -g:v 10000000

  2. Compression level! -compression_level:v 29

1 Like

So how does this compare now versus CPU encoding? I have always used my Threadripper to do CPU encoding, and I only use GPU encoding for gathering game clips quickly, or if I had to stream something.

1 Like

It’s about 11% worse on average on the videos I tested.

If you look at the last picture I uploaded, the red rhombus is CPU, while the blue cross is GPU. GPU is consistently worse, but really close.

For my usecase GPU saves 99% of time and costs ~10% filesize. Sounds like a great trade.

2 Likes

Honestly, that’s not bad and definitely will work on most use cases.

For me, I mostly transcode for long-term storage or sharing… So file size is important.

1 Like

Hmm, that’s very interesting.

I’m doing transcoding for the exact same reason!

How do you go about it?
Did you find some good enough parameters for ffmpeg and use those, or are you tuning them per video based on some metric?

Also how do you handle videos that need months to re-encode on cpu? VMs with save state?

1 Like

I use Handbrake and I have different options based on the TYPE of video I am transcoding. I do some testing on the quality and make sure that the quality is as “lossless” as I can notice when watching on my 32" 4K Photo monitor’s. So if I cannot notice any artifacts during high stress times of the videos, then I deem it to be fine (and if color is not affected at all).
So it takes me a few runs to optimize the settings for each type of content and then I set it and forget it. However I transcode with CPU using my Threadripper 3960x… I can give it 6-8 cores and just leave it for a week if I have to transcoding everything I need until its done.
Doing this I cut the size of my video library by atleast half and I couldn’t tell the difference no matter which source I watched on.

I haven’t found any video that takes longer than 1 day to re-encode even with CPU. The slowest encoding I have ever encountered (where quality still mattered) was 3FPS on my system. However usually I can encode at 8-18fps and 32-40 fps in 720p (which lots of older Cartoons and such are in)… I get 20-30fps in 1080p usually with my settings. 8-18 is 4K with higher bit rates.

1 Like

You should be able to get a bit more out of the encoder with preanalysis settings tuned. pacaqstrength set to high gives maximum compression efficiency and using pataqmode 1 for transcodes or 2 for recording with both using a lookaheadbufferdepth of 11 should give good results. For recording you can leave scene change detection disabled, but for transcoding enable it.

Handbrake, being what it is you can really push the encoder hard with it taking so much data into account with the correct parameters if you do not care about speed at all.

The AMF documentation is an amazing resource for getting the most out of the encoder, but it is a really boring read.

1 Like

I haven’t ever used those specific settings, unless they correspond to the UI.
I have lots of settings in the UI and I can share my configs here if people would like.

1 Like