View Full Version : avisynth cropping and resizing
AdeptEnc
13th November 2004, 04:55
I have read many dvd to .avi Xvid guides recently and they almost all use avisynth for cropping and resizing.
I cannot get Avisynth to properly crop - it resizes fine. I checked my scripts and when I preview them, they are written correctly - the cropping is fine. But when I do the first and second pass in Vdub, they never crop correctly. I finally just used Vdub to crop, and it worked fine everytime.
Why does everyone crop and resize in Avisynth when Vdub does it just fine??
Any suggestions??
thanks
Ark
13th November 2004, 09:27
Because cropping in Avisynth is fine. (And it's much better do all processing/filtering in one program than do it on several)
It's also faster, and you don't have to convert your video to RGB just to do simple cropping!
I don't know why on your machine it doesn't work, but if you post a screen of the "right" Avisynth cropped image (before encoding) ando one screwed up we can try to understand where the problem is.
AdeptEnc
13th November 2004, 09:39
this is my script:
*****
LoadPlugin("F:\dgmpgdec1012\DGDecode.dll")
MPEG2source("H:\[sv]-push-dvdrip-2004-ade\push.d2v")
Crop(10, 4, -6, -4)
LancZosResize(640,480)
*****
in these particular .vobs, there is a lot of white on one side - I crop it out in Vdub, write down the pixels, enter into script, check .avs file and the white is cropped out, set-up and run Vdub, crops nothing at all, ONLY take out the cropping line in the script, re-set-up Vdub with cropping this time, encode = fine. I tried writing the script several different ways - without spaces, different numbers (larger to make sure for cropping), etc.
I don't know what a 'screen' is or how to make one (unless you mean print screen - which I don't know how that would help figure the problem out).
Another question about your post - when I am cropping with Vdub, what is this about converting to RGB?? If I am using the Vdub (VirtualDubMod_1_5_10_1_All_inclusive) crop, is it doing some kind of color conversion that avisynth wouldn't??
thanks for the help!
Ark
13th November 2004, 09:54
Originally posted by AdeptEnc
I don't know what a 'screen' is or how to make one (unless you mean print screen - which I don't know how that would help figure the problem out).
Another question about your post - when I am cropping with Vdub, what is this about converting to RGB?? If I am using the Vdub (VirtualDubMod_1_5_10_1_All_inclusive) crop, is it doing some kind of color conversion that avisynth wouldn't??
thanks for the help!
Yes, i mean do a "print-screen".
However, when you use a filter in VDub, you're forced to use "Full Recompress" mode. Since VDub filters works in RGB mode, a connversion is needed to use them, and is (1) a waste of time and cpu cycles, and (2) a waste of bits, because mpeg2 is stored in YV12 color space, which contain much less color information (less bits to compress) and it's faster.
The right way is doing all cropping/resizing/filtering in Avisynth, encode in VDub using "Fast Recompress" mode, which will not do any color space conversion.
Mug Funky
13th November 2004, 10:17
actually, you'll most likely get a slightly smaller encode if you go YV12->RGB->YV12. the conversion will blur both luma and chroma very slightly.
the big deal is loss of quality and unnecessary CPU load.
i have no idea why the cropping isn't working properly though :confused:
try using something different to decode to YV12. xvid will usually register itself to do this, i think (my registry is so hacked at this point that i honestly can't tell). to reg-hack it, open regedit, search for "vidc." and when you find the part with all the codecs listed and their fourcc's, add a new string value called "vidc.YV12" and point it to "xvid.ax" or whatever xvid is using. you could probably also use ffdshow for this (i think that's what i'm doing?).
Chainmax
13th November 2004, 10:30
Or he could just install the Helix YV12/I420 codecs (http://forum.doom9.org/showthread.php?s=&threadid=56972&highlight=yuvcodec).
AdeptEnc
13th November 2004, 10:49
So, when you are using Vdub - ideally you would never use ANY filters, correct?
Next, I can make print screens if that will help, but what images should I capture?
thanks again :)
Mug Funky
13th November 2004, 11:04
that's right :) i just use it for previewing, script editing (virtualdubmod has a great avs script editor), and encoding. everything else is avisynth.
as for screen-grabs, try posting a good one and a bad one :) one before encoding where there's no probs, and one after (by opening the encoded file).
AdeptEnc
13th November 2004, 11:26
This question I'm sure is unrelated, but in another post I have in another forum, someone told me I should be using "fast recompress" in Vdub, but all the guides I have read say to use "Full Processing"...
could this have anything to do with my cropping?? (I have always used Full Processing.
thanks!!!
Ark
13th November 2004, 12:31
Originally posted by AdeptEnc
This question I'm sure is unrelated, but in another post I have in another forum, someone told me I should be using "fast recompress" in Vdub, but all the guides I have read say to use "Full Processing"...
could this have anything to do with my cropping?? (I have always used Full Processing.
thanks!!!
As i said, using Full processing auto-converts your video from whatever it was to RGB colorspace, and it's IMHO a waste of time and quality.
So try using Avisynth cropping and encode with Fast recompress, maybe your problem is there.
OR
you can try with other encoding programs like AVS2AVI, a little bit more complicated (but not with the simple drop-GUI provided by the author), but doing so you can check if the problem is in Avisynth or VDub.
Leak
13th November 2004, 13:03
Originally posted by Ark
you can try with other encoding programs like AVS2AVI, a little bit more complicated (but not with the simple drop-GUI provided by the author), but doing so you can check if the problem is in Avisynth or VDub.
Well, since AVS2AVI is basically VirtualDub with the GUI and the filtering ripped out, I'm not sure it'll behave differently.
Still - AdeptEnc, have you tried using really unreasonable values for cropping to see if it really doesn't work at all, like crop(100,100,-100,-100)? I couldn't think of any way that the crop couldn't be showing up in the final encode, as there is just no way that VirtualDub can reconstruct the parts a crop in AviSynth trims off since the cropped image is all it has to work with... :confused:
np: Triola - Wanderlust (Im Fünftonraum)
AdeptEnc
13th November 2004, 18:07
[QUOTE]Originally posted by Leak
have you tried using really unreasonable values for cropping to see if it really doesn't work at all, like crop(100,100,-100,-100)? I couldn't think of any way that the crop couldn't be showing up in the final encode, as there is just no way that VirtualDub can reconstruct the parts a crop in AviSynth trims off since the cropped image is all it has to work with...
Yes, I have tried using unreasonable number input, in fact I think I even tried those exact numbers)... I preview the script in WMP6, and YES the cropping and resizing works fine. I set-up Vdub, and cropping does NOT work and resizing DOES work.
I'm going to try and post some screen shots later...
thanks again
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.