Jump to content

FIX FOUND - devs please look: Emby unnecessarily transcoding HEVC streams with the native AVKit player


Recommended Posts

Posted

For some reason, HEVC streams ALWAYS seem to transcode to H264 with Emby when forcing native AVKit player. This is a waste of resources and isn't necessary.

When I disable server transcoding, it attempts direct play but no video is displayed .

Looking at the logs, I see ffmpeg missing "vtag:hvc1" which is an absolute requirement to get AVKit to recognise & play HEVC streams natively.


Manually remuxing the exact same files with ffmpeg allows it to play perfectly fine in Emby (even Dolby Atmos and Vision logos show on TV with this setup).

 

It's a rather trivial fix that I hope the devs here include soon as it will allow Emby be become much more performant and efficient and will improve handling of Dolby files on Apple devices.

 

  • Agree 3
Posted

edit: also needs -hls_segment_type fmp4 if Emby is not already using fMP4

It's all such a simple change that will yield massive improvements to performance & media compatibility on Apple devices.

Here's hoping the dev team sees this and chimes in.

  • Agree 1
Posted
2 hours ago, Luke said:

 

Hi there, let's look at an example. Please attach the information requested in how to report a media playback issue. Thanks!

 

@Luke

Device: Apple TV 4K 3rd gen + tvOS 26.1

Emby player: 2.0.2 (5)

Settings: Preferred Video Player = Native

File: movie.mkv (video = HEVC & audio = AC3)

Server: 4.9.1.90

OS: macOS 12.7.6

 

Problem: playing mkv results in unnecessary transcode to H264

Attempt to fix: disable video transcode on server -> result: audio only, no video playback

Log: see attachment

Log analysis: ffmpeg is not tagging the output stream as hvc1 & is outputting ts instead of fMP4

Suggested fix add -tag:v hvc1  -hls_segment_type fmp4 to the ffmpeg remux commands (and update device profiles to accommodate the compatibility change)

(Experiment Control: same movie.mkv file manually remuxed using ffmpeg -tag:v hvc1 -> HEVC plays correctly -- Same Emby Server & Player)

Benefits: ability to use the native player with HEVC media files including Dolby Vision. Improved performance and power efficiency. TV correctly switches to HDR mode.

 

Thanks for your time & attention. Hope this gets added soon as it will massively improve HDR playback on Emby on Apple TV.

 

ffmpeg-directstream-60ae0bbc-dcdf-4f6b-8960-a6a6b531d386_1.txt

 

  • Thanks 1
Posted

Posting here to keep my findings in one place for the devs (or anyone who comes here via google):

1 - Native player on Emby CANNOT currently play any of my HDR10 files (tested both H264 & HEVC in both mkv and mp4).

It says "no compatible streams available" which I suspect is due to Emby's device profiles artificially preventing playback, not actual platform limitations because the same mp4 files play in other apps that use AVPlayer... This should also be a very simple fix.

 

2- On other apps, AVPlayer appears to support HDR10 & Dolby Vision, both H264 & HEVC in mp4 containers -> TV changes to DV/HDR mode

 

3- AVPlayer on tvOS 26 seems to tone map  HDR & Dolby Vision to SDR when streamed via HLS (personal test server & player for testing, not Emby).

I think tvOS 26 changed (or temporarily broke?) something because this used to work correctly when I tested it last year with tvOS 18. That said, Apple's tvOS EDR tone mapping quality is top notch & is much better than mpv.

 

=======================

Last thoughts: I suspect Apple changed or perhaps broke something with HLS manifests because subtitles no longer work either using my scripts.

Regardless, I still think this would be a big step in the right direction for Emby as HEVC is now universal. Looking forward to seeing it implemented.

Posted
11 hours ago, Geordie said:

3- AVPlayer on tvOS 26 seems to tone map  HDR & Dolby Vision to SDR when streamed via HLS (personal test server & player for testing, not Emby).

My suspicion was right & I found the fix. 

tvOS 26 is now very strict with HLS manifests & unfortunately the master manifest created by ffmpeg isn't good enough anymore.

I needed to add the following attributes to the master manifest to get the TV to switch to Dolby Vision mode:

CODECS, SUPPLEMENTAL-CODECS, VIDEO-RANGE=PQ, FRAME-RATE

 

That's all from me for now. Bye!

Good luck to anyone reading this.

 

Posted
10 hours ago, Geordie said:

My suspicion was right & I found the fix. 

tvOS 26 is now very strict with HLS manifests & unfortunately the master manifest created by ffmpeg isn't good enough anymore.

I needed to add the following attributes to the master manifest to get the TV to switch to Dolby Vision mode:

CODECS, SUPPLEMENTAL-CODECS, VIDEO-RANGE=PQ, FRAME-RATE

 

That's all from me for now. Bye!

Good luck to anyone reading this.

 

We already had VIDEO-RANGE, right?

Posted
6 minutes ago, Luke said:

We already had VIDEO-RANGE, right?

I've been running side tests using ffmpeg, a home http server, and a generic instance of AVPlayer on tvOS 26 so I could bypass the restrictions currently imposed by Emby.

I did all that so I could see & document what it would take to get HEVC & HDR / DV working on AVPlayer on tvOS 26.

I'm sure Emby has it's own HLS manifest builder which is more capable than ffmpeg. That may or may not need to be adapted to accommodate HDR/DV playback on tvOS26.

 

So to sum up my findings:

HEVC on AVPlayer needs: -tag:v hvc1 & -hls_segment_type fmp4 (& strict -unofficial if Dolby Vision metadata is present)

This will play all HEVC videos and by default tvOS 26 AVPlayer will tone map any HDR/DV to SDR

HDR/DV on AVPlayer needs:  CODECS, SUPPLEMENTAL-CODECS, VIDEO-RANGE, FRAME-RATE (don't know if Emby already adds all those to the manifest)

https://developer.apple.com/documentation/http-live-streaming/hls-authoring-specification-for-apple-devices-appendixes

Without this, AVPlayer (at least on tvOS 26) will tone map any non-SDR content to SDR.

With the correct manifest: AVPlayer switches  the TV to HDR / DV mode and videos play as expected.

 

You and the team probably know most if not all of this already.

I just thought I'd document my findings if case you (or anyone coming here via Google) finds any of this helpful one day.

 

Thanks again for taking the time to read all this.

Looking forward to seeing Emby do native HDR on the Apple TV :)

  • Thanks 3
  • 5 weeks later...
eddyg3
Posted

@Lukeany update from the devs on this? HEVC is literally unplayable on my Apple TV

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...