Skip to content

VOD keyframe-aligned plan: the playlist advertises segment indices the producer never muxes, and the wedge recovery rebuilds the same hole #358

Closed

Description

@superuser404notfound

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:

  1. The plan should not promise a boundary the producer will fold away. A backoff like the segmented path's is the obvious first candidate.
  2. 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

  1. DrHurt commented on Aug 10, 2026

    @DrHurt
    Contributor

    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).

  2. superuser404notfound commented on Aug 10, 2026

    @superuser404notfound
    OwnerAuthor

    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, pins 4171ef41 = 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:):

    var nextLocal = (current - baseIndex) + 1
    while nextLocal < boundaries.count - 1, pts >= boundaries[nextLocal] {
        current += 1
        nextLocal += 1
    }
    return current

    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

    1. The cutter should not consume an index the playlist promised. Advancing one index per keyframe gives every planned index media and leaves the EXTINF drift that the engine already tolerates and already reports in the ledger, rather than a hole. The alternative is to reconcile the playlist with what the cutter will actually cut, which is more honest but more work.
    2. The wedge recovery must not spend its five attempts rebuilding a deterministic hole. It re-anchors to the same position, rebuilds the same plan, and produces the same gap. A recovery that reproduces its own trigger cannot converge, so it should recognise the repeat and surface an error instead of looping.

    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.

  3. superuser404notfound commented on Aug 10, 2026

    @superuser404notfound
    OwnerAuthor

    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 ledger proves 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: ensureMuxer takes max(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 header with cacheTarget=<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.ts

    Both plan the same way:

    segment plan: uniform stride fallback (index unusable (5 IRAPs, coverage=120.0s, largestGap=61.1s))
    ledger seg-0, seg-2, seg-5, seg-7, seg-10, seg-12      <- one entry per 10 s GOP, 4 s stride
    

    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:

    GET /seg0.mp4
    GET /seg1.mp4
    seg1: slow serve, sending early chunked header
    playbackStalled
    backpressure PARK (advance) head=12 target=2 cacheTarget=1 highStored=10 cached=5 parked=12s (no playback progress)
    backpressure WEDGE BROKEN (advance) head=12 target=2 cacheTarget=1 parked=16s
    

    highStored=10 while the consumer waits for cacheTarget=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:

    • The uniform fallback plan, which is not keyframe-derived at all. Any source with a GOP longer than the 4 s target and an index that fails keyframeIndexIsTrustworthy lands here. MPEG-TS recordings are the obvious population, and that is a large one.
    • A keyframe-aligned plan built from an index that claims random-access points the bitstream does not have, which is your file.

    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.

  4. added
    bug
    on Aug 10, 2026
  5. superuser404notfound commented on Aug 10, 2026

    @superuser404notfound
    OwnerAuthor

    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:

    before: segment plan: uniform stride fallback (index unusable (5 IRAPs, coverage=120.0s, largestGap=61.1s))
            ledger seg-0, seg-2, seg-5, seg-7, seg-10 ...   -> GET /seg1 stalls forever
    after:  segment plan: uniform stride fallback (..., measured IRAP spacing 10.000s -> stride=10.000s, 12 segments)
            ledger seg-0 .. seg-11 contiguous, every drift 0.000, plays to the end
    

    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_info plus the cue prewarm happened to scan. The 10 s-GOP TS above indexed 1.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. segverify reports 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.ts
  6. superuser404notfound commented on Aug 10, 2026

    @superuser404notfound
    OwnerAuthor

    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=playing for the remaining 85 s of the run, with GET /seg3 and 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.

    • First fold: re-anchor the producer at that index. The boundaries move with the producer's base, so the index can open, and on this source it does. Same file, same build: plays to the end, final t=209.80s, no slow serve and no stall.
    • Second fold: fail with 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.
    • A retry arriving while the repair is in flight waits rather than failing, and adopt clears 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.

    before: GET /seg3 -> slow serve -> playbackStalled -> repeat, clock frozen at 90.00s, state=playing
    after:  #358 plan indices 3...3 folded into seg-4 (no IRAP reached their boundary)
            #358 seg3 was folded away by the cutter; re-anchoring the producer there so its boundary can open
            final t=209.80s state=playing   VERDICT: OK
    

    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.

  7. superuser404notfound commented on Aug 10, 2026

    @superuser404notfound
    OwnerAuthor

    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:

    ffprobe -v error -select_streams v:0 -skip_frame nokey -show_entries frame=pts_time -of csv=p=0 file.mp4 2>/dev/null | head -40

    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.

  8. DrHurt commented on Aug 10, 2026

    @DrHurt
    Contributor

    Last test for today: stalls at 14s

    20:06:56.099 [AetherPlayer] open file.mp4 forceLive=false
    20:06:56.134 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb0c8914680] [warning] UDTA parsing failed retrying raw
    20:06:56.138 Last message repeated 3 times: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb0c8914680] [warning] UDTA parsing failed retrying raw
    20:06:56.138 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb0c8914680] [error] stream 41, missing mandatory atoms, broken header
    20:06:56.138 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb0c8914680] [warning] stream 0, timescale not set
    20:06:56.138 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb0c8914680] [warning] Attached picture on stream 41 has invalid size, ignoring
    20:06:56.146 [AetherEngine] load url=file:///Users/user/Desktop/file.mp4 source-format=dolbyVision effective-format=sdr rate=25.000
    20:06:56.146 [VTProbe] codec=av01 hwSupported=false
    20:06:56.241 [VTProbe] canHardwareDecode codec=173 1920x1080 -> true (status=0)
    20:06:56.241 [AetherEngine] dispatch: codec=173 → native
    20:06:56.243 [AetherEngine] native subtitles: prepare=false eager=false textTracks=36 bitmapOCR=0 enable=false
    20:06:56.243 [AetherEngine] A53 SEI caption tap armed (synthetic id 99608)
    20:06:56.243 [HLSVideoEngine] video codecpar: codec=173 1920x1080 profile=2 level=120 fieldOrder=0 extradata=184B head=0102200000009000
    20:06:56.244 [HLSVideoEngine] cue prewarm: seek to 1268.3s took 0.3ms
    20:06:56.244 [HLSVideoEngine] segment plan: keyframe-aligned, 766 IRAPs → 603 segments [firstKeyframePts=-300000 (-3.000s) videoStream.start_time=0 format.start_time=0us plan[0].startSeconds=0.000]
    20:06:56.244 [HLSVideoEngine] DV source: profile=8 compat=1 level=4 rpu=1 el=0 bl=1 color_primaries=9 color_trc=16 color_space=9
    20:06:56.313 [HLSVideoEngine] segment retention budget: 2048 MiB (volumeAvailable=11625 MiB, forwardWindow=10 seg)
    20:06:56.313 [HLSVideoEngine] audio: codec=aac → stream-copy as `mp4a.40.2` (fallback duration=1024 in audioTb 1/48000)
    20:06:56.314 [HLSSegmentProducer] init OK (baseIndex=0, segments=571, targetDur=4.000s, srcVideoTb=1/100000) audio=stream-copy inTb=1/48000
    20:06:56.314 [HLSVideoEngine] prepared: codec=hvc1.2.4.L120,mp4a.40.2 resolution=1920x1080 fps=24.971 range=PQ DV=profile81 segments=571 duration=2536.7s
    20:06:56.314 [HLSLocalServer] Listening on port 49566
    20:06:56.314 [HLSVideoEngine] serving on http://127.0.0.1:49566/media.m3u8 (dvModeAvailable=false effectiveDvMode=false panelIsHDR=false displaySupportsHDR=false matchContent=true sourceIsHDR=true useMaster=false videoRange=pq dvVariant=profile81)
    20:06:56.314 [HLSSegmentProducer] pump thread qos=userInitiated
    20:06:56.314 [HLSSegmentProducer] video gate open: actual=-300000 anchorPts=0 target=-9223372036854775808 desired=0 shift=-300000 videoPID=0 reconstructed=false
    20:06:56.314 [HLSSegmentProducer] first video pkt: dts=0 pts=300000 duration=4000 size=1044 (fallback=4004 in srcVideoTb)
    20:06:56.315 [HLSSegmentProducer] #65 ledger seg-0 base=0 itemAxis=0.000s sourceStart=-3.000s planSource=-3.000s drift=0.000s shift=-3.000s
    20:06:56.318 [HLSSegmentProducer] #65 ledger seg-1 base=0 itemAxis=3.680s sourceStart=0.680s planSource=2.000s drift=-1.320s shift=-3.000s
    20:06:56.318 [NativeAVPlayerHost] #1 load url=http://127.0.0.1:49566/media.m3u8 startPos=nil headers=none
    20:06:56.318 [NativeAVPlayerHost] #1 layer.isReadyForDisplay=false t+0.00s (carried in from the previous item when true)
    20:06:56.319 [HLSSegmentProducer] init.mp4 captured (1432 B)
    20:06:56.320 [NativeAVPlayerHost] #1 timeControlStatus=paused reason=- t+0.00s
    20:06:56.320 [HLSSegmentProducer] audio gate open: actual=0 target=-144000 desired=0 shift=-144000 gapMs=0.0
    20:06:56.320 [AetherEngine] #321: effective video route = loopback
    20:06:56.320 [NativeAVPlayerHost] #1 rate=1.0
    20:06:56.320 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingWhileEvaluatingBufferingRateReason t+0.00s
    20:06:56.321 [NativeAVPlayerHost] #1 rate=1.0
    20:06:56.321 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingWhileEvaluatingBufferingRateReason t+0.00s
    20:06:56.321 [NativeAVPlayerHost] #1 rate=1.0
    20:06:56.323 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingWhileEvaluatingBufferingRateReason t+0.00s
    20:06:56.326 [HLSSegmentProducer] #65 ledger seg-2 base=0 itemAxis=10.400s sourceStart=7.400s planSource=7.400s drift=0.000s shift=-3.000s
    20:06:56.346 [HLSSegmentProducer] #65 ledger seg-3 base=0 itemAxis=17.760s sourceStart=14.760s planSource=14.760s drift=0.000s shift=-3.000s
    20:06:56.353 [HLSSegmentProducer] #65 ledger seg-5 base=0 itemAxis=25.080s sourceStart=22.080s planSource=23.560s drift=-1.480s shift=-3.000s
    20:06:56.354 [HLSSegmentProducer] #358 plan indices 4...4 folded into seg-5 (no IRAP reached their boundary)
    20:06:56.365 [HLSSegmentProducer] #65 ledger seg-6 base=0 itemAxis=30.880s sourceStart=27.880s planSource=27.880s drift=0.000s shift=-3.000s
    20:06:56.379 [HLSSegmentProducer] #65 ledger seg-8 base=0 itemAxis=35.560s sourceStart=32.560s planSource=34.920s drift=-2.360s shift=-3.000s
    20:06:56.381 [HLSSegmentProducer] #358 plan indices 7...7 folded into seg-8 (no IRAP reached their boundary)
    20:06:56.390 [HLSSegmentProducer] #65 ledger seg-9 base=0 itemAxis=42.480s sourceStart=39.480s planSource=39.480s drift=0.000s shift=-3.000s
    20:06:56.402 [HLSSegmentProducer] #65 ledger seg-10 base=0 itemAxis=49.120s sourceStart=46.120s planSource=46.120s drift=0.000s shift=-3.000s
    20:06:56.426 [AetherEngine] VOD shift published: -3.000s (prev 0.000s, delta -3.000s, changed=YES) seamAt=0.000s seams=1 foldShift=-3.000s presentationOrigin=0.000s rawClock=0.00s avBufAhead=0.00s
    20:06:56.443 [HLSLocalServer] GET /media.m3u8 HTTP/1.1
    20:06:56.443 [HLSLocalServer] #227 client 127.0.0.1 first request: GET /media.m3u8 HTTP/1.1
    20:06:56.443 [HLSLocalServer] first request headers fd=16: Host: 127.0.0.1:49566 | X-Playback-Session-Id: E5F3926A-A059-4C3D-A44D-567AAF8711D5 | Accept: */* | User-Agent: AppleCoreMedia/1.0.0.24G231 (Macintosh; U; Intel Mac OS X 15_7_1; en_gb) | Accept-Language: en-GB,en;q=0.9 | Accept-Encoding: gzip | Connection: keep-alive
    20:06:56.459 [NativeAVPlayerHost] #1 asset.load(isPlayable) ok url=http://127.0.0.1:49566/media.m3u8 value=true
    20:06:56.459 [NativeAVPlayerHost] #1 asset.load(tracks) ok url=http://127.0.0.1:49566/media.m3u8 count=0
    20:06:56.465 [NativeAVPlayerHost] #1 asset.load(duration) ok url=http://127.0.0.1:49566/media.m3u8 seconds=2536.659
    20:06:56.465 [HLSLocalServer] GET /init.mp4 HTTP/1.1
    20:06:56.465 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingToMinimizeStallsReason t+0.15s
    20:06:56.569 [HLSLocalServer] GET /seg0.mp4 HTTP/1.1
    20:06:56.572 [NativeAVPlayerHost] #1 accessLog uri=http://127.0.0.1:49566/media.m3u8 server=127.0.0.1 bytes=131072 reqs=0
    20:06:56.575 [HLSLocalServer] GET /seg1.mp4 HTTP/1.1
    20:06:56.579 [HLSSegmentProducer] #65 ledger seg-11 base=0 itemAxis=56.160s sourceStart=53.160s planSource=53.160s drift=0.000s shift=-3.000s
    20:06:56.593 [HLSSegmentProducer] #65 ledger seg-13 base=0 itemAxis=63.160s sourceStart=60.160s planSource=61.440s drift=-1.280s shift=-3.000s
    20:06:56.595 [HLSSegmentProducer] #358 plan indices 12...12 folded into seg-13 (no IRAP reached their boundary)
    20:06:56.627 [NativeAVPlayerHost] #1 layer.isReadyForDisplay=true t+0.31s
    20:06:56.984 [NativeAVPlayerHost] #1 item.status=readyToPlay
    20:06:56.984 [NativeAVPlayerHost] #1 timeControlStatus=playing reason=- t+0.67s
    20:06:56.985 [NativeAVPlayerHost] #1 item.videoTrack codec='hvc1' enabled=true dim=1920x1080 primaries=ITU_R_2020 transfer=SMPTE_ST_2084_PQ matrix=ITU_R_2020 fullRange=false (readyToPlay)
    20:06:56.985 [NativeAVPlayerHost] #1 item.audioTrack codec='aac ' enabled=true sr=48000 ch=2 bits=0 fmt=aac  layoutTag=<missing> (readyToPlay)
    20:06:56.986 [NativeAVPlayerHost] #1 remote-HLS videoFormat=hdr10 subType='hvc1' transfer=SMPTE_ST_2084_PQ rate=0.000
    20:06:59.450 [HLSLocalServer] GET /seg2.mp4 HTTP/1.1
    20:07:06.811 [HLSLocalServer] GET /seg3.mp4 HTTP/1.1
    20:07:06.829 [HLSSegmentProducer] pump qos -> utility (now=utility epochHead=11 target=3 lead=8)
    20:07:06.836 [HLSSegmentProducer] #65 ledger seg-15 base=0 itemAxis=68.240s sourceStart=65.240s planSource=67.120s drift=-1.880s shift=-3.000s
    20:07:06.836 [HLSSegmentProducer] #358 plan indices 14...14 folded into seg-15 (no IRAP reached their boundary)
    20:07:14.128 [HLSLocalServer] GET /seg4.mp4 HTTP/1.1
    20:07:14.128 [VideoSegmentProvider] #358 seg4 was folded away by the cutter; re-anchoring the producer there so its boundary can open
    20:07:14.128 [AetherEngine] seek#1 nativeScrub began target=22.08
    20:07:14.137 [HLSSegmentProducer] seg-15.m4s partial at teardown (588 B) discarded, not adopted
    20:07:14.137 [HLSSegmentProducer] pump finished: reason=stopRequested packetsRead=5450 packetsWritten=1701 lastError=0 elapsed=17822ms cacheCount=11
    20:07:14.137 [HLSSegmentProducer] init OK (baseIndex=4, segments=567, targetDur=4.000s, srcVideoTb=1/100000) audio=stream-copy inTb=1/48000
    20:07:14.137 [HLSVideoEngine] producer restarted at idx=4 (seek=22.08s [absolute source-PTS], restart took 10ms; stopWait=9ms seek=0ms build=0ms)
    20:07:14.137 [HLSSegmentProducer] pump thread qos=userInitiated
    20:07:14.138 [HLSSegmentProducer] video gate open: actual=2208000 anchorPts=2508000 target=2208000 desired=2508000 shift=-300000 videoPID=0 reconstructed=false
    20:07:14.138 [HLSSegmentProducer] first video pkt: dts=2508000 pts=2808000 duration=4000 size=6131 (fallback=4004 in srcVideoTb)
    20:07:14.138 [HLSSegmentProducer] #65 ledger seg-5 base=4 itemAxis=25.080s sourceStart=22.080s planSource=23.560s drift=-1.480s shift=-3.000s
    20:07:14.138 [AetherEngine] VOD shift published: -3.000s (prev -3.000s, delta 0.000s, changed=no) seamAt=25.080s seams=2 foldShift=-3.000s presentationOrigin=0.000s rawClock=17.10s avBufAhead=3.99s
    20:07:14.138 [HLSSegmentProducer] audio gate open: actual=1059840 target=1059840 desired=1203840 shift=-144000 gapMs=0.0
    20:07:14.149 [HLSSegmentProducer] #65 ledger seg-6 base=4 itemAxis=30.880s sourceStart=27.880s planSource=27.880s drift=0.000s shift=-3.000s
    20:07:14.150 [HLSSegmentProducer] init.mp4 captured (1432 B)
    20:07:14.162 [HLSSegmentProducer] #65 ledger seg-8 base=4 itemAxis=35.560s sourceStart=32.560s planSource=34.920s drift=-2.360s shift=-3.000s
    20:07:14.164 [HLSSegmentProducer] #358 plan indices 7...7 folded into seg-8 (no IRAP reached their boundary)
    20:07:14.172 [HLSSegmentProducer] #65 ledger seg-9 base=4 itemAxis=42.480s sourceStart=39.480s planSource=39.480s drift=0.000s shift=-3.000s
    20:07:14.174 [HLSSegmentProducer] pump qos -> utility (now=utility epochHead=8 target=4 lead=4)
    20:07:14.183 [HLSSegmentProducer] #65 ledger seg-10 base=4 itemAxis=49.120s sourceStart=46.120s planSource=46.120s drift=0.000s shift=-3.000s
    20:07:14.199 [HLSSegmentProducer] #65 ledger seg-11 base=4 itemAxis=56.160s sourceStart=53.160s planSource=53.160s drift=0.000s shift=-3.000s
    20:07:14.209 [HLSSegmentProducer] #65 ledger seg-13 base=4 itemAxis=63.160s sourceStart=60.160s planSource=61.440s drift=-1.280s shift=-3.000s
    20:07:14.211 [HLSSegmentProducer] #358 plan indices 12...12 folded into seg-13 (no IRAP reached their boundary)
    20:07:14.218 [HLSSegmentProducer] #65 ledger seg-15 base=4 itemAxis=68.240s sourceStart=65.240s planSource=67.120s drift=-1.880s shift=-3.000s
    20:07:14.220 [HLSSegmentProducer] #358 plan indices 14...14 folded into seg-15 (no IRAP reached their boundary)
    20:07:16.141 [HLSLocalServer] seg4: slow serve, sending early chunked header
    20:07:18.077 [NativeAVPlayerHost] #1 playbackStalled
    20:07:18.077 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingToMinimizeStallsReason t+21.76s
    20:07:22.348 [AetherEngine] scrub landing watch expired after 8s; reporting stalled
    20:07:22.348 [AetherEngine] seek#1 nativeScrub stalled target=22.08
    20:07:23.724 [HLSSegmentProducer] #65 backpressure WEDGE BROKEN (advance) head=15 target=5 cacheTarget=4 parked=9s (fast path: fetch target + rendered clock both frozen); exiting pump for host re-anchor on AVPlayer position
    20:07:23.725 [HLSSegmentProducer] seg-15.m4s partial at teardown (588 B) discarded, not adopted
    20:07:23.725 [HLSSegmentProducer] pump finished: reason=backpressureWedge packetsRead=3715 packetsWritten=1074 lastError=0 elapsed=9587ms cacheCount=11
    20:07:23.725 [HLSVideoEngine] #65 backpressure wedge: re-anchoring producer to 21.01s -> seg3 (AVPlayer position) (attempt 1/5)
    20:07:23.725 [AetherEngine] seek#2 nativeScrub began target=14.76
    20:07:23.725 [HLSSegmentProducer] init OK (baseIndex=3, segments=568, targetDur=4.000s, srcVideoTb=1/100000) audio=stream-copy inTb=1/48000
    20:07:23.725 [HLSVideoEngine] producer restarted at idx=3 (seek=14.76s [absolute source-PTS], restart took 0ms; stopWait=0ms seek=0ms build=0ms)
    20:07:23.725 [HLSSegmentProducer] pump thread qos=userInitiated
    20:07:23.725 [HLSSegmentProducer] video gate open: actual=1476000 anchorPts=1776000 target=1476000 desired=1776000 shift=-300000 videoPID=0 reconstructed=false
    20:07:23.725 [HLSSegmentProducer] first video pkt: dts=1776000 pts=2076000 duration=4000 size=12040 (fallback=4004 in srcVideoTb)
    20:07:23.725 [HLSSegmentProducer] #65 ledger seg-3 base=3 itemAxis=17.760s sourceStart=14.760s planSource=14.760s drift=0.000s shift=-3.000s
    20:07:23.726 [AetherEngine] VOD shift published: -3.000s (prev -3.000s, delta 0.000s, changed=no) seamAt=17.760s seams=2 foldShift=-3.000s presentationOrigin=0.000s rawClock=21.01s avBufAhead=0.09s
    20:07:23.726 [HLSSegmentProducer] audio gate open: actual=708608 target=708480 desired=852480 shift=-144000 gapMs=2.7
    20:07:23.732 [HLSSegmentProducer] #65 ledger seg-5 base=3 itemAxis=25.080s sourceStart=22.080s planSource=23.560s drift=-1.480s shift=-3.000s
    20:07:23.732 [HLSSegmentProducer] init.mp4 captured (1432 B)
    20:07:23.733 [HLSSegmentProducer] #358 plan indices 4...4 folded into seg-5 (no IRAP reached their boundary)
    20:07:23.744 [HLSSegmentProducer] #65 ledger seg-6 base=3 itemAxis=30.880s sourceStart=27.880s planSource=27.880s drift=0.000s shift=-3.000s
    20:07:23.755 [HLSSegmentProducer] #65 ledger seg-8 base=3 itemAxis=35.560s sourceStart=32.560s planSource=34.920s drift=-2.360s shift=-3.000s
    20:07:23.757 [HLSSegmentProducer] #358 plan indices 7...7 folded into seg-8 (no IRAP reached their boundary)
    20:07:23.765 [HLSSegmentProducer] #65 ledger seg-9 base=3 itemAxis=42.480s sourceStart=39.480s planSource=39.480s drift=0.000s shift=-3.000s
    20:07:23.766 [HLSSegmentProducer] pump qos -> utility (now=utility epochHead=8 target=4 lead=4)
    20:07:23.775 [HLSSegmentProducer] #65 ledger seg-10 base=3 itemAxis=49.120s sourceStart=46.120s planSource=46.120s drift=0.000s shift=-3.000s
    20:07:23.792 [HLSSegmentProducer] #65 ledger seg-11 base=3 itemAxis=56.160s sourceStart=53.160s planSource=53.160s drift=0.000s shift=-3.000s
    20:07:23.802 [HLSSegmentProducer] #65 ledger seg-13 base=3 itemAxis=63.160s sourceStart=60.160s planSource=61.440s drift=-1.280s shift=-3.000s
    20:07:23.804 [HLSSegmentProducer] #358 plan indices 12...12 folded into seg-13 (no IRAP reached their boundary)
    20:07:23.811 [HLSSegmentProducer] #65 ledger seg-15 base=3 itemAxis=68.240s sourceStart=65.240s planSource=67.120s drift=-1.880s shift=-3.000s
    20:07:23.813 [HLSSegmentProducer] #358 plan indices 14...14 folded into seg-15 (no IRAP reached their boundary)
    20:07:24.389 [AetherEngine] #65 re-engaging stalled AVPlayer (stall + 6s without fetches): nudge seek to 21.01s
    20:07:24.389 [NativeAVPlayerHost] #1 rate=1.0
    20:07:24.389 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingToMinimizeStallsReason t+28.07s
    20:07:26.432 [AetherEngine] memprobe t=30s rss=96MB vmInt=55MB vmExt=40MB vmCmp=0MB vmIOS=0MB physFP=61MB mallocBlocks=145606 mallocMB=39 avioFetchedMB=0 cacheCount=11 cacheMB=15 packetsWritten=1257 audioFifo=0 abFifoKB=0 abSwrKB=0 abTotKB=0 muxBytesMB=13 muxCuts=8 srvConns=1 srvBytesMB=2 srvSfMB=2 pktAlive=3 pktTotal=13441 subCues=0 prefetch=off swFrames=0 audioTracks=2 subTracks=36 subActive=false avBufAhead=0.1s avBufBehind=21.0s frameAhead=0.00s prodShift=-3.00s hostShift=-3.00s seams=2
    20:07:28.998 [HLSSegmentProducer] #65 backpressure WEDGE BROKEN (advance) head=15 target=5 cacheTarget=4 parked=5s (fast path: fetch target + rendered clock both frozen); exiting pump for host re-anchor on AVPlayer position
    20:07:28.999 [HLSSegmentProducer] seg-15.m4s partial at teardown (588 B) discarded, not adopted
    20:07:28.999 [HLSSegmentProducer] pump finished: reason=backpressureWedge packetsRead=4276 packetsWritten=1257 lastError=0 elapsed=5274ms cacheCount=11
    20:07:28.999 [HLSVideoEngine] #358 consumer is blocked on seg4, which 2 pumps have now folded away (no IRAP reaches its plan boundary). A re-anchor rebuilds the same gap, so the source cannot be played past it; failing instead of re-anchoring.
    20:07:30.005 [HLSVideoEngine] #65 consumer re-engage: no segment fetch for 6s after wedge re-anchor (pos=21.01s, wedge capture 21.01s); asking host to nudge AVPlayer
    20:07:30.005 [AetherEngine] #65 re-engaging stalled AVPlayer (wedge re-anchor): nudge seek to 21.01s
    20:07:30.006 [NativeAVPlayerHost] #1 rate=1.0
    20:07:30.006 [NativeAVPlayerHost] #1 timeControlStatus=waitingToPlay reason=AVPlayerWaitingToMinimizeStallsReason t+33.69s
    
  9. superuser404notfound commented on Aug 11, 2026

    @superuser404notfound
    OwnerAuthor

    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.

    first video pkt: dts=0 pts=300000        (srcVideoTb=1/100000, so PTS = DTS + 3.000s)
    firstKeyframePts=-300000 (-3.000s)       videoStream.start_time=0
    

    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 at drift=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.mp4
    • 5 s offset, IRAPs every 4.2 s: segment 0 was never opened at all, so the session never started (final t=-5.08s, seg0 slow-served forever). Worth noting against yesterday's commit: the fold bookkeeping does not cover this one, because it lives in advanceMuxer and the first muxer allocation is not an advance.
    • 3 s offset, wider boundaries: no fold, but a constant drift=-2.480s, a whole keyframe interval of plan-versus-content disagreement that nothing reported.

    Both now read drift=0.000 on 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. segverify says 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 firstKeyframePts also 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.

  10. superuser404notfound commented on Aug 11, 2026

    @superuser404notfound
    OwnerAuthor

    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.

  11. DrHurt commented on Aug 11, 2026

    @DrHurt
    Contributor

    That fixed it and CPU usage is slightly below QuickTime (~3%) which makes me very happy! That was a brief 60s test.

  12. superuser404notfound commented on Aug 11, 2026

    @superuser404notfound
    OwnerAuthor

    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=300000 is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions