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
HDR10+ and Dolby Vision missing dynamic metadata #2
I've tested the current implementation and these are my findings:
It's VERY fast. I'm super impressed.
Video:
DV P8.1: TV switches to HDR mode (not DV) and plays the HDR10 base layer, no DV dynamic metadata
DV P5: TV switches to HDR mode (not DV), purple/green video as no HDR10 layer in P5
HDR10+: TV switches to HDR mode (not HDR10+) and plays the HDR10 base layer without the "plus" metadata
HLG & HDR10: both play correctly, TV switches to HDR mode and colours play correctly.
In the other thread, I said you could use AVPlayer to decode & render videos but if you can achieve the same results via AVSampleBufferDisplayLayer then that's probably better.
Tested again the new Sodalite rebrand 0.4.0 build 13
Same results:
Static HDR:
HLG & HDR10 - work as expected
Dynamic HDR:
HDR10+ --- plays HDR10 base layer (fallback)
DV P8.1/8.4 --- plays HDR10/HLG base layer (fallback)
DV P5 --- wrong colours (because no HDR10 fallback)
TV does NOT switch to DV mode with any of the DV profiles tested.
No worries, sorry for tagging! Super impressed by your work. I think this will eventually become the gold standard for media playback on Apple devices replacing KSPlayer.
No worries, sorry for tagging! Super impressed by your work. I think this will eventually become the gold standard for media playback on Apple devices replacing KSPlayer.
Very well done!!!
Wow thanks a lot!! This project was started for my tvOS Jellyfin Player because all the existing engines wouldnt fit my needs or were to complicated to implement.
I pushed a potential fix for the dolby vision stuff. HDR10+ is still an issue i have to look at. Could you please test this? I currently dont have a dv display :(
The fix is gonna be part of the 0.5.0 update, this may take some days until release. Thanks again for your testing, that was really helpful information!
I see you’ve released 0.5.0 with potential fixes for DV & HDR10+ but it’s probably still awaiting Apple review.
Looking forward to testing it and reporting back.
One trick we use is incrementing build number without changing version number. That bypasses Apple review and gives testers instant access to beta builds for quicker feedback & debugging.
Unfortunately got exact same results. P8 & HDR10+ fall back to HDR10, wrong colours with P5.
First thought is whether gating on displaySupportsDolbyVision is actually working as expected (because Apple documentation says it’s deprecated) so it might be blocking the new pathway.
I’ll try again after work and will manually change TV mode to DV to see if that changes anything.
Might be worth removing gating for now for debugging purposes (another 0.5.0 build).
Thanks for testing and the detailed analysis! Two follow-up changes just landed (engine c01cb15, Sodalite fee8c3e). Will be in the next TestFlight build.
Two distinct root causes addressed:
displaySupportsDolbyVision gate removed — your hypothesis was on point. AVPlayer.availableHDRModes is soft-deprecated on tvOS 26 and observed in third-party players to lag the HDMI HDR-mode handshake. We now always tag DV streams as dvh1 + dvcC whenever the codec params carry an AVDOVIDecoderConfigurationRecord, regardless of the gate. Profile 8.1 / 8.4 still play their backward-compatible base layer on non-DV TVs; Profile 5 has no compatible base so it'll still produce wrong colours on a non-DV sink, same as before.
HDR10+ HEVC bitstream walker added — the HW (VideoToolbox) path was the bug here. FFmpeg only parses ITU-T T.35 SEI inside its own HEVC decoder, which we bypass entirely on the HW path. So AV_PKT_DATA_DYNAMIC_HDR10_PLUS on packets was empty for HEVC sources and our previous extraction returned nil. Now there's a manual NAL walker that parses PREFIX_SEI_NUT / SUFFIX_SEI_NUT, unescapes RBSP, finds payload_type 5 SEI matching the HDR10+ signature (country_code 0xB5 / terminal_provider 0x003C / oriented_code 0x0001 / application_identifier 4) and returns the T.35 payload starting at the country_code byte for kCMSampleAttachmentKey_HDR10PlusPerFrameData. SW path was already correct via AVFrame side data and is unchanged.
Diagnostics added so the next test round leaves a clear trace:
[VideoDecoder] AVPlayer.availableHDRModes raw=N contains.dolbyVision=true|false on every stream open. Tells us what the deprecated API actually returns on your hardware.
[VideoDecoder] Dolby Vision detected: profile=N level=N rpu=N el=N bl=N compat=N → tagging as 'dvh1' with dvcC plus a hex dump of the 24-byte dvcC atom. Lets us cross-check the bit packing against MP4Box -info if needed.
[VideoDecoder] HEVC bitstream SEI walker found HDR10+ T.35 payload (N bytes) (one-shot per stream). Confirms the new HW-path extraction worked.
[Renderer] HDR10+ attachment count: N (last payload N bytes) at 1, 30, then every 600 frames. Proves the metadata is actually reaching the display layer.
If you can grab a Console log during your next test (TV + Play/Pause for a screenshot is fine, idevicesyslog if you have a Mac), those four lines plus the visible TV behaviour should narrow down whatever remains in one round. Especially curious whether the gate logs contains.dolbyVision=true or =false on your TV.
Quick update: the issues from the previous post are fixed, the new pipeline is up on the device.
Verified on Apple TV across two real Jellyfin sources (1440x1080 HEVC + AC-3, 1920x1080 H.264 + EAC3):
Initial playback: clean. Resume-from-position into mid-stream segments (seg-54, seg-60) lands the right bytes in the player.
Forward scrubs: clean across multiple jumps per session (seg-1 → seg-60 → seg-116, etc).
Backward scrubs: clean too. Cache window slides the right way on a back-jump, producer restarts at the requested index, AVPlayer gets bytes within ~350 ms.
A/V sync: holds across all of the above. No drift, no freeze, no chaos-after-a-few-seconds behaviour.
The resume-jump deadlock was the single root cause behind the previous round's "HEVC freezes after 2 s" AND the "H.264 hangs after second scrub" symptoms. One bug, two presentations.
Open polish items on my side:
Scrub-restart latency. When the old producer's pump is in mid-mux at the moment of scrub, the restart blocks for up to ~800 ms before the pump notices the stop signal. Easy fix: have producer.stop() broadcast on the cache's condvar so the pump's awaitFetchHighWater returns immediately instead of waiting for its 1 s poll interval. Drops scrub-restart latency to a flat ~250 ms regardless of pump state.
First-segment latency. Currently ~370 ms because hls_time = 6.0 and the producer has to demux 6 s of source before the first cut. Dropping to hls_time = 4.0 halves that and stays well within Apple's HLS Authoring Spec recommendation.
Both are small. The hard part is done.
I'll roll those in after one more day of soak-testing, and then move on to the codec expansion you offered to help with. Looking forward to the writeup.
With your permission, I’ll probably open a new thread for the codec stuff as this one has become a bit long.
Also: thinking outloud but how would you feel about moving the AVPlayerLayer & related bits like matching dynamic range & frame rate from sodalite to aether so that the engine is self contained from file input to render surface.
That way iOS/tvOS/macOS devs in the future can simply drop aether in, load a file and it just works.
Yes please, separate thread for the codec work is the right call. This one has earned its retirement.
And: yes, that direction is exactly where I want to take this. The engine already owns the render surface on the FFmpeg + VideoToolbox path (it hands the host an AVSampleBufferDisplayLayer), but the AVPlayer path leaks responsibility back to Sodalite: the host mounts the AVPlayerLayer, builds the AVDisplayCriteria, talks to AVDisplayManager for the HDMI mode handshake, and even decides when to fall back. That asymmetry is the main reason "drop aether in and play a file" isn't true yet on the native route.
The plan is to fold all of that into the engine, then collapse to a single path:
one public surface, an AetherPlayerView (UIKit/AppKit + a SwiftUI wrapper) that hosts the active renderer
the engine owns the dynamic-range handshake end-to-end, building the CMVideoFormatDescription from the format it already detects (HDR10 / HDR10+ / HLG / DV with the correct dvh1 / hvc1 codec tag)
frame-rate matching driven by the actual stream rate from the demuxer, not a hardcoded 23.976
host honors a single boolean ("match content", off by default like Apple) and otherwise stays out of it
and after the AVPlayer surface lands, the aether sample-buffer path retires: every source flows through the muxer to fMP4 over loopback, including MP4 containers, so the engine is a pure format-agnostic feeder for AVPlayer with one path and predictable behavior
Codec expansion (VP9 + AV1) lands on top of that, gated on real VTRegisterSupplementalVideoDecoderIfAvailable + VTIsHardwareDecodeSupported probes at engine init. Older silicon that can't AVPlayer-decode a codec gets a clear refusal instead of a silent software fallback.
Looking forward to the writeup. The codec thread can land on a much tidier engine.
I have created a separate thread with containers and codecs to help Aether's HLS engine use the full capabilities of AVPlayer.
Some thoughts after looking at recent changes:
AV1 is only supported on devices with hardware decoding. There is no software fallback in AVPlayer.
VP9 is only ever used on YouTube. Only Safari can decode it, and only inside webm containers. (my fault, sorry)
I see you removed the ffmpeg/dav1d software decode layer (correct me if I'm wrong). I think a lot of users (especially with older devices) would want to have software decode for at least AV1 (and a small minority of users will want VP9 and older codecs).
May I suggest, once Aether HLS + AVPlayer is stable, that you offer ffmpeg/dav1d as a self contained Aether "extension" that plugs into your new player view for devs that want to increase codec compatibility via software decoding.
Activity
DrHurt commentedon May 3, 2026
Tested again the new Sodalite rebrand 0.4.0 build 13
Same results:
Static HDR:
HLG & HDR10 - work as expected
Dynamic HDR:
HDR10+ --- plays HDR10 base layer (fallback)
DV P8.1/8.4 --- plays HDR10/HLG base layer (fallback)
DV P5 --- wrong colours (because no HDR10 fallback)
TV does NOT switch to DV mode with any of the DV profiles tested.
DrHurt commentedon May 3, 2026
@superuser404notfound
I think I see a potential reason why DV is failing.
CMVideoFormatDescriptionin videotoolbox setup is missingkCMVideoCodecType_DolbyVisionHEVCanddvcCHave a look here:
Marginal/QuickLookVideo#158
superuser404notfound commentedon May 3, 2026
Sorry for not responding quicker! Thanks for your testing i will take a look into it!
DrHurt commentedon May 3, 2026
No worries, sorry for tagging! Super impressed by your work. I think this will eventually become the gold standard for media playback on Apple devices replacing KSPlayer.
Very well done!!!
fix(video): tag Dolby Vision streams as 'dvh1' with a dvcC extension
superuser404notfound commentedon May 3, 2026
Wow thanks a lot!! This project was started for my tvOS Jellyfin Player because all the existing engines wouldnt fit my needs or were to complicated to implement.
I pushed a potential fix for the dolby vision stuff. HDR10+ is still an issue i have to look at. Could you please test this? I currently dont have a dv display :(
DrHurt commentedon May 3, 2026
That was super fast. I'll test it once you push a new built to test flight (don't have the setup to build this).
superuser404notfound commentedon May 3, 2026
The fix is gonna be part of the 0.5.0 update, this may take some days until release. Thanks again for your testing, that was really helpful information!
DrHurt commentedon May 3, 2026
HDR10+ probably needs
kCMSampleAttachmentKey_HDR10PlusPerFrameDatabut we should wait until we test & iron out Dolby Vision before moving to HDR10+I'll keep an eye on TestFlight and let you know how it goes.
feat(video): pass HDR10+ dynamic metadata to the display layer
DrHurt commentedon May 5, 2026
I see you’ve released 0.5.0 with potential fixes for DV & HDR10+ but it’s probably still awaiting Apple review.
Looking forward to testing it and reporting back.
One trick we use is incrementing build number without changing version number. That bypasses Apple review and gives testers instant access to beta builds for quicker feedback & debugging.
We bump version only when releasing!
superuser404notfound commentedon May 6, 2026
0.5.0 is now live for testing!
DrHurt commentedon May 6, 2026
Unfortunately got exact same results. P8 & HDR10+ fall back to HDR10, wrong colours with P5.
First thought is whether gating on displaySupportsDolbyVision is actually working as expected (because Apple documentation says it’s deprecated) so it might be blocking the new pathway.
I’ll try again after work and will manually change TV mode to DV to see if that changes anything.
Might be worth removing gating for now for debugging purposes (another 0.5.0 build).
fix(video): drop DV display gate + extract HDR10+ from HEVC bitstream
superuser404notfound commentedon May 6, 2026
Thanks for testing and the detailed analysis! Two follow-up changes just landed (engine c01cb15, Sodalite fee8c3e). Will be in the next TestFlight build.
Two distinct root causes addressed:
displaySupportsDolbyVisiongate removed — your hypothesis was on point.AVPlayer.availableHDRModesis soft-deprecated on tvOS 26 and observed in third-party players to lag the HDMI HDR-mode handshake. We now always tag DV streams asdvh1+dvcCwhenever the codec params carry anAVDOVIDecoderConfigurationRecord, regardless of the gate. Profile 8.1 / 8.4 still play their backward-compatible base layer on non-DV TVs; Profile 5 has no compatible base so it'll still produce wrong colours on a non-DV sink, same as before.HDR10+ HEVC bitstream walker added — the HW (VideoToolbox) path was the bug here. FFmpeg only parses ITU-T T.35 SEI inside its own HEVC decoder, which we bypass entirely on the HW path. So
AV_PKT_DATA_DYNAMIC_HDR10_PLUSon packets was empty for HEVC sources and our previous extraction returned nil. Now there's a manual NAL walker that parses PREFIX_SEI_NUT / SUFFIX_SEI_NUT, unescapes RBSP, finds payload_type 5 SEI matching the HDR10+ signature (country_code 0xB5 / terminal_provider 0x003C / oriented_code 0x0001 / application_identifier 4) and returns the T.35 payload starting at the country_code byte forkCMSampleAttachmentKey_HDR10PlusPerFrameData. SW path was already correct via AVFrame side data and is unchanged.Diagnostics added so the next test round leaves a clear trace:
[VideoDecoder] AVPlayer.availableHDRModes raw=N contains.dolbyVision=true|falseon every stream open. Tells us what the deprecated API actually returns on your hardware.[VideoDecoder] Dolby Vision detected: profile=N level=N rpu=N el=N bl=N compat=N → tagging as 'dvh1' with dvcCplus a hex dump of the 24-byte dvcC atom. Lets us cross-check the bit packing againstMP4Box -infoif needed.[VideoDecoder] HEVC bitstream SEI walker found HDR10+ T.35 payload (N bytes)(one-shot per stream). Confirms the new HW-path extraction worked.[Renderer] HDR10+ attachment count: N (last payload N bytes)at 1, 30, then every 600 frames. Proves the metadata is actually reaching the display layer.If you can grab a Console log during your next test (TV + Play/Pause for a screenshot is fine,
idevicesyslogif you have a Mac), those four lines plus the visible TV behaviour should narrow down whatever remains in one round. Especially curious whether the gate logscontains.dolbyVision=trueor=falseon your TV.Thanks again!
108 remaining items
superuser404notfound commentedon May 13, 2026
Quick update: the issues from the previous post are fixed, the new pipeline is up on the device.
Verified on Apple TV across two real Jellyfin sources (1440x1080 HEVC + AC-3, 1920x1080 H.264 + EAC3):
The resume-jump deadlock was the single root cause behind the previous round's "HEVC freezes after 2 s" AND the "H.264 hangs after second scrub" symptoms. One bug, two presentations.
Open polish items on my side:
Scrub-restart latency. When the old producer's pump is in mid-mux at the moment of scrub, the restart blocks for up to ~800 ms before the pump notices the stop signal. Easy fix: have
producer.stop()broadcast on the cache's condvar so the pump'sawaitFetchHighWaterreturns immediately instead of waiting for its 1 s poll interval. Drops scrub-restart latency to a flat ~250 ms regardless of pump state.First-segment latency. Currently ~370 ms because
hls_time = 6.0and the producer has to demux 6 s of source before the first cut. Dropping tohls_time = 4.0halves that and stays well within Apple's HLS Authoring Spec recommendation.Both are small. The hard part is done.
I'll roll those in after one more day of soak-testing, and then move on to the codec expansion you offered to help with. Looking forward to the writeup.
DrHurt commentedon May 13, 2026
With your permission, I’ll probably open a new thread for the codec stuff as this one has become a bit long.
Also: thinking outloud but how would you feel about moving the AVPlayerLayer & related bits like matching dynamic range & frame rate from sodalite to aether so that the engine is self contained from file input to render surface.
That way iOS/tvOS/macOS devs in the future can simply drop aether in, load a file and it just works.
superuser404notfound commentedon May 13, 2026
Yes please, separate thread for the codec work is the right call. This one has earned its retirement.
And: yes, that direction is exactly where I want to take this. The engine already owns the render surface on the FFmpeg + VideoToolbox path (it hands the host an
AVSampleBufferDisplayLayer), but the AVPlayer path leaks responsibility back to Sodalite: the host mounts theAVPlayerLayer, builds theAVDisplayCriteria, talks toAVDisplayManagerfor the HDMI mode handshake, and even decides when to fall back. That asymmetry is the main reason "drop aether in and play a file" isn't true yet on the native route.The plan is to fold all of that into the engine, then collapse to a single path:
AetherPlayerView(UIKit/AppKit + a SwiftUI wrapper) that hosts the active rendererCMVideoFormatDescriptionfrom the format it already detects (HDR10 / HDR10+ / HLG / DV with the correctdvh1/hvc1codec tag)Codec expansion (VP9 + AV1) lands on top of that, gated on real
VTRegisterSupplementalVideoDecoderIfAvailable+VTIsHardwareDecodeSupportedprobes at engine init. Older silicon that can't AVPlayer-decode a codec gets a clear refusal instead of a silent software fallback.Looking forward to the writeup. The codec thread can land on a much tidier engine.
DrHurt commentedon May 13, 2026
I have created a separate thread with containers and codecs to help Aether's HLS engine use the full capabilities of AVPlayer.
Some thoughts after looking at recent changes:
AV1 is only supported on devices with hardware decoding. There is no software fallback in AVPlayer.
VP9 is only ever used on YouTube. Only Safari can decode it, and only inside webm containers. (my fault, sorry)
I see you removed the ffmpeg/dav1d software decode layer (correct me if I'm wrong). I think a lot of users (especially with older devices) would want to have software decode for at least AV1 (and a small minority of users will want VP9 and older codecs).
May I suggest, once Aether HLS + AVPlayer is stable, that you offer ffmpeg/dav1d as a self contained Aether "extension" that plugs into your new player view for devs that want to increase codec compatibility via software decoding.
fix(producer): enforce monotonic dts on the source-TB packet stream
fix(routing): software fallback for H.264/HEVC formats VideoToolbox c…
docs: 5.8.2 changelog + H.264/HEVC software-fallback notes (#2)
Merge fix/2-vt-decodability-sw-fallback: H.264/HEVC software fallback…
fix(routing): guard VT require-hardware key for iOS/tvOS 17 (#2)
docs: correct native-subtitle path to WebVTT and add #2 SW-decode row
docs: fix FFmpegBuild license (LGPL-2.1) and #2 routing in architecture
fix(routing): exempt DV Profile 5 from the VT capability probe gate (s…
fix(engine): a session-preserving reload preserves the transport and …
fix(open): fewer connections at open on scarce origins, the source ax…