Repository navigation
Description
What happened?
AetherEngine 7.33.2 fails to open a valid finite HLS VOD when each segment is served through an outer endpoint whose path has no media extension and whose query contains the actual MPEG-TS path.
Example shape:
https://media.example/api/ts?url=https%3A%2F%2Forigin.example%2Fsegment-001.ts
The outer endpoint returns a valid MPEG-TS body containing HEVC video and AAC audio. The outer URL and query are required for authorization; directly requesting the nested URL is refused.
FFmpeg's HLS extension check evaluates the outer segment URL. Because /api/ts has no accepted transport extension, it rejects the segment with AVERROR_INVALIDDATA before AetherEngine can produce the typed HLS classification that normally reaches the AE#268 seekable TS-to-fMP4 ingest. The relevant FFmpeg gate is in test_segment:
RFC 8216 defines a media segment by its URI and body; it does not require the URI path to end in .ts:
Steps to reproduce
Serve a finite direct-media playlist such as:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
https://media.example/api/ts?url=https%3A%2F%2Forigin.example%2Fsegment-001.ts
#EXT-X-ENDLIST
Have the outer endpoint return an MPEG-TS segment whose PMT identifies HEVC with stream type 0x24.
Then load the playlist using:
let options = LoadOptions(
httpHeaders: requiredHeaders,
isLive: false,
nativeRemoteHLS: false,
autoplay: false
)
try await engine.load(
url: playlistURL,
startPosition: nil,
options: options
)On unmodified 7.33.2, direct Aether playback fails during source open:
AVERROR_INVALIDDATA (-1094995529)
backend not established
Downstream diagnostic result
A narrow experimental admission path was added without changing the segment transport.
On a physical Apple TV it recorded:
queryWrappedOnly=true
segments=120
queryWrappedSegments=120
duration=1203.28s
carriage=hevc_in_mpegts
AE#268 event=taken
This proves that:
- the playlist is finite and resolvable;
- the URL shape is correctly recognized;
- the first segment body is HEVC-in-MPEG-TS;
- the existing AE#268 ingest can accept the source once the extension gate is bypassed safely.
A later segment-fetch failure is a separate transport issue and should not be folded into QueryWrapped admission.
Expected behavior
Before the generic FFmpeg URL opener rejects the source, AetherEngine should perform a narrow, bounded admission check for an explicit finite HLS playlist:
- recognize an outer segment path without a known media extension when a query value contains a conventional MPEG-TS path;
- confirm the actual body is MPEG-TS and its PMT carries HEVC;
- preserve the complete outer URL, query, redirects, and HTTP headers;
- route the source through the existing AE#268 seekable TS-to-fMP4 ingest;
- never unwrap and directly request the nested URL;
- avoid globally disabling FFmpeg's extension safety check.
The following sources must retain their current behavior:
- ordinary
.tssegment URLs; - query values naming non-transport media;
- live/DVR playlists;
- encrypted or fMP4 playlists;
- H.264, audio-only, unreachable, or ambiguous sources.
This issue should not introduce a QueryWrapped-specific downloader, timeout, concurrency model, buffer, or HTTP-version policy. Those belong to the underlying HLS transport layer.
AetherEngine version or commit SHA
7.33.2 / e7afcfad3973426a6ffff31fc111f6b1e5078061
Host app
Custom integration using SyncnextHybrid's diagnostic smoke player.
Platform
tvOS, physical Apple TV 4K.
Playback path
Source open before backend selection; expected destination is the AE#268 seekable HLS VOD ingest.
Related issue
#268 implements the destination ingest path. This report covers an earlier admission gap that prevents query-wrapped segments from reaching it.
Activity
qoli commentedon Oct 10, 2026
Companion issue #732 tracks the persistent HTTP/1.1 HLS transport policy. This issue is intentionally limited to QueryWrapped recognition and admission into the existing AE#268 ingest.
superuser404notfound commentedon Oct 11, 2026
Thanks for the detailed report. I tried to reproduce this on both the reported tag and current main, and on this engine a query-wrapped segment URL reaches the AE#268 ingest without any extra admission step. So the failure you saw must come from somewhere other than the segment URL shape, and I'd like to find where before changing anything.
Why FFmpeg's
test_segmentgate should not be on this pathFFmpegBuild is built with
--disable-network, so libavformat's HLS demuxer never fetches a playlist or a segment in AetherEngine. A URL load goes like this:AVIOReaderopens the URL, sees an#EXTM3Ubody (by content, not by extension) and throws the typedhlsPlaylistOnVODPath.load()catches that and callsHLSVODIngestReader.makeIfHEVCMPEGTS, which parses the playlist itself, resolves the first segment URI as written (outer URL, query and headers intact), and classifies that segment's PMT.hevcInMPEGTSit reloads on the ingest. Nothing in that chain looks at the segment path's extension.What I ran
A local origin serving the 120-segment long-GOP HEVC fixture (10 s segments, one IRAP per segment) only through
/api/ts?url=https%3A%2F%2Forigin.example%2Fseg000.ts, with every other path answering 403, so a direct request for the nested URL would show up in the log. Thenaetherctl play --seek-every 12 --seek-count 1 --seek-pattern 600:e7afcfad)/media.m3u8AE#268: finite HEVC-in-MPEG-TS HLS,segments=120 duration=1200.04s, seek to segment 57,VERDICT: OK/api/playlist?id=42(no extension)60f5cc9e)/media.m3u8The nested URL was never requested directly (0 denied requests).
One variant does behave differently: when the outer endpoint refuses the probe's
Range: bytes=0-…request with 403, the log shows[HLSVODIngest] carriage probe inconclusive: playlistUnreachable(403)and the load falls back to the AE#154 native bypass. That is still notAVERROR_INVALIDDATA, but it is the kind of shape I'd look at next.What would pin it down
load()call to the error. The[AVIOReader],[AetherEngine] AE#154/AE#268and[HLSVODIngest]lines say which step stopped.engine.load(url:), or through a.customsource / reader built in SyncnextHybrid. A custom source cannot be rerouted (there is no playlist URL to ingest from), and that is exactly where an m3u8 body ends inAVERROR_INVALIDDATA./api/tsendpoint answers aRangerequest (200, 206, or a refusal)."backend not established" is not an engine string, so I assume it comes from the host; the line just before it in the engine log will be the useful one.
I'll keep this open until the log shows where it fails.
qoli commentedon Oct 11, 2026
Thanks for checking this on both 7.33.2 and main. I went back through the original device run, host log, and downstream diff. There are two corrections to my original report, followed by the production behavior that still needs explaining.
Corrections to the original report
You are right about the upstream call chain and
--disable-network. I confirmed that our pinned FFmpegBuild also has--disable-network. The historical evidence does not establish that FFmpegtest_segmentsaw the outer segment URL, so the issue body states that causal attribution too strongly. The downstream result proves that an early content-backed check can admit this source into AE#268; it does not by itself prove which upstream check was bypassed.Also, the failing build was based on tag
7.33.2/e7afcfad, but it was not a completely pristine checkout: it carried our pre-existing downstream patches0001,0002, and0004, while the QueryWrapped patch0005was absent. I should not have called that “unmodified 7.33.2”. None of those earlier patches implements QueryWrapped admission, but this distinction matters for reproduction.What the failing run actually did
This was not a
.customsource. The physical-device smoke host constructsLoadOptions(httpHeaders: ..., autoplay: false)and callsengine.load(url:options:)directly:https://github.com/qoli/SyncnextHybrid/blob/2b029f9/Examples/HybridSmokePlayer/Sources/SmokeViewModel.swift#L331-L364
Immediately before launching the same source identity with the same required header, a preflight against the playlist URL returned:
In other words, this playlist endpoint ignored the range and returned the complete valid playlist. A fresh outer segment endpoint from that playlist separately answered a bounded range correctly:
The direct Aether run then produced this on a physical Apple TV (tvOS 26.6):
backend not establishedin the original issue is indeed host wording, not an engine log line.The historical
devicectl --consolecapture unfortunately contains only the two smoke events above; it did not retain the[AVIOReader], AE#154 / AE#268, or[HLSVODIngest]lines you asked for. I therefore cannot honestly present that historical capture as the complete engine log.What the downstream experiment changed
The relevant part of the downstream diff is here:
https://github.com/qoli/SyncnextHybrid/blob/2b029f9/Patches/AetherEngine/0005-query-wrapped-hls-segment-ingest.patch#L1-L61
It calls the bounded
HLSVODIngestReaderclassification before the normal probe/open path, but only for an explicit finite.m3u8/.m3uURL whose segments have the QueryWrapped shape and positive HEVC-in-MPEG-TS evidence. On the real source it recorded:This narrows the unexplained difference to the path before that early check. Given your reproduction and the source code, the better question is now:
Your local-origin fixture establishes that QueryWrapped segment URLs alone are not sufficient to cause the failure. It does not reproduce the production origin / physical-tvOS response behavior above. The later HTTP/1.1 connection-affinity failure occurs only after admission and remains separate under #732; I am not asking #733 to absorb that transport policy.
I will treat the
test_segmentexplanation as withdrawn unless a new pristine-tag run proves it. The next useful artifact is exactly what you requested: a fresh run on pristine 7.33.2 with the full engine log fromload(url:)through the terminal error, including[AVIOReader], AE#154 / AE#268,[HLSVODIngest], response status, and the playlist prefix. That will distinguish an AVIOReader classification/open problem from an ingest probe or host integration problem without guessing from the finalAVERROR_INVALIDDATA.superuser404notfound commentedon Oct 13, 2026
Thanks for the corrections and the preflight, that last detail was the missing piece. I can now reproduce your exact error on current main, and it has nothing to do with the segment URL shape.
What reproduces it
A playlist response that is a
200without a known length (chunked, or noContent-Lengthat all). Same local origin as before (/api/playlist?id=42, segments only via/api/ts?url=...), only the playlist framing varied:200,Content-Lengthset,RangeignoredVERDICT: OK206honouringRange200,Content-Encoding: gzip200,Transfer-Encoding: chunkedLOAD FAILED: HLSVideoEngine: open failed (Demuxer: open failed (Invalid data found when processing input (-1094995529)))200, no length header, connection-closeSo a
200that ignoresRangeis fine on its own. The engine asksbytes=0-33554431, and a complete 41 KB body with a length is a valid answer to that. The length is what matters.Why
Without a length, the ranged open's
200cannot be told apart from an origin that ignores ranges, so the DMX-101 guard hangs up at the head and the open continues forward-only on one unranged GET. The AE#154#EXTM3Ucheck only looked at the persistent window, which that path leaves empty. FFmpeg then got the playlist as container bytes, henceAVERROR_INVALIDDATA. Your 0005 patch avoided this because it classified the playlist before the reader ever opened, which is why it looked like a QueryWrapped admission problem.Fix
398fc5b0onfix/ae733-playlist-on-forward-only-openruns the same classification on the first bytes of the forward-only stream. With it, the chunked and length-less variants logHLS playlist body on the forward-only open (AE#733), route through AE#268 (segments=120), and seek to segment 57 withVERDICT: OK. The other variants are unchanged. There is a regression test, and the full suite is green.To confirm this is your origin's shape: does the playlist response carry a
Content-Lengthheader (curl -sD - -o /dev/null -H 'Range: bytes=0-33554431' <playlist url>)? If it is chunked or has no length, this is the fix, and pristine main plus398fc5b0should play the source without patch 0005.chore(release): prep 7.36.0 - DTS:X keeps its heights, a repeated liv…
qoli commentedon Oct 16, 2026
Verified fixed on the original ONE reproduction on 2026-10-16, using a physical Apple TV 4K (AppleTV6,2), tvOS 26.6, and HybridSmokePlayer in direct
aetherEnginemode.Candidate and source
c6365cc3c8850bdb670654ca26dcd21f73670875, with FFmpegBuild 3.7.1.AVIOReaderand the relevant ingest/probe/transport files were byte-identical to official 7.36.0.Player()supplied the URL and required headers. The original outer segment URLs were preserved. Local verification first obtained HTTP 200 for the playlist and complete first segment and decoded both video and audio.heldSourceConnectionat its default false. The explicit HLS VOD needs an explicit persistent HTTP/1.1 transport policy with cross-segment connection reuse #732 policy was tested separately.The physical-device log now shows the forward-only
HLS playlist body ... (AE#733)classification, followed by AE#268 andsegments=120 duration=1203.28s.Control result: PASS
Run
52b937b0-5dcf-4060-97a9-b38fe2c03048:One earlier attempt reached the corrected classification/ingest path but then hit
NSURLError -1001during source reading. A diagnostic replay and then the same original signed binary, with the same URL/headers and no transport or timeout changes, passed. The precise transient-timeout cause remains unproven; I am not attributing it to the playlist classification or HTTP/2.The original #733 reproduction is resolved without patch 0005. Closing as completed. The separate #732 protocol/reuse acceptance is reported there. Signed URLs and header values remain private.