Skip to content

Is AV1 the future?

March 25, 2023

phenixnuner

When encoding video for home playback instead of streaming the goal is to achieve the best compression and quality in the fastest amount of time. When streaming games file size does not matter as long as a you do not saturate your network bandwidth. While for home use compression is king. I wanted to test what is the best format and encoder to meet these conditions. No AVC (h.264) was included as most video is already encoded in this format to begin with (AVC is commonly stored in the .mp4 container). This test uses handbrake 1.6.0 to test AV1 vs HEVC (h.265) to see if the AV1 is a good future proofing format.

For this testing a scene from the original Ghost in The Shell 1080p Bluray(Specifically the 25th Anniversary Edition) that I obtained from personal copy using Make MKV. For comparison of video quality I used the structural similarity index (SSIM) where 1 is an identical image and 0 is an unrelated image to the reference image. SSIM scores where taken from 4 different parts of the scene which will be shown below.

Screenshot of the “Action Sequence” from the Ghost in the Shell (1995)
Screenshot of the “Cityscape” from the Ghost in the Shell (1995)
Screenshot of the “Film on CRT” from the Ghost in the Shell (1995)
Screenshot of the “Major +Bato” from the Ghost in the Shell (1995)

Below are the settings that where used to test each encoder using Handbrake.

EncoderPresetEncode Type
x265UltrafastConstant Quality
FasterConstant Quality
FasterConstant Quality + Tune:Animation
FasterConstant Quality + Tune:Grain
FasterConstant Quality + Tune:SSIM
MediumConstant Quality
SlowConstant Quality
PlaceboConstant Quality
x265 encoding preset

EncoderPresetEncode Type
Apple Video ToolboxQualityConstant Quality
SpeedConstant Quality
Apple Video Toolbox encoding preset

EncoderPresetEncode Type
NVENCFastestConstant Quality
MediumConstant Quality
SlowestConstant Quality
NVENC encoding preset

EncoderPresetEncode Type
AV112Constant Quality
5Constant Quality
2Constant Quality
AV1 (SVT-AV1) encoding preset

Below you will see charts containing the averaged encoder SSIM values. The closer the value is to 1 the closer the image is to an exact copy of the original video.

PresetSSIM
Ultrafast0.953
Faster0.966
Faster + Tune:Animation0.960
Faster + Tune:Grain0.965
Faster + Tune:SSIM0.966
Medium0.967
Slow0.970
Placebo0.969
x265 average all scene average SSIM values

It is important to point out that moving the x265 preset up doesn’t cause massive changes in quality. Going from ultrafast to faster is quite a big jump in SSIM value but faster to medium has less range than adjusting the encoders tune. Notice that placebo does not beat Slow. People have this idea that increasing the preset increases the quality but it really just takes a longer time to search for the optimal settings which may not lead the a better quality.


PresetSSIM
Quality0.943
Speed0.943
Apple Video Toolbox average all scene average SSIM values

Apple’s encoder appears to be broken in handbrake do not use it or buy a mac to use it.


PresetSSIM
Fastest0.966
Medium0.967
Slowest0.967
NVENC average all scene average SSIM values

For our scene not a big difference between the presets for home use just use Medium or Fastest.


PresetSSIM
120.960
50.969
20.971
AV1 (SVT-AV1) average all scene average SSIM values

AV1 with its 2 settings showed the the best quality of the entire test. It however took forever as you will see the in the test below.


PresetAvg. Encode FpsPercentage of Original (%)
Ultrafast174.412.0
Faster55.219.8
Faster + Tune:Animation52.613.1
Faster + Tune:Grain41.434.4
Faster + Tune:SSIM56.018.4
Medium29.722.0
Slow13.826.4
Placebo1.328.4
x265 encode Speed and Compression

As you see adjusting the preset has a massive impact on encoding rate. Going from faster to medium does not drastically improve the encoding quality or compression but will take twice as long to encode.


PresetAvg. Encode FpsPercentage of Original (%)
Quality114.83.1
Speed114.93.1
Apple Video Toolbox speed and Compression

Once again do not use handbrake to encode using the M1 macs built in GPU. The files look bad probably because they have to low of a bitrate hence the High compression ,but I used constant quality encodes so this is annoying.


PresetAvg. Encode FpsPercentage of Original (%)
Fastest304.131.4
Medium214.231.4
Slowest116.831.4
NVENC speed and Compression

NVENC’s setting just adjust quality but do change compression. NVENC has to worst compression of the whole test. While the encoder is fast it does not provide much compression. In some extreme cases I have found that NVENC does not provide in compression at all. I generally avoid NVENC since my CPU is strong enough to encode but you should consider it if you have a weaker CPU. I would not recommend buying a new GPU for its encoder best to upgrade your CPU.


PresetAvg. Encode FpsPercentage of Original (%)
12261.922.0
56.521.2
20.424.2
AV1 (SVT-AV1) speed and Compression

The compression was middling but the encode times where some of the slowest in this whole test. Preset 5 had quality similar to x265 Slow ,but was half the speed and no where near faster which with tunes is not far off from Slowest. I would recommend AV1 as player support is poor and does not provide any benefits over the much more wildly supported H265 video codec.

Best performance

I created a top five list of best performing encoder. First the encoder setting had to perform above average and then second it must have the highest score consisting of the sum of milliSSIM per second and Megabytes saved per second. This tells us how much quality does the encode gain per second of encoding and how much file size reduction is achieved during the encode duration.

  1. x265 faster Constant Quality using the SSIM tune (Score: 13.17)
  2. x265 faster Constant Quality no tune (Score: 12.84)
  3. x265 faster Constant Quality using the Grain tune (Score: 8.67)
  4. x265 Medium Constant Quality no tune (Score: 6.80)
  5. AV1 (SVT-AV1) 5 Constant Quality (Score: 1.50)

Below is a side by side comparison of our original with the winning codec. I want to say since our metric is in fact SSIM using the SSIM tune is basically cheating however I generally recommend using faster as it gives you the best encode time and image quality.

Action Sequence Original (Left) & x265 faster using SSIM tune (Right)
Cityscape Original (Left) & x265 faster using SSIM tune (Right)
Film on CRT Original (Left) & x265 faster using SSIM tune (Right)
Major+Bato Original (Left) & x265 faster using SSIM tune (Right)

I am not going to show the others as the SSIM scores are relatively similar and the quality is very good for all of them. Below I will show Apple Media Toolbox which had the worst quality to give an idea of the range.

Apple Video Toolbox

Action Sequence Original (Left) & Video Toolbox Quality (Right)
Cityscape Original (Left) & Video Toolbox Quality (Right)
Film on CRT Original (Left) & Video Toolbox Quality (Right)
Major +Bato Original (Left) & Video Toolbox Quality (Right)

Conclusion

I was shocked at how poor AV1 did considering the hype around it. It was able to get the highest encode quality. However, its’ compression was generally around than of h.265 and encode time was much longer. Remember H265 came out in 2013 and AV1 in 2019. AV1 is not even competing with H265 but the new H266(VVC). The real big push for AV1 is that big companies do not have to pay any licensing fees to use the codec. However, the total license fees are capped for HEVC (H265). Also, the big push for that AV1 is better from an open source perspective is nonsense since both handbrake and x265 are open source and open souce encoders exist for h.266.

Notice that increasing the “quality setting” does not lead to drastic increases in SSIM score. This is due to the fact that the “Higher Quality” presets spend more time searching for more optimal ways to store the content which may or may not lead to better quality. I would suggest sticking with faster for x265 if your doing constant quality encode. Also, NVENC had the worse compression and middling quality. If you want to encode video for compression I would suggest a CPU upgrade before GPU. However, if you cannot get near real time on the x265 Ultrafast preset then you should use NVENC as it will give you better quality at a much faster speed. Apple’s video toolbox handbrake integration is bad do not use it. If you have to encode videos on a mac use Apple’s Compressor not Handbrake.

Raw Results

Here is a spreadsheet with my raw results below.

Computers

  • MacBook Pro (13″,M1,2020) 16gb of ram and 512GB running MacOS Monterey
  • Custom Built Desktop with a 3950x
ProcessorAMD 3950x with additional 200Mhz allowed Boosted & Infinity Fabric running at 1867Mhz
OSDebian 11 Bullseye
Graphics CardGigabyte GTX 1070 G1
RamPatriot Viper Gaming PC4-35200 4400MHz running at 3533Mhz
SSDWD – BLACK SN750 (WDBRPG0010BNC-WRSN)
MotherboardAsrock X570 Creator
CoolerIce Gaint ProSiphon Elite
This system has been tuned and overclocked

Benchmarks

To compare how your computer would run these task I attaching a few benchmarks

Geekbench 5

ComputerScore
Custom Desktop
-Single Core1418
-Multi-core16677
M1 Macbook Pro
-Single Core1063
-Multi-core4303

Phoronix Test Suite 10.8.4

TestResult FPS
SVT-AV1 Preset 4 Bosphorus 4K3.229
SVT-AV1 Preset 4 Bosphorus 1080p7.649
x265 Bosphorus 4K23.36
x265 Bosphorus 1080p43.87
You can use then ratio between your computers results for this test to estimate your own computers performance

Phoronix test suite is a free and open source cross platform application that can be used to benchmark computers.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: