VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Member
    Join Date: Aug 2005
    Location: UK
    Search Comp PM
    Hi - i've tried for hours to make sense of how this command works, including using megui script creator, but i am just too thick.

    All i want to do is get rid of the top and bottom bars in a 16:9 HD recording of a 2.35 AR movie. Put another way, I want to resize 1920 x 1080 to 1280x544 and lose the black bars at the same time. I've managed to work out that the resize instruction (presumably) is LanczosResize(1280,720). But i've tried various crop commands [crop(x, x, x, x)] and none of them seems to work.

    I'd settle for just the script, but if anyone can explain the numbers - in words that a mere IQ of 130 (last time i looked) can understand - I'd be most grateful.
    Quote Quote  
  2. 1st "to resize 1920 x 1080 to 1280x544 and lose the black bars at the same time."
    LanczosResize(1280,720)
    crop(0, 88, 1280, 544)
    2nd there are multiple ways op use crop: http://avisynth.org/mediawiki/Crop
    3rd ' crop(0, 88, 1280, 544)' 0 since you don't want to change the width 88 since you want to change the height by 720-544 = 176 and 176/2 is 88, 1280 since you don't want to change the width, 544 since you want this to be the output height.
    4nd alternatively you could use the 'Crop(int left, int top, int -right, int -bottom)' syntax, which would give you
    Crop(88, 0, 88, 0)
    first number = crop from the left side
    second number = crop from top side
    third number = crop from right side
    forth number = crop from bottom side

    Cu Selur
    Quote Quote  
  3. Member
    Join Date: Aug 2005
    Location: UK
    Search Comp PM
    Thanks Selur. I followed the link, but could not make head or tails of the numbers in the second example, maybe because i didn't understand the Reduceby2 command. Anyway, i digress.

    I DO understand your first example and the explanation of the figures you have used although it seems very complicated.

    I thought i'd already tried Crop(88, 0, 88, 0) and it didn't work. However, i have been using the crop command before the resize command, and possibly i used Crop(0, 88, 88, 0). It seemed megui script creator preferred this order.

    After sheer trial and error, i found that
    crop(0, 138, 0, -138)
    LanczosResize(1280,544)
    seems to work.

    Out of interest, is there a best method for this example?
    Quote Quote  
  4. After sheer trial and error, i found that
    crop(0, 138, 0, -138)
    LanczosResize(1280,544)
    seems to work.
    that is the other way.
    It depends what you want to do first: crop or resize
    before I used first resize and than crop since you said you wanted to " resize 1920 x 1080 to 1280x544 and lose the black bars at the same time" and not loose the black bars and than resize to 1280x544.

    Personally I would crop first (which ever syntax you prefer) and then resize, but it really should normally not make much of a difference.
    (+ I don't like LanczosResize, I prefer GaussResize )
    Quote Quote  
  5. Member
    Join Date: Aug 2005
    Location: UK
    Search Comp PM
    Right, i thought perhaps mod 16 factors might affect which method to use. (I have no idea what i mean by that)

    Is GaussResize a simple alternative command, i.e. a direct replacement for LanczosResize or does it need other parameters?
    Quote Quote  
  6. GraussResize has the same syntax as LanczosResize, see: http://avisynth.org/mediawiki/Resize
    Quote Quote  
  7. Member
    Join Date: Aug 2005
    Location: UK
    Search Comp PM
    OK thanks. I'll give it a go.
    Quote Quote  
  8. Originally Posted by Bully9 View Post
    I thought i'd already tried Crop(88, 0, 88, 0) and it didn't work.
    For reasons which you discovered later on, right? The second pair, when resizing that way, has to be negative (except for any zeros). Also, your '88s' in that example refer to the left and right crops, not top and bottom. It should be:

    Crop(0,88,0,-88)

    crop(0, 138, 0, -138)
    LanczosResize(1280,544)
    That's how I do it too, crop first before the resize and the second pair of numbers is negative.

    If you'd like a video picture to guide you in doing the cropping and resizing, I open the basic script in Gordian Knot (or a D2V if it's a DVD) and crop and resize in there. It even gives you the script for the crop and resize operation when you're done. It's quite simple actually. Also, you can get the right crop values (but not the resize) in VDub by adding the Null Transform filter, followed by the Crop filter. Again, you'll have the video to guide you as you crop.
    Quote Quote  
  9. DOH, overlocked the minus
    Quote Quote  
  10. Crop first, then resize. Because a sharpening resize filter like Lanczos will create a row of brighter pixels between the black border and the picture.
    Quote Quote  



Similar Threads