-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils/frame_queue: add PTS drift compensation
By default, allows for correcting drift/jitter of up to 1 ms per frame, in line with expected jitter from e.g. Matroska sources. This is enough to cover the mismatch between 23.976 Hz and 24.000 Hz, but not the mismatch between 24 and 25 Hz (which is just over 1ms per frame). There are two use cases in which this code will be useful: 1. Displaying 23.976 Hz video files on e.g. 60.000 Hz monitor (or any other near-miss), in display-timed mode. Given the usual 3:2 cadence, after five vsyncs (three source frames), we will have: Vsync (wallclock) PTS = 83.33333333333334 Frame PTS = 83.41675008341676 This is a difference of 0.1ms, and will therefore be fixed by this code, adjusting all future wallclock PTS up by the cumulative drift (0.1ms). 2. Displaying any video with some amount of jitter on the PTS measurements. This avoids some situation where we have frames with weights 0.999 and 0.001 for example. Normally this should get rounded away by the frame mixing code anyway, but it's better to have an exact match.
- Loading branch information
Showing
5 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters