This may be more involved than you want to be, but I have some AVS code that I use -- it tries to guess the proper size of the video (at 0.9 pixel aspect, ie. ready to go to an MPEG-2 encode), and scales it up. you can also adjust the percent (eg. scale to 95% of max instead of 100%) to compensate for safe zones. It will also telecine, but you can skip that call if you want (although some encoders just duplicate frames if you're at, say, 23.976fps, so you might get better results just doing the telecine in AVS yourself)
http://studiotwentysomething.net/amvworld/lib-ntsc.avs
Doh! My examples of calling this code is on another computer... A 2nd post coming right up...
Amv --> Dvd
- remsleep
- Joined: Tue Jun 01, 2004 12:19 am
- Location: Silicon Valley
- Contact:
- remsleep
- Joined: Tue Jun 01, 2004 12:19 am
- Location: Silicon Valley
- Contact:
OK - heres some examples that may make things more clear.
Feel free to ignore these 2 posts entirely
simple case - if vid7 is not obviously 4:3 or 16:9, just warn. otherwise, scale
it up to 90% of its max size, and add a blank 3sec preroll
prp7 = ntsc43_std_prep(vid7,90,true)
general case - same as above, but this is a case that appears not really to be 4:3 or
16:9, but I'm overriding to say "treat these as square pixels anyway" (1.0,true). If I
knew the pixels were really 0.9 (eg. an amv that happens to be 720x480, but has moons and
wheels that are out-of-round...), I can use 0.9 instead of 1.0.
prp6x = ntsc43_std_prep(vid6,90,true,1.0,true)
the sharpening versions just do the indicated sharpening after size-up (eg. amvs that are
small, say 320x240, will likely need some sharpening.
In revisiting this code, I realize I had a weird distortion sometimes that I havent
debugged yet. It was appearing right on the border of the final image anyway, so I would
just crop off this seemingly 1-pixel band of distortion and put the borders back, eg:
# Some weird distortion was showing up at the edges...
prp4 = Crop(prp4x,38,0,-38,0).AddBorders(38,0,38,0)
Feel free to ignore these 2 posts entirely
simple case - if vid7 is not obviously 4:3 or 16:9, just warn. otherwise, scale
it up to 90% of its max size, and add a blank 3sec preroll
prp7 = ntsc43_std_prep(vid7,90,true)
general case - same as above, but this is a case that appears not really to be 4:3 or
16:9, but I'm overriding to say "treat these as square pixels anyway" (1.0,true). If I
knew the pixels were really 0.9 (eg. an amv that happens to be 720x480, but has moons and
wheels that are out-of-round...), I can use 0.9 instead of 1.0.
prp6x = ntsc43_std_prep(vid6,90,true,1.0,true)
the sharpening versions just do the indicated sharpening after size-up (eg. amvs that are
small, say 320x240, will likely need some sharpening.
In revisiting this code, I realize I had a weird distortion sometimes that I havent
debugged yet. It was appearing right on the border of the final image anyway, so I would
just crop off this seemingly 1-pixel band of distortion and put the borders back, eg:
# Some weird distortion was showing up at the edges...
prp4 = Crop(prp4x,38,0,-38,0).AddBorders(38,0,38,0)
Nihongo o renshuu suru no tame ni, kaiwa no paatonaa o sagashite imasu kedo...