-
Notifications
You must be signed in to change notification settings - Fork 19
bug: Adjust encoder frame rate based on max_fps(/src/main.rs) #142
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
base: main
Are you sure you want to change the base?
Conversation
Set encoder frame rate based on max_fps argument if provided.
|
currnet recording quality current.mp4modified recording quality output.mp4Tested on: fedora43 linux + sway + 540hz fixed display refresh rate |
russelltg
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.
I'm somewhat surprised that this affects quality at all, but a good find regardless.
src/main.rs
Outdated
| enc.set_frame_rate(Some(framerate)); | ||
|
|
||
| let encoder_framerate = if let Some(max_fps) = args.max_fps { | ||
| Rational(max_fps as i32, 1) |
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.
This will handle fractional framerates poorly, and also it should prob be min(max_fps, display_framerate) yeah?
Better handle fractional framerate. Select min(max_fps, framerate) as encoder framerate.
russelltg
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.
sorry i wasn't clearer about exactly how i wanted this done
pilot-whale
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.
Sorry,I did not get you clearly earlier.
Co-authored-by: Russell Greene <[email protected]>
Set encoder frame rate based on max_fps argument if provided.
Problem: The video encoder always uses the display refresh rate as its own framerate, while the
--max_fpsargument only reduces the number of frames sent to the encoder. This mismatch results in blurry frames, particularly when the--max_fpsis significantly lower than the display refresh rate.Tested on: fedora43 linux + sway
Let me know if anything needs to be adjusted.