fraunhoferhhi/vvenc

First One Second Of VVC Encoding Is Lower Quality?

JohnTravolski opened this issue · 4 comments

I have been testing vvc/libvvenc in ffmpeg as a long term archival format. I have been using this build:

(release-6.0n-patch6, using this build https://www.chosenfewsoftware.com/projects/ffmpeg-vvc/)

I have been using ffmetrics to plot the PSNR and SSIM values of the encoded file compared to the lossless original file over time (these video files are rendered 3D animations [8 bits per channel, RGB], so the source is a PNG sequence and is truly lossless). The command I have been using to encode is the following:

ffmpeg -i "{input}" -y -c:v libvvenc -preset medium -vvenc-params bitrate=320M "{output}"

I noticed there there is always a big jump in the PSNR or SSIM values around the one second mark of the video. Here are examples for two different videos:

image

image

The green line is vvc, with prores (red) and libx265 (yellow) codecs as a comparison. Notice how around the 60th frame, there is a big jump in the PSNR value for vvc (the content is 60fps). The SSIM value does the same thing.

Is this expected behavior? Why does this happen? Is there a parameter to prevent this and keep the quality more consistent between frames?

Hi there,

it looks like you are running VVenC in rate control mode. What you seeing is a tune-in behavior. At such super high rates (is this UHD? if so, computer generated animation should not require more than 50mbps for great quality) our QP estimation undershoots a bit apparently. It is intended, since it is much easier to compensate up than down (the latter leads to heavy artifacts). Also, does it really matter if your PSNR is 50 instead of 53 for a second? Both are visually lossless for 8 bit content. After one second rate control adapts and keeps the quality throughout the rest of the encoding (my guess is that the produced file is still well below 320mbps).

So why does this not happen to x265? If I understand correctly, you are running it CRF mode, which basically is constant QP +-perceptual adaptations. Thats why they are not doing QP corrections, because the encoding doesn't have target rate set. You could do similar configuration with VVenC by setting target QP rather than rate (something around 10? you'd have to give it a try).

Last but not least, it looks like you are using a key-frame distance of 4 seconds for x265, did you align that for VVenC? If I were to guess from the plots, you left it at default 1 second.

@adamjw24 , thanks, this is helpful.

  • This is 4K 60fps content.
  • Some animations are much more intricate and detailed than others, so I used a very high bitrate as a catchall since I'm intending to use this as an archival format for thousands of animations.
  • Yes, I was using CRF mode for libx265. I will try your suggestion for vvenc.
  • I am not sure what the key-frame distance is in the ffmpeg patch I used, but it is unchanged from default, as should be clear given it is not specified in the command I used.

Interesting. Using a new build of ffmpeg with the latest patches, I no longer observe this behavior.

Glad to hear, RC is being worked on very heavily atm. I'm closing for now.