View Single Post
Old 6th July 2018, 16:01   #12  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by TlatoSMD View Post
But I hope it's at least understandable how a video can be encoded in such a color space that it looks alright on an RGB monitor without any corrections, but too green and yellowish when outputting it to a YUV monitor or doing a standard YUV --> RGB gamma fix in VLC?
The levels have to be expanded on playback.
The LCD PC monitor I bought a while ago doesn't default to full range luminance levels. It expected limited range levels unless you tell it otherwise. Maybe as PC monitors are often connected to something other than a PC these days, manufacturers have decided it's less hassle for the HDMI inputs to default to limited range?

For x264, the colorimetry is written to the video stream if you tell it to write it, and in theory a player should pay attention to that, otherwise it'll probably use Rec.601 for SD and Rec.709 for HD.

Here's a pixel shader for MPC-HC. It was originally designed to fix a graphic driver problem, but I fiddled with it so it'll work for any source. It converts Rec.709 to Rec.601, so if you have standard definition that's Rec.709 and the player's using Rec.601, it'll display correctly. The standard PC-TV level shaders are also in the zip file. https://files.videohelp.com/u/210984/Shaders.zip

Quote:
Originally Posted by TlatoSMD View Post
Understanding that in order to get away from the green and yellow tint that I get from the gamma correction in VLC, I knew I needed more red and blue, but not more green. Since the values for green are the largest for each format, I figured I'd go 1 minues (value). Trying the values for 601, the result was a dark purple image, which couldn't be right because the image has to be brighter, just like when I use global gamma and set it from 10 to 9. So figuring that Y aka green is the "standard" in YUV against which the other two colors are compared, I raised the green gamma from its computed position up to the default 1.00 and added the same number to the other two channel gammas. That looked better, so I rendered the result to HDD and looked at it in VLC plus gamma correction, and found the thing was still much too red, even though the global gamma fix in VLC did still make it a bit greener.
Don't forget, if you upscale or downscale and don't write the colour to the video stream the player will use different co-efficients according to the resolution.

As has been pointed out, TV vs PC levels and rec.709 vs Rec.601 are two different things. The difference between Rec.709 and Rec.601 isn't huge. The wrong levels will either make the picture look too dark or a bit "washed out".
I have an old version of VLC installed but it seems to be outputting full range levels. If you're using a HDMI input, does it expect full range levels?
If the video looks okay when played with a standard player connected to a standard TV, it'll be fine. They should expect limited levels and the TV will expand them to full range.

For the record, colourspace conversion can be done in Avisynth like this:
ColorMatrix(mode="Rec.709->Rec.601", clamp=0)
Levels conversion:
ColorYUV(Levels="TV->PC")
But seriously.... don't convert the levels unless you really know you need to. The problem probably isn't the video itself, but it's the encoding or playback stage where it's going wrong. Most likely playback. A monitor's HDMI inputs may default to full range or limited range, DVI will probably be full range and VGA is full range. Of course you should check there's no picture enhancing crap enabled in your video card's control panel. It may be doing horrible things.

Last edited by hello_hello; 6th July 2018 at 16:09.
hello_hello is offline   Reply With Quote