Repository navigation
Closed
Labels
bugSomething isn't working
Description
What happened?
Support remote HLS external WebVTT subtitles in loopback mode (non-nativeRemoteHLS)
Description
When playing a remote HLS stream with external WebVTT subtitles (e.g. WWDC video streams using separate subtitle playlist tracks #EXT-X-MEDIA:TYPE=SUBTITLES) in loopback mode (nativeRemoteHLS = false), no subtitle tracks are populated, and the subtitle picker remains empty.
Steps to reproduce
- Load a remote HLS URL containing external subtitles, such as:
https://devstreaming-cdn.apple.com/videos/wwdc/2025/323/4/0fd37581-632a-4827-b656-d192163cece0/cmaf.m3u8 - Configure load options to disable bypass:
options.nativeRemoteHLS = false - Inspect
engine.subtitleTracksafter the stream is loaded. - Expected Result: Subtitle tracks for all declared languages (English, Chinese, Japanese, etc.) are available for selection.
- Actual Result:
engine.subtitleTracksis empty.
AetherEngine version or commit SHA
5.9.5
Host app
AetherPlayer
Platform
macOS
OS version
macOS 27 beta3
Device / chip
MacBook Pro M3
Playback path
Native AVPlayer
Source media (for playback bugs)
Error codes / log lines
## Root Cause Analysis
Upon inspecting the `AetherEngine` source code, the issue stems from the following aspects in the loopback pipeline:
1. **FFmpeg Probe Limitation**:
FFmpeg (`libavformat`)'s HLS demuxer does not automatically resolve and expose `#EXT-X-MEDIA:TYPE=SUBTITLES` tracks as inline `AVMEDIA_TYPE_SUBTITLE` streams during the initial probe. Thus, `Demuxer.subtitleTrackInfos()` returns an empty array.
2. **Ingest Engine Omits Subtitles**:
In `Sources/AetherEngine/IO/HLSIngest/HLSPlaylist.swift`, the `parseMaster(_:)` method only resolves variant streams and audio renditions (`TYPE=AUDIO`), completely ignoring `TYPE=SUBTITLES` declarations:
// Currently only AUDIO is parsed:
} else if line.hasPrefix("#EXT-X-MEDIA:") {
if attribute("TYPE", in: line) == "AUDIO",
let uri = attribute("URI", in: line),
let group = attribute("GROUP-ID", in: line) {
...
}
}
Anything else
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Merge feature/ae154-remote-hls-autoroute-bypass-subs: non-live remote…
docs: changelog entry for 5.10.0 (#154 remote HLS auto-route + bypass…
superuser404notfound commentedon Jul 19, 2026
Thanks for the detailed report and the source-level analysis, both pointers were on target.
Digging in showed the situation was one step worse than described: with
nativeRemoteHLS = false, a remote VOD m3u8 did not just come up with an emptysubtitleTracks, the load itself could never succeed. The bundled FFmpeg is built with--disable-network, so the hls demuxer neither engages behind the engine's custom AVIO context (its probe rejects a playlist without a.m3u8extension or MIME hint, the "Not detecting m3u8/hls with non standard extension and non standard mime type" log) nor could it ever fetch a variant or a segment. On 5.9.5 the repro URL fails withopenFailed(-1094995529)(AVERROR_INVALIDDATA) before any track list exists. TheHLSPlaylist.parseMasterin the analysis belongs to the live MPEG-TS ingest (HLSLiveIngestReader); it does ignoreTYPE=SUBTITLES, but it also rejects fMP4/CMAF playlists (EXT-X-MAPgoes terminal), so it never participates in this stream either.Demuxing remote HLS VOD inside the loopback pipeline would mean rebuilding AVPlayer's HLS stack (CMAF ingest, byte ranges, rendition switching), which goes against the engine's native-first design; AVPlayer plays remote HLS natively and well. 5.10.0 fixes the issue along that line instead:
AVIOReaderError.hlsPlaylistOnVODPath, the load(url:) with isLive: true on an HLS playlist URL fails open: silent reconnect loop with no terminal state (262 cycles over a 5.75-min observation), playlist body consumed as raw bytes, no error, no give-up #140 sibling for VOD) andload()transparently reroutes it onto thenativeRemoteHLSbypass.options.nativeRemoteHLS = falsestill lands on AVPlayer for remote HLS, the host just no longer needs to pre-route it.AVMediaSelectionGroupasengine.subtitleTracks: synthetic ids, group order preserved, language tags, forced and SDH dispositions carried.selectSubtitleTrack(index:)selects the rendition through AVPlayer's media selection (AVPlayer renders the cues itself; there are no overlay cues on this path),clearSubtitle()deselects, and a selection made by AVKit or a system caption preference is mirrored intoactiveSubtitleTrackIndexonce the item is ready.startPositionnow also applies on the bypass as a resume seek.Verified end to end against the WWDC URL from the report: the reroute engages, all 7 declared renditions (en, zh, ja, ko, fr, es, pt) appear in
subtitleTracks, and selecting English lands on the item's media selection.Released in 5.10.0. Please retest with that version and report back.
feat(hls): reroute non-live remote HLS onto the native bypass and sur…
jihongboo commentedon Jul 22, 2026
Thank you for your reply. I’ve used the latest version, and I’ve found that the issue has been resolved on non-MacOS platforms. However, the problem still persists on Mac. When I tried to debug it, I noticed that setting
nativeRemoteHLSdoesn’t seem to have any effect.superuser404notfound commentedon Jul 22, 2026
Thanks for retesting, and for the extra detail on the macOS side.
Two things up front, then a fix and one request.
On
nativeRemoteHLShaving no effect: that is expected now. Since 5.10.0 a remote HLS VOD URL is rerouted onto the AVPlayer bypass whethernativeRemoteHLSistrueorfalse, because the loopback pipeline (FFmpeg built with--disable-network) can never demux it. So toggling the flag no longer changes remote-HLS behavior; both settings land on AVPlayer.On the empty picker:
subtitleTracksis populated asynchronously and is a@Publishedproperty. On the bypass the engine loads the item's legibleAVMediaSelectionGroupand only then setssubtitleTracks, which happens afterload()returns (sometimes afterreadyToPlay). A host that readsengine.subtitleTracksonce, right afterload(), will see it empty. It has to observe the property. Worth double-checking on your side, since that alone can look like "empty on one platform, populated on another" purely from timing.I could not reproduce an empty result on macOS 26.5: the reroute engages, all 7 declared renditions surface, and English is selectable end to end. You are on macOS 27 beta3, one OS version ahead of what I can test here, so the most likely cause is a real timing difference: on that OS
loadMediaSelectionGroup(for: .legible)may return an empty group until the item reachesreadyToPlay, and the discovery loaded that group exactly once and gave up if it was empty, leavingsubtitleTracksempty for the whole session.I have staged a fix along that line: the discovery now retries the legible-group load once after
readyToPlaybefore giving up, so an early-empty group recovers instead of dropping every rendition. The fast path is unchanged (a non-empty first load skips the wait). Commit87d8216onfix/ae154-remote-hls-subtitle-readiness-retry.To make sure that is actually your failure mode before I cut a release, could you grab two log lines from a macOS 27 beta3 run (both go through
EngineLog)?[AVIOReader] HLS playlist body on the VOD loopback path (AE#154); rerouting to the native remote-HLS bypass.[AetherEngine] AE#154: remote-HLS legible group surfaced N subtitle rendition(s)Interpretation:
surfaced 0or is absent: the early-empty group is the cause and the staged retry fixes it.surfaced 7but your picker is still empty: the engine surfaced the tracks and the host is readingsubtitleTracksonce instead of observing the@Publishedvalue.Thanks again.
superuser404notfound commentedon Jul 22, 2026
Follow-up: the readiness retry is now released in AetherEngine 5.18.6, and AetherPlayer 0.12.2 (build 54) bundles it.
Since the symptom is macOS-only while iOS works, it is worth ruling out that the macOS AetherPlayer you tested pins an engine from before the fix. The cleanest retest is on a current build: update AetherPlayer to 0.12.2 through the in-app updater (Sparkle), or grab the DMG directly from https://github.com/superuser404notfound/AetherPlayer/releases/tag/v0.12.2, then load the WWDC URL again and open the subtitle picker.
If 0.12.2 still shows an empty picker on macOS 27 beta3, the two log lines from my previous comment (the
rerouting to the native remote-HLS bypassline and thelegible group surfaced N subtitle rendition(s)line) will tell us exactly which layer to look at. Thanks.jihongboo commentedon Jul 22, 2026
First of all, I downloaded AetherPlayer 0.12.2, but I didn't find the entrance to play the remote video.
Secondly, I didn't find these two logs.
About
[AVIOReader] HLS playlist body on the VOD loopback path (AE#154); rerouteing to the native remote-HLS bypass.,Self.bodyBeginsWithHLSPlaylistTag(firstWindowPrefix())returns false,firstWindowPrefix()returns:Regarding
[AetherEngine] AE#154: remote-HLS legible group surfaced N subtitle rendition(s), first of all, I need to setnativeRemoteHLSto true, and secondly, the following conditions returned directly, which seems to begroupacquisition failure.By the way I just updated macOS to 27 beta4, and the issue sill there.
superuser404notfound commentedon Jul 23, 2026
Thanks, you are right about AetherPlayer 0.12.2: the macOS app did not expose any way to enter a remote URL, so the released app was not actually usable as the retest vehicle. I have added an Open URL sheet to the macOS empty state and File menu, with Cmd-L as the shortcut, in AetherPlayer commit
d52f8c6. It uses the same URL validation andPlayerViewModel.openpath as the iOS UI. This will be included in the next AetherPlayer release.I tested that macOS UI end to end on macOS 26.5 with the exact WWDC URL from this issue. Playback starts through the native path and the subtitle menu contains all seven renditions: English, Chinese, Japanese, Korean, French, Spanish, and Portuguese.
There are also two important clues in the debugger data:
The bytes you captured decode to an ISO BMFF header:
00 00 00 1c 66 74 79 70 4d 34 56 20, orftypM4V. That is an MP4 media object, not an HLS playlist. The exact issue URL currently responds withContent-Type: application/vnd.apple.mpegurland begins with#EXTM3U. Therefore theAVIOReaderin that debug run was not reading the master-playlist response whenfirstWindowPrefix()was inspected. Please check the exacturlheld by thatAVIOReader, including any host-side URL replacement or redirect handling.The
publishRemoteHLSSubtitleTracksimplementation in your comment is the older one-shot version. AetherEngine 5.18.6, commitc10ec2508a19ae334163d0077a86c2e995ff32c7, usesvar group, waits forreadyToPlayafter an empty first result, and loads the legible group again. AetherPlayer 0.12.2 pins that exact commit. If your source build still shows the one-shotguard let groupimplementation, it is compiling a different AetherEngine revision from the one bundled by 0.12.2.The new macOS URL entry point will make the next retest unambiguous. Since I cannot test macOS 27 beta4 locally, please retest that build there once it is published. If it still differs, the exact AetherEngine revision plus the
AVIOReader.urlvalue at the prefix check should identify whether the remaining difference is dependency resolution, URL routing, or AVFoundation behavior on macOS 27.superuser404notfound commentedon Jul 23, 2026
Follow-up: AetherPlayer v0.12.3 (build 55) is now released and bundles AetherEngine 5.20.1.
The macOS retest path is now:
cmaf.m3u8URL from this issue.The signed and notarized DMG is available from the release page, and the Sparkle appcast now advertises build 55. Please retest this build on macOS 27 beta4. If the subtitle menu is still empty there, please share the exact AetherEngine revision and the
AVIOReader.urlvalue from that run.fix(subtitles): retry remote-HLS legible discovery after readiness (s…
jihongboo commentedon Jul 25, 2026
I just updated to the latest version (5.23.2), and then I found that the problem was solved. Similarly, there is no problem with AetherPlayer. I think this bug has been solved.
Thank you.
fix(io): a playlist served without a length is classified on the forw…
docs(modifications): record the superuser404notfound#154 HLS MIME dec…
docs(guide): give the superuser404notfound#154 MIME declaration its o…
fix(native): declare the HLS MIME type on the #154 reroute so a mis-t…
Merge PR #1040: declare the HLS MIME type on the #154 reroute
fix(native): declare the HLS MIME type on the superuser404notfound#154 …
docs(modifications): record the superuser404notfound#154 HLS MIME dec…