What is HDR?
HDR (High Dynamic Range) is how bright or dark an image can be. Often referred to as peak luminance. This allows an image to have much brighter light and darker blacks. So if you had an image with direct sunlight above a cave opening, you would be able to view how bright the sun is without brightening the whole image and making the cave opening more grey, as opposed to the rich black that you see in its recesses. The idea being that you get a visual range closer to what your eyes would see in the real world.
Now with such range of light, how shades of color are perceived will vary. You can see this in the real world. Try staring at a color and change the ambient light around you. You’ll see a change in the shade of color. This is natural. But with movies, the colors are deliberately configured to create a certain kind of image. This is called mastering. The same rules will apply. When they master the image, they will apply a luminance to that color to have a specific shade. These shades of color should never be changed or the image will not look correct. When these movies/images are mastered, it is done so on a reference display. These displays will have a very high peak luminance, usually 4000 -10000 nits. And the colors are mapped to that brightness. Here’s a short video that talks about it.
The display/TV you buy is very likely not a reference display, and will have a much lower peak luminance. Often somewhere around 800 nits. So following the above rules, when you lower the brightness that much, the shades of color are going to change. We don’t want that. So when the video is mastered and rendered, they include metadata embedded into the file, that will provide information for your display to remap the colors to where they should correctly be. This is called tone mapping. Every HDR display does this.
Playing HDR videos
Conventionally, when playing the video, the metadata is sent with it and the display will read and use it. This is referred to as ‘pass-through’. As we are talking about playing the videos on a computer, this process is more complicated. Not all operating systems support it. In the case of Windows 10, there is specific criteria that has to be met for Windows to send the metadata to your display. It has to be full screen, have exclusivity of the window etc. Windows has an internal mechanism that will enable HDR, when the criteria is met. This is what people refer to as ‘triggering’. Recent changes in Windows now allow you enable HDR manually, and to have your desktop always be in HDR10. Nvidia has taken advantage of that by turning it on an off, dynamically. This allows you to have HDR passthrough in a window. And when playback ends, it will turn it off again. This is what madVR, does.
mpv and HDR
mpv is the internal player used in Emby Theater. It is a multi-platform media player. As I mentioned, not all operating systems support HDR. So they developed their own tone mapping algorithms, to allow them all to be able to watch HDR media. We talked about your display having to tone map the colors. Instead of your display performing the tone mapping, mpv will do it through software and render the image at the desktop level. This means there will be no ‘triggering’ of HDR on your display. As mpv is computer software, it is assumed that most computer displays are not running in HDR, but instead in SDR. So the default settings are intended for SDR (bt.709 colorspace), and tone mapped to that.
Here are some links to what the mpv developers are saying about HDR tone mapping and a pull request for further development of HDR passthrough.
This is basically how many shades of color are supported in that environment. Also referred to as color gamut. The wider the gamut, the more shades of color. The two most common are bt.709 (SDR) and bt.2020 (HDR wide color gamut). We learned that mpv by default maps to bt.709, so to allow the use of a wide color gamut, that needs to be manually configured. This is easily done and only needs to be done, once (see HDR tone mapping with mpv).
Windows in HDR10
When using mpv to play HDR media, it is recommended to manually turn on HDR in windows and run Windows in that mode. With that enabled, you can then configure mpv to tone map to that colorspace and luminance.
Here’s where things are a little different to HDR passthrough. With passthrough, your display does all the rendering of the color. With mpv, it’s rendered at the desktop layer. Caution, if you calibrated your display for HDR passthrough, it likely won’t look right with mpv. If you have your display calibrated HDR passthrough, you may notice that your desktop is little brighter or not as vivid and clear. As we are using the desktop to render to, it must look like a conventional desktop. In my case, I manually configured the settings to make the colors strong (but not over-saturated), the backlight and contrast to be comfortable to look at in my viewing environment. There is no magic, just make your desktop look clear and vibrant. And if you have the option, select gamma 2.2. mpv will automatically use that transfer characteristic. If you don’t have that option, don’t worry about it.
I’m attaching a zip file with some files and a configuration that will give you a good start. I’m including the auto-profiles script that allows me to configure a profile specifically for HDR media. I’m using separate color profiles for SDR and HDR, with added config for HDR tone mapping. Using these color profiles, you don't need to set a colorspace.
- Download and unzip to C:\Users\YOU\AppData\Roaming
- In that mpv folder, you will see a folder called color profiles.
- Open that folder, right click on and install each file.
- Play a movie
I hope this helps.
Edited by Doofus, 18 August 2019 - 08:40 PM.