Log in

View Full Version : Jaggy chroma help with YV12


Lyris
1st May 2010, 21:21
Hey everyone, this seems to be a basic that has totally escaped me for some time now. I've searched but can't find an answer to the problem.

Source: Blu-ray Disc, MPEG2, 60i, top field first.

Scenario: I am re-encoding some ~40mbps MPEG-2 files from a Blu-ray Disc with x264. The final output will be an BDMV structure for Blu-ray Disc (burned onto a DVD5). Naturally I am using x264 for the conversion.

Here is my script:

mpeg2source("cars.d2v")

Here is my x264 command line:

x264 --crf 16 --preset veryslow --weightp 0 --bframes 3 --nal-hrd vbr
--vbv-maxrate 14745 --vbv-bufsize 14745 --level 4.1 --keyint 30 --tff --b-pyramid strict
--slices 4 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 "%if%" -o "%of%"

Here is what I get out the other end, a problem I'm sure everyone is familiar with. Look at the mangled chroma, not the fact the colours are wrong (I'll deal with that later):

http://landofwhimsy.com/temp2/avcout.jpg

And here is the clean source:

http://landofwhimsy.com/temp2/mpeg2source.jpg

The question is, why is this happening? DGIndex is outputting YV12, my AVISynth script is outputting YV12, x264 is dealing with YV12 also, no? Why are any colour space conversions taking place at all and how do I stop this?

LoRd_MuldeR
1st May 2010, 21:27
Probably a playback/renderer issue.

Stephen R. Savage
1st May 2010, 21:47
This happens when you perform progressive chroma upsampling on interlaced YUV 4:2:0. The video is fine, your media player is just mangling it. The chroma positioning should be correct if you turn on deinterlacing. As for the color error, either your media player or DGIndex is using the wrong coefficients to convert to RGB. I suspect the culprit is DGIndex, but it's hard to say for sure without a reference.

There will always be at least one colorspace conversion because your display only accepts RGB input.

Guest
2nd May 2010, 01:42
As for the color error, either your media player or DGIndex is using the wrong coefficients to convert to RGB. I suspect the culprit is DGIndex, but it's hard to say for sure without a reference. DGIndex/DGDecode does not convert to RGB when serving the video through the Avisynth script.

Stephen R. Savage
2nd May 2010, 01:54
DGIndex/DGDecode does not convert to RGB when serving the video through the Avisynth script.

But it does when presenting the display window, which he is comparing the colors to.

Guest
2nd May 2010, 02:38
He's complaining about the colors in the encoded result, which has nothing to do with the DGIndex display window.

Lyris
2nd May 2010, 04:23
For the record, DGAVCindex is used in the screen shot above, and obviously DGindex for the MPEG-2 source.

I'll burn this to disc and test it in my standalone setup - thanks.

Lyris
2nd May 2010, 20:31
Whew, you're right. It's not present in the final encode. Thanks all!
Now to get to the bottom of the colour issue. Luckily I have a Klein K-10 (http://spectracal.com/klein-k-10.html) so I can actually measure off the screen from both sources for problem solving purposes.

henryho_hk
7th May 2010, 15:04
Try "ColorMatrix"