HDR -> SDR conversion

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Maybe 10 is a bit too strong. I'll reduce it in the next version.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

I slipstreamed 1.11 to reduce default hue to 5. Hopefully, you can live with that. I do think this hue correction is a good thing. If you can show otherwise, please do.
DAE avatar
sv503
Posts: 1
Joined: Thu Jan 31, 2019 1:34 am

Re: HDR -> SDR conversion

Post by sv503 »

Hi, Donald!
Please give recommendations, how to select the parameter "Prefetch"? What does this parameter affect? Thank's.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

It's an Avisynth+ thing that you can google. There are so many variables affecting it that your best bet is to use Avsmeter to time your script and empirically determine the best value. For some scripts, any prefetch reduces performance.
DAE avatar
Keyser78
Posts: 8
Joined: Thu Feb 07, 2019 1:33 am

Re: HDR -> SDR conversion

Post by Keyser78 »

Hello :-) Which version of Dgsource (dgdecnv) has parameter "fulldepth"? I use 2053, checked others :-( There's no in manual either.
DAE avatar
Guest

Re: HDR -> SDR conversion

Post by Guest »

All versions of DGDecodeNV, for the last great while at least, have the fulldepth instruction
From the manual
fulldepth: true/false (default: false)

When fulldepth=true and the encoded video is HEVC 10-bit or 12-bit, then DGSource() delivers 16-bit data to Avisynth with the unused lower bits zeroed. The reported pixel format is CS_YUV420P16. If either of the two conditions are not met, then DGSource() delivers 8-bit YV12 or I420 data, as determined by the i420 parameter. When fulldepth=false and the video is HEVC 10-bit or 12-bit, then the video is dithered down to 8-bit for delivery. If you need a reduced color space (less than 16 bits) for your high-bit-depth processing, you can use ConvertBits() as needed after your DGSource() call.
DAE avatar
Keyser78
Posts: 8
Joined: Thu Feb 07, 2019 1:33 am

Re: HDR -> SDR conversion

Post by Keyser78 »

I try to use it in Avspmod 2.5.1 and get a script error: dgsource does not have a named argument "fulldepth". :-(
User avatar
DJATOM
Posts: 176
Joined: Fri Oct 16, 2015 6:14 pm

Re: HDR -> SDR conversion

Post by DJATOM »

Your version is too old, update dgdecodenv.dll.
PC: RTX 2070 | Ryzen R9 5950X (no OC) | 64 GB RAM
Notebook: RTX 4060 | Ryzen R9 7945HX | 32 GB RAM
DAE avatar
Keyser78
Posts: 8
Joined: Thu Feb 07, 2019 1:33 am

Re: HDR -> SDR conversion

Post by Keyser78 »

Thanks! I've been using first 2053 version :facepalm: Now it works great.
DAE avatar
Dion
Posts: 28
Joined: Sun Dec 04, 2016 12:30 am

Re: HDR -> SDR conversion

Post by Dion »

Dion wrote:
Thu Sep 13, 2018 1:00 am
Have you ever considered making an HDR to SDR app for the Nvidia Shield? It has an Nvidia GPU in it and one thing it lacks is an HDR to SDR app that can hook onto Plex or Kodi or some other popular video apps.

Could even charge for it an probably make some decent bank. :D
https://nvidianews.nvidia.com/news/nvid ... rcomputing

Maybe useful for this? I'm not a dev so maybe you could comment.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Thanks for the suggestions, guys. I need to make a DGHDRtoSDR() update and then I can look at this stuff.

Do you feel GOOOD? Say YEAH! Wheee.
User avatar
zys4416
Posts: 9
Joined: Fri Jul 29, 2011 9:04 pm

Re: HDR -> SDR conversion

Post by zys4416 »

great filter!
i'm very looking forward to the HLG2SDR function.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: HDR -> SDR conversion

Post by Guest 2 »

admin wrote:
Mon Jun 17, 2019 8:32 pm
Do you feel GOOOD? Say YEAH! Wheee.
YEAH! :lol:
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

zys4416 wrote:
Fri Aug 30, 2019 3:17 am
i'm very looking forward to the HLG2SDR function.
I didn't make one because of the supposed backwards compatibility of HLG. Can you further justify your request?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Guest 2 wrote:
Fri Aug 30, 2019 5:19 am
YEAH! :lol:
Better late than never!
User avatar
zys4416
Posts: 9
Joined: Fri Jul 29, 2011 9:04 pm

Re: HDR -> SDR conversion

Post by zys4416 »

admin wrote:
Fri Aug 30, 2019 8:21 am
zys4416 wrote:
Fri Aug 30, 2019 3:17 am
i'm very looking forward to the HLG2SDR function.
I didn't make one because of the supposed backwards compatibility of HLG. Can you further justify your request?
I have same 2160p 10-bit TS sources in HLG / BT.2020 (mediainfo reported), and I want to re-encode them to 1080p in SDR / BT.709 for archiving.

When I play a TS source, the color looks mostly fine, it seems to be a 4K UHD source.

You mean that I can re-encoding without any filters?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Any chance you could give me a link to one of those transport streams? You can use DGSplit to cut the first 50MB. Only you can decide if it looks "good enough" with no special processing. With one of your streams I can try it both ways and we'll see how they compare.
User avatar
zys4416
Posts: 9
Joined: Fri Jul 29, 2011 9:04 pm

Re: HDR -> SDR conversion

Post by zys4416 »

admin wrote:
Tue Sep 03, 2019 8:50 am
Any chance you could give me a link to one of those transport streams? You can use DGSplit to cut the first 50MB. Only you can decide if it looks "good enough" with no special processing. With one of your streams I can try it both ways and we'll see how they compare.
I have provided 3 clips, 50MB per clip, thank you for your help :D

http://138.68.0.28:8008/trim_162.ts
http://138.68.0.28:8008/trim_187.ts
http://138.68.0.28:8008/trim_203.ts
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Thank you very much. I will make a proper HLG to SDR filter and see how it compares.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

This is interesting:

https://www.youtube.com/watch?v=yGSjun9gsbs

It shows that, compared to a proper conversion to SDR 709, playing HLG 2020 directly is "OK" but it is much darker and there are color shifts.

Probably your clips will perform similarly. Seems to me there is indeed a good justification for a new filter.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Guys, I have added a 'HDR' field to the HEVC Info dialog. This will show "PQ" for HDR10, "HLG" for HLG, and is blank for SDR.

I also figured out how to properly detect HDR. There are two ways to signal it: 1) through the transfer_characteristics (16 is PQ, 18 is HLG), and 2) through SEI messages. Previously I was looking only at the presence/absence of SEI messages. Now I look at both. You have to look at both because a HLG stream can signal 709 via transfer_characteristics together with a preferred_transfer_characteristics SEI specifying HLG. This allows for backward compatibility of HLG with 709 displays. Refer to T-REC-H.Sup18-201710-I!!PDF-E.pdf for details:

https://www.itu.int/rec/T-REC-H.Sup18-201710-I

Will slipstream it after some regression testing.
User avatar
zys4416
Posts: 9
Joined: Fri Jul 29, 2011 9:04 pm

Re: HDR -> SDR conversion

Post by zys4416 »

I found the official HD version here:

https://www.youtube.com/watch?v=ih1l6wb7LhU

for these clips:

trim_187.ts at 35:03
trim_203.ts at 38:02

I can't find trim_162.ts in HD version, I think SDR ver. and HDR ver. are different editions.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Thanks but I don't know how to download youtube videos.
User avatar
Bullwinkle
Posts: 338
Joined: Thu Sep 05, 2019 6:37 pm

Re: HDR -> SDR conversion

Post by Bullwinkle »

Hello there culture lovers. Today we take a look at the modern day HLG to SDR known as The Good Stuff. Here is one fetching picture. They call me fetching. Fetching all the pixels ain't saving whoa! Ooh. Okay that is all for today next week the meaning of Randomness and Beauty.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin »

Whee!
Post Reply