You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Videos with Dolby Profile 5 in MP4 container cannot be played using native player (avplayer hls). #19
The engine's DV Profile 5 path looks correct on inspection: P5 is detected from the dvcC record, routed as dvh1 with the dvcC box preserved through muxing, and the HLS master/media playlist emits CODECS="dvh1.05.<level>,..." as expected. So the most likely causes are environmental rather than a missing code path.
Could you share the following so I can reproduce or rule things out?
Apple TV model (4K gen 1 / 2 / 3?) and tvOS version.
Display chain: TV (and AVR if any), and whether they negotiate Dolby Vision when other DV content plays (e.g. an Apple TV+ DV title).
AetherEngine version, and which host app (Sodalite or your own integration).
Whether any DV Profile 5 file plays for you, or only this one fails. Profile 7 / 8.1 files for comparison are useful too.
Console log from the playback attempt (start of session through the failure). If the host exposes a log capture, that is ideal; otherwise the AVFoundation / AVPlayer error code from the failure is the minimum useful signal.
If you can share a short sample that reproduces, even a 5 to 10 second clip, that helps a lot. P5 compatibility_id=0 has no HDR10 base layer, so it requires a DV-capable sink end to end; that is the first thing I want to rule out before chasing a muxer bug.
Thanks for the sample and platform info. M1 MacBook Pro changes the picture from my original triage, which assumed Apple TV.
Two things matter on macOS specifically:
AetherEngine's displayCapabilities.supportsDolbyVision is hard-coded to false on macOS (AetherEngine.swift:192). The DV detection on tvOS/iOS uses AVPlayer.availableHDRModes, but that API doesn't report DV on macOS, so the engine conservatively treats any macOS display as non-DV. For Profile 5 the engine still emits dvh1 + dvcC because that's the only legal packaging (no HDR10 base layer), routes the media playlist only, and relies on AVPlayer's internal DV decoder to tonemap. If AVPlayer's macOS DV decode path requires the display to advertise DV, the decode never engages and you get the symptom you reported.
Profile 5 has compatibility_id=0 with no HDR10 base layer. On a display chain that isn't DV-capable end to end, there is nothing to fall back to. The behaviour may be the expected outcome of "P5 on a non-DV sink", not an engine bug.
To narrow it down, please share:
Exact MacBook Pro model (M1 13" 2020, M1 Pro/Max 14" or 16" 2021, M2, etc.) and macOS version. The 14"/16" XDR panels can decode DV in some configurations; the 13" Retina cannot.
Which host: Sodalite, DemoPlayerMac, or your own integration.
AetherEngine version (commit SHA or release tag).
Whether the same file plays in QuickTime Player or Safari (Apple-native DV decode, no engine involved). If QuickTime also fails, the file cannot render DV on this Mac regardless of the engine.
Whether any other DV Profile 5 file plays through AetherEngine on this Mac.
AVFoundation / AVPlayer error code from the failed session (item.error or console log).
If QuickTime plays it but AetherEngine does not, there is an engine bug to fix. If neither plays it, the file needs a DV-capable display chain.
It’s very strange — it doesn’t seem to be related to the device. The video cannot be played on QuickTime Player, nor can it be played by AVPlayer on my iPhone. It appears to be a format issue. For a Dolby Vision video with profile 5, level 6, if it is packaged in MKV, it can be played via HLS, but not in MP4 format.
PS: I am using the release version 2.0.
Thanks, that's informative. It rules out a panel/display chain issue.
What I'm seeing: the MP4 container is rejected by Apple's AVAsset layer (QuickTime, iPhone AVPlayer). The matching MKV of the same content plays through AetherEngine, which means the elementary HEVC+DV stream is fine. So if there's an engine-side bug, it's in how AetherEngine handles a Profile 5 MP4 whose dvcC box or sample entry is non-standard in a way that breaks Apple's mp4 demuxer.
In the engine's pipeline, both MKV and MP4 go through the same FFmpeg demux + fMP4 remux. If FFmpeg's mp4 demuxer fails to extract AV_PKT_DATA_DOVI_CONF from the source's dvcC (non-standard location, malformed payload), doviConfigRecord returns nil, the variant classifies as .none, and the route falls back to plain HEVC HDR10. The output fMP4 sample entry then doesn't match the actual bitstream and AVPlayer rejects it. The MKV path succeeds because matroska stores the DV configuration record in a separate element that FFmpeg's matroska demuxer reads correctly even when the MP4 demuxer can't.
To confirm, please share:
ffprobe -hide_banner -v error -show_streams -show_format <file.mp4> output. Relevant fields: codec_tag_string on the video stream, any side_data_list entries (specifically a DOVI configuration record), color_transfer, color_primaries.
AetherEngine console log from the failed MP4 playback. Search for [HLSVideoEngine] serving on and the dvVariant= value.
If you have Bento4 handy, mp4dump -v <file.mp4> and the dvcC / hvcC / ftyp lines. That shows whether the dvcC is in the standard place.
If the log says dvVariant=none and ffprobe shows no DOVI side data, that is the engine-side fix path: extend the classifier to detect P5 from codec_tag == 'dvh1' and infer a default DOVI record when FFmpeg cannot parse the source's configuration directly.
Tested on my iPhone and also not working so it’s not an aether problem.
It’s probably a bad file and AVPlayer is very strict.
Many online files are mastered using dodgy tools which deviate from specs.
Tested via another app which uses AVPlayer via local HLS and it worked so I suspect they have a hack in place for broken DV5 files (this never happens with DV8 which AVPlayer is more relaxed about)
Best way @superuser404notfound can address this is comparing the Dolby reference mp4 I sent him with your broken file, seeing where the differences are and whether it could be corrected on the fly.
The MP4 has dvh1 + a well-formed dvcC (P5 L6 compat_id=0), but the HEVC SPS VUI transfer / primaries / matrix are all unspecified and there's no colr atom on the sample entry. FFmpeg's mp4 demuxer reports color_transfer=unknown for that source. The engine was stream-copying through to its output fMP4 without filling in the gap, so AVPlayer saw a dvh1 sample entry with no explicit PQ signal and refused to engage the DV decoder.
The MKV variant works because matroska's Colour element populates codecpar.color_* directly, which FFmpeg's mp4 muxer then writes as a colr nclx atom. The mp4 demuxer has no equivalent inference.
Fixed in af8cafd: when dvVariant == .profile5, force the canonical P5 color tuple (BT.2020 primaries, PQ transfer, BT.2020-NCL matrix, limited range) on the muxer's stream codecpar before avformat_write_header. P5 is defined as IPT-PQ-c2, so the dvcC record alone implies that signaling, which makes the override safe (no risk of mislabeling a non-PQ source).
@strangeliu please pull the latest main and re-test. @DrHurt thanks for the comparison framing, the broken-vs-reference angle made the missing PQ signal jump out quickly.
The MP4 has dvh1 + a well-formed dvcC (P5 L6 compat_id=0), but the HEVC SPS VUI transfer / primaries / matrix are all unspecified and there's no colr atom on the sample entry. FFmpeg's mp4 demuxer reports color_transfer=unknown for that source. The engine was stream-copying through to its output fMP4 without filling in the gap, so AVPlayer saw a dvh1 sample entry with no explicit PQ signal and refused to engage the DV decoder.
The MKV variant works because matroska's Colour element populates codecpar.color_* directly, which FFmpeg's mp4 muxer then writes as a colr nclx atom. The mp4 demuxer has no equivalent inference.
Fixed in af8cafd: when dvVariant == .profile5, force the canonical P5 color tuple (BT.2020 primaries, PQ transfer, BT.2020-NCL matrix, limited range) on the muxer's stream codecpar before avformat_write_header. P5 is defined as IPT-PQ-c2, so the dvcC record alone implies that signaling, which makes the override safe (no risk of mislabeling a non-PQ source).
@strangeliu please pull the latest main and re-test. @DrHurt thanks for the comparison framing, the broken-vs-reference angle made the missing PQ signal jump out quickly.
Still unable to play using the latest commit (commit hash: af8cafd)
The 2.0.1 colr fix was necessary but not sufficient. Reproduced your symptom locally with the Dropbox sample and found the second-layer cause: the source MP4's hvcC carries only the 22-byte configuration header (numOfArrays = 0) and ships VPS / SPS / PPS in-band on every IRAP packet. AVPlayer cannot build a CMVideoFormatDescription from a dvh1 sample entry whose configuration record has no parameter set arrays, which is exactly the item.tracks[*].fourCC=<no fdesc> + CoreMediaErrorDomain -4 you saw. The matroska demuxer dodges this because matroska parameter sets live in CodecPrivate, which FFmpeg lifts into codecpar.extradata as a complete annex-B sequence that the mp4 muxer's ff_isom_write_hvcc then rebuilds properly.
Fixed in ed0e6af, released as 2.0.2 (release): the engine scans the first IRAP packet for VPS / SPS / PPS NAL units, builds a proper hvcC, and replaces the output stream's codecpar.extradata before avformat_write_header. Gated on the precise signal (HEVC, extradata ≥ 23 B with byte 22 = 0, NALU length size 4); other inputs fall through to the existing stream-copy path.
Verified locally against your sample:
aetherctl serve loopback playback advances in QuickTime / AVPlayer past 9 s and runs to completion.
init.mp4 has all four expected boxes: dvh1 + hvcC (125 B with parameter sets) + colr nclx 9/16/9 + dvcC P5 L6 compat_id=0.
Colors render correctly (IPT-PQ-c2 → tonemapped, no green/purple cast).
@strangeliu the 2.0.2 DMG will appear on the release page in a couple of minutes when the notarization workflow finishes. Please retest and let me know.
Thanks for the clean repro file, the patience through two iterations, and confirming the fix. Closing.
Also thanks to @DrHurt for the broken-vs-Dolby-reference framing — that's what made the missing-PQ-signal angle obvious, and after that the empty-hvcC angle followed naturally from the next layer of diagnostics.
Activity
superuser404notfound commentedon May 28, 2026
Thanks for the report.
The engine's DV Profile 5 path looks correct on inspection: P5 is detected from the
dvcCrecord, routed asdvh1with thedvcCbox preserved through muxing, and the HLS master/media playlist emitsCODECS="dvh1.05.<level>,..."as expected. So the most likely causes are environmental rather than a missing code path.Could you share the following so I can reproduce or rule things out?
If you can share a short sample that reproduces, even a 5 to 10 second clip, that helps a lot. P5 compatibility_id=0 has no HDR10 base layer, so it requires a DV-capable sink end to end; that is the first thing I want to rule out before chasing a muxer bug.
strangeliu commentedon May 28, 2026
Thanks for your quick response, The device I am using is an M1 MacBook Pro. Here is the problematic video segment:
https://www.dropbox.com/scl/fi/hp7js4bdxebaxkt2b78se/The.Wandering.Earth.-.2023.V2.WEB-DL.4K.HEVC.DV.DDP-Enichi.mp4?rlkey=d7kdlkrvowkidp5e0trm4sr8v&st=8nl9lzk0&dl=0
superuser404notfound commentedon May 28, 2026
Thanks for the sample and platform info. M1 MacBook Pro changes the picture from my original triage, which assumed Apple TV.
Two things matter on macOS specifically:
AetherEngine's
displayCapabilities.supportsDolbyVisionis hard-coded tofalseon macOS (AetherEngine.swift:192). The DV detection on tvOS/iOS usesAVPlayer.availableHDRModes, but that API doesn't report DV on macOS, so the engine conservatively treats any macOS display as non-DV. For Profile 5 the engine still emitsdvh1+dvcCbecause that's the only legal packaging (no HDR10 base layer), routes the media playlist only, and relies on AVPlayer's internal DV decoder to tonemap. If AVPlayer's macOS DV decode path requires the display to advertise DV, the decode never engages and you get the symptom you reported.Profile 5 has
compatibility_id=0with no HDR10 base layer. On a display chain that isn't DV-capable end to end, there is nothing to fall back to. The behaviour may be the expected outcome of "P5 on a non-DV sink", not an engine bug.To narrow it down, please share:
item.erroror console log).If QuickTime plays it but AetherEngine does not, there is an engine bug to fix. If neither plays it, the file needs a DV-capable display chain.
strangeliu commentedon May 28, 2026
It’s very strange — it doesn’t seem to be related to the device. The video cannot be played on QuickTime Player, nor can it be played by AVPlayer on my iPhone. It appears to be a format issue. For a Dolby Vision video with profile 5, level 6, if it is packaged in MKV, it can be played via HLS, but not in MP4 format.
PS: I am using the release version 2.0.
superuser404notfound commentedon May 28, 2026
Thanks, that's informative. It rules out a panel/display chain issue.
What I'm seeing: the MP4 container is rejected by Apple's AVAsset layer (QuickTime, iPhone AVPlayer). The matching MKV of the same content plays through AetherEngine, which means the elementary HEVC+DV stream is fine. So if there's an engine-side bug, it's in how AetherEngine handles a Profile 5 MP4 whose
dvcCbox or sample entry is non-standard in a way that breaks Apple's mp4 demuxer.In the engine's pipeline, both MKV and MP4 go through the same FFmpeg demux + fMP4 remux. If FFmpeg's mp4 demuxer fails to extract
AV_PKT_DATA_DOVI_CONFfrom the source'sdvcC(non-standard location, malformed payload),doviConfigRecordreturns nil, the variant classifies as.none, and the route falls back to plain HEVC HDR10. The output fMP4 sample entry then doesn't match the actual bitstream and AVPlayer rejects it. The MKV path succeeds because matroska stores the DV configuration record in a separate element that FFmpeg's matroska demuxer reads correctly even when the MP4 demuxer can't.To confirm, please share:
ffprobe -hide_banner -v error -show_streams -show_format <file.mp4>output. Relevant fields:codec_tag_stringon the video stream, anyside_data_listentries (specifically aDOVI configuration record),color_transfer,color_primaries.[HLSVideoEngine] serving onand thedvVariant=value.mp4dump -v <file.mp4>and thedvcC/hvcC/ftyplines. That shows whether thedvcCis in the standard place.If the log says
dvVariant=noneand ffprobe shows no DOVI side data, that is the engine-side fix path: extend the classifier to detect P5 fromcodec_tag == 'dvh1'and infer a default DOVI record when FFmpeg cannot parse the source's configuration directly.DrHurt commentedon May 28, 2026
Tested on my iPhone and also not working so it’s not an aether problem.
It’s probably a bad file and AVPlayer is very strict.
Many online files are mastered using dodgy tools which deviate from specs.
Tested via another app which uses AVPlayer via local HLS and it worked so I suspect they have a hack in place for broken DV5 files (this never happens with DV8 which AVPlayer is more relaxed about)
Best way @superuser404notfound can address this is comparing the Dolby reference mp4 I sent him with your broken file, seeing where the differences are and whether it could be corrected on the fly.
I suspect it will be straightforward.
DrHurt commentedon May 28, 2026
When I worked on this before, this problem only ever happened with some DV5 files in mp4 containers.
Never happened with mkv or DV8.
fix(dv5): force canonical color signaling on Profile 5 mp4 output
superuser404notfound commentedon May 28, 2026
Confirmed the root cause from the Dropbox sample.
The MP4 has
dvh1+ a well-formeddvcC(P5 L6 compat_id=0), but the HEVC SPS VUI transfer / primaries / matrix are all unspecified and there's nocolratom on the sample entry. FFmpeg's mp4 demuxer reportscolor_transfer=unknownfor that source. The engine was stream-copying through to its output fMP4 without filling in the gap, so AVPlayer saw advh1sample entry with no explicit PQ signal and refused to engage the DV decoder.The MKV variant works because matroska's
Colourelement populatescodecpar.color_*directly, which FFmpeg's mp4 muxer then writes as acolr nclxatom. The mp4 demuxer has no equivalent inference.Fixed in
af8cafd: whendvVariant == .profile5, force the canonical P5 color tuple (BT.2020 primaries, PQ transfer, BT.2020-NCL matrix, limited range) on the muxer's stream codecpar beforeavformat_write_header. P5 is defined as IPT-PQ-c2, so the dvcC record alone implies that signaling, which makes the override safe (no risk of mislabeling a non-PQ source).@strangeliu please pull the latest main and re-test. @DrHurt thanks for the comparison framing, the broken-vs-reference angle made the missing PQ signal jump out quickly.
strangeliu commentedon May 28, 2026
strangeliu commentedon May 28, 2026
Still unable to play using the latest commit (commit hash: af8cafd)
superuser404notfound commentedon May 28, 2026
Please download the new dmg from the 2.0.1 release page and test again.
strangeliu commentedon May 28, 2026
not working. item.status=failed err=CoreMediaErrorDomain/-4 'The operation couldn’t be completed. (CoreMediaErrorDomain error -4.)'
fix(dv5): rebuild hvcC with in-band parameter sets for empty-config MP4s
superuser404notfound commentedon May 28, 2026
The 2.0.1 colr fix was necessary but not sufficient. Reproduced your symptom locally with the Dropbox sample and found the second-layer cause: the source MP4's
hvcCcarries only the 22-byte configuration header (numOfArrays = 0) and ships VPS / SPS / PPS in-band on every IRAP packet. AVPlayer cannot build aCMVideoFormatDescriptionfrom advh1sample entry whose configuration record has no parameter set arrays, which is exactly theitem.tracks[*].fourCC=<no fdesc>+CoreMediaErrorDomain -4you saw. The matroska demuxer dodges this because matroska parameter sets live inCodecPrivate, which FFmpeg lifts intocodecpar.extradataas a complete annex-B sequence that the mp4 muxer'sff_isom_write_hvccthen rebuilds properly.Fixed in
ed0e6af, released as 2.0.2 (release): the engine scans the first IRAP packet for VPS / SPS / PPS NAL units, builds a proper hvcC, and replaces the output stream'scodecpar.extradatabeforeavformat_write_header. Gated on the precise signal (HEVC, extradata ≥ 23 B with byte 22 = 0, NALU length size 4); other inputs fall through to the existing stream-copy path.Verified locally against your sample:
init.mp4has all four expected boxes:dvh1+hvcC(125 B with parameter sets) +colr nclx 9/16/9+dvcCP5 L6 compat_id=0.@strangeliu the 2.0.2 DMG will appear on the release page in a couple of minutes when the notarization workflow finishes. Please retest and let me know.
strangeliu commentedon May 28, 2026
It works, great job!
superuser404notfound commentedon May 28, 2026
Thanks for the clean repro file, the patience through two iterations, and confirming the fix. Closing.
Also thanks to @DrHurt for the broken-vs-Dolby-reference framing — that's what made the missing-PQ-signal angle obvious, and after that the empty-hvcC angle followed naturally from the next layer of diagnostics.
DrHurt commentedon May 28, 2026
Could this theoretically affect DV8 / DV 10 sources as well?
I’m wondering if the fix should be broadened to cover any broken mp4 DV file.
DrHurt commentedon May 28, 2026
I see the extra data fix applied unconditionally to broken files so that’s a good safety net.
P5 colour fix:
Hardcoding range to limited is not a good idea as some files including the reference I sent you have full range.
The grand majority of files will have limited range, but files with full range may end up with black crush (or cause other issues)
Edit: thinking out loud:
Maybe try disabling the P5 colour fix altogether and see if the hvcC fix alone is enough?
DrHurt commentedon May 29, 2026
I stand corrected.
I had a DV8.1 mp4 that I could never get to work with AVPlayer on my previous project.
It now works with Demo app 2.0.2 where it didn’t work with previous version.
I’m writing this here to confirm that the extra-data fix works with broken DV 8.1 mp4s as well.
Very well done!
fix(dv): P5 colr override fills range gap instead of forcing limited
fix(video): decide NAL framing from the packets, not from the config …
fix(dv): a synthesized Profile 5 record is served like a recorded one (…
fix(colour): an init's colr range, mdcv and Profile 5 range come from…
fix(hls): lift HDR static metadata the container lacks from the SEI i…
fix(hls): lift HDR static metadata the container lacks from the SEI i…