Log in

View Full Version : Colour difference?


EncodedMango
15th January 2014, 03:28
Hi there, recently I was playing with some game footage to practice some encoding and I'm having an issue, the colour of the original and the colour of the encoded file are different.

Original:
http://i.minus.com/i6CQrwhyfMupD.jpg

Encoded:
http://i.minus.com/ibsTwpUUQrJENx.jpg

The source video 720p, lossless RGB, and I use MPC-HC with madVR as video player so I don't think it can be a renderer issue.

My settings are:
CRF18, Very slow
--level 4.1 --keyint 30 --open-gop --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --output-csp i444

What could be the issue? I tried to make sure the colourmatrix wasn't the issue, and the output was without chroma subsampling but still there still seems to be an issue and I'm out of my depth.
Thanks.

vivan
15th January 2014, 03:50
x264 uses rec601 for rgb -> yuv conversion. Use avisynth for it.
Or you can change bt709 to bt470bg but that will work only with madVR, since other renderers are broken and ignore those flags.

EncodedMango
15th January 2014, 04:13
x264 uses rec601 for rgb -> yuv conversion. Use avisynth for it.
Or you can change bt709 to bt470bg but that will work only with madVR, since other renderers are broken and ignore those flags.
I just tried bt470bg and it worked! Thanks for that one.

But like you mentioned, it will only work with madVR so it isn't an ideal option. I've never used Avisynth, what exactly are you suggesting I use it for?

EDIT: I just checked with MediaInfo and the encoded file shows:
http://puu.sh/6lo6q.png
Is this normal? I set bt470bg for all of them when encoding

poisondeathray
15th January 2014, 04:34
He' s suggesting to use avisynth for the RGB=>YUV conversion using a Rec709 matrix instead of the Rec601 that x264 uses. So you don't have to rely on madvr or flags (but you should still flag it bt709)

ConvertToYV24(matrix="rec709")

EncodedMango
15th January 2014, 04:54
He' s suggesting to use avisynth for the RGB=>YUV conversion using a Rec709 matrix instead of the Rec601 that x264 uses. So you don't have to rely on madvr or flags (but you should still flag it bt709)

ConvertToYV24(matrix="rec709")
Not PC.709?

I'll try it out, thanks.

poisondeathray
15th January 2014, 05:27
Not PC.709?




PC matrix would actually be better quality wise (you're "mapping" 0-255 RGB to 0-255 Y'CbCr, instead of 0-255 to 16-235 Y' , 16-240 CbCr), but the majority of setups will convert back to RGB for display using Rec709 matrix and the levels will look incorrect. But the setups that obey full range flags will decode it correctly if you used a PC matrix for the actual RGB=>YUV conversion

The other option is to encode as RGB, but it's not as efficient as YUV 444 encoding for x264

EncodedMango
15th January 2014, 11:52
So after reading a lot of things about Avisynth today I finally tried what you suggested, ConvertTo function and it seems to have worked, thank you, everyone.