Skip to content

Add option to route video via AVPlayer instead of AVSampleBufferDisplayLayer #1

Closed

Description

@DrHurt

Thank you very much for this project.

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)

AVPlayer natively supports via hardware decoding:

Video: h.264/h.265/vp9/av1/mpeg4 (limited profiles)
Dynamic Ranges: SDR, HLG, HDR10(+), Dolby Vision Profiles 5, 8.1, 8.4, 10.1,10.4
Audio: AAC, AC3, eAC3+Atmos, FLAC, ALAC (all up to 7.1 aka 8 channels)

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.

eg. MKV (hevc+trueHD) ----ffmpeg---> fMP4 (hevc+flac)---HLS---> AVPlayer

This is what KSPlayer's ProAVPlayer does and it works brilliantly.

Activity

  1. 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
  2. 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
  3. DrHurt commented on May 1, 2026

    @DrHurt
    ContributorAuthor

    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)

    #EXTM3U
    #EXT-X-STREAM-INF:BANDWIDTH=xxx,AVERAGE-BANDWIDTH=xxx,VIDEO-RANGE=PQ,CODECS="dvh1",RESOLUTION=3840x2160,FRAME-RATE=60.00
    playlist.m3u8
    

    
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

  4. 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
  5. 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
  6. superuser404notfound commented on May 3, 2026

    @superuser404notfound
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions