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
Add option to route video via AVPlayer instead of AVSampleBufferDisplayLayer #1
May I suggest, as an option, expanding your remux (HLS) path to include all compatible video streams so that SDR & HDR videos play natively via AVPlayer along with the audio instead of running 2 separate layers and syncing them, and tinkering with AVSampleBufferDisplayLayer to ensure it handles per-frame dynamic metadata (DV & HDR10+) and tone mapping.
AVPlayer automatically sets up the correct decoding, rendering, and tone mapping pipelines & changes TV dynamic range. It also automatically integrates with the wider ecosystem (HomePods, AirPods, iPhone remote control, dialogue enhancement, volume normalisation etc)
Tone Mapping between HDR/DV & SDR is done automatically (with the correct HLS manifest)
You can also convert non-supported audio like TrueHD & DTS to FLAC on the fly while remuxing with minimal resource usage so you can play those codecs losslessly through AVPlayer
In this setup, Aether becomes a mini-HLS server that takes non-compatible containers, remuxes & streams media compatible media to the native AVPlayer via HLS.
changed the title [-]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer[/-][+]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata [/+]on Apr 29, 2026
changed the title [-]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata [/-][+]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata)[/+]on Apr 29, 2026
It took me a lot of time researching & testing this when working on KSPlayer so hope you find it useful. You can try it out in KSPlayer by enabling ProAVPlayer.
Here’s a full breakdown of how to pass on video via HLS to AVPlayer for native playback.
AVPlayer quirks:
Use master playlist only for HDR content
Use segments playlist directly for SDR
Use segments playlist for HDR content if you want to force HDR/DV tone mapping to SDR
Master playlist header: (example, modify as per profile below)
HLG: CODECS=hvc1 VIDEO-RANGE=HLG
HDR10 & HDR10+: CODECS=hvc1 VIDEO-RANGE=PQ
DV P5 & P8.1: CODECS=dvh1 VIDEO-RANGE=PQ
DV P8.4: CODECS=hvc1 VIDEO-RANGE=HLG
AV1 codecs: (On supported hardware only)
DV P10 & P10.1: CODECS=dav1 VIDEO-RANGE=PQ
DV P10.4: CODECS=dav1 VIDEO-RANGE=HLG
FFMPEG quirks when remuxing:
-tag:v hvc1 is needed for any SDR hevc stream & HLG & DV 8.4
-tag:v dvh1 is needed for DV P5, P8.1
-strict unofficial is needed with all DV but not with HDR
-c:a flac will convert TrueHD & DTS to flac with zero quality loss so they can accompany the video for native playback in AVPlayer!
Further notes:
P8.6 is not a valid profile (but should still play if treated as 8.1)
P7 isn’t supported but the above method can be adapt to force playback of the HDR10 base layer.
changed the title [-]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata)[/-][+]Update: route video via AVPlayer instead of AVSampleBufferDisplayLayer (HLS & HDR profiles added)[/+]on May 1, 2026
changed the title [-]Update: route video via AVPlayer instead of AVSampleBufferDisplayLayer (HLS & HDR profiles added)[/-][+]Add option to route video via AVPlayer instead of AVSampleBufferDisplayLayer[/+]on May 2, 2026
Thanks again for the writeup, this is genuinely valuable reference material. AetherEngines video path is FFmpeg + VideoToolbox + AVSampleBufferDisplayLayer rather than HLS+AVPlayer, so the master-playlist / codec-tag table doesn’t apply directly to the pipeline. Bookmarking it for any future fallback path i might add for codecs VT can’t handle. Closing as informational, open a new issue if you spot an HDR signalling bug in the actual pipeline.
Activity
[-]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer[/-][+]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata [/+][-]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata [/-][+]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata)[/+]DrHurt commentedon May 1, 2026
It took me a lot of time researching & testing this when working on KSPlayer so hope you find it useful. You can try it out in KSPlayer by enabling ProAVPlayer.
Here’s a full breakdown of how to pass on video via HLS to AVPlayer for native playback.
AVPlayer quirks:
Master playlist header: (example, modify as per profile below)
Full AVPlayer HDR HLS profiles for reference:
HLG: CODECS=hvc1 VIDEO-RANGE=HLG
HDR10 & HDR10+: CODECS=hvc1 VIDEO-RANGE=PQ
DV P5 & P8.1: CODECS=dvh1 VIDEO-RANGE=PQ
DV P8.4: CODECS=hvc1 VIDEO-RANGE=HLG
AV1 codecs: (On supported hardware only)
DV P10 & P10.1: CODECS=dav1 VIDEO-RANGE=PQ
DV P10.4: CODECS=dav1 VIDEO-RANGE=HLG
FFMPEG quirks when remuxing:
-tag:v hvc1 is needed for any SDR hevc stream & HLG & DV 8.4
-tag:v dvh1 is needed for DV P5, P8.1
-strict unofficial is needed with all DV but not with HDR
-c:a flac will convert TrueHD & DTS to flac with zero quality loss so they can accompany the video for native playback in AVPlayer!
Further notes:
P8.6 is not a valid profile (but should still play if treated as 8.1)
P7 isn’t supported but the above method can be adapt to force playback of the HDR10 base layer.
Good luck
[-]Route all compatible video & audio via AVPlayer instead of using AVSampleBufferDisplayLayer (fix HDR & DV dynamic metadata)[/-][+]Update: route video via AVPlayer instead of AVSampleBufferDisplayLayer (HLS & HDR profiles added)[/+][-]Update: route video via AVPlayer instead of AVSampleBufferDisplayLayer (HLS & HDR profiles added)[/-][+]Add option to route video via AVPlayer instead of AVSampleBufferDisplayLayer[/+]superuser404notfound commentedon May 3, 2026
Hey again!
Thanks again for the writeup, this is genuinely valuable reference material. AetherEngines video path is FFmpeg + VideoToolbox + AVSampleBufferDisplayLayer rather than HLS+AVPlayer, so the master-playlist / codec-tag table doesn’t apply directly to the pipeline. Bookmarking it for any future fallback path i might add for codecs VT can’t handle. Closing as informational, open a new issue if you spot an HDR signalling bug in the actual pipeline.
fix(video): per-DV-profile codec tag + video range (P8.4 = hvc1+HLG, …
diag(renderer): release-visible logs for the 4K MKV stall path
diag(muxer): split writePacket-failure log into two lines so tb_out s…
fix(hls): dedupe video packets across segments to stop cross-fragment…
fix(hls): drop pts<dts leading pictures the mp4 muxer can't accept
fix(hls): delay_moov movflag + init-capture pass enables EAC3 stream-…
fix(producer): enforce monotonic dts on the source-TB packet stream
fix(memory): AVIOReader.close runs cleanup after markClosed + 256 MB …
diag(audio): use AVPlayerItem.tracks + dump audio route on readyToPlay
fix(audio): stream-copy ADTS-AAC into fMP4 instead of FLAC-bridging it
test(io): close a scripted-origin connection exactly once
fix(muxer): a source container's audio codec_tag never reaches the fM…
fix(subtitles): a cue start rounded down no longer closes at its own …