Repository navigation
fix(demux): repair HEVC MP4s without composition offsets (#699) - #700
Merged
Merged
Conversation
The #409 repair only armed on H.264, so an HEVC MP4 whose writer dropped ctts while the bitstream reorders pictures reached AVPlayer and the software decoder in decode order, which shows as flicker. The picture order reader now takes the HEVC parser as well, and the window self-check also accepts a decode-order prefix of at least nine pictures that fills its own range exactly, which covers a hierarchical mini-GOP longer than the reorder delay (five pictures at delay 2 on the reporting asset). The partial-region repair stays H.264-only. Reporting asset (CUVA conformance B.1-04, 4K50 HEVC Main 10): 0 backward steps across all 1500 served frames, 35 of 88 before. New HEVC twin pair reproduces the healthy twin's timestamps packet for packet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
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.
What
The flicker reported in #699 is not related to HDR Vivid. The reporting asset (CUVA conformance stream
B.1-04.mp4, 4K50 HEVC Main 10, HLG base) carries B pictures and nocttstable, so every sample reportsPTS == DTS. This is the #409 defect, but the #409 repair only armed on H.264, so the HEVC file went to AVPlayer and the software decoder in decode order.H264PictureOrderReadernow also opens libavcodec's HEVC parser (which takeshvcClength-prefixed payloads directly), and the repair session arms on HEVC as well.videoDelay + 1allowance. The check now also accepts a decode-order prefix of at leastminimumSamplespictures that fills its own display range exactly. That is the stricter test, and a stray rank that halves the measured step still fails it.Verification
ffprobe: 0 backward steps across all 1500 frames, uniform 20 ms. Before:swdecodereported 35 of 88 backward steps, the served master presented 0.00, 0.06, 0.08, 0.04, 0.10, 0.02 …setts=pts=DTSon one): the repaired twin matches the healthy twin packet for packet (HEVCCompositionOffsetRepairTests). Onmainthey differ.swift test: 4065 swift-testing + 17 XCTest, exit 0.check-doc-links.pyclean.aetherctl playon the asset:VERDICT: OK; presented-frame counts are the same asmainwithin run-to-run noise (about 1450 per arm, two runs each).🤖 Generated with Claude Code
https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS