-
Notifications
You must be signed in to change notification settings - Fork 78
FrameRate Changes, Implement CFR and estimated buffer framerate #190
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
Conversation
this sets the framerate toggle to a propeer CFR, and implements buffrate for encoder hinting buffrate is used to preserve VFR on encoders that require a framerate cap or target framerate (IE encoders without proper VFR support). it can also be used as a soft fps cap, but unless set at an integer value of the display, it may provide poor results
|
Hi, thank you for working on this, but I think the docs need to be clarified. Even I am not sure what buffrate is, and what framerate is (basically, what is the difference between -B and -r)? When would I use the one, when the other? |
|
Ill amend this to be clear when I get the chance, but buffrate sets the buffer input device's framerate, where as framerate uses the fps frame filter to set framerate, the reason for the distinction is that when we set the buffer device framerate, you use the video buffer video filter, which in ffmpeg more or less acts as a video source device. so what we are doing is telling ffmpeg the framerate to expect as the input stream. this is not a hard framerate, but rather a maximum framerate to expect, this lets it work as a framerate cap so to speak. this means that ffmpeg should never encode more FPS then the buffrate, it also however does still allow sending lower FPS then the buffer is set to, hence preserving VFR while setting a cap on the framerate. this is necessary since there are numerous encoders and I think even a muxer or two that need this information to work properly. (in my testing I primarily used SVT-AV1). Framerate on the other hand uses the ffmpeg fps filter to set a constant framerate, this works in most cases by duplicating frames until the fps target is hit, this is necessary for a lot of users as VFR is relatively unsupported in a lot of applications. (some video editors, and even some video sharing applications do not work with VFR videos) I originally thought to leave Framerate to mean the buffer rate, but I think most users would expect framerate to be equal to CFR as this is what most other software does (from video editors, to handbrake). although this could be done by the user manually specifing the fps filter, I believe it would be best if this had its own toggle for the user's experience. I also thought about renaming buffrate to max FPS to hint towards the implicated use of using it to preserve VFR. however I am not sure that all encoders will play nice with that. |
ammen99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the clarification!
|
Sorry for the super late update, I won't lie I completely forgot about this. I changed the docs to be more clear, also instead of suggesting that buffrate might work as a softcap for fps. that seems rather inconsistent so I left it out |
this sets the framerate toggle to a proper CFR, and implements buffrate for encoder hinting
buffrate is used to preserve VFR on encoders that require a framerate cap or target framerate (IE encoders without proper VFR support). it can also be used as a soft fps cap, but unless set at an integer value of the display, it may provide poor results.