VideoHelp.com Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Member
    Join Date: Jun 2009
    Location: Hong Kong
    i'm trying to write avisynth script for making LanczosResize in virtualdub, however the virtualdub will automatically close when i opened the avs file in virtualdub, below is my avs script and the video source is DVD (NTSC 16:9, 720x480), i just want to convert it to avi format, i think that 720x405 (16:9) is the right display ratio, after that, i have searched some articles about the resizing, someone used 720x404 for resizing the video, then i tried to open the avs file in virtualdub by this display ratio, it works!!! so does any one ans me what's the problem of my avs script, it seems the problem is come from the display ratio...please help, thanks...

    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Decomb.dll")
    MPEG2Source("C:\test.d2v") <--- generated by DGindex 1.55
    Telecide(post=0, guide=1, blend=false, show=false)
    Decimate(cycle=5, quality=3, mode=3)
    Crop(0,6,720,468)
    LanczosResize(720,405)
    Quote Quote  

  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date: Aug 2000
    Location: Sweden
    I guess the size must divisible even by at least 2 or the best is probably divisible by 16. So 405=202.5 = not even. Try instead 404,406 or best 400.
    Quote Quote  

  3. But since you've cropped away the black bars to the tune of 6 rows from the top and 6 rows from the bottom, it's not a 1.78:1 movie but more like 1.85:1 and it should be resized to 720x384:

    LanczosResize(720,384)

    As Baldrick says, you should usually resize to Mod16 (height and width divisible by 16). Your original 405 is completely wrong. No YV12 source (like DVDs) can be resized to an odd number.
    Quote Quote  

  4. Member
    Join Date: Jul 2009
    Location: Spain
    Which version of Avisynth are you running?
    You should have got an error message:
    "Resize: YV12 destination height must be multiple of 2."
    instead of crashing VDub.

    Note that for interlaced sources, a multiple of 4 is needed (though Avisynth won't enforce that), so 406 would also be wrong. In fact, if your source is interlaced (you don't say), your crop would have to be mod4 too, cropping 6 lines is going to reverse the field dominance.
    Quote Quote  

  5. Member
    Join Date: Jun 2009
    Location: Hong Kong
    thanks for your helping all guys...

    oh, i think i'm wrong, Is YV12 destination height should be divided by 2 or 4 to get integer number?

    i'm using ver 2.52 of avisynth, nothing message i have got, it just automatically close when i open the avs file. my DVD source is Interlaced video, so i should amend the height to be divisible by 4 if it is an interlaced video? am i right?

    i have yet another question is that my understanding of resizing rule (for 16:9 video) is width and height should be divisible by 16 and 9 respectively, is it right? or this rule cannot be applied in YV12 format?

    below is my amended avs script: (it works very well in vdub and i cross out the cropping script)

    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Decomb.dll")
    MPEG2Source("C:\test.d2v")
    Telecide(post=0, guide=1, blend=false, show=false)
    Decimate(cycle=5, quality=3, mode=3)
    LanczosResize(720,404)
    Quote Quote  

  6. Member
    Join Date: Dec 2005
    Location: none
    Originally Posted by Gavino
    YV12... if your source is interlaced (you don't say), your crop would have to be mod4 too, cropping 6 lines is going to reverse the field dominance.
    Even worse, the luma channel will still have the same field dominance, but the chroma channels' field dominance will be reversed. So the wrong colors will be applied to the two fields.
    Quote Quote  

  7. Originally Posted by okman
    i'm using ver 2.52 of avisynth, nothing message i have got, it just automatically close when i open the avs file.
    Upgrade your AviSynth.
    my DVD source is Interlaced video
    After the IVTC it's no longer interlaced.
    so i should amend the height to be divisible by 4
    For encoder efficiency both height and width should be divisible by 16. But once made progressive they only have to be divisible by 2.
    Quote Quote  

  8. Member
    Join Date: Jul 2009
    Location: Spain
    Originally Posted by okman
    oh, i think i'm wrong, Is YV12 destination height should be divided by 2 or 4 to get integer number?
    The minimum requirement is height/2 should be an integer.
    If interlaced, then same goes for height/4.
    And for encoding purposes it is recommended that height/16 be an integer too.
    i'm using ver 2.52 of avisynth, nothing message i have got, it just automatically close when i open the avs file.
    You should upgrade to the latest version 2.58, which is more robust and does more error checking, as well as having more built-in filters.
    my DVD source is Interlaced video, so i should amend the height to be divisible by 4 if it is an interlaced video? am i right?
    See above, but if you are applying IVTC, your video is progressive by the time you resize it. (I missed that earlier.)
    i have yet another question is that my understanding of resizing rule (for 16:9 video) is width and height should be divisible by 16 and 9 respectively, is it right? or this rule cannot be applied in YV12 format?
    To get an exact 16:9 ratio, then yes, but as long as width/height is close to 16/9, you won't really notice the difference. It's more important (indeed, necessary) to satisfy the mod2/mod4 rule.
    Quote Quote  

  9. Member
    Join Date: Aug 2009
    Location: Asia
    If you're just trying to make an AVI from the DVD, why don't you use Handbrake or a similar tool? They are specifically designed to do this sort of thing.

    If you do it manually in VirtualDub/Avisynth, you have to calculate the post-cropping aspect ratio yourself, like manono said. In this case, you should resize to 720x384.
    Quote Quote  

  10. Member Ehrlichia's Avatar
    Join Date: Jan 2010
    Location: United States
    in the resize script you forgot to put the - in... i.e. Crop(0,6,720,468)
    should be crop(0,6,-720,-468) but this would basically delete your video cropping your 720 wide to 0 and 468 high to 0 giving you no picture you might want to do
    crop(0,6,-0,-0)
    Lanczosresize(720,400)
    Quote Quote  

  11. You can do it at least 3 different ways, none of them the way you did it. You can:

    Crop(0,6,0,-6)
    LanczosResize(720,384))#or LanczosResize(Width,384)

    or:

    Crop(0,6,720,468)
    Lanczosresize(720,384)#or LanczosResize(Width,384)

    or:

    LanczosResize(720,384,0,6,720,468)

    And if a crop value is zero, you don't need to put the negative sign before it, no matter where it is in the list of crops.
    Quote Quote  




Similar Threads

  1. Problem resizing with avidemux
    By crazy3d in forum Editing
    Replies: 0
    Last Post: 20th Nov 2010, 10:54
  2. Avi resizing or creating quick dvd using avidemux
    By striker9 in forum Video Conversion
    Replies: 13
    Last Post: 2nd Nov 2010, 11:01
  3. problem resizing
    By w3wt in forum Video Conversion
    Replies: 3
    Last Post: 24th Sep 2010, 07:35
  4. problem resizing movie
    By goatvideo in forum Newbie / General discussions
    Replies: 3
    Last Post: 21st Jun 2009, 18:58
  5. Avisynth resizing/letterboxing problem
    By czerro in forum Authoring (VCD/SVCD)
    Replies: 3
    Last Post: 3rd Jan 2008, 14:29
Search   Contact us   About   Advertise   Forum   RSS Feeds   Statistics   Tools