Skip to content

feat(remote-hls): telemetry, audio tracks and delivered video format on the bypass - #664

Merged
superuser404notfound merged 4 commits into
mainfrom
feat/remote-hls-stats
Sep 28, 2026
Merged

superuser404notfound merged 4 commits into
mainfrom
feat/remote-hls-stats

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

On the nativeRemoteHLS bypass (route remoteBypass) the engine published almost nothing a host could show: no liveTelemetry, an empty audioTracks, and no delivered video format. Hosts then fell back to their own metadata for the original file. Sodalite's Stats for Nerds showed "3840x2160, Main 10, 17 Mbps" for a 1280x720 H.264 Jellyfin transcode.

Everything is read from AVPlayer's own item, with no second connection to the origin:

  • Telemetry: the sampler runs on the bypass. Both bitrates come from AVPlayer's transfer total, using the same window and lifetime rules as the other routes. Network throughput, transferred bytes, dropped frames and forward buffer come from the access log and the loaded ranges. The loopback counters stay 0.
  • Audio: there is one TrackInfo per audio track AVPlayer built, with codec, channels, sample rate, profile and Atmos taken from the format description, and ids starting at 400000. selectAudioTrack is informational on this route and logs the call instead of acting on it.
  • Delivered video: sourceVideoWidth/Height and sourceVideoStreamFormat (colour, profile, bit depth) now describe the stream AVPlayer plays. The doc contracts say that under a transcode this is the delivered stream, not the library file.

No new public API. docs/api.md is updated.

Tests: swift test passes (XCTest 646 plus swift-testing 3584), and there are 21 new tests. aetherctl play --native-hls on Apple's bipbop fMP4 master shows all three.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf

Vincent Herbst and others added 4 commits September 28, 2026 15:30
…obe vocabulary

Pure mapping for the nativeRemoteHLS bypass, which runs no libav probe: the
delivered video's dimensions, colour description (CoreMedia names to libav's)
and avcC / hvcC profile, depth and pixel format as a VideoStreamFormat, and
each audio track as a TrackInfo (codec, channels, rate, AAC profile, E-AC-3
JOC from the dec3 record). Synthetic audio ids from 400000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf
…e-HLS bypass

The bypass has no demuxer, so both bitrate fields come from the access log's
session transfer total through TransferRateMeter (same 10 s window and
active-seconds average as the demuxer meter). The producer A/V gap and the
#169 tail-park synthesis stay with the loopback route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf
… format on the bypass

loadRemoteHLS now starts the telemetry sampler, and the host reads the item's
audio tracks (bypass only, via SessionLoadContract.readsBackAudioTracks) and
the delivered video's description next to the #168 format read. The engine
publishes them as audioTracks / activeAudioTrackIndex and sourceVideoWidth /
sourceVideoHeight / sourceVideoCodecName / sourceVideoStreamFormat, so a stats
panel shows the transcode actually playing instead of the library's file.
selectAudioTrack refuses .remoteBypass (AVPlayer owns the selection there).
aetherctl play prints the settled source and audio state plus inst/avg bitrate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf
…the transfer

Metering the bitrate fields from AVPlayer's transfer total made them read
buffer fill at link speed: 22.6 Mbps instant and 15.8 average for a 3.7 Mbps
Jellyfin transcode on an iPhone right after a start. The fields name the
stream's rate, so on the bypass they are now the playing variant's declared
BANDWIDTH and AVERAGE-BANDWIDTH from the access log. The transfer stays in
the network fields. TransferRateMeter goes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf
@superuser404notfound
superuser404notfound merged commit 10f83ff into main Sep 28, 2026
7 checks passed
@superuser404notfound
superuser404notfound deleted the feat/remote-hls-stats branch September 28, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant