Sign In

Guide for Working with 4K HDR Blu-ray Rips in SDR

Author
Time
 (Edited)

Guide for Working with 4K HDR Blu-ray Rips in SDR

HDR footage is nothing new. We’ve been using it for well over a decade in SDR workflows, despite HDR delivery being relatively new. Think of Arri Log C, RED RWG/Log3G10, Sony S-log, or Panasonic V-log. These are all HDR color spaces that we’ve been grading inside of SDR environments for a very long time. So treating the HDR footage from a UHD disc is a very similar process. Here’s how to get your UHD Blu-ray discs to a point where you can properly add custom grades to them.

•Create a remux from your UHD disc, using MakeMKV. This will copy the entire HDR film into an MKV wrapper without transcoding. (There are lots of guides for this online already, so I won’t go through that here).

In my example, I’m using a 4K HDR remux of X-Men: Apocalypse (Sorry, I haven’t bought my Star Wars OT in 4K yet).

•Use Hybrid (FFmpeg GUI) to rewrap the MKV file to MP4 (Not transcode. We want to preserve the original HEVC file). The reason we need our 4K HDR HEVC file to exist within an MP4 wrapper is so DaVinci Resolve can import it. To do this, set your Video setting in Hybrid to “passthrough” and ensure the container is set to “mp4.” Audio can be set to “ignore,” since we don’t need audio for this. Once you’re done, set your output folder and file name, and add it to the queue.

•In Hybrid, go to the “Jobs” tab, and hit the “Start” button to start processing your queue.

Once it’s done, you will have your original HEVC file, now as an MP4.

•Import the MP4 HEVC file into DaVinci Resolve Studio’s media pool, on the Media page. (Note: the free version of Resolve does not support importing HDR HEVC files, so this must be done in Resolve Studio)

•Ensure that the Resolve color management settings are set to the default: DaVinci YRGB, with timeline color space set to Rec. 709 Gamma 2.4.

•Make sure your project resolution and framerate are set to 4K UHD (3840x2160), 23.976fps.

•On the Edit page, pull the new MP4 file into a new timeline. It will look flat and ugly, with a slight green shift. This is what we want. We don’t want a tonemapped version. We want this log, flat, ugly version. This means it’s the HDR source. (Also, please note that the file will be a bit sluggish in Resolve because HEVC is a high-compression delivery codec and not really intended for editing/grading).

•On the delivery page, prepare a ProRes 422 HQ export of the film, in full resolution 3840x2160. Once you’ve prepared it, set an output location and add it to the render queue. Then on the render queue, hit “Start Render.”

This will give you the full 10-bit, wide gamut footage, without any of the HDR metadata. And since it’s ProRes (an intermediate codec intended for editing and grading), it will run much faster and be much less taxing on your CPU/GPU than the original HEVC version. The file size will be relatively large — approximately 220 GB / hour. You may think this is excessive, but that’s the price you have to pay to use proper intermediate codecs! (Using proper codecs will save you much time and frustration).

Note: If you’re on a Windows PC then you unfortunately won’t have the ProRes encoding options. You may use DNxHR HQX instead. It’s a fine alternative to ProRes HQ, although it is a bit more sluggish. Or you may also use any of your preferred image sequence formats: EXR, DPX, TIFF, etc. (although, in my opinion, those produce unnecessarily large file sizes, especially for footage sourced from HEVC).

Once your export is complete, you now have your film ready to be graded and used in your fan restoration! This new ProRes clip is what you will now import into Resolve (or any other software) and use from now on.

The next step is knowing how to use this HDR footage and make it look pretty. Here’s one simple way to get a starting point in your color grade, using a Color Space Transform (CST) node in Resolve:

•Open your OpenFX palette and drag the “Color Space Transform” effect onto a new node.

•Set the Input Color Space to Rec.2020 and the Input Gamma to ST2084.
•Set the Output Color Space to Rec.709 and the Output Gamma to Gamma 2.4.
•Change Tone Mapping Method to Luminance Mapping, and Gamut Mapping to Saturation Mapping.

Now we have properly converted the color space from Rec.2020 to Rec.709, with tone mapping. This won’t look perfect, because every film is graded differently. It’s simply a color space conversion. But you’re now in the correct color space for SDR, and it should provide you with a really great starting point. You may add a node before or after the CST node, and tweak it to taste, using Lift/Gamma/Gain, YRGB Curves, and Contrast/Pivot/Hue/Saturation.

In my case, I added a node before the CST, and brought down the gamma/midtones as well as brought the temperature slightly cooler, and now it feels a bit more balanced.

If Resolve isn’t your preferred grading application, you may export your custom CST/grade as a Lookup Table (LUT) and bring it into any other software to use as a starting point for your grading. Here’s how:

•Right-click on a clip that has your CST/grade applied to it.
•Click “Generate 3D LUT (33 Point Cube).”
•Choose a directory where you want to export the LUT.

You can now use the .cube LUT file in any supported application.

You don’t need to grade the HDR footage with a CST like this; it’s just one way to get a quick starting point. You can do 100% custom grading on your HDR footage instead, if preferred. But I think this is a quick and effective way to get in the right ballpark.

I went ahead and created a LUT out of this, in case anyone wants it for their non-Resolve software applications. Just note that, in terms of grading hierarchy, you’ll want to make any large color adjustments in a layer/node before the LUT. There are two flavors of the LUT – one with just the default CST, and one with the CST + a few custom adjustments. Feel free to download them here.

And that’s it. Hope this helps.

-44

Author
Time

I do it a bit different.
After ripping and remuxing to a mkv, I use ffmpeg to convert the x265 .mkv to ProRes4444.
In Resolve I’ll then typically use a tonemapping LUT I created with DisplayCAL or another tonemapping LUT.
And finally still in Resolve I’ll do my final grade/edit.

Author
Time
 (Edited)

oohteedee said:

I do it a bit different.
After ripping and remuxing to a mkv, I use ffmpeg to convert the x265 .mkv to ProRes4444.
In Resolve I’ll then typically use a tonemapping LUT I created with DisplayCAL or another tonemapping LUT.
And finally still in Resolve I’ll do my final grade/edit.

Nice! That sounds like it would work really well too. Similar ideas. I like the idea of skipping a step and just going straight to ProRes in FFmpeg; however, I haven’t done that myself because FFmpeg’s ProRes implementation is unlicensed, and I’ve actually noticed a slight color shift with it. Maybe the issues have been fixed since I played around with it a couple of years back, and if so that would be awesome. That’s also a great way to get it into ProRes if you’re on Windows! Great thinking!

Author
Time

I’ve been converting to prores in FFMpeg and can confirm that it works really well. No color shift that I have seen.

Author
Time

Stotchy said:

I’ve been converting to prores in FFMpeg and can confirm that it works really well. No color shift that I have seen.

Nice. That’s great to hear!

Author
Time

I wonder if Adywan knows about this for his SW Revisited projects? He just picked up the 4K SW boxset this week!

Author
Time

Thanks a lot for this useful topic!

Author
Time

You could probably use an SDR encode as a proxy and replace the proxy footage with the full 4K HDR at the end.

a trolling bantha