-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: Smaller IDR interval results in x2 increase in file size #493
Comments
What is whole set of AMF parameters you use? |
Here:
|
Few things to start with:
|
Ehm... Did you just set both min and max qp to 0 with this? Meaning it is forced to not do compression neither below, nor above CQP 0. Also... Why would you even decided to constrain QP for CBR encode? Isn't it directly opposite of what CBR supposed to represent? QP constraint has priority over bitrate management. Meaning that with min/max QP set your CBR encode will actually not be CBR. |
I set QP to zero because I am not intending to use QP mode. I am using CBR. So these params are not supposed to impact the encoder at all. At least that's how it works in NVENC. That's also why I set the pick bitrate same as the target as I need it to be constant no matter what.
This assumption is wrong. I decide to use CBR mode because I want the quality to be dictated by the bitrate. If I wanted it to be based on the QP I would use QP mode. |
Sorry, Github was down, so i was forced to wait a bit. It seems like you have some misunderstanding, AMF is not NVENC and that is not how it works with AMF. Frankly speaking NVENC also should work this way, and if it doesn't, then i have questions myself. QP is just "compression level" with extra steps. It doesn't matter if you use CQP or CBR, in the end compression is represented via QP. And in AMF min/max QP are not guidelines for bitrate that tell encoder to not use QP, but instead enforcing limiters that tell encoder what range of compression levels it can choose from. For example, those can be used in cases when you want quality to be at least on X level no matter what and how much bitrate it will take. By default MIN_QP is 0 and MAX_QP is 51. CQP uses it's own parameter set, which is basically either single QP value for IPB frames, or 3 different QP values for I:P:B (or 2 for I:P, depends on codec). And CQP mode actually disables min/max QP parameters, so it could potentially use different QP values for I:P:B frames. What do you think these parameters are meant for if they are "supposed" to be used with CQP? CQP is constant by description, and there is no place for min/max range. And CQP is only QP rate control besides QVBR (which, coincidentally is also controlled by QP option, even if separate from CQP, inverted and also ignores target bitrate). QVBR, on other hand does not ignore limits enforced by min/max QP. Easy proof that QP is hard limiter, rather than guideline (also don't mind this --max-bitrate 800000, it was done just for purity of test): Command (CBR with restricted QP):
As you can see, encoder just cannot compress anything below specific QP mark. Command (Set QP_MAX to 8): Output:
From here you can see that encoder tries to follow set bitrate, but that MAX_QP 8 hard limits it from doing so forcing it to encode everything at QP 8 as it is highest encoder allowed to do. Command (Just CBR. I only removed min/max QP): Output:
Hmm... I also now know that there is another intenal limiter to how shallow QP can be for bitrate constraining methods, it seems. (QP 4 is limit, for CQP limit is QP 1). Never experimented with this beforehand. TIL.
Will say though this is one is weird. Can provide samples of said source and encoded video? |
What do you mean by "Command (Just CBR. I only removed min/max QP)" ? Remove - means set to defaults? I grabbed Libx264 to verify your statement regarding the QP params impact in CBR mode and yes, you're right, I am getting even worse compression than on AMF with min/max QP set to 0. Default QP - 1500kb , Zero QP - 9433Kb. I will try to set the Max QP to 51 and see what we get. And thanks for the clarification on the QP purpose. |
Yes, i just removed those arguments from command, meaning they weren't passed, so they were automatically set to defaults.
And that's because either VCEEnc or AMF has additional inernal limit on MIN_QP option which does not allow you to do less than QP 4. Unless you do CQP, then QP 1 is very much possible. |
Changed maxQP to 51, the file size is back to normal. Thanks for the assistance guys. |
Hello.
I changed the IDR frame insertion rate so that instead of every 30th frame,I insert every 5th. The output video video size jumped from 7mb to 17 mb. I am comparing the results to the Nvidia encoder, same IDR interval, same bitrate and same resolution. Nvidia encoded file size increased maybe 0.05%.
Here are the parameters I work with:
My question is - how to reduce the file size when IDR frames are inserted more frequently? Should I use a different quality preset?
The text was updated successfully, but these errors were encountered: