Log in

View Full Version : Convert 4k HDR to 1080p removing HDR


Mike-uk
25th August 2018, 16:10
Hi, iv just attempted to convert a 4k video to MKV 1080p with handbreak, all went well it plays

but it has retained the HDR info( wasn't expecting it to ), so it looks all washed out on a non 4k tv

is there a way to remove HDR, so essently making a blu ray from 4k HDR source material ?


cheers


Mike

videoh
25th August 2018, 16:28
DGSource + DGHDRtoSDR + Avisynth+

http://rationalqm.us/hdr/DGHDRtoSDR_1.9.rar

Requires an nVidia card. Use jpsdr's HDRTools if you do not have nVidia.

Mike-uk
25th August 2018, 17:33
Thanks ill take a look at those tools

benwaggoner
28th August 2018, 18:21
Hi, iv just attempted to convert a 4k video to MKV 1080p with handbreak, all went well it plays

but it has retained the HDR info( wasn't expecting it to ), so it looks all washed out on a non 4k tv

is there a way to remove HDR, so essently making a blu ray from 4k HDR source material ?
And note that a SDR derived from HDR isn't going to match what an actual SDR grade looks like. A colorist will make separate passes, making different creative decisions based on what each color space can do. A fully automated HDR->SDR is better than SDR->HDR, but just watching the SDR version is almost always going to be a superior experience.

Atak_Snajpera
29th August 2018, 13:18
but just watching the SDR version is almost always going to be a superior experience.
key word "almost" ;)
BD
http://fs5.directupload.net/images/180608/n8xoqczd.jpg

Matrix Remastered BD
http://fs1.directupload.net/images/180608/73n52l4f.jpg

HDR to SDR tonemapping via DGTonemap.dll (Hable)
http://fs5.directupload.net/images/180608/ci4cgjs5.jpg

More screenshots
https://www.bloodsuckerz.cx/bd-1080p-1080i-720p-720i/240923-stirb-langsam-uhd-bd-x264-crf21-2.html#post618794

foxyshadis
30th August 2018, 08:44
key word "almost" ;)
BD
http://fs5.directupload.net/images/180608/n8xoqczd.jpg

Matrix Remastered BD
http://fs1.directupload.net/images/180608/73n52l4f.jpg

HDR to SDR tonemapping via DGTonemap.dll (Hable)
http://fs5.directupload.net/images/180608/ci4cgjs5.jpg

More screenshots
https://www.bloodsuckerz.cx/bd-1080p-1080i-720p-720i/240923-stirb-langsam-uhd-bd-x264-crf21-2.html#post618794

That's way WAY beyond just SDR-vs-HDR, that's a creative decision to wholly regrade the Wachowskis' original vision of the film into a more neutral, audience-friendly tone. You may as well have two separate movies to pick from at that point.

Atak_Snajpera
30th August 2018, 12:58
My point is that it is better to do own HDR->SDR conversion than rely on some "professionals". Remastered Matrix looks overexposed to me. Tonemapped version looks more natural.
Ps. Yes I prefer original green version in case if we want to talk about color grading.

Gser
30th August 2018, 21:15
My point is that it is better to do own HDR->SDR conversion than rely on some "professionals". Remastered Matrix looks overexposed to me. Tonemapped version looks more natural.
Ps. Yes I prefer original green version in case if we want to talk about color grading.

Actually the "original" version shown in theaters was not as green, the new 4K HDR remaster of Matrix is very close to it, the home releases kept getting greener and greener. I'm very satisfied with the new release of Matrix overall, so happy it wasn't spoiled with too much DNR like so many other old movies. I just finished watching the new HDR release on an HDR tv, nothing looked over-exposed to me. I'm guessing they wanted to make the old matrix look more like second and third releases thus they made it greener.

Atak_Snajpera
31st August 2018, 12:11
I just finished watching the new HDR release on an HDR tv, nothing looked over-exposed to me.
I'm comparing remastered SDR BD to tonemapped version (HDR->SDR) using free avisynth plugin.

Original version
http://fs5.directupload.net/images/180608/6rhdyfgk.jpg

Remastered SDR BD
http://fs5.directupload.net/images/180608/7ky4kmcl.jpg

HDR to SDR tonemapped with DGHable
http://fs1.directupload.net/images/180608/lgx2tteu.jpg

videoh
31st August 2018, 14:19
Atak_Snajpera, can you give us your script for the DGHable version, please? Thank you.

benwaggoner
31st August 2018, 16:32
My point is that it is better to do own HDR->SDR conversion than rely on some "professionals". Remastered Matrix looks overexposed to me. Tonemapped version looks more natural.
Ps. Yes I prefer original green version in case if we want to talk about color grading.
The thing is, most colorists spend WAY more time on the SDR grade than the HDR grade for home theater, as SDR still dominates audience-hours and revenue. So the creative intent of the actual SDR grade can be quite different from a HDR->SDR conversion.

If you want a more "pleasing" color, which is a controversial choice with something as intentionally stylized as the Matrix films, you could also switch your TV from Cinema to Standard mode.

If you want to see what the filmmakers intended their SDR to look like, watch the original SDR version. And the Matrix films are pretty unique color-wise, so aren't good content to make broader generalizations from.

Now, I certainly have seen HDR->SDR conversion be useful. For live sports, for example, where the color is pretty much all done in camera without significant creative color work happening in the truck.

But for major movies and TV shows, the SDR represents a lot of creative work and expression. In many cases, the home video HDR starts with the SDR grade and is modified from there, with some scenes remaining roughly SDR. No automated conversion is going to understand creative intent like that.

hydra3333
7th September 2018, 05:16
Atak_Snajpera, can you give us your script for the DGHable version, please? Thank you.

yes, +1

an3k
29th May 2019, 01:45
It should be this
loadplugin("DGDecodeNV.dll")
loadplugin("DGTonemap.dll")
loadplugin("avsresize.dll")
SetFilterMTMode("z_ConvertFormat", MT_MULTI_INSTANCE) # May not be needed.
DGSource("THE GREAT WALL.dgi",fulldepth=true)
z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none")
DGHable()
z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
prefetch(4)

If you want to crop and/or resize either use DGSource for that or the AviSynth internal filters. Be sure to put them before z_ConvertFormat()

StvG
29th May 2019, 06:04
It should be this
loadplugin("DGDecodeNV.dll")
loadplugin("DGTonemap.dll")
loadplugin("avsresize.dll")
SetFilterMTMode("z_ConvertFormat", MT_MULTI_INSTANCE) # May not be needed.
DGSource("THE GREAT WALL.dgi",fulldepth=true)
ConvertBits(10) # Use 12 for 12-bit
z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none")
DGHable()
z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
prefetch(4)

If you want to crop and/or resize either use DGSource for that or the AviSynth internal filters. Be sure to put them before z_ConvertFormat()
"ConvertBits(10) # Use 12 for 12-bit" - remove that line.

an3k
29th May 2019, 06:57
"ConvertBits(10) # Use 12 for 12-bit" - remove that line.

The whole code is taken from the plugin author. Without that line You have YUV420P16 but afaik you want YUV420P10. Or am I missing something?

StvG
29th May 2019, 07:18
DGSource output is YUV420P16 (even if you have 10-bit video). You convert it to YUV420P10 and then to RGBPS (32-bit float). Just convert YUV420P16 to RGBPS.

Here (https://forum.doom9.org/showpost.php?p=1836983&postcount=51) you can see what DGSource author used.

an3k
30th May 2019, 06:59
DGSource output is YUV420P16 (even if you have 10-bit video). You convert it to YUV420P10 and then to RGBPS (32-bit float). Just convert YUV420P16 to RGBPS.

You're absolutely right. I totally did not thought about this process. I just took what was written in the readme that comes with the plugin.

Here (https://forum.doom9.org/showpost.php?p=1836983&postcount=51) you can see what DGSource author used.

Updated my previous posting. Thanks for heads-up :)

SpasV
30th May 2019, 18:23
Hi, iv just attempted to convert a 4k video to MKV 1080p with handbreak, ...
but it has retained the HDR info, so it looks all washed out ...
Mike
It hasn't retained HDR. Just opposite. The HDR has gone, you've got 8-bit color video, which cannot be HDR, in the source's color space, which is BT.2020.
The colors may seem washed out but I like them because they are closer to the natural colors. Look at the human skin for example.
Personally, I'm entirely negative about HDR to SDR tone maping.

Asmodian
30th May 2019, 21:03
I think you might be confused. 8 bit color video can be HDR, why couldn't it? Watching BT.2020 on a sRGB/BT.709 display is simply wrong. Just don't watch HDR if you don't want to tone map it and don't have a HDR display that can display the entire range of the mastering display (complicated since no publisher does 4K SDR releases).

Closer to the natural colors? My world looks nothing like BT.2020 content on a BT.709 display. HDR tone mapping often looks odd in some ways, and I think you should just watch the SDR master if you have an SDR display, but that doesn't mean watching BT.2020 on a BT.709 display is in anyway useful.

SpasV
30th May 2019, 21:32
Look at this http://forum.doom9.net/showthread.php?t=175960&highlight=alternative