Repository navigation
feat(timing): SPS VUI frame rate and VFR-aware seeking - #62
Merged
Merged
Conversation
- for raw Annex B streams override FFmpeg's guessed frame rate with the SPS VUI timing (H.264 time_scale/(2*num_units_in_tick), H.265 time_scale/num_units_in_tick) - build a per-frame PTS table from container packets on the first seek and use it for SeekByContainer, so variable-frame-rate content lands on the requested frame instead of an index/fps estimate - fall back to the previous estimate when the table is unavailable - add a VUI frame-rate parsing test Fixes #10
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10.
VUI frame rate for raw streams
MainWindownow overrides the decoder's guessed frame rate for raw Annex B streams with the SPS VUI timing:time_scale / (2 * num_units_in_tick)vui_time_scale / vui_num_units_in_tickThis affects playback pacing, the Time display mode and audio sync.
VFR-aware seeking
FFmpegDecoder::BuildFramePts()performs one demux-only pass over container packets and records each packet PTS in seconds (decode order).SeekByContainer()usesframe_pts[target_index]instead of theindex / fpsestimate, then falls back to the old formula if the table is missing or too short.Trade-offs:
stts/cttsinmp4indexTests
H264ParamsTest.ParsesVuiFrameRatectest: 69/69 passtidy.shon the touched files: 0 issuesFixes #10