-
Notifications
You must be signed in to change notification settings - Fork 248
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
fix(359): Support fractional fps. #364
base: main
Are you sure you want to change the base?
Conversation
The code looks fine. I'll run it on a large conversion job and check drift values to confirm we are fixing the right behavior I've seen. |
Based on early testing, I think this needs to be revisited. I already spoke to the submitter about this privately. Highlight: Video duration is 10 seconds more for a 34 seconds video (if we trust the master's number). This is 33%+ longer. Does it make sense? Below is some evidence collected on a small capture that I can share privately. Little performance impact, most likely attributable to duration. Original:
with PR:
larger file size (it's longer):
ffprobe on result with PR:
ffprobe on result with master:
Packet(frame?) count, original:
with PR:
|
As discussed offline, I think we need to fully revisit how to calculate FPS/insert still frames. As a starting point, we can know the expected wallclock duration of the recording based on the first PDU time and last PDU time. From there, it should be easy to calculate the total number of frames and make sure that they are dispersed evenly through the recording. Then PDUs should be snapped to the nearest(?) frame. I'll probably abandon this or push significant changes when I have a chance. |
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.
Marking this clearly has "needing changes" to avoid accidental merge.
This pull request fixes #359
I've done two things:
I'm not sure if the drift was a real issue though since we only updated the previous timestamp whenever at least one frame was rendered. In other words, if the timestamp between 2 PDUs is smaller than the frame rate delta, we would just let the delta increase until we've gone past the next integer frame, then render the screen at the current PDU.
The only thing that might happen is that at low frame rates, some information is lost because the screen changes faster than our frame rate can observe. RDP doesn't really have a concept of framerate, updates are sent as they happen, so it's difficult to map it to a constant frame rate.