Log in

View Full Version : Encoding HDR movie with SDR compatibility?


Wowfunhappy
12th September 2018, 19:59
I copy all of my BluRays into a personal "digital archive", so I'll be able to easily access them later on from a range of different devices. I start by ripping the discs with MakeMKV, and I then re-encode them with ffmpeg, so they won't be quite so huge.

For the first time, I have a 4K BluRay that supports HDR, and I'm not sure what to do with it. I don't want to loose HDR, but I also want the movie to look more-or-less correct on standard screens.

I'd also like the movie to be playable via more standard software than madVR. Although I truthfully don't have a specific device in mind, I generally live in Apple's ecosystem, so for the purposes of this question, pretend I'm targeting both the iPad Pro (HDR) and the standard iPad (no HDR).

Without creating two separate streams, is this completely impossible right now?

I'm starting to suspect it is, because I haven't found any information on how to do it. I would have expected there to be a metadata field that marks a stream as HDR and provides players with information to guide with tone mapping. It seems to me that some day, Apple or Samsung or someone else is going to release a phone that can record HDR videos, and people will expect their videos to be viewable on all types of displays, without saving out multiple formats.

Am I SOL? To be clear, I know that HDR → SDR tone mapping will never be perfect, I'm just looking for something better than the super washed out colors you get by default when playing HDR content on SDR screens.

Thanks! Again, if this is impossible, that's a fine answer, I just wanted to check!

videoh
12th September 2018, 20:02
Consider transcoding from HDR10 PQ to HDR10 HLG. I have a free tool for that: DGPQtoHLG. It requires an nVidia card.

Gser
12th September 2018, 20:27
The Apple eco system is everything that is wrong with this world.

Wowfunhappy
12th September 2018, 20:40
Consider transcoding from HDR10 PQ to HDR10 HLG. I have a free tool for that.

Thank you, "HDR10 HLG" was the Google keyword I needed! This looks like what I want, and it seems like Apple is on board!

What is the quality loss like when converting PQ → HLG? And how bad will it look on standard 8 bit SDR screens?

videoh
12th September 2018, 22:43
Quality loss would come only from your re-encode. It will look "OK" on a SDR display. You'll have to decide if it is acceptable for you.

FranceBB
13th September 2018, 14:04
Consider transcoding from HDR10 PQ to HDR10 HLG

This.
You won't be able to do this on regular Avisynth, but you can do it in Avisynth+ via HDRTools: https://forum.doom9.org/showthread.php?t=175488

Alternatively, you can use a LUT (in attachment):


#Index
FFMpegSource2("Video.m2ts", atrack=-1)

#Bringing everything to 16bit
ConvertBits(16)

#Convert to RGB 16bit
ConvertToPlanarRGB()

#Converting HDR PQ to HDR HLG
Cube("PQ_to_HLG.cube")

#Convert to yuv 4:2:0
Converttoyuv420(matrix="Rec2020")

#Dithering down to 10bit with Floyd-Steinberg error diffusion
ConvertBits(bits=10, dither=1)


https://i.imgur.com/grCS93W.png

videoh
13th September 2018, 16:00
You won't be able to do this on regular Avisynth, but you can do it in Avisynth+ via HDRTools You can also use DGPQtoHLG if you have an nVidia card. It will run much faster than HDRTools.

Cary Knoop
14th September 2018, 16:31
For archiving I would keep it HDR and use dynamic methods to view it in SDR until you have equipment that can show HDR.

benwaggoner
15th September 2018, 12:41
For archiving I would keep it HDR and use dynamic methods to view it in SDR until you have equipment that can show HDR.
I concur. HLG is okay in practice for some stuff. But in the end it is based on the concept that two different creative intents can be coded with the same set of code values, without metadata. HLG kinda works in practice, but it definitely doesn't work in theory :sly:!

Also, HLG support in displays and devices isn't as common as HDR-10 support.

The HDR on that disc had a separate color grade with different creative intent than the standard Blu-ray SDR grade. An SDR you derive from HDR will typically look quite a bit different than the intended SDR look for that title. So even if HLG works-ish, you still aren't getting the real SDR experience.

foxyshadis
16th September 2018, 08:04
It would be interesting to see some HDR-vs-SDR-vs-HLG comparisons from the same source. Of course, I've seen some HDR movies that appear to have been graded in an entirely different way than the original SDR Bluray... and then there's The Matrix, which gets a completely different regrade every single time it's released since the DVD days, to the point that you might as well just impose your own creative intent on it.

benwaggoner
16th September 2018, 13:24
It would be interesting to see some HDR-vs-SDR-vs-HLG comparisons from the same source. Of course, I've seen some HDR movies that appear to have been graded in an entirely different way than the original SDR Bluray... and then there's The Matrix, which gets a completely different regrade every single time it's released since the DVD days, to the point that you might as well just impose your own creative intent on it.



I’ve seen plenty. HDR-10 looks the best, particularly if there was a lot of creative color work done. HLG is pretty good, especially for stuff like live sports where there isn’t creative color. SDR derived from HDR can look great-for-SDR, but won’t match the creative intent of a creative SDR grade. But it is generally fine for stuff like live sports/news/concerts.

One issue with HLG is that the more tuned it is for HDR, the worse it’ll be on SDR, and vise versa.


Sent from my iPhone using Tapatalk

Blue_MiSfit
18th September 2018, 08:25
I have to throw in a word of support for the overall Dolby Vision ecosystem. HDR10 is great, has the widest support for sure, and when "good" creative decisions are made it can really wow.

However, I'd argue that DoVi is technically a superior solution - you just have to be okay with everything that comes with it ;)

foxyshadis
18th September 2018, 11:02
HDR10 has some definite severe limitations -- but HDR10+ is essentially technically identical to DV when it comes to gamut and limitations, for all practical purposes. The last thing DV has over the free competition is 12-bit, but I've never seen a real-world 12-bit DV release (since there's no such thing as 12-bit UHD BD and no streaming company uses it) so it's basically theoretical at this point. DV did get to dynamic lighting first, so I'm sure it'll hang on with studios eager to maximize their investment for many years, but there's going to have to be a DV+ if it's going to have a future.

If 12-bit ever makes inroads into the real world, I'm certain there will be an HDR12 to back it up by then.

sneaker_ger
18th September 2018, 11:19
I've never seen a real-world 12-bit DV release (since there's no such thing as 12-bit UHD BD
Isn't 12 bit used on UltraHD Blu-Ray? 10 bit HEVC plus 2 bits from the extra Dolby Vision layer.

kolak
18th September 2018, 15:35
Is there much in decoding power needs between 10 and 12bit HEVC?

sneaker_ger
18th September 2018, 15:37
When UltraHD Blu-Ray was finalized only the 8 and 10 bit profiles of HEVC were standardized or at least the hardware wasn't available yet. I don't remember 100%.

SeeMoreDigital
18th September 2018, 21:54
Until manufacturers start producing projectors and panels that are actually capable of displaying native 12-bit content for the home market, I personally don't see the point of Dolby Vision's version of 'dynamic' 12-bit HDR.

Currently, Dolby Vision for the home seems overly complicated. Which is probably why there's been so many issues with it (ie: black mattes looking grey, colours flashing/being displayed the wrong colour, blown white levels...).

Given that today's projector, panel and video encoding world revolves around 10-bits, HDR10+ makes much more sense to me.

Cary Knoop
18th September 2018, 22:05
Until manufacturers start producing projectors and panels that are actually capable of displaying native 12-bit content for the home market, I personally don't see the point of Dolby Vision's version of 'dynamic' 12-bit HDR.

Currently, Dolby Vision for the home seems overly complicated. Which is probably why there's been so many issues with it (ie: black mattes looking grey, colours flashing/being displayed the wrong colour, blown white levels...).

Given that today's projector, panel and video encoding world revolves around 10-bits, HDR10+ makes much more sense to me.
I think that would be the same logic as using black and white at the dawn of color TV, 'almost no-one has it so what is the point?'.

Now in 2018 folks are still enjoying color from 60's productions.

SeeMoreDigital
18th September 2018, 22:19
Not the same logic at all...

Cary Knoop
18th September 2018, 22:59
Not the same logic at all...
Then what are you saying, should you master a movie using Doly Vision so that a decade from now people can enjoy the 12-bit quality or would you master using HDR10 because, well, almost no-one has the capability right now to see it?

Blue_MiSfit
19th September 2018, 03:12
AFAIK Dolby Vision reconstructs 12 bit ICtCp based on the 10 bit ICtCp layer encoded as HEVC (Usually interpreted as YCbCr as far as the HEVC encoder is aware) plus the dynamic metadata. I think this is all typically sourced from 12-16 bit J2K.

I could be wrong about this though.

Compare that to HDR10 which is typically sourced from ProRes or 10 bit J2K.

kolak
19th September 2018, 13:13
Yes, they are and quite often it all starts from 16bit TIFF.

Atlantis
29th August 2023, 22:44
I was looking for this too. But at the end, I guess I have to have 2 video tracks, right? For the best quality solution, one track for HDR and one track for SDR?

Blue_MiSfit
30th August 2023, 05:11
Yes.

This is what premium streaming services do.

benwaggoner
30th August 2023, 16:44
Yes.

This is what premium streaming services do.
And a big part of this is because the SDR and HDR masters are different source files with different creative decisions. Any "common master" format is going to require a lot of dynamic metadata at a minimum. And of course SDR-only devices won't know about any of that metadata.

The original SDR + metadata + enhancement layer model of Dolby Vision makes a ton of sense if the goal is to deliver SDR and HDR in the same stream without 2x the bitrate. It's still a good approach for Blu-ray, where capacity is a bigger limitation than bitrate.

For streaming, the DoVi single-layer HDR offers better compression efficiency and better performance (for example 30p instead of 24p).

Apple's oddball HLG + DoVi dynamic metadata approach is an interesting one, although HLG to SDR is still a weaker creative tool than native SDR.