View Full Version : Problem with Levels at 10 bits
rgr
21st March 2023, 01:28
Why does those scripts give the correct colors?
ffms2("2022_12_30 12_44_13.mp4")
convertbits(bits=10)
levels(64,1,1019,0,1023,coring=false,dither=false)
converttorgb64(matrix="PC.709")
ffms2("2022_12_30 12_44_13.mp4")
convertbits(bits=10)
levels(64,1,1019,64,940,coring=false,dither=false)
converttorgb64(matrix="709")
Why does this script produce distorted colors (especially green)?
ffms2("2022_12_30 12_44_13.mp4")
convertbits(bits=10)
levels(64,1,1019,64,940,coring=false,dither=false)
Tested on MPC-HC with MPC-VR renderer.
FranceBB
21st March 2023, 13:57
It's a bit hard to say without the source...
On paper, what you're doing is taking a 10bit planar source in Limited TV Range (supposedly) 64-940 with overshooting beyond the 0.7V region (so over 940) and doing a soft highlights rollback from 1019 to 940.
And, sure enough, that's exactly what's happening:
ColorBars(848, 480, pixel_type="YV24")
ConvertBits(10)
levels(64,1,1019,64,940,coring=false,dither=false)
https://i.imgur.com/IPtBMAb.png
Now, your first script is wrong.
ConverttoRGB64(matrix="PC.709")
means that you're treating your YUV input as Full PC Range, however it's not as you're LITERALLY providing a Limited TV Range YUV, therefore what happens is that you end up with an RGB that has the wrong levels as it will be considered already full range and it won't convert. In other words, you end up with something called Studio RGB which is RGB in Limited TV Range and, although some studios do use it (I'm looking at you, Warner), unless you know what you're doing and the whole supply chain is aware of this, it will almost definitely NOT be decoded correctly. This is because, by standard, RGB is always Full PC Range, therefore you need to tell ConverttoRGB64 that what you're providing in YUV is in Limited TV Range so that it can expand the values from limited to full like so:
ConverttoRGB64(matrix="Rec709")
https://i.imgur.com/liTAXFi.png
and of course, although the blacks are "touching the ground" as they're starting at 0, the whites are not "touching the sky" as you performed the rollback through Levels().
Nothing wrong here...
Perhaps it's your source... share and we'll see...
poisondeathray
21st March 2023, 15:06
Maybe MPCHC + MadVR are using different RGB conversion ? Maybe some issue with flagging or passing props causing different conversion ? What does PropShow say ?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.