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. |
![]() |
#1 | Link |
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
HLG processing for good picture on SDR monitor
Due to huhn's "madVR doesn't support HLG" in thread LAV Filters - DirectShow Media Splitter and
Decoders here I've known madVR still not support HLG if it can be correctly done at all (as MPC-BE developer says there's only few HLG content so they don't want support HLG in their MPC-BE well - present their EVR Custom Presenter (EVR-CP)'s auto switching on as minimum with DXVA2 (native and copy-back) Processing: HDR(HLG) to SDR gives overcontrasted and bad saturated video as minimumn on SDR monitors - even worse than without any processing - washed out colors and i.e. red becomes orange w/o processing: SDR (well): ![]() HLGw/oProcessing (undersaturated and undercontrasted): ![]() HLGtoSDRprocessing (oversaturated and overcontrasted): ![]() I've found with old version of LAV Video Decoder 0.68.1.35 (modified by Aleksoid1978 to accelerate 4K h265 10bit via NVIDIA CUVID in WinXP) Processing: HDR(HLG) to SDR not switching on even in any DXVA2 mode. Return to huhn's "madVR doesn't support HLG" - I'm not pity very much because my old computer couldn't use madVR in modes showing not worse than EVR or EVR-CP on 4K but I want watch F1 in HLG h265 10bit 4:2:0 4K with colors not worse than before HLG (see SDR picture) in i.e. 2018 - I've recorded many files to compare - here's three of them: 20180729-160530_RTL UHDsdr.ts (73MB) https://yadi.sk/i/nKbwy-6ohkWQxw 20190511-140255_RTL UHDhlg.ts (19MB) https://yadi.sk/d/sVcYR6QgkfcGOw 20190630-183800_RTL UHDhlg.ts (14MB) https://yadi.sk/d/OjMMtl5d6JibQQ But my GTX750v2 videocard is strong enough to process 4K video with shaders (i.e. Convert HDR to SDR or HDR but they gives wrong colors too) in EVR-CP so my questions are: 1. Does anybody know some another HLG to SDR shader I can try? 2. Can anybody write such shader which can process HLG metadata (repeat - if it can be correctly done at all)? |
![]() |
![]() |
![]() |
#2 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
1. It's not a shader but DGHDRtoSDR 1.13 can now convert HLG to SDR. DGIndexNV can also do it for its display, with parameter sliders compatible with DGHDRtoSDR. The results are very pleasing and expose the issues with just playing HLG directly without conversion. It should be easy to do in a shader but I don't do DirectShow stuff so someone else will have to do it. I'd be happy to provide the algorithm if someone wants it to make a shader. But anyway, it's not rocket science. You just replace the PQ EOTF with the HLG EOTF.
2. AFAIK, HLG does not have any metadata that would guide the presentation. Yes, I know about the preferred transfer function SEI, but it is fixed at 18 for HLG. Lack of metadata is a big plus for HLG. Last edited by videoh; 23rd September 2019 at 19:09. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
videoh, thanks for reply and your algorithm.
I'm not programmer but I've heard about DGIndexNV (DGDecNV) but never used it so I'm not sure I'll can to convert HLG to SDR correctly. Tell me, please where can I download DGHDRtoSDR 1.13 to try to convert HLG videos to SDR to see result? If link is a secret can you convert 20190511-140255_RTL UHDhlg.ts and/or 20190630-183800_RTL UHDhlg.ts and upload it, please? Last edited by VictorLS; 23rd September 2019 at 17:15. |
![]() |
![]() |
![]() |
#4 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
No secrets from you, VictorLS! You'll find it here (scroll down a bit):
http://rationalqm.us/mine.html You should be able to tweak parameters to fairly well match the SDR version. DGIndexNV has a GUI tweaker for it that makes finding good parameters really easy. You'll need a decent nVidia card to run DGIndexNV. You can run DGHDRtoSDR without an nVidia card but it can be slow in SW mode. Do you have a decent nVidia card installed? The gentleman that asked me to implement this said he is very happy with the results (zys4416 at DG forum): "the result is pretty perfect". Sweetie Pie would say "purrfect". Probably jpsdr's HDR tools can also do this conversion. Always great to hear from jpsdr so maybe he will chime in. Bullwinkle said: "PQ sucks. People say I don't suck. HLG is the True Way." Last edited by videoh; 23rd September 2019 at 19:39. |
![]() |
![]() |
![]() |
#5 | Link | ||
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
Quote:
Yes, I have decent enough GTX750v2 on GM206 (as GTX950 and GTX960 but I think ~ two times slower) videocard - it can hardware decoding 4K h265 10bit 4:2:0 even in WinXP. I hope it'll be so. Quote:
I tried so AviSynth+ script in ffdshow: ================================= loadplugin("C:\dghdrtosdr.dll") DGHDRtoSDR(impl="sw",mode="hlg",white=1800) Prefetch(3) ================================= (impl="sw" because I haven't dgdecodenv.dll) but got error while playing trim_187.ts and my test h265 SD SDR quasi-interlaced file (I've written AviSynth(+)-script to deinterlace it correctly). How can I get YUV420P16? |
||
![]() |
![]() |
![]() |
#6 | Link | ||
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#7 | Link | |||||
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
Quote:
Quote:
Quote:
Quote:
![]() In any case many thanks for proposition (in anyway we are in Crimea under sanctions and PayPal not work in Crimea as international cards too) - I've sent you PM. Quote:
![]() Last edited by VictorLS; 24th September 2019 at 12:27. |
|||||
![]() |
![]() |
![]() |
#9 | Link | |
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
DJATOM
Best regards to former and I hope future in Russian World compatriot. Quote:
First race of FormulaE in history was translated from 4:2:2 feed - I've remuxed it with mkvtoolnix 09-13_13-19-15_hy1_-002.mkv (126MB) https://yadi.sk/i/G7KrUACkbUYEU Eurovision 1920x1080i50 feeds was MPEG2 and now h264 but always 4:2:2 In some years international F1 feed from 10e is transmitted as h264 1920x1080i50 4:2:2 (namely when F1 - other events of weekend are in 4:2:0 chroma subsampling) i.e. 4:2:2 20190414-090034_TATA WIF Main_КвятКитай.ts (19MB) https://yadi.sk/i/XqdkpfKMddC_vA In some month if I remember correctly from 4e9 was transmitting 3840x2160p25 4KUA channel 20171204-234107_4KUA.ts (55MB) https://yadi.sk/d/bo-0KiV83QKoge - only MainConcept HEVC Video Decoder can decode all 25 frames per second on my old and weak Athlon II x3 460 with ~90% load of each core, LAV Video Decoder stutters with 100% load. Later I saw just seldom feeds like h264 1920x1080i50 4:2:2 09-16_14-29-23_LEV VS VAL HD50_.ts (62MB) https://yadi.sk/d/2lXjVe2S3MxFXG (my processor is quite enough to decode all 50 fps with ~50% load) or h265 4:2:2 3840x2160p50 20180428-175510_4K ENC 3 RMAD VS LEG.ts (563MB) https://yadi.sk/d/m0s5ztpj3XnUyw - I believe few processors (begining from Intel Core i7 and top AMD Ryzen) can decode all 50 frames per second and keep video and audio synced. I watched it with MainConcept's SkipPB option or with MPC Video Decoder with "Skip non Intra frames" in Properties of MPCVideoDec_skip_non_I-frames.7z (7,2MB) https://yadi.sk/d/ZBA-K2-6UUV4TQ with synced audio and ~1fps ![]() videoh Thank you very much - I've got well enough (some cool) colors while playing HLG in DGIndexNV: ![]() Last edited by VictorLS; 25th September 2019 at 22:49. |
|
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 376
|
VictorLS
И тебе привет (: (Hope mods will not restrict me for few Russian words) So there are not so much channels with 4:2:2 color mode, I see. Actually it might be useful for animes, since usually it's done into Apple ProRes 4:2:2 @ 10 bit (I have few friends who worked on such files, but they didn't shared those with me due to NDA). I personally think it's better to use 4:4:4 (with upscaling of old content) for broadcasting, we're not in analogue TV era where interlace and halved chroma saved a lot of channel bandwidth, allowing more channels per allocated analogue TV frequencies and improving overall quality of transmission. |
![]() |
![]() |
![]() |
#11 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
@VictorLS
You are most welcome and I am happy you find DG tools useful. Maybe I would pop the whites a little by backing off on the tm parameter and/or bumping up the white parameter. @DJATOM Hello to you too. ![]() Last edited by videoh; 26th September 2019 at 22:14. |
![]() |
![]() |
![]() |
#12 | Link | |||
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
You're right.
Quote:
Quote:
In any way I haven't seen 4:4:4 from SATs yet and sure it wouldn't. Btw my old 1-core Athlon II 3,2GHz couldn't decode 4:2:2 h264 1920x1080i50 ~20Mbit/s international F1 feed so I've bought 3-core CPU (not found 4-core that time in sale) and insert in old 690G mobo and now CPU load about 50% of each core so I need hardware acceleration of 4K, 8K and so on. Quote:
![]() |
|||
![]() |
![]() |
![]() |
#13 | Link |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 376
|
@videoh
Hi, Don. @VictorLS You can subscribe onto "Binaries update thread" and receive notifications onto e-mail. But I'm just personally checking Don's forum for new posts and updates (good reason to do so). |
![]() |
![]() |
![]() |
#14 | Link | |
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
Quote:
20190511-130113_ARENA HD_flag.ts (38MB) https://yadi.sk/i/HiuZ5Rb2RKkc0g 20190511-152944_RTL UHD_flag.ts (67MB) https://yadi.sk/i/985DVw34OHQrrA |
|
![]() |
![]() |
![]() |
#15 | Link |
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
I was written about mpv https://mpv.srsfckn.biz/ is well player for HLG and this is so as minimum for last version (and with hardware acceleration in my case with --hwdec=auto in mpv.conf):
![]() so problem with watching HLG records is solved but for live watching (and play records in my favorite KMPlayer) some HLG->SDR shader with quality not lower than mpv is still appreciated. Last edited by VictorLS; 30th September 2019 at 23:21. |
![]() |
![]() |
![]() |
#18 | Link | |||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,575
|
Quote:
For instance, the ATP Masters 1000 world feed which is shot and distributed across the whole world via Sat to all the licensors is in H.264 4:2:2 planar 10bit 25i, however once we get the signal, we make sure that luma and chroma is in limited tv range and we insert the comment, it gets dithered down to 8bit 4:2:0 planar (yv12) and re-encoded to H.264 25i with a way lower bitrate. ![]() Quote:
As a side note, sometimes old japanese broadcasters living in the stone-age prefer to get an XDCAM-50 file instead which is just a crappy MPEG-2 8bit yv16 telecined which is a shame 'cause if you are a sub-licensor you don't get the original masterfile from the Studio, but the mezzanine file sent to the japanese broadcaster instead. Anyway, I did like that job, but I prefer to work as encoder in the new company as I've been encoding documentaries, tv series and other more important and exciting things than anime. Quote:
I can't share their name for privacy reasons, but I know a few people who have been sacked only because someone hacked their account and stole a proxy file (not even the masterfile!!) and shared it publicly on the internet via torrent before it was aired. Last edited by FranceBB; 8th October 2019 at 20:21. |
|||
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: Mar 2009
Location: Russian Crimea
Posts: 335
|
FranceBB, Thanks for your post.
Here's "new" HLG file 20190831-160457_RTL UHD.mkv (135MB) https://yadi.sk/i/SRloXWrOP-L-xA - mpv.exe plays it with right colors and and mpv.conf with "--hwdec=auto" near it to play with hardware acceleration if it's supported by videocard. Last edited by VictorLS; 5th February 2020 at 14:12. |
![]() |
![]() |
![]() |
#20 | Link | |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Quote:
![]() No wonder to me broadcast is a dying breed! ATP matches can be viewed over the internet and there are 0.0 reasons to support this idiotic interlaced signal, it's 2019 for crying out loud! And if "granny's TV" needs it then interlace the original 50p signal over the air to 50i (or 25i if you prefer this semantic)! Last edited by Cary Knoop; 16th November 2019 at 21:07. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|