Skip to content

AetherEngine 5.18.3

Choose a tag to compare

@superuser404notfound superuser404notfound released this 22 Jul 04:13

Fixed

HEVC-in-MP4 progressive VOD rejected by Apple TV hardware on the loopback remux (#187)

A plain HEVC-in-MP4 progressive file dispatched to the native/loopback path built a fragmented-MP4 init that Apple TV hardware rejected before any media fetch:

asset.load(tracks) ok  count=0
item.status=failed  err=AVFoundationErrorDomain/-11829 'Cannot Open'
item.error.underlying=CoreMediaErrorDomain/-12848

H.264 through the same muxer, HEVC-in-TS through the live ingest remux (#168), and HEVC fMP4-HLS played directly all worked. Both 8-bit Main and 10-bit Main10/HDR10 failed identically.

Root cause. libx265 (and other encoders) embed a large user-data SEI_PREFIX (NAL type 39) array in the hvcC config record. The VOD muxer copies the source codec parameters verbatim (avcodec_parameters_copy), so that array reached the init.mp4 sample 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. macOS and the tvOS Simulator both tolerate it, so the failure only surfaced on device. The live MPEG-TS and direct fMP4-HLS paths never hit this because their hvcC is rebuilt from parameter sets alone (VPS/SPS/PPS). This is not a recent code regression: the remux path has copied the source hvcC verbatim since it was written.

Fix. The HEVC config record is canonicalized before write_header, keeping only the VPS(32)/SPS(33)/PPS(34) arrays and dropping SEI_PREFIX(39)/SEI_SUFFIX(40) and any other NAL arrays, so the VOD init matches the canonical form the working paths already emit. HDR10 static metadata (in-band per-IRAP plus the colr/mdcv/clli boxes) and Dolby Vision signaling (dvcC/dvvC, RPU) live outside the hvcC and are unaffected.

Verified via aetherctl segverify end-to-end: an 8-bit Main file's init hvcC drops from 2433 B (4 arrays) to 112 B (VPS/SPS/PPS), a 10-bit HDR10 file's from 2554 B to 115 B with the colr PQ/BT2020 box preserved, both still independently decodable. Covered by the new HEVCConfigRecordTests suite (7 tests).

Acknowledgements

Reported by kskchaitanya1993 (#187), with a deterministic codec/container test-bed.

Full test suite: 940/940. macOS, iOS Simulator, and tvOS Simulator builds green.