Log in

View Full Version : What colorspace am I left with after encoding?


jriker1
16th February 2008, 15:22
I have a YUY2 colorspace Lagarith encoded AVI file that I converted to MPEG2 NTSC in CCE. The AVISynth script I used was:

avisource("I:\converted\HHGTTG cleaner.avi" , audio=false, pixel_type = "YUY2", fourCC="LAGS")

What do I have then for the resulting MPEG2 file? Is it RGB32 or YUY2 or what? Heard you can only have RGB colorspace for MPEG2, but not sure that's true.

Thanks.

JR

Guest
16th February 2008, 15:33
It's 4:2:0 YUV, also known as YV12.

jriker1
16th February 2008, 16:04
It's 4:2:0 YUV, also known as YV12.

That's what I figured. There is no way around that I assume right? I notice that the blackest black in the video seem lighter than the original, and the video seems to have a white haze over it. More noticable in certain scenes. Also should I use some kind of color converter in AVISynth to convert it to YV12 before it gets to CCE? Will that produce better results?

I know in CCE there is an advanced setting for Luminance Level which defaults to 16-235. Thinking maybe setting it to 0-255 may produce more accurate colors but not sure.

JR

45tripp
16th February 2008, 17:39
Also should I use some kind of color converter in AVISynth to convert it to YV12 before it gets to CCE? Will that produce better results?

yes


I know in CCE there is an advanced setting for Luminance Level which defaults to 16-235. Thinking maybe setting it to 0-255 may produce more accurate colors but not sure.

no.
it's only for rgb input anyway

gl

jriker1
16th February 2008, 18:49
Here is what I have so far. And keep in mind this footage is dubbed originally to DV from a S-VHS so not sure how black the blacks will be anyway.

- Source AVI 4:2:2 - Blacks are dark dark grey
- Converted to MPEG2 thru CCE - Blacks look like they have a slight green tint to them.
- Converted to MPEG2 thru CCE with ConvertToYV12() in AVISynth script - Blacks look a bit brown.

Not sure which is the better of two evils yet, or if there are better options that ConvertToYV12() or straight CCE encoding to convert 4:2:2 - 4:2:0. Note I have Sony Vegas as my primary editing environment if that matters.

You need to look at the following more on a standard TV to really make out the differences, however in the picture:
- Top bar is true black
- Background is the source 4:2:2
- Box on the left is the MPEG2 conversion thru CCE
- Box on the right is the MPEG2 conversion thru CCE using ConvertToYV12()

http://img152.imageshack.us/img152/4484/blackrj0.jpg

Also wouldn't this from AVISynth's site contradict the above comment that CCE converts to YV12 on output? How can it do that if AVISynth site claims it can't even handle it as input.

http://avisynth.org/mediawiki/FAQ_YV12#How_do_I_use_v2.5x_if_the_encoding_programs_can.27t_handle_YV12_.28like_TMPGEnc_or_CCE_SP.29.3F

Thanks.

JR

45tripp
17th February 2008, 04:10
sorry, somehow misread.
feed cce with yuy2

jriker1
17th February 2008, 18:58
sorry, somehow misread.
feed cce with yuy2

But the ending output will still be YV12 right? Still think it's funny how CCE can't handle YV12 as input even though it's the tools final output format.

JR

PhillipWyllie
20th February 2008, 02:26
MPEG-2 is always in the YV12 colour-space. You couldn't post a sample of the video you're having and a sample of your script so people can try and replicate your problem. I've never had problems with CCE and black(if the black in the video is really black). A colour with a luminance value of 0, or 16 is (almost) indistinguishable to the naked eye.

According to Photoshop the luminance values in your sample picture are top-bar=~5, source=~19, CCE conversion=~23, and Avisynth conversion=~22. I tried saving a pure black image in Photoshop to a jpeg(medium quality) and the luminance was 1, with the lowest quality settings the luminance was 0.

I encoded two short MPEG-2's using a pure black source, one with converttoyuy2, and the other without(using 16-235 as luminance range). I then opened the videos in VDubMod and saved a BMP picture(using a B-frame) to compare in Photoshop. both the resulting pictures were pure-black.

I'd submit that your "black" isn't black

Guest
20th February 2008, 02:43
MPEG-2 is always in the YV12 colour-space. That is not true.

http://neuron2.net/library/mpeg2/iso13818-2.pdf
(Section 4.1.5)

PhillipWyllie
20th February 2008, 03:06
Sorry, I "meant" to say "CCE always outputs YV12 MPEG-2". :)

jriker1
20th February 2008, 03:43
You couldn't post a sample of the video you're having and a sample of your script so people can try and replicate your problem.

My script was listed earlier in this thread. It's a simple single line AVISource command. Nothing fancy. As for uploading a sample, forum doesn't support video files as attachments. Let me know where I can post one and I'll be glad to do so.

I'd submit that your "black" isn't black
I think I said that already earlier in the thread, however perhaps you were just confirming this. My issue is not necessarily that black is black. It's grey isn't the same grey and yellow isn't the same yellow, and orange isn't the same orange, etc. CCE seems to have washed out yellows, and the grey/black that I have in the image is not perfectly reproduced. It's down right quite off from the original.

Also I posted this in another thread compairing encoders, however here is the same deal comparing what CCE does compared to ProCoder. ProCoder seems more accurate in it's color representation.

http://img520.imageshack.us/img520/7067/comparequ1.jpg
JR

Guest
20th February 2008, 04:49
As for uploading a sample, forum doesn't support video files as attachments. Let me know where I can post one and I'll be glad to do so. http://forum.doom9.org/showthread.php?t=96362

Boulder
20th February 2008, 05:09
@jriker1: You might want to check out the ColorMatrix filter. There's a long thread about it in the Avisynth usage forum.