add borders

This forum is for video and audio help and discussion.

add borders

Postby jakkor » Mon Feb 03, 2014 2:38 pm

Hey
I need convert avi to dvd and don't remember how calculate black borders and add in avisynth.
Source Pal, resize avi 640x360 16:9.
How should look correct script?
jakkor
 
Joined: 25 Feb 2009

Re: add borders

Postby l33tmeatwad » Tue Feb 04, 2014 10:49 am

If you need to make it 4:3 with the boarders, it needs to be 640x480, so add 60 to the top and bottom.
Sites: Website | Facebook | Twitter | YouTube
Guides & Scripts: AMV 101 | AviSynth 101 | Anime Upscale
PixelBlended Studios: Website | Facebook | Tumblr | Twitter | YouTube
User avatar
l33tmeatwad
 
Joined: 16 Feb 2005
Location: Charleston, SC
Status: Trolling

Re: add borders

Postby Qyot27 » Tue Feb 04, 2014 4:10 pm

Is the target DVD going to be PAL or NTSC? That affects the proper content and border values, unless (and this is what I'd do, personally) you just do a standard 16:9 anamorphic encode, in which case you won't add borders and simply resize to 720x576 or 720x480, and set the 16:9 flag in the encoding program so that it's flagged correctly.

If you're dead-set on letterboxing to 4:3, then the proper values are:
NTSC content: 720x360, borders: 60 pixels
PAL content: 720x432, borders: 72 pixels

Since it's MPEG-2 and therefore advisable to make sure the content and borders are all mod16, this means
NTSC content: 720x352, borders: 64 pixels
PAL content: 720x416, borders: 80 pixels

Getting the content to mod16 in this case can be done by cropping 4 pixels from the top and bottom (NTSC), or 8 pixels from the top and bottom (PAL). Or, simply ignore the small distortion in the aspect ratio caused by not cropping and just resizing to those values, since you probably won't be able to notice it anyway.


Also, since the source is PAL, with the assumption being a framerate of 25fps, if the target is an NTSC DVD, then you'll have to do one of two things:
A) Perform a slowdown/audio length-pitch shift to 23.976fps and then use standard 23.976->29.97 pulldown flags.
B) Encode without pulldown flags, leave the audio alone, and then use DGPulldown to set custom 25->29.97 flags.

B is more preferable since it keeps the audio pitch the same and NTSC viewers are already accustomed to the slight pulldown stutter (which would also be there for 23.976->29.97).
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
User avatar
Qyot27
Surreptitious fluffy bunny
 
Joined: 30 Aug 2002
Location: St. Pete, FL
Status: Creepin' between the bullfrogs

Re: add borders

Postby jakkor » Sat Feb 08, 2014 5:38 am

probably it

DirectShowSource("C\DVD\Movie.avi\mkv\mp4", fps=xx.xxx)
Lanczos4Resize(X,Y)

#X=720, Y=Y1
#X=704, Y=Y2, if "Overscan Border"
AddBorders(x1,x2,y1,y2)

# PAL:
#x2 = (576-Y1)/2, y2=(576-Y1)/2, x1=0, y1=0
#x2 = (576-Y2)/2, y2=(576-Y2)/2, x1=8, y1=8, if "Overscan Border"
# NTSC:
#x2 = (480-Y1)/2, y2=(480-Y1)/2, x1=0, y1=0
#x2 = (480-Y2)/2, y2=(480-Y2)/2, x1=8, y1=8, if "Overscan Border"
ConvertToYV12()
jakkor
 
Joined: 25 Feb 2009


Return to Video & Audio Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron