CoreMedia -15517 can surface when the advertised codec graph does not match the media

GitHub source

Inferred. This page is generated from GitHub Issue #22; GitHub remains the canonical authoring and discussion source.

Source#

Apple Developer Forums — visionOS HLS report surfaced in the HLS forum index: a 4K HEVC Main 10 + E-AC-3 fMP4 presentation fails in AVPlayer with:

AVFoundationErrorDomain -11848 "Cannot Open"
NSLocalizedFailureReason = "The media cannot be used on this device."
underlying CoreMediaErrorDomain -15517

The posted EXT-X-STREAM-INF advertises:

CODECS="hvc1.2.4.L150.B0,mp4a.a6"

while the actual multichannel audio is E-AC-3. Apple's HLS report flags, among other MUST-FIX findings, that the playlist codec type does not match the content codec type, the CODECS attribute does not declare EC-3, and multichannel audio is not authored as a separate audio rendition.

Forum index: https://developer.apple.com/forums/tags/http-live-streaming?page=5

Problem#

It is tempting to search for a private semantic definition of CoreMediaErrorDomain -15517 and treat the number as the diagnosis. In this case the public-facing failure already says the media cannot be used on the device, while Apple's validator identifies concrete authoring violations upstream.

The useful debugging question is therefore not:

What does -15517 mean?

but:

Which advertised media capability differs from the samples AVPlayer actually discovers?

Evidence level#

DOCUMENTED#

Apple's HLS Authoring Specification requires every EXT-X-STREAM-INF to provide CODECS, requires multichannel audio to use separate audio streams, and identifies Dolby Digital Plus / E-AC-3 with the ec-3 codec identifier. The specification also requires separate audio streams to be declared with EXT-X-MEDIA.

OBSERVED#

The reported stream advertises mp4a.a6 in the variant while the media is described as E-AC-3 5.1. hlsreport reports a codec/content mismatch and missing EC-3 declaration, together with additional authoring failures. AVPlayer rejects the presentation with -11848 and underlying -15517.

IMPLEMENTATION EVIDENCE#

-15517 is an underlying CoreMedia status on the rejection path, but no reviewed public Apple contract assigns that numeric value a stable semantic meaning. It must not be used as a production classifier by itself.

INFERENCE#

A codec/capability-graph mismatch is a strong candidate for the rejection boundary because the manifest advertises a different audio codec than the media and Apple's validator independently identifies that mismatch. The exact internal condition producing -15517 remains unproven until a one-variable manifest/media A/B removes the error.

UNKNOWN#

  • The exact CoreMedia predicate that emits -15517.
  • Whether fixing only the codec declaration is sufficient for the original asset, because the report contains several simultaneous MUST-FIX violations.
  • Whether -15517 is reused for other unsupported/inconsistent media configurations.

Investigation / Explanation#

Treat HLS playback eligibility as a capability graph:

multivariant playlist
→ CODECS / RESOLUTION / VIDEO-RANGE / audio-group declaration
→ device-playable variant filtering
→ media playlist
→ init segment sample descriptions
→ actual track codec / channel layout
→ decoder capability
→ AVPlayerItem readiness

The first invariant to prove is:

advertised CODECS
== codecs reachable through the variant's referenced renditions
== codecs present in the init/media samples

For multichannel E-AC-3, author the audio as a separate EXT-X-MEDIA:TYPE=AUDIO rendition and ensure the associated variant's CODECS list accurately describes the media formats reachable through that variant.

Do not change decoder settings, retry the player, or special-case -15517 before the authoring graph validates.

Verification matrix#

Create controlled variants from the same elementary media:

A. current manifest: wrong/missing E-AC-3 codec declaration
B. correct CODECS declaration only
C. correct CODECS + separate E-AC-3 audio rendition
D. C + required stereo AAC compatibility rendition
E. C with a known-good lower-resolution HEVC video

For every run capture:

mediastreamvalidator / hlsreport result
EXT-X-STREAM-INF CODECS
EXT-X-MEDIA AUDIO attributes
init-segment sample-entry fourcc
channel count
AVPlayerItem.status
AVPlayerItem.error + underlying chain
actual audio/video playlist requests

Interpretation:

A fails, B succeeds
→ codec declaration mismatch is the primary discriminator

A/B fail, C succeeds
→ rendition topology / multichannel separation is required for this path

C fails while validator still reports MUST-FIX items
→ fix remaining authoring violations before attributing failure to AVFoundation

fully compliant C/D still fails on one OS/device only
→ move the boundary from authoring to platform capability/regression

A stronger test is to keep the media bytes unchanged and modify only the manifest declaration, then keep the corrected manifest unchanged and swap only the audio sample entry. This separates signaling from media encoding.

Solution / Guideline#

  1. Run Apple's HLS validation tools before reverse-engineering an undocumented CoreMedia code.
  2. Make CODECS describe the actual formats reachable through each variant; for E-AC-3 use the appropriate ec-3 signaling.
  3. Author multichannel audio as a separate audio rendition and associate it with the video variant through an audio group.
  4. Provide the compatibility audio required by Apple's current authoring specification for the target platform/profile.
  5. Re-test with one violation changed at a time; do not fix ten validator findings simultaneously if the goal is root-cause attribution.
  6. Treat -15517 as implementation evidence until the producer condition is demonstrated. Application logic should react to supported AVPlayerItem state/error surfaces, not a guessed private status meaning.

Reusable engineering rule#

Before reverse-engineering a private media error code, prove that the manifest's advertised capability graph matches the media actually delivered.

Use:

advertised capability
→ referenced rendition
→ sample description
→ actual encoded media
→ device capability
→ player readiness

The first mismatch is a stronger root-cause boundary than the final undocumented CoreMedia number.

References#