jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
412 stars 128 forks source link

Dolby Vision Profile 5 does not play correctly (DirectPlay) #1772

Open kaysond opened 2 months ago

kaysond commented 2 months ago

Software Versions

Describe the bug

When playing a video with the following profile, the colors have a green/purple hue, as if the setup does not actually support HDR, when it in fact does.

Video
Title: 4K HEVC HDR
Codec: HEVC
Profile: Main 10
Level: 150
Resolution: 3840x2160
Aspect ratio: 16:9
Interlaced: No
Framerate: 24
Bitrate: 16373 kbps
Bit depth: 10 bit
Video range: HDR
Video range type: DOVI
DV title: DV Profile 5
DV version major: 1
DV version minor: 0
DV profile: 5
DV level: 6
DV rpu preset flag: 1
DV el preset flag: 0
DV bl preset flag: 1
DV bl signal compatibility id: 0
Pixel format: yuv420p10le
Ref frames: 1

How To Reproduce

  1. Find video with above profile
  2. Play it without Transcoding

Expected behavior

Video should play as HDR

Logs

Server debug log: https://hastebin.com/share/omiqezupev.yaml

Screenshots

Connection Information

Local over https

Additional context

I'm playing this on a Roku 4800X which supports the above video profile. If I use Roku Media Player to play the file, it works just fine, and my TV shows "HDR". With Jellyfin, "HDR" does not show up, and I get the incorrect colors. I suspect the Roku is trying to play it as SDR. Maybe there's some kind of hint that has to be given to the player API to decode it as HDR?

kaysond commented 2 months ago

Bump. I'm happy to help debug and/or fix this if someone can help point me in the right direction.

cewert commented 2 months ago

Nothing jumps out to me that could be causing this but I also don't use HDR. Note that your device has two versions, Roku Ultra and Roku Ultra LT. The Roku Ultra LT also supports HDR10+.

Here's the docs for HEVC - https://developer.roku.com/en-ca/docs/specs/media/streaming-specifications.md#supported-video-codecs

A good first step when debugging video files, is to see if roku's own media player can play the file correctly. If that can't play the file, then neither can our app.

kaysond commented 2 months ago

@cewert - I have the non-LT. I mentioned this in the "Additional Context", but Roku Media Player can play the video files just fine.

My theory is that for some reason in the Jellyfin app, it's trying to play the video as non-HDR, so it's decoding the colors incorrectly. I believe that the HDMI link has to specify the color range, so maybe there's some command that sets the Roku into an HDR mode?

kaysond commented 2 months ago

Yeah I think I'm on the right track.

Here's my receiver's video info when playing on Jellyfin: 20240416_112600

And when playing on RMP: 20240416_112746

I did a quick search through the Roku dev docs, and the only mention I could find of HDR was the downloadedSegment property of the TrickPlay fields on a video media playback node. It says it only applies to DASH/HLS, but maybe it's taking a cue from there as to how to set up the HDMI link?

cewert commented 2 months ago

There's no HDR flag to toggle that I'm aware of.

Thanks for the testing info. That explains why your colors are off but I'm not sure what the fix is at this time.

kaysond commented 2 months ago

There's no HDR flag to toggle that I'm aware of.

Thanks for the testing info. That explains why your colors are off but I'm not sure what the fix is at this time.

Can you give me a rough idea where in the code the video player is set up? I'll try messing around with it and see if I can get anywhere.