Anamorphic widescreen encoding with AviSynth + CCE SP2

Discussion in 'MPEG-1 and MPEG-2 encoding (AVI to DVD)' started by juantohu, Jun 30, 2009.

  1. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    Hello mates,

    I'm trying to make a NTSC DVD-Video that:

    a) When played on a standard 4:3 TV, black bars are inserted to the top and bottom of the image (allowing the movie to be viewed in letterbox format)
    b) When played on a widescreen 16:9 TV, the image stretches back to its original rectangle shape.

    My source specs are:

    Resolution: 592 x 320
    FPS: 25 (PAL)
    AR: 1.85:1 (16:9)


    About the AviSynth script, should I use:

    BicubicResize(720,346,0,0.5)
    AddBorders(0, 67, 0, 67)


    or

    BicubicResize(720,460,0,0.5)
    AddBorders(0, 10, 0, 10)


    or none?

    ...also, in CCE SP2, which frame rate should I use? the original (25) or a NTSC one?

    Thanks in advance :)
     
  2. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    You just have to select 16/9 in the dvd creation program.

    As far as a) is concerned, it's achieved by the dvd player, when it
    detects a 16/9 DVD and you have the output set for a 4:3 TV.

    I always leave the frame rate the same - but that's because my dvd
    player converts PAL > NTSC for me (and does it quite well)

    Not sure about the addborders. Download AVStoDVD and look at the
    avisynth script it generates.
     
    Last edited: Jun 30, 2009
  3. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    First, thanks for the answer ;)

    So, I just use 16:9 as my aspect ratio in CCE SP2 then?
    The one thing that I don't want to happen is that when the movie is played on a standard TV the image would then look squeezed and thin... what's the cause of this and how do I prevent it?

    I'll check AVStoDVD out and then post a reply here.

    ---
    EDIT: The Auto AviSynth Script shows BicubicResize(720,576,0,0.5) and AddBorders(0,6,0,6) ...that makes sense, since it's a PAL video, but I want to encode to NTSC. Should I leave 720x576 as the frame size or should I change it to 720x480 anyway?
     
    Last edited: Jun 30, 2009
  4. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    AVStoDVD is quite clever at handling this. Look at the "settings" tab
    and select your output type. I *think* for a 25fps avi > NTSC DVD
    conversion, the program produces a hybrid 25 fps @ 720*480.

    Then it runs DGPulldown to up the frame rate to 29.97 (NTSC)
    before authoring the DVD.


    Yes, use 16*9 if you want to create an anamorphic DVD.
    As I said, when the player detects it it will process the image
    based on the player setting.

    If you tell the player your TV is 16*9, it plays the material
    as-is (at full height).
    If you tell the player your TV is 4*3, it squashes the picture,
    top to bottom, so that the image on the TV has the proper aspect ratio.
    Otherwise, everything would look tall and thin.
     
  5. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    I had PAL as the video standard in the audio/video preferences (I've never used AVStoDVD before), changed it to NTSC and now I got:

    Video = Video.ConvertToYV12
    #Using DGPulldown to upsize FPS
    Video = Video.AddBorders(0,6,0,6)
    Video = Video.BicubicResize(720,480,0,0.5)


    You were right, DGPulldown is the way to go... but what are the borders for? aren't they going to produce a 492 vertical resolution? does this has something to do with overscanning? (sorry if this is a dumb question)

    Now, my real question is: should I encode with CCE using 25 fps and then use DGPulldown to change it to 29.97 fps? or what's the procedure like?
    The problem is that if I encode using 25 fps with CCE, it automatically forces the frame size to 720x576.

    Thanks again for your time mate.

    ---
    EDIT: Nevermind that, as FulciLives from the VideoHelp.com forums said:

     
    Last edited: Jul 1, 2009
  6. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    The add borders is done before the resize to 720*480.
    This gives a slight letterbox top and bottom.

    The reason for this is that your source wasn't exactly 16*9,
    but slightly wider.

    Yes, I believe CCE should be fine. I've got CCE basic installed,
    and I've done this myself - I created a template
    with these settings.

    AVStoDVD uses HCEnc, and when used with 2-pass encoding, gives
    high quality results. Good luck!
     
    Last edited: Jul 1, 2009
  7. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    Now I'm a little confused...
    Should I add borders to reach an exact 16:9 AR first and then resize to 720x480?
    ..or should I resize first (720x462) and then add borders (9 top and 9 bottom) to reach a 480 vertical resolution?

    Also, while doing my manual calculations for the resizing parameters I got the following:

    BicubicResize(720,462,0,0.5)
    AddBorders(0,9,0,9)


    but FitCD and AVStoDVD both produce slightly different scripts:

    FitCD
    BicubicResize(720,472,0,0.6,0,0,592,320)
    AddBorders(0,4,0,4)


    AVStoDVD
    AddBorders(0,6,0,6)
    BicubicResize(720,480,0,0.5)


    Which one is the best/correct one?
    or what's the correct formula?

    Doom9.org uses this one and ChickenMan uses this other one.

    Thanks again ;)
     
  8. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    They're almost the same. Often, to achieve a result divisible
    by 4, one of the dimensions is rounded up/down.
     
  9. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    So, values must be divisible by 4 then...

    What about this?

    Last question... promise :)
     
  10. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    If the resolution of the AVI file, either horizontal or vertical is only divisible by 2, then it might not decode properly.
    In your avi, 592*320, it's OK.

    Doing the addborders first and resizing to 720*480,
    is virtually the same as the way fitcd did it. 4 pixels difference
    vertically, not really visible when the movie is watched. The main
    this is they both came out to 720*480 in the end.



     
  11. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    OK :)

    davexnet, thanks a lot for all your help; I was going mad with all the little details.

    Cheers!
     
  12. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    Actually, I did the calculations to find the actual details.
    See what you think of my conclusions:

    original avi size 592/320=1.85
    16*9=1.777
    853=480 x 1.777. OK.

    AVStoDVD adds 12 to the height resulting in 592*332.
    (592/332= very close to the ideal 1.777)

    When it's encoded you get a thin letterbox, top and bottom
    of 18 or 19 pixels total (sum of top and bottom)
    853/1.85 = 461. This means the AVStoDVD size is spot on.
    It's more accurate than the FitCD sizes.
     
    Last edited: Jul 1, 2009
  13. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    OK, that got me thinking:

    592/334 = 1.772 , closer to 16:9 than 592/332
    ..is AVStoDVD not using 334 as the vertical resolution (adding 14 to the height) for the reason that it is a number not divisible by 4? Numbers divisible by 4 are prefered instead of numbers that just divide by half?

    Your method is WAY easier and faster than mine: for a true 16:9 you just divided 853 by the video's aspect ratio and got 461.something... what about 4:3? you just need to do 640/AR?

    Are these formulas useless?

    4:3
    Code:
    ((720 / width) * height) / 1.1
    16:9
    Code:
    ((720 / width) * height) / 1.1 + 108
    Lastly, talking specifically about my source, should I do:

    a) BicubicResize(720,462,0,0.5)
    AddBorders(0,9,0,9)


    or

    b) AddBorders(0,6,0,6)
    BicubicResize(720,480,0,0.5)


    or

    c) BicubicResize(720,461,0,0.5)
    AddBorders(0,9,0,10)


    or

    d) AddBorders(0,7,0,7)
    BicubicResize(720,480,0,0.5)


    or

    e) BicubicResize(720,460,0,0.5)
    AddBorders(0,10,0,10)


    ??????
     
  14. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    I would say that they are all OK and more or less functionally
    equivalent. On the finished result, can you really notice
    that it's 460 Vs. 462 ?

    The only question I have is - Does the resize work properly when you
    specify an odd number? (c).

    Not sure what to make of your formulas. How do you use them ?
     
  15. juantohu

    juantohu Member

    Joined:
    Jun 30, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    11
    About the formulas:

     

Share This Page