Skip to content

AetherEngine 5.19.0

Choose a tag to compare

@superuser404notfound superuser404notfound released this 22 Jul 16:52

Added

Fast live-join profile for realtime raw-TS sources (IPTV zapping) (#195)

New LoadOptions.liveJoinProfile with a .fastZap opt-in for low-latency live joins.

The problem. Raw live MPEG-TS over HTTP on the native loopback path took 10-18 s to first frame on a strict-realtime origin. Since 5.18.5 the first live manifest is gated on the live-edge holdback: the window must carry HOLD-BACK = 3 x TARGETDURATION of content before the first serve (the RFC 8216bis floor; undercutting it is exactly the -16832 restart loop #189 fixed). With the fixed ~4 s segment cut target, TARGETDURATION never fell below 6 (the ceil(1.5 x cut) floor), so the holdback was always >= 18 s, regardless of how short the source GOPs were. A backlog-serving origin fills that at I/O speed; a strict-realtime origin can only fill it in wall-clock time.

The fix. .fastZap shrinks TARGETDURATION instead of the holdback: live segments are cut at every keyframe past 0.5 s, so they quantize to the source keyframe cadence, TARGETDURATION collapses to ceil(max EXTINF) (the real GOP length), and the holdback the join waits for shrinks proportionally. The holdback contract itself is unchanged in both profiles:

  • Long-GOP sources cannot be cut shorter than their GOP and degrade to .standard behavior automatically (#189's 5.76 s segments produce TD=6 / 18 s holdback under both profiles).
  • Bursty ingest origins keep the observed-cadence TARGETDURATION floor (#167), so fast join never trades away the raised patience bursty delivery requires.
  • .standard remains the default and is byte-identical to 5.18.7.

Measured (strict-realtime origin, 1080p50 H.264, GOP = 1 s, ~6 Mbps TS, zero backlog): readyToPlay at +2.0 s with .fastZap vs +20.0 s with .standard; stable playback afterwards, no -16832 / -12888 / -15410.

Trade-off (documented on the option): a smaller TARGETDURATION also tightens AVPlayer's unchanged-playlist patience and live-edge buffer, so an origin that stalls or bursts mid-stream rebuffers or errors more readily than under .standard. Opt in for zapping UX, keep .standard for lean-back viewing.

Tooling. aetherctl live gains --fast-zap and --preroll N (0 models a strict-realtime origin with no backlog burst) for reproducible A/B join-latency runs, plus timestamped logs and a JOIN metric.

Proposed with field measurements by @Simpendaal (#195). Covered by Issue195FastLiveJoinTests; the #189 holdback tests are untouched and green.