Req Dolby Vision Tone Mapping for playing HDR files on SD screens
#1
Dolby Vision files are now supported with tone mapping (so they can be watched on non-HDR displays) in Jellyfin as per https://www.reddit.com/r/jellyfin/commen..._is_coming using GPU acceleration & ffmpeg 5.x.

Jellyfin does it server-side... but that's effectively the same as doing the conversion in Kodi when Kodi is playing the video.
It would be nice to get that support in Kodi. (Especially since Kodi is a popular front-end for Jellyfin.)

Jellyfin uses their own ffmpeg fork (basically mainline plus their patches). It looks like there are many dolby vision tone map support fixes recently: https://github.com/jellyfin/jellyfin-ffm...s/jellyfin

It has also been suggested that using libplacebo might be one way to accomplish this.

via https://github.com/haasn/libplacebo: "libplacebo currently supports Vulkan (including MoltenVK), OpenGL, and Direct3D 11. It contains backwards compatibility code for very old versions of GLSL down to GLES 2.0 and OpenGL 1.3 and very old Direct3D feature levels down to 9_1."
Reply
#2
MPV does DV too (including profile 5). You just have to activate vo=gpu-next, there are plenty of tone mapping options though to match it to your screen. Would be neat if Kodi did support it, especially for decoding DV to HDR10 (Samsung owners rejoice...).
Reply
#3
(2023-10-26, 23:33)kadajawi Wrote: MPV does DV too (including profile 5). You just have to activate vo=gpu-next, there are plenty of tone mapping options though to match it to your screen. Would be neat if Kodi did support it, especially for decoding DV to HDR10 (Samsung owners rejoice...).

somebody hasn't been paying attention in class ...

DV is only available on Android and CoreELEC
- android is covered https://forum.kodi.tv/showthread.php?tid=371557
- CoreELEC is covered https://discourse.coreelec.org/t/coreele...sion/20982

but team kodi will not put code into Kodi that is not cross platform and all the other platforms do not support it (XBOX, MacOS, Windows, Linux), the only other potential is LG WebOS

so instead of waiting for something that will (likely) never come, buy an HD Fury that will do this for ALL SOURCES - https://www.hdfury.com/product/8k-arcana-vrr-40gbps

and Samsung owner's have already rejoiced instead of waiting
Reply
#4
Ok I'm not enough of a tech nerd to actually understand how the Arcana would beneficial in this situation... It seems the device does a lot. But are you suggesting it would also for example tone map a typical purple green DV source played in Windows (by kodi obviously) and output it to tonemapped SDR or HDR. If so I would say this is indeed a very interesting product...
Reply
#5
(2023-10-27, 18:38)banggun Wrote: Ok I'm not enough of a tech nerd to actually understand how the Arcana would beneficial in this situation... It seems the device does a lot. But are you suggesting it would also for example tone map a typical purple green DV source played in Windows (by kodi obviously) and output it to tonemapped SDR or HDR. If so I would say this is indeed a very interesting product...

*adds DV support to a non-DV display (samsung)

as far as what it will do for a non-DV player i am not sure, i don't use such devices

better to ask other owners https://www.avsforum.com/threads/hdfury-...ad.3268765
Reply
#6
Ah that would be a different use case. I do actually have a LG C1 that supports DV as well as a Shield that can also playback DV. But I feel kodi doesn't run very stable on the shield, it often goes back to android main screen crashing for some unknown reason. I much prefer running it on Windows. Either way I didn't realize MPV now also can tone map DV files. Just tested that and it works fine. So I guess using it as alternative player in Kodi is a good enough alternative for now....
Reply
#7
(2023-10-27, 19:49)banggun Wrote: Ah that would be a different use case. I do actually have a LG C1 that supports DV as well as a Shield that can also playback DV. But I feel kodi doesn't run very stable on the shield, it often goes back to android main screen crashing for some unknown reason. I much prefer running it on Windows. Either way I didn't realize MPV now also can tone map DV files. Just tested that and it works fine. So I guess using it as alternative player in Kodi is a good enough alternative for now....

that would be the 'standard' experience for kodi on android users, despite many attempts and custom compiling it doesn't improve so i have opted out of kodi on android in favor of jellyfin on androidtv
(my media all comes from jellyfin anyway, was using jellyfin for kodi)

it will remain that way until kodi entices an android developer to join their team

mpv tonemapping > on windows i assume?
Reply
#8
(2023-10-27, 17:58)izprtxqkft Wrote:
(2023-10-26, 23:33)kadajawi Wrote: MPV does DV too (including profile 5). You just have to activate vo=gpu-next, there are plenty of tone mapping options though to match it to your screen. Would be neat if Kodi did support it, especially for decoding DV to HDR10 (Samsung owners rejoice...).

somebody hasn't been paying attention in class ...

DV is only available on Android and CoreELEC
- android is covered https://forum.kodi.tv/showthread.php?tid=371557
- CoreELEC is covered https://discourse.coreelec.org/t/coreele...sion/20982

but team kodi will not put code into Kodi that is not cross platform and all the other platforms do not support it (XBOX, MacOS, Windows, Linux), the only other potential is LG WebOS

so instead of waiting for something that will (likely) never come, buy an HD Fury that will do this for ALL SOURCES - https://www.hdfury.com/product/8k-arcana-vrr-40gbps

and Samsung owner's have already rejoiced instead of waiting
From what I can tell (and as the developer quietvoid said) that Kodi build linked does not do the job. It is able to extract the HDR10 compatibility layer (profile 7 and 8), however if there is none (profile 5), bad luck on TVs without DV.

On the other hand, MPV (on Windows at least) is able to playback profile 5 files and tonemaps them to something decent enough. Having whatever magic MPV is doing as part of Kodi (especially on Android) would be fantastic.

If your TV does DV, you don't need the Arcana. What it does (from what I can tell... I was just about to buy it, when I found out about MPV):
It tells the player (Fire TV 4K, NVIDIA Shield TV 2019, ...) to do LLDV. LLDV is basically a fakeout by TV manufacturers / Dolby for TVs that did not have the hardware to actually do DV tonemapping. In that case, the player had to do the tonemapping and would just send the TV a HDR signal... without telling it so. Obviously, Dolby didn't want any TV to support DV without paying license fees, even though this meant that any HDR-TV was capable of DV. So two things have to happen: The TV needs to tell the player it does officially support DV and request LLDV. then the TV needs to understand that the signal coming in return is HDR.

What the HDFury devices do is to pretend to the player that the TV is saying it needs an LLDV signal by setting the EDID. This is something that also more affordable splitters by some brands like EZCOO are capable of. You are AFAIK also able to code the EDID to tell the player the maximum brightness of the TV with some of these devices (though it ain't easy). The problem is that the TV will believe it is getting SDR... and displays the image as such. You need to be able to set the TV to interpret the "SDR" signal as HDR. Sadly, the number of TVs that can do this is extremely limited. I believe there's one series of Samsung TVs that can be set that way by going to the developer menu. Short distance projectors also don't do this. Some regular projectors do however.

In case you can't change the TV settings, the HDFury Arcana (and higher) come into play: The Arcana can append the information that it's a HDR signal, so that the TV switches into the correct mode. Also it should be a tad easier to use.
Reply
#9
(2023-10-27, 20:58)kadajawi Wrote: You need to be able to set the TV to interpret the "SDR" signal as HDR.

you seemed to have it all mapped out, everything looks right in what you said but my TV (2018 Samsung QN82Q6FNA HDR10+) works perfect with the Arcana2 and everything gets tone mapped beautifully but there is no SDR
the display mode switches itself, without intervention, to HDR+

the Arcana2 has a little display on it, what it is reporting is the following

Input 4:2:2 BT.2020 12b LLDV
Output 4:2:2 BT.2020 12b HDR

where HDR10+ is 10 bit, it is doing an amazing job when receiving 12 bit
12 bit is the color space for DV so what you are likely lacking is the dynamic contrast if anything

* to the best of my understanding
Reply
#10
(2023-10-27, 19:59)izprtxqkft Wrote:
(2023-10-27, 19:49)banggun Wrote: Ah that would be a different use case. I do actually have a LG C1 that supports DV as well as a Shield that can also playback DV. But I feel kodi doesn't run very stable on the shield, it often goes back to android main screen crashing for some unknown reason. I much prefer running it on Windows. Either way I didn't realize MPV now also can tone map DV files. Just tested that and it works fine. So I guess using it as alternative player in Kodi is a good enough alternative for now....

that would be the 'standard' experience for kodi on android users, despite many attempts and custom compiling it doesn't improve so i have opted out of kodi on android in favor of jellyfin on androidtv
(my media all comes from jellyfin anyway, was using jellyfin for kodi)

it will remain that way until kodi entices an android developer to join their team

mpv tonemapping > on windows i assume?

Correct that's on Windows. I've just tried a few different files to test the differences between the results from MPV and native playback from the TV (mostly mp4 or TS files that LG C1 supports) and the results are mostly very good but there are some cases especially some demo LG Dolby Vision videos where tone mapping gets way off and the image gets too bright and oversaturated. From my understanding you can set more parameters in the MPV config settings and it does indeed improve results a bit but not nearly good enough to even be called somewhat indistinguishable from the native playback. Then again I only found the results to be this extreme on one video, most seem ok.. Either way it's still better then what kodi outputs without any tone mapping. Not really sure why MPV (which afaik is also cross platform) can do this but Kodi can't?
Reply
#11
(2023-10-27, 21:19)izprtxqkft Wrote: you seemed to have it all mapped out, everything looks right in what you said but my TV (2018 Samsung QN82Q6FNA HDR10+) works perfect with the Arcana2 and everything gets tone mapped beautifully but there is no SDR
the display mode switches itself, without intervention, to HDR+

the Arcana2 has a little display on it, what it is reporting is the following

Input 4:2:2 BT.2020 12b LLDV
Output 4:2:2 BT.2020 12b HDR

where HDR10+ is 10 bit, it is doing an amazing job when receiving 12 bit
12 bit is the color space for DV so what you are likely lacking is the dynamic contrast if anything

* to the best of my understanding
The data in the stream is HDR, but with LLDV the player does not tell the TV that it is. So it is interpreted as SDR. If you can tell your TV to understand the data as HDR, it will look right. And this is what the Arcana is doing. It triggers the source device to do the DV tonemapping and informs your TV that it is receiving a HDR stream. Other device are able to do the first part, but not the second.

@banggun: I have tried it on Android, and vo=gpu-next leads to a crash there. I suppose the thing that enables DV tonemapping is working on Windows only, perhaps also on Linux and Mac. But I'd like this magic to be adopted by Kodi and others, hence my posting in this thread.

I suppose for the time being either I have to use a Windows based Kodi box (with the issues related to power consumption and controlling the device), or use a HDFury Arcana with the Shield. The Windows based box of course has much more horse power, so that's an advantage. Hm.
Reply
#12
(2023-10-27, 22:29)banggun Wrote: Correct that's on Windows. I've just tried a few different files to test the differences between the results from MPV and native playback from the TV (mostly mp4 or TS files that LG C1 supports) and the results are mostly very good but there are some cases especially some demo LG Dolby Vision videos where tone mapping gets way off and the image gets too bright and oversaturated.

Last time I looked, MPV was making a good job of mapping DV profile 5 to SDR but not reacting to the DV dynamic metadata. See this clip. That may account for what you see with your test clips.
Reply
#13
(2023-10-28, 11:59)graham-h Wrote:
(2023-10-27, 22:29)banggun Wrote: Correct that's on Windows. I've just tried a few different files to test the differences between the results from MPV and native playback from the TV (mostly mp4 or TS files that LG C1 supports) and the results are mostly very good but there are some cases especially some demo LG Dolby Vision videos where tone mapping gets way off and the image gets too bright and oversaturated.

Last time I looked, MPV was making a good job of mapping DV profile 5 to SDR but not reacting to the DV dynamic metadata. See this clip. That may account for what you see with your test clips.
 
Yes that clip indeed gives very different results whereas natively played back through the TV you can see all the different settings. On MPV all settings look exactly the same but I have to admit I would say still a very watchable. Though of course that might be the default choice for this video I wouldn't feel too awful watching this video on MPV. The video that I was  talking about in particular is this one and feels way oversaturated or too bright and or dark in different scenes:

https://4kmedia.org/lg-amaze-dolby-vision-uhd-4k-demo/

Admittedly the video even on when played back properly through my TV with DV enabled looks a bit awkward to my tastes but it looks much better then what MPV outputs I even tried Windows Media Player with the dolby vision extension but even that fails to properly render this video in something that I would call watchable in any way. Of course I don't have a DV licensed hardware so I can't watch properly DV properly in Windows any way. Most other videos I've seen including the one you posted at least give what I would call watchable results even if it's far off from it's intended purpose.
Reply
#14
(2023-10-28, 14:30)banggun Wrote:  
Yes that clip indeed gives very different results whereas natively played back through the TV you can see all the different settings. On MPV all settings look exactly the same but I have to admit I would say still a very watchable. Though of course that might be the default choice for this video I wouldn't feel too awful watching this video on MPV. The video that I was  talking about in particular is this one and feels way oversaturated or too bright and or dark in different scenes:

https://4kmedia.org/lg-amaze-dolby-vision-uhd-4k-demo/

Admittedly the video even on when played back properly through my TV with DV enabled looks a bit awkward to my tastes but it looks much better then what MPV outputs I even tried Windows Media Player with the dolby vision extension but even that fails to properly render this video in something that I would call watchable in any way. Of course I don't have a DV licensed hardware so I can't watch properly DV properly in Windows any way. Most other videos I've seen including the one you posted at least give what I would call watchable results even if it's far off from it's intended purpose.

Yes, that one is a bit funny but I think it plays on my DV-enabled Windows PC to an SDR monitor in the colours intended. It's probably the one I've had most difficulty with in my attempts to convert it to HDR10 on a Vero 4k.
Reply
#15
(2023-10-28, 01:15)kadajawi Wrote: @banggun: I have tried it on Android, and vo=gpu-next leads to a crash there. I suppose the thing that enables DV tonemapping is working on Windows only, perhaps also on Linux and Mac. But I'd like this magic to be adopted by Kodi and others, hence my posting in this thread.

I suppose for the time being either I have to use a Windows based Kodi box (with the issues related to power consumption and controlling the device), or use a HDFury Arcana with the Shield. The Windows based box of course has much more horse power, so that's an advantage. Hm.

I don't fully get the whole stance on the whole cross platform code. I mean I get that gpu-next option might not perform well on all platforms, I think it relies on Vulkan so yes it also doesn't work on my Mac natively, but perhaps Linux? Then again you could probably make it work on Mac. I don't watch videos often on my Mac but perhaps someone has tried installing Vulkan? 

https://github.com/KhronosGroup/MoltenVK

In regards to Android DV is now supported on Android and also WebOS but also doesn't work on other platforms. It seems a similar situation? Then again I do remember that they once had the DSplayer fork of Kodi to mostly help with HDR support orignally. Still often used for MadVR these days. And there's still a special DV build for Kodi on Android as well. Perhaps someone else might implement such features I have too little knowledge on how much effort it would take...
Reply

Logout Mark Read Team Forum Stats Members Help
Dolby Vision Tone Mapping for playing HDR files on SD screens0