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 > Hardware & Software > Software players

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th September 2021, 01:33   #2001  |  Link
aron7awol
Registered User
 
Join Date: Dec 2020
Posts: 109
Quote:
Originally Posted by quietvoid View Post
I guess the next easiest solution is to reencode your content down to 709.
Is there an easy way you know of to reencode with a simple gamut clip to 709 while leaving everything else alone?
aron7awol is offline   Reply With Quote
Old 12th September 2021, 03:29   #2002  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Posts: 320
Quote:
Originally Posted by aron7awol View Post
Is there an easy way you know of to reencode with a simple gamut clip to 709 while leaving everything else alone?
Not really, it's usually a couple software to setup. So without prior experience this isn't as simple.


I had the idea of trying with mpv and it seems to be a possible solution.
My setup was like this:
mpv.conf
Quote:
target-peak=10000
d3d11-output-csp=pq
d3d11-output-format=rgb10_a2
tone-mapping=clip
profile=gpu-hq
gpu-api=d3d11
target-prim=bt.2020
target-trc=pq
format=default:colormatrix=bt.2020-ncl
video-output-levels=full
dither-depth=10
fullscreen=yes
input.conf
Quote:
F3 no-osd cycle-values target-prim "bt.2020" "bt.709"
With this, I toggled between the primaries with F3 and saw noticeable desaturation for WCG red, at least.
However it seems to oversaturate most of the other colors..
__________________
LG OLED C8 | madVR 870 DPL HDR curve
quietvoid is offline   Reply With Quote
Old 12th September 2021, 09:52   #2003  |  Link
chros
Registered User
 
chros's Avatar
 
Join Date: Mar 2002
Posts: 2,188
I created 2 PR for aiopylgtv:
- Add support for dictionary via JSON in cmd line params
- Add support for setting PC mode for an HDMI input

Especially the second is really amazing, no need to click around and wait to switch between PC and non-PC mode! Although it takes a second or so, just like when switching into/out from Game preset.

I also created a basic version of it (without calibration related features) for command line usage (that runs only 1 function at a time), the reason was: it's faster about 1-2 seconds (due to it doesn't have to trigger that many request after connecting).
If someone is interested I can publish it properly, but here it is until then: bscpylgtv v0.0.2 (up for a week):
- looks for the same ".aiopylgtv.sqlite" key config
- how to install it on Windows

You can actually modify the greyed out settings as well, e.g. colorGamut in PC mode!

Examples:
Code:
bscpylgtvcommand 192.168.1.18 info_button
bscpylgtvcommand 192.168.1.18 set_current_picture_mode expert2
bscpylgtvcommand 192.168.1.18 set_current_picture_settings "{\"backlight\": 0, \"contrast\": 85}"
bscpylgtvcommand 192.168.1.18 set_current_picture_settings "{\"hdrDynamicToneMapping\": \"on\"}"
bscpylgtvcommand 192.168.1.18 set_current_picture_settings "{\"colorGamut\": \"auto\"}"
bscpylgtvcommand 192.168.1.18 set_pc_mode true hdmi2
bscpylgtvcommand 192.168.1.18 launch_app_with_params com.webos.app.softwareupdate "{\"mode\": \"user\", \"flagUpdate\": true}"
bscpylgtvcommand 192.168.1.18 power_off
__________________
Ryzen 5 2600,Asus Prime b450-Plus,16GB,MSI GTX 1060 Gaming X 6GB(v398.18),Win10 LTSC 1809,MPC-BEx64+LAV+MadVR,Yamaha RX-A870,LG OLED65B8(2160p@23/24/25/29/30/50/59/60Hz) | madvr config

Last edited by chros; 12th September 2021 at 22:22.
chros is offline   Reply With Quote
Old 12th September 2021, 16:04   #2004  |  Link
chros
Registered User
 
chros's Avatar
 
Join Date: Mar 2002
Posts: 2,188
I've updated one of the PR and bscpylgtv (link is updated as well to v0.0.2) to only apply PC mode to the selected HDMI input.
__________________
Ryzen 5 2600,Asus Prime b450-Plus,16GB,MSI GTX 1060 Gaming X 6GB(v398.18),Win10 LTSC 1809,MPC-BEx64+LAV+MadVR,Yamaha RX-A870,LG OLED65B8(2160p@23/24/25/29/30/50/59/60Hz) | madvr config
chros is offline   Reply With Quote
Old 12th September 2021, 16:41   #2005  |  Link
aron7awol
Registered User
 
Join Date: Dec 2020
Posts: 109
Quote:
Originally Posted by quietvoid View Post
Not really, it's usually a couple software to setup. So without prior experience this isn't as simple.


I had the idea of trying with mpv and it seems to be a possible solution.
My setup was like this:
mpv.conf

input.conf


With this, I toggled between the primaries with F3 and saw noticeable desaturation for WCG red, at least.
However it seems to oversaturate most of the other colors..
I have no problem working with ffmpeg or any other encoding tools. I'm just not sure which is capable of remapping gamuts.

I generated a 3dlut with bt2020 source and rec709 2.2 target, and it seemed to work somewhat, but with the 3dlut enabled everything was oversaturated. That sounds similar to your result with mpv.
aron7awol is offline   Reply With Quote
Old 12th September 2021, 16:57   #2006  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,084
you have to use bt709 in/source and bt 2020 destination.

this way madVR is forced to do the gamut conversation to bt 709 to feed the 3D LUT.

now you set send bt 2020 and that should be it.
i'M on AMD i can't send bt 2020 so i can't test this.
huhn is offline   Reply With Quote
Old 12th September 2021, 18:59   #2007  |  Link
chros
Registered User
 
chros's Avatar
 
Join Date: Mar 2002
Posts: 2,188
Quote:
Originally Posted by aron7awol View Post
I have no problem working with ffmpeg or any other encoding tools. I'm just not sure which is capable of remapping gamuts.

I generated a 3dlut with bt2020 source and rec709 2.2 target, and it seemed to work somewhat, but with the 3dlut enabled everything was oversaturated. That sounds similar to your result with mpv.
You can use portable mpv.net on windows with this config, and add/modify what quietvoid suggested.
__________________
Ryzen 5 2600,Asus Prime b450-Plus,16GB,MSI GTX 1060 Gaming X 6GB(v398.18),Win10 LTSC 1809,MPC-BEx64+LAV+MadVR,Yamaha RX-A870,LG OLED65B8(2160p@23/24/25/29/30/50/59/60Hz) | madvr config
chros is offline   Reply With Quote
Old 12th September 2021, 22:23   #2008  |  Link
chros
Registered User
 
chros's Avatar
 
Join Date: Mar 2002
Posts: 2,188
You can actually modify the greyed out settings as well, e.g. colorGamut in PC mode! (I added example to the post above.)
__________________
Ryzen 5 2600,Asus Prime b450-Plus,16GB,MSI GTX 1060 Gaming X 6GB(v398.18),Win10 LTSC 1809,MPC-BEx64+LAV+MadVR,Yamaha RX-A870,LG OLED65B8(2160p@23/24/25/29/30/50/59/60Hz) | madvr config
chros is offline   Reply With Quote
Old 13th September 2021, 01:25   #2009  |  Link
aron7awol
Registered User
 
Join Date: Dec 2020
Posts: 109
Quote:
Originally Posted by chros View Post
You can use portable mpv.net on windows with this config, and add/modify what quietvoid suggested.
He noticed oversaturation doing this with mpv, which is the same I noticed when I tested the 3DLUT with madVR.

Is this expected? If not, what do we think is going wrong?
aron7awol is offline   Reply With Quote
Old 13th September 2021, 01:49   #2010  |  Link
aron7awol
Registered User
 
Join Date: Dec 2020
Posts: 109
Quote:
Originally Posted by huhn View Post
you have to use bt709 in/source and bt 2020 destination.

this way madVR is forced to do the gamut conversation to bt 709 to feed the 3D LUT.

now you set send bt 2020 and that should be it.
i'M on AMD i can't send bt 2020 so i can't test this.
This is an interesting idea, and makes sense as an approach.

I just tried it, but where I am unsure is what type of profile and tone curve I should be using. I tried a bunch of different combos of icms and tone curve settings, but gamma ended up way off in each case I tried.

For example, I tried Rec709 2.2 for source profile, and BT2020 ST2084 10000nit for destination profile, and I tried gamma 2.2, unmodified, and 2084 hard clip at 10000 nits as options for tone curve. All ended up with bad gamma.

Do I need a BT2020 gamma 2.2 icm for this? If so, I'm not sure where to get one.
aron7awol is offline   Reply With Quote
Old 13th September 2021, 01:58   #2011  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Posts: 320
Quote:
Originally Posted by aron7awol View Post
He noticed oversaturation doing this with mpv, which is the same I noticed when I tested the 3DLUT with madVR.

Is this expected? If not, what do we think is going wrong?
I think it is expected, converting to 709 is not the same as keeping 709 in 2020 container.

I've tested this out by reencoding the S&M benchmark but I don't know if the method is accurate to compare WCG.
The final video has the original WCG clip on the left, and the 709 on the right.

VapourSynth script:
Quote:
src_path = Path("SM.mkv")
src = core.ffms2.Source(src_path)

src = src.resize.Spline36(width=1920, height=1080)

src2 = src.resize.Spline36(matrix_in_s="chromancl", matrix_s="chromancl", transfer_in_s="st2084", transfer_s="st2084", primaries_in_s="2020", primaries_s="709")
src2 = src2.resize.Spline36(matrix_in_s="chromancl", matrix_s="chromancl", transfer_in_s="st2084", transfer_s="st2084", primaries_in_s="709", primaries_s="2020")

src = core.std.StackHorizontal([src, src2])
src = src.std.AddBorders(top=540, bottom=540)

src.set_output()
Encoded with x265:
Quote:
vspipe -y source.vpy - | x265_10 -D 10 --y4m --level-idc 5.1 --crf 12 --preset ultrafast --repeat-headers --aud --hrd --no-cutree --colorprim 9 --colormatrix 9 --transfer 16 --chromaloc=2 --hdr10-opt --master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(100000000,50)" --max-cll=10000,1616 --input - --output default.hevc
You can find a snippet of the video here: https://mega.nz/file/MY9xVYxQ#1MJO-T...QoH0w066adsHB4
At least to me it makes sense when playing on the TV.
__________________
LG OLED C8 | madVR 870 DPL HDR curve

Last edited by quietvoid; 13th September 2021 at 02:06.
quietvoid is offline   Reply With Quote
Old 13th September 2021, 03:51   #2012  |  Link
aron7awol
Registered User
 
Join Date: Dec 2020
Posts: 109
That S&M demo looks great! Thank you!
aron7awol is offline   Reply With Quote
Old 14th September 2021, 18:35   #2013  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 121
Quote:
Originally Posted by chros View Post
Especially the second is really amazing, no need to click around and wait to switch between PC and non-PC mode! Although it takes a second or so, just like when switching into/out from Game preset.
Does HDMI 2.0b banding happen there too? Or is that decoding correctly like in HDMI 2.1 FRL? As for colorGamut, you can change to BT.2020 for SDR BT.2020 primaries sources?

Last edited by Balling; 14th September 2021 at 18:59.
Balling is offline   Reply With Quote
Old 14th September 2021, 18:41   #2014  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 121
>converting to 709 is not the same as keeping 709 in 2020 container.

No, that is the same. LG will convert BT.2020 to 709 primaries by converting to whatever the display is (99% DCI-D65 or P3 or whatever including outside DCI for low luminance colors) for SDR. If we talking about HDR, of course better not to touch PQ.

Of course in practice keeping should be better unless LG really effed up somewhere with 3DLUT or BT.2087.

Last edited by Balling; 14th September 2021 at 18:45.
Balling is offline   Reply With Quote
Old 14th September 2021, 19:01   #2015  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,084
did you even try to understand what they are trying to do?
huhn is offline   Reply With Quote
Old 14th September 2021, 19:07   #2016  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 121
Quote:
Originally Posted by aron7awol View Post
This is an interesting idea, and makes sense as an approach.

I just tried it, but where I am unsure is what type of profile and tone curve I should be using. I tried a bunch of different combos of icms and tone curve settings, but gamma ended up way off in each case I tried.

For example, I tried Rec709 2.2 for source profile, and BT2020 ST2084 10000nit for destination profile, and I tried gamma 2.2, unmodified, and 2084 hard clip at 10000 nits as options for tone curve. All ended up with bad gamma.

Do I need a BT2020 gamma 2.2 icm for this? If so, I'm not sure where to get one.
There is a lot of things that are wrong with this. First of all there is no such thing as 2.2 gamma. You are supposed to use 2.4 gamma on OLED. If you file is a screen recording, you were supposed to tag it with screen profile, if it is sRGB, then use BT.709 primaries, sRGB transfer and BT.709 matrix (matrix should be the same as primaries for optimal code points utilisation). sRGB is not 2.2 gamma. That is just wrong. AdobeRGB is 2.2 gamma, just like one of older tranfers from H.273. To set correct sRGB curve you are supposed to use parametric curve encoding introduced in ICC v4, 3rd type: gamma = 2.399994 (just 2.4 actually but no perfect round), a = 0.947861, b = 0.052139, c = 0.077393, d = 0.040451. https://github.com/saucecontrol/Comp...4.icc?raw=true Same about BT.709, but as I said here 2.4 gamma is supposed to be used since PQ is display referred.

Next: you should set SDR white point. It is supposed to be 203 nits for 1000 nits container. Next, PQ should be correctly done. ICC only last year introduced PQ in ICC.

And last you need to color manage to BT.2020 primaries... matrix should also change from BT.709 to 2020-ncl and also you need to either present in RGB or YCbCr 444 or for the case of 420 change chroma siting from left to top left, using FIR.

Now after that you need to switch the display in HDR mode with BT.2020 primaries and output it.

Last edited by Balling; 14th September 2021 at 19:23.
Balling is offline   Reply With Quote
Old 14th September 2021, 19:39   #2017  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,084
so the answer is no...
huhn is offline   Reply With Quote
Old 15th September 2021, 06:17   #2018  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,084
Quote:
Originally Posted by Balling View Post
Does HDMI 2.0b banding happen there too? Or is that decoding correctly like in HDMI 2.1 FRL?
it happens with 1.4 too

Quote:
As for colorGamut, you can change to BT.2020 for SDR BT.2020 primaries sources?
yes and no LG does not use words like bt 709 or bt 2020.

Quote:
>converting to 709 is not the same as keeping 709 in 2020 container.

No, that is the same. LG will convert BT.2020 to 709 primaries by converting to whatever the display is (99% DCI-D65 or P3 or whatever including outside DCI for low luminance colors) for SDR. If we talking about HDR, of course better not to touch PQ.
why would they? he wants to clip/convert the gamut and beeen able to switch between both wide "bt2020" bt709 because converting bt 709 or bt 709 in bt 2020 are not the same

Quote:
Of course in practice keeping should be better unless LG really effed up somewhere with 3DLUT or BT.2087.
what has the EOTF to do with this if we just want to do gamut mapping?
Quote:
Originally Posted by Balling View Post
There is a lot of things that are wrong with this.
we will see...
Quote:
First of all there is no such thing as 2.2 gamma.
but there clearly is and that's actually needed for tone mapping.
Quote:
You are supposed to use 2.4 gamma on OLED.
gamma is a choice usually based on room lightning not a presentation technology. BTW. LG correctly sets to gamma 2.2 (you will not get is but that a different story)
Quote:
If you file is a screen recording, you were supposed to tag it with screen profile, if it is sRGB,...
no if he screen records or not this will not change the source characteristics in general if it is a video file with bt 709 it is even now sill bt 709 because nothing changed the sRGB in windows calibration is irrelevant for that.
Quote:
...then use BT.709 primaries, sRGB transfer and BT.709 matrix (matrix should be the same as primaries for optimal code points utilisation). sRGB is not 2.2 gamma. That is just wrong.
so where did anyone claim sRGB is gamma 2.2 while it uses gamma 2.2 it's starts flat giving it an effective gamma of ~2.4 but why would that matter for anything here at all. this is about using a TV with a video player where comes sRGB into the player?

Quote:
AdobeRGB is 2.2 gamma, just like one of older tranfers from H.273. To set correct sRGB curve you are supposed to use parametric curve encoding introduced in ICC v4, 3rd type: gamma = 2.399994 (just 2.4 actually but no perfect round), a = 0.947861, b = 0.052139, c = 0.077393, d = 0.040451. https://github.com/saucecontrol/Comp...4.icc?raw=true Same about BT.709, but as I said here 2.4 gamma is supposed to be used since PQ is display referred.
no gamma 2.2 is need if PQ tone mapping is needed because that's what is assumed as the source gamma. and if it would be any other gamma nothing would change because it's just for relativity as long as both the input and the assumption match the results is valid.
Quote:
Next: you should set SDR white point. It is supposed to be 203 nits for 1000 nits container. Next, PQ should be correctly done. ICC only last year introduced PQ in ICC.
you really have no clue what we are doing here right? this is completely irrelevant.
Quote:
And last you need to color manage to BT.2020 primaries... matrix should also change from BT.709 to 2020-ncl and also you need to either present in RGB or YCbCr 444 or for the case of 420 change chroma siting from left to top left, using FIR.
windows works in RGB so it doesn't matter what the chroma loc on the GPU driver is because the GPU driver is doing the chroma subsampling and as long as the GPU HDMI and the end device agree on the same chroma loc you are fine but you have no way to change this anyway.
Quote:
Now after that you need to switch the display in HDR mode with BT.2020 primaries and output it.
maybe now is a good timing to tell you that windows "can't" gamut map using icc files.

Last edited by huhn; 15th September 2021 at 06:59.
huhn is offline   Reply With Quote
Old 15th September 2021, 07:23   #2019  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,084
took me a couple of mins but here is a 3D LUT that should work.

i just run into an unexpected issue a bt 2020 profile with a bt 709 tone curve is created with gamma 2.6 in displaycal while a bt 709 profile with a bt 709 tone curve is created with 2.2 i was expectign it to be the same so it doesn't matter what the number is if that would be the case.

after i matched them it works "perfectly" now.
if you play a bt 709 and set madVR to this device is calibrated to bt 2020 or you use this 3D LUT you will get the "same" results.
it's not perfect there still seems to be a gamma difference in the 0.0x range if not 0.00x

but here you go:
https://drive.google.com/file/d/1MpU...ew?usp=sharing

not compressed i could not upload it for some reason if i do that.
huhn is offline   Reply With Quote
Old 15th September 2021, 19:06   #2020  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 121
"it happens with 1.4 too"

Do not have any hdmi 1.4 devices, only 2.0.

"and no LG does not use words like bt 709 or bt 2020."

On LG CX there is an override menu with it, so yes, they do.

"what has the EOTF to do with this if we just want to do gamut mapping?"

BT.2087 has indeed nothing to do with EOTF. Mostly. Though it indeed color manages on linear light.

"LG correctly sets to gamma 2.2"

The fact that it greys out gamma 2.2 means nothing. Yes, there are some appearance of underlying hacks of 2.2 gamma, but that is not an argument. As for "gamma is a choice usually based on room lightning not a presentation technology" you cannot do such a choice with PQ, not really, it is absolute and is meant to be looked in dark room. So there is no point, 2.4 gamma must be applied. Also, BT.1886 depends on presentation tech.

"not this will not change the source characteristics in general"

You are wrong. Use mpv with target-trc=srgb and you will see.

"while it uses gamma 2.2 it's starts flat giving it an effective gamma of ~2.4 but why would that matter for anything here at all."

Because sRGB uses 2.4 gamma internally with linear spline that makes it almost 2.2. Just like BT.709 OETF that is 1/0.45= 2.2222... gamma, yet is 1.961 gamma since it has a linear spline.

"windows works in RGB so it doesn't matter what the chroma loc on the GPU driver is because the GPU driver is doing the chroma subsampling and as long as the GPU HDMI and the end device agree on the same chroma loc you are fine but you have no way to change this anyway."

It is hard to make Windows work in YCbCr, but possible. You cannot control HDMI sample location. What I was talking about was SDR convertion of a source to top left chroma.

Last edited by Balling; 15th September 2021 at 19:37.
Balling 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 13:29.


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