VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    I have been trying to resize an Xvid via Avisynth to CCE .
    The target format is DVD and size is 720x480.

    This is the GSpot info for the Xvid file:

    Xvid File:
    00:42:34 (61,243 fr)
    640x368 (1.74:1) [=40:23]
    Bitrate=1011 kb/s
    Framerate=23.976

    Here are some the avisynth scripts I have used:

    1)

    AVISource("D:\disc2.avi")
    LanczosResize(688,368,6,0,628,368)
    AddBorders(16,56,16,56)

    2)

    AviSource("D:\disc2.avi", false)
    LanczosResize(720,364,0.0,0.6)
    AddBorders(0,58,0,58)

    The output when compared to the original Xvid
    still seems to lose some of the screen from the
    left and right side of the screen when the MPG
    is played back on my 4:3 TV screen.

    Can anyone help with advice on how to improve the script
    for Avisynth so I dont lose the sides and the output is still
    correct ratio for my 4:3 TV.


    Thanks
    [/img]
    Quote Quote  
  2. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    You might have to add more than 16 px left & right to compensate for overscan (and resize horisontally correspondingly), even if I get by with 704 (8+8 border) on my TV. But the overscan varies from TV to TV.

    /Mats
    Quote Quote  
  3. The short answer: Typical overscan on televisions runs from 5 to 10 percent of the picture on each side. 16 pixels isn't enough padding at the sides. You'll need 36 to 72. So make the final picture smaller and pad more.

    Do you realize that if you bought the original DVD that you would lose just as much picture when you play it on TV?

    And even if you do get the video to fit exactly on your TV, the next TV you play it on will be different -- it will overscan more or less. You'll either still have some of the picture "missing", or you will see black bars at the sides.
    Quote Quote  
  4. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    Thanks for the quick responses...but

    I get so confused with these different scripts for resizing ...

    so I gather from the replies that it is impossible to replicate the
    output from an Xvid on a computer screen on to a TV...

    I didnt realise that overscan on TV could take away so much of the
    picture.

    So the AddBorders command doesnt take a away any picture ??
    but the Lanczos Resize does crop or remove some of the image??
    So to do resizing ..I may need more like
    LanczosResize(688,368,6,0,628,368)
    AddBorders(36,56,36,56) ...???
    Or do I need to add 20 more for the 56 figure as well??

    I had previously tried using some the guides shown on this site
    for Xvid conversion to Mpeg/DVD
    but found the calculations didnt seem to provide a satisfactory
    output. This is partly because I now know that some of the
    scripting actually crops the original video ...so you lose
    some of the image.

    I am now tearing my hair out trying to work out how to resize
    with a script via Avisynth so as to get a reasonable output for
    the 720x480 format(the original Xvid was 640x368 NTSC
    progressive, 23.976 frame rate).

    Does any one have a good (ha!) script for the Lanczos resize
    and AddBorder so as to give a reasonable job???

    Some of you may have more experience in this area ..and this
    is why I have asked for input.
    I know this is a constantly asked question in this group.
    But as this is the last (and most difficult problem) before
    I can take a whole series of Xvids for conversion
    it would be much appreciated ...to get any input or scripts for the
    Xvid mentioned!!???
    Quote Quote  
  5. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    I use
    LanczosResize (704, 400)
    (for example) followed by
    addBorders(8,88,8,88)
    JunkMalle wold probably use
    LanczosResize (684, 380)
    addBorders(18,98,18,98)
    You'll have to adjust the height when trying different widths to make the proportions right

    /Mats
    PS! I've used PAL frame height in this example (576) - adjust accordingly for NTSC DS
    Quote Quote  
  6. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    I have to come clean and say I got the previous two scripts
    from outputs from FitCD and Film Machine...

    But i had previously tried a method shown in one
    this sites guides ...which went as follows

    the Xvid movie is 640x368

    The target is 720x480

    so it is for NTSC ..keep it same as source
    as from what I've read it degrades if you try and convert
    from NTSC to PAL...

    Anyway ..

    so 720/640= 1.125

    1.125x368=414

    480-414=66

    66/2=33

    so the script is :

    LanczosResize(720,414)
    AddBorders(0,33,0,33)

    But this one didnt seem to work...it certainly
    didnt add much padding on sides

    Can you explain how you get the figures for
    this one ...???
    Quote Quote  
  7. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    No, this adds no padding on the sides at all.
    Your target width (according to junkmalle) should be 720-18-18=684

    Using your formula, you now get 684/640=1.06875
    The height becomes 1,06875*368=393,3, but try to stick with numbers at least divisible by 8, so settle for 392

    So, do a
    LanczosResize(684,392)
    followed by adding borders to pad up to DVD resolution:
    AddBorders( 18,44,18,44)
    (The order is left, top, right and bottom)

    Now you have a movie with the size of 684 by 392 centered in a frame the size of 720*480

    Generally, like I said, keeping everything at numbers divisible by 8 is good practice, even if it's not always necessary.

    /Mats
    Quote Quote  
  8. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    Thanks for this.. mats.hogberg and your mate there ...junkmalle...
    ...as I said I have been tearing my hair out

    I must have done at least a dozen trial small encoding using
    a small 1000 frame section which had a good area
    with some nice reference points...so I could see what was
    moving in/out ...getting cut off ...etc

    So does this side padding of 18 ...is there a way of calculating this
    or is it just trial and error???
    ...its for future reference..when I am doing these calculations...
    I have some other much higher resolution Xvids(920 x528 I think)
    that I need to convert as well

    Thanks for the advice about the "divisible by 8"
    I assume this probably has something to do with
    video standards or standard ratios??
    Quote Quote  
  9. Originally Posted by mats.hogberg
    Your target width (according to junkmalle) should be 720-18-18=684
    No, it's 5 to 10 percent on each side so his target width should be around 720-36-36 = 648. Since his source width is 640 he might just leave it at that and scale only in the Y direction.
    Quote Quote  
  10. Originally Posted by aussiemac
    So does this side padding of 18 ...is there a way of calculating this
    or is it just trial and error???
    Every TV is different. You can only tell how much any particular TV will overscan by trial and error or using a video chart with calibration marks to determine how much the TV overscans on each side. You'll probably find that it's not even on both sides. And you'll probably find it varies with how long the TV has been on, the phase of the moon, and the tides.
    Quote Quote  
  11. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    "the phase of the moon,and the tides"....now I know its only the
    ones with the ring that can influence those...

    So ...junkmalle...it sounds like what you are saying ..dont
    put anything in for the AddBorders x area

    AddBorders(0,y,0,y)

    but that then brings me back to the original value for
    y of 33...calculated like I did before???
    as below??

    so 720/640= 1.125

    1.125x368=414

    480-414=66

    66/2=33

    ...I'm lost ...cause then the LanczosResize would be 720,414...???
    ...no I am confused now
    Quote Quote  
  12. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    I have noticed with regards the overscan that my ppicture
    tends to sit slightly to the right more...

    I have used a "video Essentials DVD" for calibrating my
    TV Picture ...and I seem to recall it had a test pattern on there.

    ..but thats away from my confusion about this resizing/border
    figures..
    Quote Quote  
  13. Member monzie's Avatar
    Join Date
    Nov 2003
    Location
    The Village
    Search Comp PM
    Originally Posted by aussiemac
    I have to come clean and say I got the previous two scripts
    from outputs from FitCD and Film Machine...

    But i had previously tried a method shown in one
    this sites guides ...which went as follows

    the Xvid movie is 640x368

    The target is 720x480

    so it is for NTSC ..keep it same as source
    as from what I've read it degrades if you try and convert
    from NTSC to PAL...

    Anyway ..

    so 720/640= 1.125

    1.125x368=414

    480-414=66

    66/2=33

    so the script is :

    LanczosResize(720,414)
    AddBorders(0,33,0,33)

    But this one didnt seem to work...it certainly
    didnt add much padding on sides

    Can you explain how you get the figures for
    this one ...???
    Those calculations DO NOT make sense!

    Lets start with the avi's horizontal of 640, DIVIDE this by 0.91 (a NTSC pixels with compared to its height) and the answer is 703.29 round to nearest number divisible by 16 and the answer is 704.

    The vertical height remains the same at 368 (as NTSC pixels are 0.91 X 1, whilst avi pixels are 1 X 1, so you only calculate the horizontal).

    So for your example you should use 720 X 480 DVD with borders of 8,56,8,56 (704 X 368 video size).

    Your method changes the AR.

    DO NOT get hung up about losing the sides of a movie on your TV!!! How many movies have you watched on TV or DVD and never known?
    Quote Quote  
  14. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    Hi monzie...the method I used was shown in a guide from Videohelp.com
    entitled:

    "How to Convert AVI to DVD + AC3 with CCE and AC3Machine"
    by Games-Realm.

    I understand what you are saying ...with your calculations...using this 0.91
    (an NTSC's pixel width compared to its height)for NTSC you get rounded to nearest number divisible by 16..eg 704.

    As for the height ..because the in ratio of the pixel width to height...the height value are both 1 for AVI and NTSC...so we leave it at 368.

    So in the avisynth script you use :
    LanczosResize(704,368)
    AddBorders(8,56,8,56)....Right??

    the addborders figures being the amounts to bring the 704 and 368
    back to the 720 and 480 for NTSC DVD???

    So what ratio does a PAL pixel use for this calculation??
    Does it have a ratio of 0.91(w) x 1(h)??

    Is the AVI pixel size(avi pixels are 1(W) x1(H)) cause its from the VGA or computer world as compared to the NTSC(0.91(W)x 1(H)) or PAL pixel ratio which come from the TV or Broadcasting world???

    The only reason I was getting worried by the lose of sides on TV...
    was when I compared a similar frame from both the AVI and
    the subsequent (after the conversion) DVD side by side...
    there was a noticeable loss of picture from AVI to DVD...

    I understand what you are saying though ...we watch DVDs
    everyday and never get bothered by this issue.

    Thanks for this feedback ...by the way monzie!
    Quote Quote  
  15. Member monzie's Avatar
    Join Date
    Nov 2003
    Location
    The Village
    Search Comp PM
    Look, heres my quick guide to PIXELS:

    AVI
    the pixels are square (or as near as dam it) having a ratio of 1:1 (so all stuff like xvids/divxs will be 1:1).

    NTSC
    4:3 pixels are 0.91 x 1 (also called 11:10)
    16:9 pixels are 1.21 x 1 (also called 40:33)

    PAL
    4:3 pixels are 1.09 x 1 (also called 59:54)
    16:9 pixels are 1.45 x 1 (also called 118:81)

    You can either calculate your own OR just use FITCD to do the calcs for you.

    As far as I know normal TV's do not use pixels at all, they use an anolog signal that is scanned horizontally across the screen at 13.5mhz (ie the DVD player converts a row of mpeg horizontal pixels into an anolog signal). The 'pixels' you see on your TV screen are created by the electron guns guide mesh and screens phosphors and are therefore 'fixed'...play a VCD or a VHS tape and you will have just as many TV 'pixels' as a DVD.

    Now if you are paying attention you would have noticed that I told you to use 720 DVD with a video of 704 X 368, but why you may ask dont I just use 704 DVD and forget the side borders? The answer is because a 704 DVD has the same LENGTH of anolog signal as a 720 (13.5mhz) and you would lose even more of your picture to overscan becuase you have no side borders or 'padding'.

    Personally I now use either 704, 688, 672 or 656 as my encoding widths (depending on the upscale of the avi)...the padding is hardly visibible if at all as my TV is a 16:9, so playing anything 4:3 involves zooming up the picture anyway.
    Quote Quote  
  16. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    Thanks for information on the pixels
    for all formats..monzie!! Its appreciated!

    So what happens if you have an Avi of
    920 x 528?? How do you resize??

    Thats obviously bigger than the NTSC 720x 480 DVD format...
    Quote Quote  
  17. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    sorry that avi size should have been 960 x 528!
    Quote Quote  
  18. Member monzie's Avatar
    Join Date
    Nov 2003
    Location
    The Village
    Search Comp PM
    Your not paying attention!!

    You already have the tools/information to find your solution.

    What makes you think I do one on one tutorials for people who cant be arsed to read, do sums, or press buttons!

    Try these:

    http://www.uwasa.fi/~f76998/video/conversion/

    http://www.mir.com/DMG/aspect.html
    Quote Quote  
  19. Member
    Join Date
    Nov 2004
    Location
    australia
    Search Comp PM
    Thanks for your advice and the links on this
    subject... monzie.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!