fraunhoferhhi / vvenc

VVenC, the Fraunhofer Versatile Video Encoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
965 stars 173 forks source link

Rate control destroys quality towards end of video #82

Closed alexander-g2 closed 3 years ago

alexander-g2 commented 3 years ago

Version: 1.1.0

Settings: vvencapp -s 1920×800 -r 24 -c yuv420 --preset faster --internal-bitdepth 8 -ip 128 -b 1000000 -i input.yuv -o VVC.266

Video: Tears of Steel

File (can't append here): https://drive.google.com/file/d/1VyfTHq3nw0L6f1vwNE47MSFmGp2YMcBM/view?usp=sharing

The problem starts at 11:50. The quantizer increases to 63 (from around 30 normal). Quality recovers after ~10 seconds.

https://user-images.githubusercontent.com/60253802/129493757-ba493714-9538-4644-8c04-bee50dcaacba.mp4

This is also right after the credits. My guess is that the encoder expected an easy to compress last 20 seconds, then drastically lowered quality after realizing bitrate was going to go over budget. Final bitrate is 997.7 kbps.

adamjw24 commented 3 years ago

Thanks for reporting. We'll have look.

alexander-g2 commented 3 years ago

And thanks for looking into it. Another minor thing I noticed today was a small typo in vvencFFapp. The description of --ForceDecodeBitstream1 has really misspelled as realy. https://github.com/fraunhoferhhi/vvenc/search?q=realy

adamjw24 commented 3 years ago

See 19014cb. The other thing will probably take longer to resolve.

crhelmrich commented 3 years ago

Thanks, alexander-g2! To isolate the problem more precisely: can you please check whether the problem also occurs if you use -ip 64 instead of -ip 128?

Thanks,

Christian

alexander-g2 commented 3 years ago

To isolate the problem more precisely: can you please check whether the problem also occurs if you use -ip 64 instead of -ip 128?

It does. Frames 16000-16400 are QP ~40. Frames 16800-16900 are QP ~30 and frame 17000 is QP 17. So rate control actually decreases QP during the credits. After that, QP increases and hits 63 at frame 17129.

I copied the output from the console: rc_issue.txt

alexander-g2 commented 3 years ago

85 solved my problem. Thanks for taking care of the issue so swiftly!