Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th July 2019, 04:02   #1  |  Link
Timberlake
Registered User
 
Join Date: Mar 2019
Posts: 3
How to convert HDR to SDR correctly

Recently I've been working on covert HDR to SDR correctly.

Source is playing by mpc-hc. Using madVR.



This is a screenshot of the encode using following script.

Code:
loadplugin("D:\Software\Encode\dgdecnv2053\DGDecodeNV.dll")
loadplugin("D:\Software\Encode\_AVSFilter\DGHDRtoSDR_1.12\DGHDRtoSDR.dll")
DGSource("00005.dgi", fulldepth=true)
DGHDRtoSDR()
prefetch(6)
BilinearResize(1920, 1080)

This is a screenshot of the encode using following script.

Code:
loadplugin("D:\Software\Encode\dgdecnv2053\DGDecodeNV.dll")
loadplugin("D:\Software\Encode\_AVSFilter\DGTonemap\DGTonemap.dll")
loadplugin("D:\Software\Encode\_AVSFilter\avsresize-r1d\Release\avsresize.dll")
SetFilterMTMode("z_ConvertFormat", MT_MULTI_INSTANCE) # May not be needed.
DGSource("00005.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")
# Choose one of these:
#DGReinhard()
DGHable()
z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
prefetch(4)
BilinearResize(1920, 1080)

Or perhaps there is something wrong with madVR.
Two scripts each comes from DGHDRtoSDR_1.12.txt and DGTonemap_1.2.txt
Timberlake is offline   Reply With Quote
Old 28th July 2019, 07:14   #2  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 840
You haven't actually told us what you think is bad or wrong! There is no "correct" for this conversion. Every method has to make some subjective tradeoffs.

BTW, you can do the resize with DGSource() to improve performance.
videoh is offline   Reply With Quote
Old 28th July 2019, 07:53   #3  |  Link
Timberlake
Registered User
 
Join Date: Mar 2019
Posts: 3
Quote:
Originally Posted by videoh View Post
You haven't actually told us what you think is bad or wrong! There is no "correct" for this conversion. Every method has to make some subjective tradeoffs.

BTW, you can do the resize with DGSource() to improve performance.
Oh, it just none of the encodes have the same color compared to the source.
Thanks for the advice.
Timberlake is offline   Reply With Quote
Old 28th July 2019, 11:24   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,617
Let me use this thread to expose some doubts about that conversion.

- Like the color space Rec. 2020 is bigger than Rec. 709 we never can obtain the same color, we only can obtain a aproach.

- In order to compare screenshots, the original is taken from a monitor capable of show Rec. 2020 space or we are comparing how madvr do the conversion 2020 -> 709 with other methods?

- It is possible obtain a screenshot with the true HDR color?
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 28th July 2019, 12:16   #5  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,093
Default exposure in DGHable is too strong! Use DGHable(exposure=1.0)

Default value



exposure=1.0

Last edited by Atak_Snajpera; 28th July 2019 at 12:27.
Atak_Snajpera is offline   Reply With Quote
Old 28th July 2019, 17:27   #6  |  Link
Timberlake
Registered User
 
Join Date: Mar 2019
Posts: 3
Thanks a lot. I am new here as an encoder and a new member of this forum.
There is so much to learn.
Timberlake is offline   Reply With Quote
Old 28th July 2019, 17:53   #7  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 840
Welcome to the forum and good luck for your projects!
videoh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.