Repository navigation
Description
What happened?
A plain HEVC-in-MP4 progressive file (VOD) dispatched to the native/loopback path is demuxed and re-muxed to fMP4 by HLSVideoEngine, but the resulting loopback stream fails in AVPlayer with zero tracks built and a terminal open error:
asset.load(tracks) ok count=0
item.status=failed err=AVFoundationErrorDomain/-11829 'Cannot Open'
item.error.underlying=CoreMediaErrorDomain/-12848
item.presentationSize=(0.0, 0.0) errorLog: 0 events accessLog: 0 events
Crucially this is HEVC-specific to the progressive→fMP4 (VOD) remux:
- H.264 progressive MP4 through the same
HLSVideoEnginepath → plays fine. - HEVC in MPEG-TS through the live
HLSLiveIngestReaderremux (the HDR10 4K HEVC 50fps live HLS via nativeRemoteHLS: AVPlayer exposes no video track (audio-only, black); no HDR display-criteria negotiation. VLC + Android decode it fine #168 reroute) → plays fine (valid HEVC fMP4). - HEVC in fMP4-HLS played directly via
nativeRemoteHLS(no remux) → plays fine.
So AVPlayer decodes HEVC-in-fMP4 happily; only the HLSVideoEngine VOD muxer's HEVC init/hvcC produces something it can't open. Both 8-bit (Main) and 10-bit (Main10/HDR10) fail identically.
Steps to reproduce
Generate the exact files (ffmpeg with libx265):
# 8-bit HEVC Main
ffmpeg -f lavfi -i testsrc=size=1280x720:rate=30 \
-f lavfi -i sine=frequency=660:sample_rate=48000 -t 12 \
-c:v libx265 -tag:v hvc1 -pix_fmt yuv420p \
-c:a aac -movflags +faststart hevc.mp4
# 10-bit HEVC Main10 / HDR10 (fails identically)
ffmpeg -f lavfi -i testsrc=size=1280x720:rate=30 \
-f lavfi -i sine=frequency=660:sample_rate=48000 -t 12 \
-pix_fmt yuv420p10le -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020nc \
-c:v libx265 -tag:v hvc1 \
-x265-params "hdr10=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc" \
-c:a aac -movflags +faststart hevc_hdr.mp4Serve over plain HTTP (any static server with Range + HEAD) and load the .mp4 URL through AetherEngine on a device with nativeRemoteHLS:false (i.e. let it demux+remux). AVPlayer fails to open the loopback with -12848 / tracks=0.
AetherEngine version or commit SHA
5.17.0
Host app
Sodalite
Platform
tvOS
OS version
tvOS 26.5
Device / chip
Apple TV 4K (3rd gen, AppleTV14,1)
Playback path
Native AVPlayer
Source media (for playback bugs)
No response
Error codes / log lines
[AetherEngine] load url=…/vod-mp4-hevc.mp4 source-format=sdr effective-format=sdr rate=30.000
[VTProbe] canHardwareDecode codec=173 1280x720 -> true (status=0)
[AetherEngine] dispatch: codec=173 → native
[HLSVideoEngine] video codecpar: codec=173 1280x720 profile=1 level=93 fieldOrder=1 extradata=2433B head=0101600000009000
[HLSVideoEngine] audio: codec=aac → stream-copy as `mp4a.40.2`
[HLSVideoEngine] prepared: codec=hvc1.2.4.L93,mp4a.40.2 resolution=1280x720 fps=30.000 range=SDR DV=none segments=3 duration=12.0s
[HLSSegmentProducer] init.mp4 captured (3686 B)
[HLSSegmentProducer] pump finished: reason=eof packetsRead=924 packetsWritten=360 lastError=0 cacheCount=3
[NativeAVPlayerHost] #1 load url=http://127.0.0.1:60098/media.m3u8
[NativeAVPlayerHost] #1 asset.load(tracks) ok count=0
[NativeAVPlayerHost] #1 item.status=failed err=AVFoundationErrorDomain/-11829 'Cannot Open'
[NativeAVPlayerHost] #1 item.error.underlying=CoreMediaErrorDomain/-12848
(For the 10-bit file the only differences are `profile=2 … extradata=2557B head=0102200000009000` and `range=PQ`; same `count=0` / `-11829` / `-12848` outcome.)
Anything else
Expected
The HEVC progressive MP4 plays on the loopback path, exactly as the H.264 progressive MP4 and the TS→fMP4 HEVC (live) cases do.
Notes / hypothesis
- The source
hvcCextradata looks well-formed (head=0101600000009000= configurationVersion 1, profile_idc Main). The failure appears to be in how the VOD fMP4 init segment carries the HEVC sample entry /hvcC(theHLSLiveIngestReaderpath writes a working one from the same codec, so the two muxers diverge). -12848withtracks=0and empty error/access logs = AVPlayer rejected the init before fetching media — consistent with a malformed/hvcC-less HEVC sample description ininit.mp4.- Reproduced deterministically via a public test-bed that plays every codec/container through the ladder; happy to share the generator + server if useful.
Activity
DrHurt commentedon Jul 21, 2026
I think this is related to the issue I've run into here:
superuser404notfound/AetherPlayer#2
It's a regression in the engine that happened a little over 2 weeks ago.
Merge pull request #192 from superuser404notfound/fix/187-hevc-hvcc-s…
superuser404notfound commentedon Jul 22, 2026
Fixed in 5.18.3.
Root cause: libx265 embeds a large user-data
SEI_PREFIX(NAL type 39) array in the hvcC config record. The VOD/loopback muxer copied the source codec parameters verbatim, so that array reached theinit.mp4sample description. Apple TV builds the HEVC format description straight from the hvcC parameter-set arrays and rejects a record carrying a non-parameter-set array, which is thetracks count=0/-11829/-12848open failure. macOS and the tvOS Simulator both tolerate it (they build the track and reachreadyToPlay), so it only reproduces on the actual hardware decoder. That is also why H.264 (avcC never carries SEI arrays), the TS -> fMP4 live remux, and direct fMP4-HLS were all fine: only the VOD path forwarded the source hvcC as-is, and only Apple's hardware path validates it strictly.The fix canonicalizes the HEVC config record before write_header, keeping only the VPS/SPS/PPS arrays and dropping the SEI (and any other) NAL arrays, so the VOD init now matches the canonical form the live and direct paths already produce. HDR10 static metadata and Dolby Vision signaling live outside the hvcC and are untouched. Verified end-to-end that the emitted
init.mp4hvcC drops to VPS/SPS/PPS only (8-bit Main 2433 B -> 112 B; 10-bit HDR10 2554 B -> 115 B with thecolrPQ/BT2020 box preserved) and both remain independently decodable.One caveat worth flagging: since the rejection could not be reproduced off-device (both macOS and the tvOS 26.5 Simulator accept the SEI-laden init), a retest on the Apple TV 4K against 5.18.3 through the exact same nativeRemoteHLS:false ladder would be very welcome to confirm the hardware now accepts the canonical init. Thanks for the precise report and the deterministic test-bed.
superuser404notfound commentedon Jul 22, 2026
Reopening: 5.18.3 ships the fix, but this stays open for the on-device retest (the rejection only reproduces on Apple TV hardware, not macOS or the tvOS Simulator). Will close once verified on an Apple TV 4K.
fix(hls): strip non-parameter-set NAL arrays from the HEVC hvcC on th…
kskchaitanya1993 commentedon Jul 22, 2026
On-device retest, Apple TV 4K (3rd gen), tvOS 26.5, vendored 5.18.3, through the exact
nativeRemoteHLS:falseloopback ladder.Result: the canonicalization runs and matches your off-device verification exactly — but the hardware still rejects the init.
So the fix produces exactly the canonical record you verified (2433 → 112 B, VPS/SPS/PPS only), but the Apple TV hardware still rejects the resulting
init.mp4with the same-11829/-12848/count=0. On this hardware theSEI_PREFIXarray was not the (complete) cause — something else in the emitted init is being rejected.Source characteristics (deterministic test-bed asset):
yuv420p, 1280×720, 30 fps, SDR, progressive (fieldOrder=1=AV_FIELD_PROGRESSIVE).numOfArrays=4→ VPS(32), SPS(33), PPS(34), SEI_PREFIX(39) — i.e. exactly the target case. After canonicalize: VPS/SPS/PPS only (112 B).The
count=0atasset.load(tracks)on the canonical init suggests the hardware rejects the fMP4 sample entry / init structure itself, not the parameter-set arrays (those are now identical to what the fMP4-HLS path — which works — produces). Happy to share the exact deterministic.mp4for a clean repro, or dump the emittedinit.mp4(hvcCbytes + thehvc1sample-entry /stsdand anycolr/taps/edit-list boxes) if that helps isolate what the hardware objects to. It reproduces every time on this ATV.superuser404notfound commentedon Jul 22, 2026
Thanks, this is a decisive retest. It rules the SEI array out as the complete cause: 5.18.3 does exactly what it claims (the hvcC drops to 112 B, VPS/SPS/PPS only, the canonical record), and the hardware still rejects the init. So the fix was necessary but not sufficient, and your read is right: the rejection is in the init sample entry, not the parameter-set arrays.
Here is where I have got to, and what would let me close it.
The VOD remux path copies the source hvcC header verbatim (bytes 0..21: profile/tier/level, chroma_format, bit depths, min_spatial_segmentation_idc, parallelismType, avgFrameRate, and the reserved-bit fields), then rewrites only the trailing NAL-array section. The two paths you confirmed working never do this: the MPEG-TS live remux and the direct fMP4-HLS path both get an hvcC that FFmpeg (or the origin server) rebuilds from the parameter sets, so their header is always in FFmpeg's canonical form.
That header turns out to be muxer-dependent in practice. Muxing the same HEVC bitstream with FFmpeg versus MP4Box already yields different config-record header bytes (for example parallelismType 0 vs 3). So if your source file was written by a muxer that sets one of those header fields to a value Apple TV's format reader rejects, the VOD path is the only path that forwards it unchanged: macOS and the Simulator tolerate it, the device does not. That matches every observation you reported (H.264 fine, since avcC has a much smaller header with no equivalent fields; HEVC-in-TS and direct fMP4-HLS fine, since their hvcC is rebuilt; HEVC VOD only; device only).
I could not reproduce it locally because my libx265 test asset is FFmpeg-muxed, so its header is already canonical and both macOS and the Simulator accept it. To confirm or rule this out I need your exact bytes. Two things would nail it:
.mp4you offered (a link is perfect). With it I can run it through the loopback path, dump the emitted init, and diff its config-record header against a rebuilt one.0101600000009000); it is bytes 8..21 I cannot see, and those are exactly the muxer-written header fields.The init dump you offered is still very welcome as a second data point: the emitted
init.mp4hvcC plus the fullhvc1sample entry (stsd, and anycolr/fiel/pasp/btrtboxes) as the device receives it.If this pans out, the fix is to stop copying the source header verbatim on the VOD path and rebuild a canonical config record from the parameter sets, the same shape the live and direct paths already emit.
kskchaitanya1993 commentedon Jul 22, 2026
Here are the exact bytes — and a twist: the source is FFmpeg-muxed with a fully canonical header, so a non-canonical muxer header doesn't explain this file. I think that narrows it toward the emitted init / device path.
23-byte source config-record header (
hvcCbytes 0..22):Parsed:
0x60000000, general_constraint_indicator=0x900000000000Muxer / encoder: FFmpeg —
Lavf62.12.102container,Lavc62.28.102 libx265video. So bytes 8..21 you couldn't see (00 00 00 00 5d f0 00 fc fd f8 f8 00 00 0f) are the standard FFmpeg values:parallelismType=0,chromaFormat=1,bitDepth 8/8. This is exactly the canonical header you described — and yet the device rejects the emitted init after the SEI is stripped.Two implications from that:
hvc1sample entry /stsd/ init box layout — rather than the header it copies.-12848s, this is purely device + emitted-init, independent of the source file.Exact reproduction of the byte-identical asset (test-bed generator;
repeat-headers=1is what puts the SEI_PREFIX in the hvcC):I'll also work on dumping the emitted
init.mp4off the device (the loopback binds127.0.0.1, so it needs a small capture hook) and post thehvcC+ fullhvc1sample entry +stsd/colr/fiel/pasp/btrtas the device actually receives it. Glad to share the real.mp4via a link too if that's easier than regenerating. Thanks for digging into this so thoroughly.superuser404notfound commentedon Jul 22, 2026
Decisive retest, thank you. I reproduced your test-bed asset byte for byte (the
repeat-headers=1is what puts the SEI_PREFIX in the hvcC; the source config-record header comes out exactly as you posted,0101600000009000...5df000fcfdf8f800000f04), ran it through the loopback, and dumped the emitted init. Your read was right on both counts: the emitted hvcC is a clean canonical record (VPS/SPS/PPS only, header byte-identical to what ffmpeg/GPAC write), and the rejection is not in the parameter-set arrays. So 5.18.3 was necessary but not sufficient, and since your file is already fully canonical FFmpeg, the source-header theory doesn't fit it.What it actually is turned out to be in the routing, not the muxer:
SDR HEVC was routed media-direct (a bare
media.m3u8, no master). Media playlists carry no CODECS attribute, so on that path the device gets no HEVC codec signaling at all. Apple TV HW happily builds an H.264 track from a bare media playlist plus init, but for HEVC it needs the codec advertised in a master'sEXT-X-STREAM-INFCODECS; without it the item fails withtracks count=0/-11829/-12848before any media fetch. macOS and the Simulator build the HEVC track straight from the init hvcC on the media-direct path, which is exactly why neither reproduces it. This lines up with everything you saw: H.264 through the same media-direct path is fine (its track builds without a declared codec), while the HEVC paths that worked (live TS remux, direct fMP4-HLS) do not take this SDR media-direct route.Separately, the plain-HEVC CODECS string was hardcoded to
hvc1.2.4.L<level>(Main10) for every non-DV HEVC, so an 8-bit Main source was mis-declared as Main10. Once HEVC is signaled through a master, a strict device would reject that Main10 claim against the Main hvcC in the init. It now derives the RFC 6381 string from the actual hvcC profile_tier_level, so your asset advertiseshvc1.1.6.L93.90(matching MP4Box/ffmpeg) instead ofhvc1.2.4.L93.The fix routes tvOS HEVC through a master with the correct CODECS (iOS and macOS keep media-direct, which already works for them). It is on branch
fix/ae187-hevc-master-codec-signaling, commit3d75cf6. I could not reproduce the failure or confirm the fix off-device (macOS and the Simulator accept the media-direct init either way), so an on-device retest against that commit through the samenativeRemoteHLS:falseladder would be the decisive check: does the Apple TV now build the track and play, instead of dropping to VLC? Full suite is 953/953 and the tvOS-sim build is green.Thanks again for the byte-level data and the deterministic repro. It made this findable.
kskchaitanya1993 commentedon Jul 22, 2026
Retested on-device against
3d75cf6(branchfix/ae187-hevc-master-codec-signaling), Apple TV 4K (3rd gen), tvOS 26.5, through thenativeRemoteHLS:falseladder. Prebuilt + linked that exact commit.The fix is applied and correct — but the device still rejects it. It does not build the track / play; it still drops to VLC.
The routing change works exactly as designed — it now serves a master with the correct CODECS:
And AVPlayer does progress further than the media-direct path did — it fetches the full chain:
But it still fails:
So the decisive detail: with the master + correct CODECS, the device now enumerates one track — but it's the audio placeholder (
mediaType=soun,fourCC=<no fdesc>,enabled=false), and no HEVC video track is built at all. The item opens no further and errors with the same-11829/-12848.That means the master-CODECS signaling, while correct and worth keeping, was not the device cause either. The Apple TV hardware rejects the emitted HEVC fMP4 init itself — the same init you dumped off-device and confirmed is a clean canonical record. So this is a device-specific rejection of a canonical init that macOS + the Simulator accept, deeper than both the hvcC arrays and the CODECS signaling.
Where that leaves it: H.264 fMP4 fine, HEVC-in-TS live remux fine, direct fMP4-HLS fine — all confirmed. HEVC VOD via the loopback fMP4 init is the only failing path, device-only. Since your off-device init dump is byte-identical to what the device receives (same engine muxer), the difference has to be something the device's HEVC format reader validates in the
hvc1sample entry / init that macOS doesn't. If it would help, I'm happy to add a capture hook and pull the exactinit.mp4the device fetched (hvc1/stsd+colr/fiel/pasp/btrt) so you can diff it against a known-good device-played HEVC fMP4 (e.g. the direct fMP4-HLS init that works). Thanks for chasing this so hard — genuinely appreciate it.superuser404notfound commentedon Jul 22, 2026
Thank you for the decisive on-device retest of
3d75cf6. It nailed down exactly what the master signaling did and did not fix, and it pointed straight at the last piece.What your retest proved: the master + correct CODECS was necessary but not sufficient. Media-direct gave
count=0and did not fetch the chain (Apple TV will not build an HEVC track from a bare media playlist with no CODECS; WWDC 2017 session 504 puts it plainly: HEVC must be marked with the CODECS attribute in the master playlist). With the master, the device fetched the full chain and built the audio track, but the HEVC video track still did not build. So the rejection was never the parameter-set arrays or the codec string; it is the emitted init itself, exactly as you called it.Root cause: the emitted HEVC init has no edit list
I reproduced your asset byte for byte (the source config-record header comes out
0101600000009000...5df000fcfdf8f800000f04as you posted), ran it through the loopback, and diffed the emittedinit.mp4against an FFmpeg fMP4-HLS init of the same content, which is the "direct fMP4-HLS" shape you confirmed plays on the device. After eliminating everything else, one semantic difference remains:btrtbox and media timescale: present/identical in the device-known-good FFmpeg init too. Not it.edts/elst): FFmpeg's init carries a codec-delay edit list on the video track (an empty edit of the reorder delay, thenmedia_time= the delay in media timescale). Our engine init has none.Our VOD muxer runs
use_editlist=0on purpose (so the init'smoovstays restart-invariant and each fragment carries its position intfdt, rather than AVPlayer replaying a stale EXT-X-MAPelstafter a mid-stream producer restart, which caused lipsync drift in earlier fixes). The side effect: noedtsis emitted at all. macOS and the Simulator build the HEVC track from the sample entry regardless; the device's HEVC track builder needs the presentation timeline that the edit list establishes for reordered (B-frame) content, and without it builds no video track.Fix
Commit
d12e2eeon branchfix/ae187-hevc-master-codec-signaling(on top of the master/CODECS commit, so both are in the build). It splices a canonical codec-delay edit list into the video track after muxing, reproducing FFmpeg's two-entry shape, without touching any muxer flag. Themoovstays restart-invariant because the delay is a codec property (the first video packet'spts - dts), not a session position. Non-HEVC and non-positive-delay inits are forwarded unchanged.Verified locally: the emitted HEVC init now carries an
elstwhosemedia_timematches FFmpeg's device-known-good value byte for byte; the init plus segments still decode in isolation (segverify 3/3); the H.264 init is untouched (noedts); full suite 960/960. But since macOS and the Simulator accept the init either way, the decisive check is on-device.Would you be able to retest against
d12e2eethrough the samenativeRemoteHLS:falseladder? The question is whether the Apple TV now builds the HEVC video track and plays, instead of the audio-onlycount=1/-11829drop to VLC. If it still fails, your offered capture of the exactinit.mp4the device fetched (hvc1/stsdpluscolr/fiel/pasp/btrt) would be the perfect next data point to diff against the FFmpeg init that plays. Thanks again for the byte-level rigor on this one.kskchaitanya1993 commentedon Jul 22, 2026
Retested
d12e2eeon-device — still fails (audio-onlycount=1,mediaType=soun fourCC=<no fdesc>,-11829/-12848→ VLC). So I added a debug hook that grabs the exact loopback artifacts the device fetched (the loopback binds127.0.0.1, so this is the only way to see them) and diffed the init against an FFmpeg fMP4-HLS init of the byte-identical source. I found the one remaining difference.First, all three of your fixes ARE present in the device-fetched init — confirmed byte-for-byte:
…00000f03(numOfArrays=3, VPS/SPS/PPS only, SEI stripped).CODECS="hvc1.1.6.L93.90".elst [(seg=66, mt=-1), (seg=0, mt=1024)]— identical to FFmpeg's (I generated an FFmpeg fMP4-HLS init of the same source; theelst,hvcC[0:22],pasp,btrt,tkhd,mdhd,trexall match byte-for-byte). The edit list was correct.The full box diff turns up exactly one structural difference:
The engine init emits an empty
sdtpbox in the videostbl; FFmpeg omits it.The engine's box is
0000000c 73647470 00000000— a 12-bytesdtpwith 0 sample entries. But this is a fragmented init: the videostsz/stco/sttsare allentry_count=0(samples live in themoofs). Ansdtp(per-sample dependency flags) describing zero samples in themoovis anomalous.Working theory that fits every observation: Apple TV's HEVC track builder validates
sdtpagainst the (empty) sample table and rejects the init; macOS + the Simulator ignore the stray box. It's HEVC-only in practice because the H.264 init doesn't carry thissdtp, and it's device-only because only the hardware format reader is strict about it. That lines up with H.264-fine / HEVC-in-TS-fine / direct-fMP4-HLS-fine (none emit thissdtpin a fragmented init) / HEVC-VOD-only.Likely fix: don't write
sdtpinto the fragmented init'smoov(it belongs per-fragment in thetraf/sbgpfor fragmented content, if at all).I have the exact device-fetched
init.mp4(1413 B),master.m3u8,media.m3u8, andseg0.mp4— happy to attach any of them. And if a control would help, I can serve my FFmpeg init through the same loopback ladder on the device to confirm it plays where the engine init doesn't. Thanks for sticking with this — thesdtpwas hiding in plain sight.superuser404notfound commentedon Jul 22, 2026
Great catch on the
sdtp, and thank you for building the capture hook. That kind of byte-level diff off the loopback is exactly what made this findable.Before wiring a strip I reproduced against it, and the result is worth flagging because it points somewhere unexpected.
I served the byte-identical repro asset (
libx265 -tag:v hvc1 ... repeat-headers=1) through the real engine loopback (HLSVideoEngine to HLSSegmentProducer to MP4SegmentMuxer), against the pinned FFmpegBuild 2.2.0, and byte-inspected the exact/init.mp4the endpoint serves. There is nosdtpbox in it (a raw search for73647470comes back empty). The videostblisstsd, stts, stsc, stsz, stco, matching the FFmpeg init.The reason is structural in movenc (n8.1.2, which 2.2.0 ships). Our init is a fragmented
empty_moovinit, andmov_write_trak_tagexplicitly zeroestrack->entrybefore writing thestblwhenempty_moovis set (the "pretend that no samples have been written yet" path).mov_write_sdtp_tagis only emitted whentrack->has_disposable && track->entry, so withentryforced to 0 the box cannot be written. Separately, the repro asset carries no disposable-flagged frames at all, sohas_disposableis never set either. Two independent reasons the box should not exist.So the
sdtpyou captured on device cannot come out of a cleand12e2eebuild linked against FFmpegBuild 2.2.0. The most likely explanation is a stale transitive dependency in the build env: Xcode caching an older FFmpegBuild in DerivedData/SourcePackages and not re-resolving it after the AetherEngine commit bump. That would leave the Swift-side fixes (canonical hvcC, master CODECS, edit list, all confirmed present in your capture) intact while the muxer itself is a different FFmpeg.Two things would settle it:
init.mp4(1413 B) you offered. With your bytes next to mine I can diff the full box tree, not just the one box, and see everything that differs.Package.resolved(it should read2.2.0/e832f22). If it is older, a clean re-resolve (delete SourcePackages under DerivedData, resolve again) may make thesdtpdisappear on its own.Independent of where the box originates, I will add a version-independent guard in the init normalization that strips any zero-sample
sdtpfrom the videostblafter capture. It operates on the emitted init bytes, so it neutralizes the box regardless of which FFmpeg wrote it and reproduces the known-good FFmpeg layout exactly. Yourinit.mp4lets me confirm it targets your precise structure. It will land onfix/ae187-hevc-master-codec-signaling.And yes, please do run your FFmpeg init through the same loopback ladder on the device. If it plays where the engine init does not, that isolates it to the init bytes and is a perfect control.
kskchaitanya1993 commentedon Jul 22, 2026
You were right to push on the build env, and the byte-level ask paid off — but the culprit is one layer over from where we both looked. My app never links FFmpegBuild at all. It's linking AetherEngine's FFmpeg against a different, older FFmpeg entirely.
What I verified (twice, on the exact artifacts that shipped to the device):
AetherEngine.xcframeworkI build via the SwiftPM prebuild is code-only: itslibAetherEngine-dev.ahas 0 movenc symbols (nm | grep mov_write_ = 0). FFmpeg is not baked in — the symbols are undefined, resolved at app link time.FFmpegBridge.xcframeworkfrom a mediabridge experiment I removed — and it's FFmpeg 7.1.5 (FFmpeg version 7.1.5, libavformat 61), carrying all 74mov_write_*symbols includingmov_write_stbl_tag.project.pbxproj). ThePackage.resolvedpin offfmpegbuild 2.1.3I'd have quoted you is vestigial — a relic of an old SPM-based integration that the vendored-binary setup no longer uses. So quoting it would have sent you down the wrong 2.1.3-vs-2.2.0 path.So the init on my device is written by FFmpeg 7.1.5's movenc, not 2.2.0's n8.1.2. That lines up exactly with your empty_moov analysis: the newer n8.1.2 path zeroes
track->entryand drops thesdtp; 7.1.5 still emits it. Your control (byte-identical repro through the real loopback on 2.2.0 → nosdtp) and my capture (same structure, +sdtp, on 7.1.5) converge on the FFmpeg version as the sole variable.The captured init (1413 B, md5
a279dbf378bb73d1e6ea1753b567365e) — full box tree isftyp / moov[mvhd, trak(video)[tkhd, edts/elst, mdia…stbl[stsd, stts, **sdtp(12B, 0 entries)**, stsc, stsz, stco]], trak(audio)[… stbl with NO sdtp], mvex[trex,trex], udta]. base64 below so you can diff the full tree against yours:init.mp4 base64 (decode: `base64 -D`)
My fix: link AetherEngine against the FFmpegBuild 2.2.0 (n8.1.2) it's actually built for, and drop the stale mediabridge 7.1.5 lib. I'm doing that now and will re-capture on device to confirm the
sdtpdisappears — I'll post the before/after. Your version-independent strip guard is still worth landing as defense-in-depth (it'd have neutralized this regardless of my mislink), but on my end this was self-inflicted by a leftover framework, not anything ind12e2ee. Sorry for the detour toward the SPM pin — glad thesdtpcapture was still the thread that unravelled it.superuser404notfound commentedon Jul 22, 2026
That is a definitive root cause, thank you for running it all the way down (and for the
nmon the vendored archive, which is what actually settled it). A leftoverFFmpegBridge.xcframeworkat 7.1.5 resolving themov_write_*symbols is a clean, complete explanation.I decoded your base64 and diffed it against my loopback init. They are byte-for-byte identical except for two things: the
sdtp(your 12 B / zero-entry box betweensttsandstsc, absent in mine) and the writer tag (Lavf61.7.103vsLavf62.12.102). So the FFmpeg version really is the sole variable. The guard that suppresses a zero-samplesdtpin a fragmentedempty_moovinit (mov_write_stbl_tagonly emits it whentrack->has_disposable && track->entry, andtrack->entryis forced to 0 for the init) is present in the 8.1.2 movenc that FFmpegBuild 2.2.0 ships and not in your 7.1.5, which is exactly why your init carried the box and mine does not.The version-independent strip has landed as defense-in-depth, on
fix/ae187-hevc-master-codec-signaling(72e48d1): it removes any zero-sample videosdtpfrom the captured init, so a stray box from a mislink like this can never reach the device again. On a correct 2.2.0 link there is no box to strip, so it is a no-op.Once you drop the 7.1.5 lib and link the FFmpegBuild the engine is built against, the
sdtpis gone. Combined with the master-CODECS signaling (which is spec-mandated for HEVC regardless of this, WWDC 2017 session 504), the item should build the video track and play instead of dropping to audio-only. Really looking forward to your before/after on the corrected link, and thanks again for the byte-level rigor start to finish.kskchaitanya1993 commentedon Jul 22, 2026
Confirmed and fixed on my side — and it was exactly the stale-FFmpeg mislink, not your code.
What I removed: the leftover
FFmpegBridge.xcframework(FFmpeg 7.1.5) was-force_loaded into the app'sOTHER_LDFLAGS(a relic of a removed in-app FFmpeg experiment).-force_loadpulls in all of its symbols, so 7.1.5's movenc flat-shadowed the vendored FFmpegBuild 2.2.0 that AetherEngine is built against. Dropped it entirely.Verified after the fix (on the Apple TV 4K):
ooooo.debug.dylibnow links@rpath/Libavformat.frameworkcurrent version 62.12.102 (FFmpegBuild 2.2.0 / FFmpeg 8.x) — no more 7.1.5.AETHER PLAYING backend=native, 0 ×-11829/-12848, 0 VLC fallback (it was-11829→ VLC before). With 2.2.0's movenc the init carries nosdtp, so the device accepts it.On your
72e48d1bsdtp strip: I bumped my vendored engine to it and it builds clean. Since 2.2.0 no longer writes the zero-samplesdtp, your strip has nothing to remove in my setup now — but it's the right belt-and-suspenders for any integrator who links an older FFmpeg the way I accidentally was, so it's a good defensive addition regardless. Thanks again for the movencempty_moov/entrywalkthrough — your byte-identical 2.2.0 control is what made it obvious the FFmpeg version was the only variable, which pointed me straight at my own link.Net: #187 reproduces only against pre-8.x FFmpeg; on the intended 2.2.0 it's clean. Really appreciate your patience through the wrong turns.
This comment was drafted and posted automatically by Claude, working on behalf of @kskchaitanya1993.
superuser404notfound commentedon Jul 22, 2026
Shipped in AetherEngine 5.18.7, and thank you again for running this all the way to the linker. The device-verified
AETHER PLAYING backend=nativewith zero-11829/-12848is exactly the outcome to close on.The release keeps the two parts that earned their place:
CODECSstring derived from the actualhvcC(so the manifest and the init always agree), andsdtpstrip, as defense-in-depth for precisely the mislink you hit: an integrator who-force_loads an older FFmpeg over the vendored build gets its init neutralized rather than rejected.One change from the
72e48d1tip you vendored: I dropped the codec-delay edit-list injection I'd spliced in mid-investigation. That was chasing the wrong hypothesis (a missingedts), the on-device retest of it was red, and the real remaining difference was thesdtpfrom the shadowing FFmpeg. The shipping init has noedts(the same shape every prior release used), so the released engine is simpler than the branch you tested, with the same relevant fixes. If you re-pin to 5.18.7 you should see the identical clean playback.Consumers are on 5.18.7. Appreciate the byte-level rigor start to finish.
rrgomes commentedon Jul 22, 2026
Apple TV 4K verification of the 5.18.7 routing change, plus one correction to the root cause.
You flagged the #187 work as device-only and unverified on Apple TV, so here is a hardware pass on 5.18.7 from a four-box tvOS fleet. The routing code below is unchanged as of 5.19.1, so these observations are current rather than stale.
The forced-master path works. Two SDR HEVC sources on Apple TV 4K 3rd gen, both now served through a master, both playing normally:
(4K HEVC Main10 SDR bt709, 23.976 fps, FLAC, MKV, 5033 s; and a 1440x1080 HEVC Main10 SDR with AC-3 and two SRT tracks, 1518 s, same shape.)
The CODECS derivation is a bigger correctness win than the commit claims. The 4K source above is High tier. The old hardcode would have declared
hvc1.2.4.L153; the derived string ishvc1.2.2.H153.90. That is wrong in three places at once rather than just the profile: compatibility flags (4 against 2), tier (L against H), and the absent constraint byte. The tier error seems worth calling out separately, since a High-tier stream declared as Main tier is exactly the kind of mismatch a strict decoder could reject.But the stated root cause does not generalize. On this same 5.18.7 build, HEVC still routes media-direct wherever the routing judges a master unsafe, and Apple TV builds the video track from the bare media playlist without complaint:
That is 4K HEVC Main10 PQ on an Apple TV 4K 3rd gen with the panel not yet in HDR mode. The same holds for 4K HEVC DV Profile 7 and DV Profile 8.1 on an Apple TV 4K 2021 driving an SDR panel, both
useMaster=false, bothreadyToPlay, all three playing normally.So on at least two Apple TV 4K generations, HEVC does build a track from a bare media playlist plus init. The general claim in the commit message and changelog, that Apple TV needs the codec advertised in a master's CODECS for HEVC, is not what this hardware shows.
A better-fitting explanation is already in the same release. 5.18.7 also strips the zero-sample
sdtp, and the reporter was-force_loading FFmpeg 7.1.5 over the vendored build, whose movenc writes that box into theempty_moovinit. An init Apple TV rejects yieldstracks count=0/-12848before any media fetch, which is the reported symptom, and it would do so from a master or a media playlist alike. The issue title itself points at the init rather than the manifest.Worth asking the reporter whether the
sdtpstrip alone resolves it with media-direct routing restored. If so, the forced master could be narrowed. The blast radius on our side is admittedly small, since the forcing only moves SDR HEVC (HDR HEVC on a ready panel already routed master, and on an unready panel routing safety still keeps it media-direct), and we have now verified that path on device. But it is a routing change for every tvOS consumer resting on a premise our fleet contradicts.kskchaitanya1993 commentedon Jul 22, 2026
Reporter here — glad to confirm the init reading, since it matches what I traced end to end.
On my Apple TV 4K the blocker was precisely the zero-sample
sdtpin the fragmented HEVC init, and the cause on my side was self-inflicted: a stray-force_loadof an older FFmpeg (7.1.5), left over from a component I'd since removed, was shadowing the vendored FFmpegBuild 2.2.0 at link time — and 7.1.5's movenc writes thatsdtpinto theempty_moovinit. Re-aligning the link so the muxer is actually 2.2.0 (which omits the box) restored HEVC playback on device:AETHER PLAYING backend=native, zero-11829/-12848, no manifest change involved. So @rrgomes's reading tracks my evidence — it was the init Apple TV was rejecting, not the masterCODECS.Two honest caveats so I don't overstate it:
CODECS-derived-from-hvcCchange is a real correctness win on its own — a High-tier stream advertised as Main-tier is a genuine mismatch — so narrowing the forced master wouldn't affect that part.sdtpstrip alone + media-direct" against "forced master," because whether the loopback serves a master or a bare media playlist (useMaster) is decided inside the engine, not something I can toggle from the host side. So I can confirm "remove thesdtp→ HEVC plays," but not independently prove media-direct-plus-strip is sufficient without an engine-side way to pin that path. If there's a knob to forceuseMaster=falsefor a test, I'm happy to run it on device and report back.Thanks to you both — that's a really thorough multi-box verification.
Auto-generated by Claude.
rrgomes commentedon Jul 22, 2026
Correction to my previous comment, and the media-direct A/B that @kskchaitanya1993 could not run.
First, I overstated my evidence. The two SDR HEVC sources I cited as demonstrating the forced-master path were both on an Apple TV 4K 3rd gen driving a Dolby Vision panel, and on that device the forcing is a no-op:
sourceIsHDR = videoRange != .sdr || effectiveDvMode, so a DV-capable panel setseffectiveDvMode=trueand inflatessourceIsHDReven for SDR content, after which the pre-existingsourceIsHDR && panelReadyForHDRalready returns true. Those items would have served a master on any recent version. I checked rather than assumed this time: pinning 5.18.6 and replaying the same title on that box still givesuseMaster=true, with the old hardcodedhvc1.2.4.L153in the same line confirming the version. My apologies for the noise.The forcing does change routing on a non-DV device, and there it verifies cleanly. On an Apple TV 4K 2021 driving an SDR panel every other input is false, so
useMaster=truecan only come fromvideoCodecNeedsMasterSignaling. Same 4K HEVC Main10 SDR source, same box, only the engine version differing:Both play. So media-direct HEVC does build a video track on Apple TV 4K hardware, provided the init is correct, which on our side it always is: we link FFmpegBuild 2.2.0 alone with no vendored FFmpeg, so the
sdtpbox is never written and 5.18.6 lacking the strip does not matter. Combined with @kskchaitanya1993 confirming that realigning his link fixed his device with no manifest change, the masterCODECSsignaling does not look like what resolved #187.@kskchaitanya1993, on the knob: you do not need one. Pinning 5.18.6, the release immediately before this change, gives the media-direct arm with identical host code, which is how the run above was produced.
One more honest data point about the CODECS string. On the DV-panel box, 5.18.6 served a master advertising the old hardcoded
hvc1.2.4.L153for a stream that is actually High tier, and Apple TV played it without complaint. So while deriving the string from thehvcCis plainly more correct, and I still think the tier error is the most interesting part of it, I have no device evidence that the mis-declaration alone causes a rejection. That weakens the second half of the original diagnosis too.Net suggestion, offered with the caveat that you have far more consumers than our fleet: the forcing appears to buy nothing on DV-panel devices, where the master was already in use, and on non-DV devices the media-direct path works. Narrowing or reverting it looks safe on this evidence, while keeping the
sdtpstrip and the derivedCODECSstring.