|
Anamorphic widescreen encoding with AviSynth + CCE SP2
|
|
juantohu
Newbie
|
30. June 2009 @ 21:42 |
Link to this message
|
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 :)
|
Advertisement
|
|
|
Senior Member
|
30. June 2009 @ 22:09 |
Link to this message
|
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.
This message has been edited since posting. Last time this message was edited on 30. June 2009 @ 22:13
|
juantohu
Newbie
|
30. June 2009 @ 22:39 |
Link to this message
|
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?
This message has been edited since posting. Last time this message was edited on 30. June 2009 @ 23:07
|
Senior Member
|
30. June 2009 @ 23:29 |
Link to this message
|
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.
|
juantohu
Newbie
|
1. July 2009 @ 01:04 |
Link to this message
|
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:
Quote: In CCE if you leave FOR DVD checkmarked it will resize to a PAL resolution when you set the frame rate to 25fps so you have to uncheck that option. If all your other settings are "on mark" then the encoding will be good.
This message has been edited since posting. Last time this message was edited on 1. July 2009 @ 01:41
|
Senior Member
|
1. July 2009 @ 03:15 |
Link to this message
|
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!
This message has been edited since posting. Last time this message was edited on 1. July 2009 @ 15:18
|
juantohu
Newbie
|
1. July 2009 @ 06:14 |
Link to this message
|
Originally posted by davexnet: 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.
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 ;)
|
Senior Member
|
1. July 2009 @ 15:20 |
Link to this message
|
They're almost the same. Often, to achieve a result divisible
by 4, one of the dimensions is rounded up/down.
|
juantohu
Newbie
|
1. July 2009 @ 17:05 |
Link to this message
|
So, values must be divisible by 4 then...
What about this?
Quote: 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?
Last question... promise :)
|
Senior Member
|
1. July 2009 @ 19:00 |
Link to this message
|
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.
|
juantohu
Newbie
|
1. July 2009 @ 19:24 |
Link to this message
|
OK :)
davexnet, thanks a lot for all your help; I was going mad with all the little details.
Cheers!
|
Senior Member
|
1. July 2009 @ 19:37 |
Link to this message
|
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.
This message has been edited since posting. Last time this message was edited on 1. July 2009 @ 19:37
|
juantohu
Newbie
|
1. July 2009 @ 21:52 |
Link to this message
|
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
((720 / width) * height) / 1.1
16:9
((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)
??????
|
Senior Member
|
1. July 2009 @ 22:58 |
Link to this message
|
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 ?
|
Advertisement
|
|
|
juantohu
Newbie
|
3. July 2009 @ 00:25 |
Link to this message
|
About the formulas:
Originally posted by ChickenMan: Our AVI had dimensions of, say, 512 x 224 ( X x Y ) as found above. This needs to be resized for a SVCD to 480 x 576 for PAL or 480 x 480 for NTSC. But the pixel aspect ratios of a PC monitor and a PAL or NTSC TV are not the same. PC Monitor pixels have a square pixel aspect ratio of 1:1 but pixel aspect ratio for PAL TV is 54:59 and for an NTSC TV is 11:10.
So the correct resizing parameters for our AVI in this example would be:
For PAL AVI:
Calculated height = ((720 / X) x Y) / (54 / 59)
=((720 / 512) x 224) / (54 / 59)
= 344.16
So the correct "Resize" statement in the AviSynth script would be:
...
BiCubicResize(480,344,0.00,0.60)
...
where the Calculated height of 344.16 has been rounded to 344 to be divisible by 4 (even better if divisible by 16).
Then we add borders on top and bottom to fill the height up to 576 pixels.
Correct borders = (576 - Calculated height) / 2
= (576 - 344) / 2
= 116
So the correct "AddBorders" statement in the AviSynth script would be:
...
BiCubicResize(480,344,0.00,0.60)
AddBorders(0,116,0,116)
...
For NTSC AVI:
Calculated height = ((720 / X) x Y) / (11 / 10)
= ((720 / 512) x 224) / (11 / 10)
= 286.36
So the correct "Resize" statement in the AviSynth script would be:
...
BiCubicResize(480,288,0.00,0.60)
...
where the Calculated height of 286.36 has been rounded up to 288 to be divisible by 4 (even better if divisible by 16).
Then you have to add borders on top and bottom to fill the height up to 480 pixels.
Correct borders = (480 - Calculated height) / 2
= (480 - 288) / 2
= 96
So the correct "AddBorders" statement in the AviSynth script would be:
...
BiCubicResize(480,288,0.00,0.60)
AddBorders(0,96,0,96)
...
[...]just change the SVCD's width of 480 to 720 for DVDR's, otherwise its the same. That was for "16:9 (encoded as 4:3)" but for "anamorphic (encoded as 16:9)" just add 128 (PAL) or 108 (NTSC) to the height figure and take 1/2 that off (64 and 54) for the added borders height figure (so they add up to 576 PAL or 480 NTSC).
|
|