add borders

Locked
jakkor
Joined: Wed Feb 25, 2009 5:07 pm
Org Profile

add borders

Post by 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?

User avatar
l33tmeatwad
Joined: Wed Feb 16, 2005 3:22 pm
Location: Christiansburg, VA
Contact:
Org Profile

Re: add borders

Post by 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.
Software & Guides: AMVpack | AMV 101 | AviSynth 101 | VapourSynth 101
PixelBlended Studios: Website | Twitter | YouTube

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: add borders

Post by 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

jakkor
Joined: Wed Feb 25, 2009 5:07 pm
Org Profile

Re: add borders

Post by 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()

Locked

Return to “Video & Audio Help”