PDA

View Full Version : Colors and objects are not in same place


olfab
2nd July 2004, 21:57
Hi.
I just started working with Gordian Knot. Could solve all problems myself I ran into except this one: If you take a look at the attached picture you know what I mean.
http://img29.exs.cx/my.php?loc=img29&image=pic47.jpg
I guess it is an issue with the colorspace (YV12?) but I'm not sure and don't know how to solve it either.
Hope someone can help me.

Thanks, Oliver

Asmodian
3rd July 2004, 02:36
Please post your avs (avisynth script).

manono
3rd July 2004, 09:31
Hello and welcome to the forum-

It's not a colorspace issue. It could be a number of things, including a cropping problem, or deinterlacing, or perhaps something else. But as Asmodian says, we'll need a look at the .avs. When you post it, please leave off all the lines beginning with "#", since they don't do anything.

olfab
3rd July 2004, 12:33
Here's my .avs file without the lines starting with #:

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\undot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\KernelDeInt.dll")
mpeg2source("C:\DVD\Projects\test01\test01.d2v")
crop(10,2,704,568)
KernelDeInt(order=1,sharp=true)
LanczosResize(544,400)
Undot()

Oliver

manono
3rd July 2004, 13:42
Hi-

Either move the Crop below the KernelDeint line, like so:

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\undot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\KernelDeInt.dll")
mpeg2source("C:\DVD\Projects\test01\test01.d2v")
KernelDeInt(order=1,sharp=true)
crop(10,2,704,568)
LanczosResize(544,400)
Undot()

or crop the top and bottom by Mod 4 (in multiples of 4), like so:

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\undot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\KernelDeInt.dll")
mpeg2source("C:\DVD\Projects\test01\test01.d2v")
crop(10,4,704,568)
KernelDeInt(order=1,sharp=true)
LanczosResize(544,400)
Undot()

I recommend the first way. When deinterlacing in the YV12 colorspace (so it is sort of a colorspace problem after all), you have to crop vertically by multiples of 4. Please see this for more information:

http://www.avisynth.org/Crop

olfab
3rd July 2004, 20:30
This works, thank you.

I understand how the second solution works. But why does the first one work. What is so important about the oder of these two lines?

Oliver

manono
4th July 2004, 18:54
Hi-

You cropped first and you didn't crop Mod 4. Take the upper crop. It was of two lines. But if you had read the link I posted above, and gone to the page to which it linked:

http://www.avisynth.org/DataStorageInAviSynth,

then you would have come across this:
4 pixels share the color data. These four pixels are a 2x2 matrix, i.e. two pairs on adjacent lines in the same field. As fields themselves are interleaved, this means that for fieldbased video line 1&3 share color data, as well as line 2&4.
So you need 2 lines from each field to get the complete color information. By cropping only 2 pixels from the top, you cut out lines 1 and 2, and left lines 3 and 4 of the 4 line set needed to convey all the color information. Remember, when interlaced, there are 2 different fields involved, and you need lines 1 and 3 from the top field to get the complete color information for it, and you need lines 2 and 4 to get the color info for the bottom field. Got it? Clear as mud?

Once you deinterlace, it becomes progressive, or frame based, and you're back to needing only 2 lines to convey the color information. And that's why it's safe to crop 2 pixels if the Crop is placed after the Deinterlace.

This isn't entirely your fault. I blame GKnot for not putting the crop after the deinterlace. Or maybe the developers give everyone too much credit for understanding all this esoteric mumbo-jumbo.

olfab
6th July 2004, 00:31
Once you deinterlace, it becomes progressive, or frame based, and you're back to needing only 2 lines to convey the color information. And that's why it's safe to crop 2 pixels if the Crop is placed after the Deinterlace.
Now I got it. Deinterlacing makes it progressive. I read the link but didn't see the connection.

Thanks again,
Oliver