Repository navigation
Description
Reported by @DrHurt through AetherPlayer#2. AetherPlayer 0.15.0 (engine 6.19.4), macOS 15.7.1, Mac mini 8,1 (x86_64, 6 cpus), local file. Playback stops about 18 s in and never comes back.
The source is a damaged mp4: stream 41, missing mandatory atoms, broken header, stream 0, timescale not set, UDTA parsing failed retrying raw, Referenced QT chapter track not found. HEVC 1920x1080, DV profile 8.1, 24.971 fps, 2536.7 s, 36 text tracks. The plan is the keyframe-aligned one: 766 IRAPs -> 603 segments [firstKeyframePts=-300000 (-3.000s)].
The playlist advertises segments the producer never muxes
After a programmatic seek to 0 the producer restarts at idx 0 and the #65 ledger line reports these indices:
0 1 2 3 _ 5 6 _ 8 9 10 11 _ 13 _ 15
4, 7, 12 and 14 never appear. The ledger emits once per routed segment (prevSeg != vodLedgerLastRoutedSeg, HLSSegmentProducer.swift:2858), so a missing index was not muxed, it is a hole. HLSSegmentProducer.swift:2866 already names the shape in a comment: "Plan indices a long GOP skipped report as zero-duration holes", but that reporting arm only runs when onSequentialSegmentFinalized != nil, which is the #346 sequential-origin path. On the ordinary VOD path the playlist keeps offering the index.
AVPlayer walks the playlist and dies on the first hole:
16:09:30.304 GET /seg0.mp4 ledger seg-0 .. seg-3 present
16:09:30.364 GET /seg1.mp4
16:09:30.389 GET /seg2.mp4
16:09:37.573 GET /seg3.mp4
16:09:44.890 GET /seg4.mp4 <- never produced
16:09:46.891 seg4: slow serve, sending early chunked header
16:09:48.832 playbackStalled t+20.32s
Playback had resumed at 16:09:30.745, so it ran 18.1 s, which is exactly what the reporter sees.
The plan and the muxed content disagree by up to 2.6 s
The same ledger lines carry the drift:
seg-1 sourceStart=0.680s planSource=2.000s drift=-1.320s
seg-5 sourceStart=22.080s planSource=23.560s drift=-1.480s
seg-8 sourceStart=32.560s planSource=34.920s drift=-2.360s
seg-15 sourceStart=65.240s planSource=67.120s drift=-1.880s
Drift is zero on the indices around them, so this is not a constant offset, it is per-boundary disagreement between the container's keyframe table and where the muxer actually cuts. On a file whose header is this damaged, that table is not a trustworthy witness, and keyframeIndexIsTrustworthy only tests gap and coverage (#64, #91), never whether the entries land on real IRAPs.
buildSegmentedSourcePlan pulls every boundary slightly below its segment start for exactly this class of problem (segmentedPlanBoundaryBackoff, added for #268), because "the producer's scan-forward gate takes the first keyframe at-or-after the boundary, so it skips the whole segment and opens a GOP late". The keyframe-aligned plan gets no equivalent.
The wedge recovery rebuilds the identical hole
16:09:54.469 backpressure WEDGE BROKEN parked=16s
16:09:54.477 re-anchoring producer to 21.01s -> seg3 (AVPlayer position) (attempt 1/5)
16:09:54.478 producer restarted at idx=3
ledger seg-3, seg-5, seg-6, seg-8 ... <- no seg-4, again
16:09:59.680 WEDGE BROKEN parked=5s
16:09:59.680 re-anchoring producer to 21.01s -> seg3 (attempt 2/5)
ledger seg-3, seg-5, seg-6, seg-8 ... <- no seg-4, again
The player's position, 21.01 s, sits inside the hole. Each attempt re-anchors to the same place, rebuilds the same plan, produces the same gap and wedges again, so the five attempts are spent on a deterministic hole rather than on a transient one, and the session ends parked in waitingToPlay / AVPlayerWaitingToMinimizeStallsReason.
Worth separating, because they fail independently:
- The plan should not promise a boundary the producer will fold away. A backoff like the segmented path's is the obvious first candidate.
- Even with a correct plan, a hole should not be an unrecoverable stall. The playlist can drop an index the producer folded, or the serve can answer the fold instead of waiting out the slow threshold and then closing the connection for a retry that meets the same nothing. Recovery that reproduces its own trigger cannot converge.
Open
I cannot tell yet whether this is a regression. The planning and producer code changed between 6.7.0 (what AetherPlayer 0.14.0 shipped) and 6.19.4 only through the #340 to #347 series, none of which touches the VOD keyframe plan, so my guess is that the file was always affected. That is a guess, not a measurement.
@DrHurt, two things would settle it:
- Does AetherPlayer 0.14.0 play the same file past the 18 s mark? The 0.14.0 .dmg is on its release page.
- The keyframe list as the container declares it, for the first minute:
ffprobe -v error -select_streams v:0 -skip_frame nokey -show_entries frame=pts_time -of csv=p=0 file.mp4 | head -40
If the file is shareable in any form, even a 60 second remux that still reproduces it, that turns this from log reading into something I can put under aetherctl seektest.
Activity
DrHurt commentedon Aug 10, 2026
Video also freezes with 0.14
Video works with 0.8.1 (since all builds between those 2 builds never worked)
FFProbe: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbf32105700] stream 41, missing mandatory atoms, broken header
I appreciate this is a broken file so I'm not too bothered about this getting fixed. (it was remuxed to mp4 by Subler app from the original MKV by the way).
superuser404notfound commentedon Aug 10, 2026
Your version bracket settles it, and it lands on one commit.
AetherPlayer 0.8.1 pins engine
cc523f93= 4.2.2, and the next release, 0.9.0, pins4171ef41= 4.11.0 plus 49 commits. Inside that span sits 489e38c, "fix(hls): keyframe-gated VOD segment cut so the IRAP opens its segment" (#92), first released as engine 4.8.0. It is not an ancestor of 4.2.2 and it is an ancestor of the 0.9.0 pin, so it is exactly in the window where playback stopped working for you. Not a 0.15.0 regression, and not new: this has been in every build since 4.8.0.The mechanism, in the cutter itself
VODSegmentCutter.index(pts:isKeyframe:):A keyframe that has already passed several plan boundaries consumes all of them and opens only the last. Every boundary it stepped over is an index that never gets a segment. That is the hole, and it is exactly the 4, 7, 12 and 14 from your ledger.
What makes it a stall rather than a cosmetic gap is the other half, which #92 states plainly and correctly for its own purpose: "EXTINF still comes from the plan boundaries". The playlist is built from the plan, so it keeps advertising the index the cutter consumed. AVPlayer requests it, the server waits out the slow threshold, sends the early chunked header, has nothing to put in the body, and closes for a retry that meets the same nothing.
Before #92 the producer routed each packet to a segment by DTS against the boundary, so every planned index got media, whether or not it started on a keyframe. That is the bug #92 fixed (segments starting mid-GOP, decode-dependent on their predecessor). The fix is right; what it did not carry is the consequence that the plan can now contain boundaries no keyframe will ever open.
Why your file walks into it
The plan for it is the keyframe-aligned one,
766 IRAPs -> 603 segments, built from the container's keyframe table. The remux left that table describing random-access points that the bitstream does not have where it claims, which is consistent with the header damage ffprobe reports. So the plan puts boundaries roughly every 4 s, the real GOPs are longer, and one GOP steps over two boundaries.I think a healthy file can reach the same place by a second route: when the keyframe index is rejected as untrustworthy, planning falls back to a uniform 4 s stride, which is not keyframe-derived at all. Any source with a GOP longer than the segment target would then have a keyframe stepping over boundaries in exactly this way. I am testing that with a synthetic long-GOP source, since it needs no broken file and would make this reproducible here.
Two fixes, and they are independent
On priority
Understood on the file, and thanks for saying so, but this is worth fixing on its own account. The trigger is a plan promising a boundary no keyframe opens, and a container index that overstates its random-access points is not exotic, Subler remuxes least of all. The second half is generic to every source. I would rather have this one than not.
superuser404notfound commentedon Aug 10, 2026
Reproduced here on a synthetic file, and it needs no broken container at all. It also corrects something I said above.
Correction first
I wrote that a gap in the
#65 ledgerproves the index was never muxed. That is not true, and my own repro refuted it. The ledger fires on a change of the VIDEO cutter's index, while the muxer's index is clamped monotonically for every stream:ensureMuxertakesmax(targetIdx, currentMuxerSegmentIndex), and audio is still routed by PTS. So on an interleaved source the audio drags the muxer through the indices the video cutter stepped over, and those segments exist and serve normally, with a sparse ledger.The real witness for a hole is on the serve side:
seg<N>: slow serve, sending early chunked headerwithcacheTarget=<N>in the park line, and no file for that index.The repro
Two files, identical apart from the audio track. 25 fps, 10 s GOP, MPEG-TS so the keyframe index is unusable and planning falls back to the uniform 4 s stride:
ffmpeg -f lavfi -i testsrc=size=1280x720:rate=25:duration=120 -f lavfi -i sine=frequency=440:duration=120 \ -c:v libx264 -preset ultrafast -b:v 2M -g 250 -keyint_min 250 -sc_threshold 0 -pix_fmt yuv420p \ -c:a aac -b:a 128k -shortest longgop.ts ffmpeg -f lavfi -i testsrc=size=1280x720:rate=25:duration=120 \ -c:v libx264 -preset ultrafast -b:v 2M -g 250 -keyint_min 250 -sc_threshold 0 -pix_fmt yuv420p \ -an longgop-noaudio.ts aetherctl play --seconds 40 file://$PWD/longgop-noaudio.tsBoth plan the same way:
With audio the session plays through: 45 s,
state=playing,drop=0, and every index 0 to 22 has a file on disk. The audio dragged the muxer through 1, 3, 4, 6 and the rest.Without audio nothing pulls the muxer into the skipped indices, and it is your log, on a file ffmpeg generated a minute earlier:
highStored=10while the consumer waits forcacheTarget=1: the producer is ten segments ahead and the one segment the player needs will never exist.What this means for the diagnosis
The trigger is not the damaged header. It is a plan whose stride is finer than the source's real random-access spacing, plus nothing else advancing the muxer into the indices the cutter steps over. Two ways in:
keyframeIndexIsTrustworthylands here. MPEG-TS recordings are the obvious population, and that is a large one.And the audio rescue is not a rescue.
max(targetIdx, currentMuxerSegmentIndex)only ever moves the muxer forward, so once the video cutter has jumped ahead, a later audio packet cannot go back and fill the index that was passed. Your file has audio and still lost index 4, which fits: there the video ran ahead of the audio in the interleave.Recovery behaves differently in the two logs, and that is worth noting rather than glossing. Mine re-anchored twice, and because each re-anchor changed the shift, the second one happened to produce the index the player was waiting for and playback resumed. Yours re-anchored to the same position five times, rebuilt the same boundaries, and produced the same gap every time. So the recovery does not fix the hole, it only sometimes moves it.
Fix directions are unchanged from the comment above, but the priority is not: this reaches ordinary long-GOP sources, not just damaged ones.
fix(hls): the uniform fallback grid is never finer than the source's …
Merge fix/358-uniform-stride: uniform grid respects the source's IRAP…
superuser404notfound commentedon Aug 10, 2026
Half of this is fixed on main,
64e5bd09. Being explicit about which half, because it is not the one that unblocks your file.Fixed: the uniform grid no longer promises boundaries a keyframe cannot open
The fallback plan used a fixed 4 s stride, and a stride finer than the GOP is the whole defect. The spacing is now read from the bitstream, bounded to 30 s of content, and the plan uses it:
The index cannot answer this question, which is worth recording because it was my first idea and it was wrong. By the time this path runs the index is untrustworthy by definition, and it holds whatever
find_stream_infoplus the cue prewarm happened to scan. The 10 s-GOP TS above indexed1.400, 59.960, 60.000, 60.280, 121.360: smallest gap 0.04 s, largest 58.6 s, real spacing 10 s. Both estimates miss by an order of magnitude, in opposite directions.Verified on four arms: the video-only repro (was a permanent stall, now plays), the same source with audio, a 5 s fixture holding a single IRAP (which the 4 s grid also gave an unopenable boundary), and a trusted dense index to confirm the keyframe-aligned path is untouched.
segverifyreports 6/6 segments independently decodable, so #92's property survives. Suite is 1732 tests in 253 suites, green.Not fixed: your file, and the recovery
Your source takes the other path. Its index passes the trust check (766 entries, dense, wide), so the plan is keyframe-aligned and built from entries that claim random-access points the bitstream does not have where it says. Nothing in this change validates index entries against the bitstream, and doing that properly means scanning the file rather than sampling it. So your file will still stall with this change in, and this issue stays open for it.
The second half is also untouched: the wedge recovery re-anchors to the same position, rebuilds the same boundaries and produces the same gap, five times over. A recovery that reproduces its own trigger cannot converge, and it should recognise the repeat and surface an error rather than looping. That one is generic, it is what turns any such gap from a bad segment into a dead session, and it is the part most likely to help you.
Repro for anyone picking this up, no broken file needed:
ffmpeg -f lavfi -i testsrc=size=1280x720:rate=25:duration=120 \ -c:v libx264 -preset ultrafast -b:v 2M -g 250 -keyint_min 250 -sc_threshold 0 \ -pix_fmt yuv420p -an longgop-noaudio.ts aetherctl play --seconds 40 file://$PWD/longgop-noaudio.tsfix(hls): a folded plan index is repaired or fails, never waited out …
Merge fix/358-hole-is-terminal: a folded plan index is repaired or fa…
superuser404notfound commentedon Aug 10, 2026
The second half is on main too,
95060f3f. This is the one that should reach your file.The wedge handler was the wrong place, and the repro says so
I built a source that still folds an index with the stride fix in: 200 s, 25 fps, 40 s GOP, which outruns the 30 s spacing scan, so the grid lands at 30 s and one boundary in four has no IRAP. On that source the old build froze at 90.00 s and then reported
state=playingfor the remaining 85 s of the run, withGET /seg3and its slow serve repeating.No recovery ran at all. The pump had finished the file, so nothing was parked, so the backpressure wedge detector never fired. Which means the freeze you saw is not only a recovery that cannot converge, it is also a recovery that in this shape never starts. The provider sees every segment request before the wait, so the decision belongs there.
What it does now
The cut records the plan indices it jumped, in the cache rather than on the producer, because a restart rebuilds the producer and the repeat across restarts is the entire signal.
final t=209.80s, no slow serve and no stall.onVODSourceFailed. That is the repair reproducing its own trigger, and no further attempt changes it. An error the host can show beats a picture that never moves while the engine reports playing.adoptclears the count when the index does land.Live is excluded throughout: its playlist is built from what was finalized, so it never offers an index the pump skipped.
Suite is 1737 tests in 254 suites, green, including five new ones for the decision itself. The failure branch is unit-tested rather than filmed: building a source that folds the same index twice needs a keyframe index that lies, which is your file and not something ffmpeg will produce on request.
@DrHurt, this does not make your file play. Its plan comes from a trusted-but-wrong index, and nothing here validates index entries against the bitstream. What it should do is turn the dead freeze into either a jump past the gap or a real error, which is the difference between a player that looks broken and one that tells you something. Worth a look when it reaches a build you run.
Staying open for the trusted-index-that-lies half.
superuser404notfound commentedon Aug 10, 2026
Both fixes are released as AetherEngine 6.20.0, and AetherPlayer 0.15.1 carries them, so the in-app updater will offer it.
@DrHurt, your file is the half that is still open, and one measurement would decide it. The command earlier printed only the container warning, no data, because the frame list goes to stdout and the warning to stderr:
The first forty lines are enough. Put next to the plan boundaries from your log, that says whether the container's keyframe table describes points the bitstream actually has, which is currently the difference between a fix and a guess. I looked at the most likely candidate on our side today, an axis mix-up between the index and the cutter, and measured it as harmless on a well-formed file, so I would rather not build anything for your case blind.
No urgency, and 0.15.1 should at least turn the freeze into a jump or a real error for you.
DrHurt commentedon Aug 10, 2026
Last test for today: stalls at 14s
fix(hls): the VOD cut gate reads the axis the plan is written in (#358)
Merge fix/358-plan-axis: the VOD cut gate reads the axis the plan is …
superuser404notfound commentedon Aug 11, 2026
Your 14 s log had the line that decides this, and it is our bug, not your file. I was wrong yesterday to lean toward the container.
Your remux carries a 3 second composition offset. The keyframe-aligned plan's boundaries are the container index's sync-sample timestamps, and for mov/mp4 those are DECODE timestamps: the mov demuxer builds its index from
current_dts. The cut gate compared a packet's PRESENTATION timestamp against them. So every keyframe reached boundaries up to 3 s beyond its own and the cutter consumed them, which is why your ledger folds exactly the indices whose boundaries sit inside those 3 s and leaves the wider-spaced ones atdrift=0.000. On an ordinary encode the offset is two frames and nobody notices, which is how this survived since #92.Reproduced without your file
Same shape, built by giving a normal encode a composition offset with
setts=pts=PTS+N:dts=DTS:ffmpeg -f lavfi -i testsrc=size=640x360:rate=25:duration=90 -c:v libx264 -preset medium -bf 3 \ -g 105 -keyint_min 105 -sc_threshold 0 -pix_fmt yuv420p -an base.mp4 ffmpeg -i base.mp4 -c copy -bsf:v "setts=pts=PTS+64000:dts=DTS" -muxdelay 0 -muxpreload 0 offset.mp4final t=-5.08s, seg0 slow-served forever). Worth noting against yesterday's commit: the fold bookkeeping does not cover this one, because it lives inadvanceMuxerand the first muxer allocation is not an advance.drift=-2.480s, a whole keyframe interval of plan-versus-content disagreement that nothing reported.Both now read
drift=0.000on every ledger line and play through. Fixed on main,72105b18.Keyframe gating is unchanged, so #92 holds: the IRAP is still the segment's first sample and its RASL pictures still follow it in decode order.
segverifysays 6/6 independently decodable on a B-frame encode, which is the case #92 was filed for, and 5/5 on the offset fixture. Suite 1737 tests in 254 suites, and the earlier #358 sources still play.One attempt that did not work, recorded because it is the obvious one: lifting the plan onto the presentation axis instead made it worse, drift from -4.200 s to -9.280 s, because
firstKeyframePtsalso feeds the producer's anchor and shift, which stay on the decode axis. Moving one side moved the two further apart.@DrHurt, your file should now play rather than merely fail politely. Thanks for the three rounds of logs, the last one carried the answer.
superuser404notfound commentedon Aug 11, 2026
Released as 6.20.1, and AetherPlayer 0.15.2 carries it, so the in-app updater will offer it.
@DrHurt, that build is the one worth trying on the file that stalled at 14 s. If it plays through, this closes; if it still stops, the log will now say something different from before and that is equally useful.
DrHurt commentedon Aug 11, 2026
That fixed it and CPU usage is slightly below QuickTime (~3%) which makes me very happy! That was a brief 60s test.
superuser404notfound commentedon Aug 11, 2026
Good to hear, and thank you for the three rounds of logs. The decisive line came out of yours: a first packet at
dts=0 pts=300000is what showed the plan and the gate were reading two different axes, and no amount of reasoning about the container would have found that without it.Closing on your confirmation. If it stalls again on a longer run, reopening this is better than a new issue, since the ledger lines to compare against are all in here.
fix(video): find the moov prime by seeking, and tell the host when th…
fix(video): contain a timestamp leap that escapes the timeline rebase (…
fix(video): plan a sequential origin without spending its prefix on t…
fix(producer): a plan boundary is compared on the axis its container …
fix(ts): no index-less prewarm, the uniform plan anchored on its firs…
feat(hls): audio as its own rendition, the HLS Authoring Specificatio…
fix(planning): anchor a uniform plan's segment 0 on the first IRAP th…
fix(planning): anchor a uniform plan's segment 0 on the first IRAP th…