View Single Post
Old 11th September 2018, 05:19   #32  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by mp3dom View Post
It happens even with level 4.0 and bitrate 25Mbps with 1 slice... but I think to have a little understood the culprit.
The problem appears only with VBV for a basic reason: given the maximum bitrate to be 40 Mbps and focusing on the last second only (where the scene change and the problem appear), the scene-change is at about 3/4 of that second. Previous scene (18 frames length) is bitrate hungry (crf-7 eats about 100 Mbps without VBV) while the remaining 6 frames (where the problem appears) is less demanding (crf-7 eats 40 Mbps without VBV), so x264 allocate the most of the bitrate to the hungry scene leaving not enough bitrate to encode the last 6 frames efficiently. The QPs on the grainy scene are near 15, while on the other scene are near 12. After that second, the scene "regain" its bitrate because the 40 Mbps are now spread across the same kind of scene, and not a new (totally different) one and the average qp is lowered to about 6. I guess adding grain to those 6 frames makes some difference mainly because I just "force" x264 to lower the quality on the grainy scene and give some more bitrate to the gradient scene.
Sounds like a job for two-pass encoding!
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote