View Full Version : Avisynth 2.5 beta, YV12 and cropping
emilytzgyr
29th January 2003, 11:50
Hi,
I thought I give the new avisynth 2.5 beta a try. I installed it as it was said in the FAQ. When I open the avs file in VDubMod, it says "YUV images can only be cropped by even numbers". But I thought the new ayisynth works in YV12 colorspace and not YUV? Of course it wouldn't be a problem to crop by even numbers, but I just wondered. Here is my script:
LoadPlugin("E:\ANWEND~1\DVD_VI~1\GORDIA~1\mpeg2dec3.dll")
mpeg2source("E:\DVD\Grand Canyon\Grand Canyon.d2v")
crop(7,2,706,476)
BilinearResize(640,480)
BTW: I can easily open the script in the original VDub. Shouldn't that be impossible?
sh0dan
29th January 2003, 11:51
YV12 is an YUV colorspace (just as YUY2 is).
IanB
29th January 2003, 13:46
emilytzgyr,
Of course you could always use the "free ride" cropping feature of the
resize filters for odd numbers. E.g.
LoadPlugin("E:\ANWEND~1\DVD_VI~1\GORDIA~1\mpeg2dec3.dll")
mpeg2source("E:\DVD\Grand Canyon\Grand Canyon.d2v")
BilinearResize(640,480, 7.0, 2.0, 706.0, 476.0)
Note: The cropping numbers are FLOATS :D and can be
fractional which weights the edge pixels to get an accurate result.
IanB
bond
29th January 2003, 16:07
i also got this message when i wanted to open my old .avs scripts (also using the updated filters of course)
the crop feature in avisynth2 didnt show this message, why has this changed?
emilytzgyr
29th January 2003, 16:09
Thanks IanB,
this is cool. I didn't know that.
jang0
29th January 2003, 16:21
Originally posted by bond
i also got this message when i wanted to open my old .avs scripts (also using the updated filters of course)
the crop feature in avisynth2 didnt show this message, why has this changed?
i think it is the case because yv12 stores one chroma value for 4 pixels (chroma is downsampled vertically and horizontally by 2) and therefore the video must be always mod2 (height & size dividible by 2)
bond
29th January 2003, 17:13
thanks :)
Josip Tosic
29th January 2003, 17:27
So there's no way to have pixel aspect ratio error of %0,00 now? I mean, O.K. we can still use resize filters to crop the video first but it'll slow down IVTC, right?
My approach to DivX encoding can be summed up by "crop first, ask questions latter" motto. :)
WarpEnterprises
31st January 2003, 23:37
@IanB
The cropping numbers are INT.
source:
AVSValue __cdecl Crop::Create(AVSValue args, void*, IScriptEnvironment* env)
{
return new Crop( args[1].AsInt(), args[2].AsInt(), args[3].AsInt(), args[4].AsInt(),
args[0].AsClip(), env );
}
sh0dan
31st January 2003, 23:52
@WE: Sorry, but for resample functions they are float:
{ "PointResize", "cii[src_left]f[src_top]f[src_width]f[src_height]f", Create_PointResize },
{ "BilinearResize", "cii[src_left]f[src_top]f[src_width]f[src_height]f", Create_BilinearResize },
{ "BicubicResize", "cii[b]f[c]f[src_left]f[src_top]f[src_width]f[src_height]f", Create_BicubicResize },
{ "LanczosResize", "cii[src_left]f[src_top]f[src_width]f[src_height]f", Create_Lanczos3Resize},
The latter "f" shows float - furthermode, the args are passed an array, and parsed as floats.
WarpEnterprises
1st February 2003, 00:15
Now I read the other thread...
{ "Crop", "ciiii", Crop::Create }
So this is maybe the only real world difference Crop / Resize-Crop
Sum-up for non-C++-freaks:
Crop has to be used with integers as arguments
xxxResize can crop with floats
IanB
2nd February 2003, 11:45
> So this is maybe the only real world difference Crop / Resize-Crop
And a very important difference it is to. Without the fractional crop inputs to the
xxxResize lots of things like odd factor YV12 and Bob etc would not be possible.
IanB
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.