nova-video-player / aos-AVP

NOVA opeN sOurce Video plAyer: main repository to build them all
Apache License 2.0
3.13k stars 188 forks source link

[Bug]: HDR10+ is cancer #832

Open KyleSanderson opened 1 year ago

KyleSanderson commented 1 year ago

Problem description

Playback HDR10+ results in a dead screen.

Steps to reproduce the issue

HDR10+ dual encode with Dolby Vision.

Expected behavior

Screen shows picture. These patches work well in contrast https://github.com/quietvoid/xbmc/releases/tag/v21-dovi

Your phone/tablet/androidTV model

Firestick 4K Max

Operating system version

Yes

Application version and app store

GitHub

Additional system information

No response

Debug logs

No response

phhusson commented 1 year ago

Got a sample?

courville commented 1 year ago

To complement the request: can you please share a sample KO with nova and OK with kodi-dovi on same device (with spec of device and tv setup used)?

KyleSanderson commented 1 year ago

It's specific to the Firestick unfortunately

courville commented 1 year ago

@KyleSanderson, thx and what are the capabilities of your TV, is the firestick plugged directly to the TV or via an AV receiver? A sample will help too.

KyleSanderson commented 1 year ago

My panel supports both - it's a Firestick hardware bug. https://forum.kodi.tv/showthread.php?tid=371557&pid=3146377#pid3146377

phhusson commented 1 year ago

I'm expecting they are far from being the only ones with that bug. Can you share a sample?

KyleSanderson commented 1 year ago

I'm expecting they are far from being the only ones with that bug. Can you share a sample?

Flipped you a note for a file I found that reproduces it to the email on your GH profile.

phhusson commented 1 year ago

Got it, thanks.

daf0x commented 9 months ago

My panel supports both - it's a Firestick hardware bug. forum.kodi.tv/showthread.php?tid=371557&pid=3146377#pid3146377

I'm not reading anything in that thread about it being a hardware bug, could you please clarify where it says it's a hardware bug?

What I am reading in that thread appears to be a number of fixes and workarounds, like the ability to select either DV or HDR10 (by selectively disabling one or the other), as well as some on-the-fly DV profile conversion. Is there any chance of implementing the same fixes in Nova?

FWIW I found that Nova has a setting "Disable Dolby Vision", but it doesn't seem to do anything. (Some?) files with both DV and HDR10 still play with a black screen (with the TV briefly showing the Dolby Vision logo), and DV-only files still play as normal (i.e. no weird colours due to disabled DV). This is on org.courville.nova-2574680-6.2.25-20230908.0819-universal-release.apk / FireTV 4k Max.

courville commented 9 months ago

Nova relies on ffmpeg for this dovi fixes using patches from quietvoid (the one commenting kodi forum thread): https://github.com/quietvoid/FFmpeg/commits/4.4-MatroskaBlockAdd When looking at https://github.com/quietvoid/FFmpeg/branches, it seems that there are other branches active perhaps addressing the thread comments. What would be good it to find the ones needed and included in kodi, i.e. to be analyzed...

EDIT: https://github.com/quietvoid/FFmpeg/commits/dovi_dm_data contains latest additions and https://github.com/quietvoid/FFmpeg/commits/dovi_dmv1 is still WIP

EDIT2: https://github.com/xbmc/xbmc/commit/e6d107d9ae00259e4659ba583a6db99c0959f4c2

EDIT3: seems that this is the one for firestick https://github.com/xbmc/xbmc/pull/23079 on kodi side

courville commented 9 months ago

I found an issue with the disable Dolby Vision switch that is fixed in 6.2.26 https://github.com/nova-video-player/aos-AVP/releases Can you please retest with this release?

daf0x commented 9 months ago

Thanks for the update! With 6.2.26 the behaviour is still the same, whether the setting is on or off the screen remains black except for the TVs Dolby Vision logo at the start. I also tested these files on MX player and on the TV built-in player and they both do play, albeit in 'plain' HDR (no Dolby Vision).

An additional thing to note is that while the screen is black during playback, also Nova's UI is not visible. So this setting (if it would work) would need to be toggled from the main settings, which is not convenient.

--- update

I tried removing the HDR10+ meta data from one of these files using DDVT Tool, and after removal the file now plays fine in Nova, as well as other players:

So it looks like the in the above-mentioned thread option of stripping the HDR10 meta data would be the ideal solution. I.e. perhaps even the profile conversion is not needed for most files, and just on-the-fly converting hybrid files to dolby-vision-only already fixes 90% of files?

KyleSanderson commented 9 months ago

I found an issue with the disable Dolby Vision switch that is fixed in 6.2.26 https://github.com/nova-video-player/aos-AVP/releases Can you please retest with this release?

The metadata can't be present in the bitstream, otherwise the hardware bug kicks on. This is the patch you're looking for https://github.com/quietvoid/xbmc/commit/20a46b27cbb784d706bb176f5a6017cf747fae5d

phhusson commented 9 months ago

I'm repeating what you all said, just to be sure I understood it all:

On Firestick 4K Max, if we send DoVi + HDR10+ to the video decoder (no matter whether it is the dolby vision decoder or the normal decoder), on a HDR10+ television, the video decoder will try to send Dolby Vision which will simply fail because the video pipeline can't transform Dolby Vision to HDR10+.

Is my understanding correct so far?

And so the suggested fix by @KyleSanderson is to filter out Dolby Vision NALs, so that the decoder receives HDR10+ and sends HDR10+ to the TV. Is that correct?

Thanks

daf0x commented 9 months ago

It's great to see this issue gaining some traction :)

My understanding so far is that if you send both DV and HDR10 then it fails, and the workaround is to make sure to send either DV or HDR10.

But I am no expert at this, I just would like to make sure the solution is not moving towards supporting only HDR10, as the problem does not appear to be that the TV (or firestick?) doesn't understand DV, only the combination causes issues. See also my test above where manually selecting only DV fixed playback.

@KyleSanderson could you please help us understand the solution?

phhusson commented 9 months ago

I'm pretty sure Dolby Vision "EL" variants (which contain both HDR10 and Dolby Vision) require the HDR10 part to be sent to decoder. Maybe you're confusing HDR10 with HDR10+? (which are largely unrelated)

KyleSanderson commented 9 months ago

I'm pretty sure Dolby Vision "EL" variants (which contain both HDR10 and Dolby Vision) require the HDR10 part to be sent to decoder. Maybe you're confusing HDR10 with HDR10+? (which are largely unrelated)

The panel does not matter. It's a straight hardware decoder bug, confirmed by Dolby, and long ignored by Amazon. They do have a new set of Firesticks coming out in the next couple hours on a new FireOS so they may just be hoping this goes away.

See https://github.com/jellyfin/jellyfin-androidtv/issues/2630#issuecomment-1685802341 for more information (and check the comments from quietvoid).

phhusson commented 9 months ago

So what you're saying is that this Amazon device doesn't support Dolby Vision EL (like what's included BluRay releases) at all? There is simply no way to support Dolby Vision EL on those devices?

daf0x commented 9 months ago

So what you're saying is that this Amazon device doesn't support Dolby Vision EL (like what's included BluRay releases) at all? There is simply no way to support Dolby Vision EL on those devices?

Sorry, I don't believe that is what @KyleSanderson is saying, as that is not my experience at all. I have a Fire TV Stick 4K Max (same as OP/@KyleSanderson) and I've been using Nova on it to play DV-only content for well over half a year now without issue. Additionally my above test I think should confirm that removing only HDR10+ meta-data prevents the black-screen issue and allows the file to play perfectly fine in Dolby Vision mode.

Further, I don't think that your conclusion is in line with what quietvoid says in the linked jellyfin thread:

The only workaround has been to strip the Dolby Vision or HDR10+ from bitstream before passing the bytes to the decoder. https://github.com/jellyfin/jellyfin-androidtv/issues/2630#issuecomment-1641845333

I.e. both and Dolby Vision and HDR10+ work just fine on Fire TV Stick 4K Max, it's just that there can be only one of the two present in per file.

phhusson commented 9 months ago

I.e. both and Dolby Vision and HDR10+ work just fine on Fire TV Stick 4K Max, it's just that there can be only one of the two present in per file.

Ok thanks, that's finally some clear explanation. Does this device support HDR10+ to Dolby Vision and/or Dolby Vision to HDR10+ conversion? HDR10+ and DoVi to HDR10? ( = do we rely on display capabilities to filter-out, or do we need to be more clever)