#407: extend the generated-PTS repair to AVI (measured XviD sample) - #517
Open
a1go3 wants to merge 1 commit into
Open
#407: extend the generated-PTS repair to AVI (measured XviD sample)#517a1go3 wants to merge 1 commit into
a1go3 wants to merge 1 commit into
Conversation
The gate was Matroska-only for want of a measured AVI. Here is one: a 2000s
XviD rip (mpeg4 ASP, tag XVID, 720x304, video_delay 1, packed B-frames) takes
the same transposition, and `aetherctl swdecode` says so in the same words:
before 0.042 0.083 0.167 0.125 0.209 0.292 0.250 0.334 0.417
Steps backwards: 12 of 37
after 0.042 0.083 0.125 0.167 0.209 0.250 0.292 0.334 0.375
Steps backwards: 0 of 37
AVI needs no ms_compat equivalence to establish the same fact, because avidec
has no other mode: the container carries no presentation timestamps at all,
every track carries a FourCC, and the demuxer puts the frame index on pkt->dts.
So on an AVI input any PTS present was necessarily invented by +genpts, which
makes codec_tag != 0 a tautology there rather than a signal. video_delay > 0
carries the whole gate; the Matroska branch keeps its tag condition untouched.
Both existing exclusions hold in AVI: zero reorder delay (decode order IS
presentation order) and the natively routable codecs whose packets reach the
fMP4 muxer.
The source is progressive (interlaced_frame 0 and repeat_pict 0 on every frame
of a mid-file window), its timestamps are evenly spaced at 0.0417 s with no
gaps or duplicates, and no deinterlacer is involved: the packed bitstream is
the only unusual property and it is not the cause. The invented axis is.
`nonMatroskaContainer` pinned the old decision that "avi" must not arm the
repair; it becomes `ptsCarryingContainer` over the containers that do supply
timestamps, and four AVI cases join it. Full suite: 2743 tests, 373 suites,
all passing.
Reported as superuser404notfound#516.
Author
|
Verified on device: iPhone 13 Pro / iOS 26.5, host app built against this branch. The sample that produced #516 now plays with no visible judder — so the fix holds beyond the headless |
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.
Fixes #516.
VFWDecodeOrderPTSRepairalready describes this failure exactly; its gate was Matroska-only because no AVI had been measured:Here is the measurement. A 2000s XviD rip —
mpeg4Advanced Simple Profile, tagXVID, 720x304,video_delay = 1, packed B-frames — takes the same transposition, andaetherctl swdecodereports it in the same words the Matroska case did:Why AVI needs no equivalence of its own
avidechas no second mode. The container carries no presentation timestamps at all, every track carries a FourCC, and the demuxer puts the frame index onpkt->dts. So on an AVI input any PTS present was necessarily invented by+genpts— which makescodec_tag != 0a tautology there rather than a signal, and leavesvideo_delay > 0carrying the whole gate.The Matroska branch keeps its tag condition untouched: there the tag is what separates the VFW-carried tracks that withhold PTS from the natively mapped ones that must keep theirs.
Both existing exclusions hold unchanged in AVI, and are pinned by tests:
Ruling out the alternatives on this sample
So the diagnosis does not rest on the verdict alone:
field_order=unknown, andinterlaced_frame=0/repeat_pict=0on every frame of a mid-file 25-frame window. TogglingdeinterlaceModeanddeinterlaceFieldRateon device changed nothing, consistent with the deinterlacer correctly never engaging.best_effort_timestamp_timeadvances evenly at 0.0417 s with no gaps and no duplicates.preferredDecodePath = .softwarechanged nothing.mpeg4_unpack_bframessuggestion is left alone deliberately — a separate, independent improvement, out of scope for a gate change.Tests
nonMatroskaContainerpinned the old decision that"avi"must not arm the repair. It becomesptsCarryingContainerover the containers that genuinely supply timestamps (mov,mp4,…,asf,mpegts), and four AVI cases join the suite: the measured XviD shape, tag-independence, the two shared exclusions, and per-element name matching forisAVI.Full suite on this branch: 2743 tests in 373 suites, all passing.
Scope
The gate can now arm only on AVI, and only where
video_delay > 0— files that today play with their pictures in the wrong order. Nothing that plays correctly changes behaviour.Happy to adjust naming or split the test changes if you would rather keep
VFWin the type name now that it covers a second carriage.