Skip to content

Live, engine-cut TS with a 5 s GOP: first window waits ~2 s for whole segments; partial segments (EXT-X-PART)? #936

Open

Description

@firestaerter3

What should the engine do?

On engine-cut live sources, publish LL-HLS partial segments (EXT-X-PART with PART-HOLD-BACK) so the start holdback follows the part length instead of the GOP. Channels with a 5 s GOP would then start about as fast as 1 s GOP channels do now.

Motivating media or use case

Xtream live TS through Dispatcharr into Jellyfin, played in Moonfin 2.8.0 (AetherEngine 7.50.0) on macOS 26.5.1, loopback route, fastZap. H.264 or HEVC 1080p50 + AAC. Measured 2026-10-30, six zaps in a row:

Channel GOP TARGETDURATION / holdback First live window Click to first frame
NPO 1 (h264) 1 s 2 / 6 s 0.36 s 2.0 s
NPO 2 (h264) 1 s 2 / 6 s 0.42 s 1.9 s
RTL 5 (h264) 1 s 2 / 6 s 0.64 s 3.4 s (slow upstream)
RTL 4 (h264) 3.84 s 6 / 18 s 1.82 s 3.4 s
NPO 3 (hevc) 5 s 8 / 24 s 2.51 s, "4 segments / 20.000s < 24.000s holdback, fastZap bounded start after 2.000s grace" 3.5 s
SBS 6 (hevc) 5 s 8 / 24 s 2.07 s, "5 segments / 25.000s >= 24.000s holdback" 3.6 s

The upstream sends its backlog in a burst: on NPO 3 four 5 s segments were finalized within 1.4 s of the source opening, and the gate then waited out the 2 s grace. On 1 s GOP channels the same step is 0.4 to 0.6 s. So on the long-GOP channels about 1.5 to 2 s of each zap is the holdback being sized in whole GOPs. AVPlayer itself is quick once the manifest is served (0.04 s to first frame), which is a big improvement over 6.89.1, where RTL 4 took 7.6 s.

If partial segments are too large a change, a smaller grace when the cut backlog already holds a few whole GOPs would get part of the way.

Area

Performance

Host app / integration context

Moonfin 2.8.0 on macOS, Jellyfin 12 native tuner, Dispatcharr proxy.

Would you be willing to open a PR?

No

Activity

  1. added
    area: live
    enhancement
    on Oct 30, 2026
  2. quint-aether commented on Oct 30, 2026

    @quint-aether

    This is a new feature request. Today the loopback server publishes whole segments only. It supports blocking reload at segment level but serves no EXT-X-PART (see Sources/AetherEngine/Network/HLSLocalServer.swift). Your fallback idea, a shorter grace when the cut backlog already holds several GOPs, is related to #686, which covered the second request's grace in fastZap's bounded start on engine-cut raw TS. #447, #594 and #678 cover earlier work on how the fastZap holdback is sized.

    Automated triage by Quint (Claude). A maintainer reads every issue and will follow up.

  3. superuser404notfound commented on Oct 31, 2026

    @superuser404notfound
    Owner

    Thanks for the measurements, the table makes the cost very clear.

    Partial segments are a large change to the loopback server (parts, preload hints, part-level blocking reload, and a different AVPlayer start path), so they are not planned for now.

    The smaller idea is the one worth doing. On NPO 3 the gate waited out a 2 s grace that could not have changed the outcome: four 5 s segments were already cut, the holdback was 4 s away, and once the upstream burst is over the next GOP takes 5 s to arrive in real time. The plan is to end that grace as soon as the source is back to real time and the missing depth cannot arrive within it.

    One question before that lands: on the NPO 3 zaps that started bounded (20 s window against a 24 s holdback), did the log show any -16832, #524 the client is running thin, or a visible rebuffer in the first 30 s or so? Long-segment bounded starts are the case that has not been measured yet, and those lines decide how aggressive the shorter grace can be.

  4. superuser404notfound commented on Oct 31, 2026

    @superuser404notfound
    Owner

    The shorter grace is merged in 315704e (not released yet).

    The gate now watches how far the cutter has read into the open segment. Once the burst is drained and the source reads at 1x, a grace that can no longer reach the next keyframe ends right away instead of running out. A burst that is still arriving keeps the grace, and so does a 1 s GOP channel, where the grace is still worth one more segment.

    Measured with aetherctl live --fast-zap --realtime on 6 Mbit/s seeds, two to three runs per row:

    Shape Before: first manifest / first picture After
    5 s GOP, 20 s upstream burst (the NPO 3 shape) 2.01-2.06 s / 2.38-2.57 s 0.67-0.77 s / 1.11-1.21 s
    5 s GOP, no backlog 10.42-10.45 s 8.44-8.48 s
    1 s GOP, no backlog 1.23 s, 3 segments unchanged
    1 s GOP, 20 s burst 0.03 s, full holdback unchanged

    The window served is the same as before (four segments, 20 s against the 24 s holdback), it just goes out about 1.3 s sooner. There was no -16832 in any of the 5 s rows. The question from the earlier comment still stands: a field log from NPO 3 or SBS 6 on the next release, especially any -16832 or rebuffer in the first 30 s, would show whether that shallower window costs anything on a real client.

  5. superuser404notfound commented on Nov 1, 2026

    @superuser404notfound
    Owner

    Released in 7.54.0 (ee5027c).

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

    area: liveenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions