View Single Post
Old 1st August 2010, 00:33   #11  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by Gavino View Post
This isn't right. It should be:
Code:
nW=round(vd.Width*(vasr/pasr))
Note also that this is only appropriate when vasr <= pasr, ie the photo is narrower than the video. When the photo is wider, you want to add borders on the top and bottom instead of the sides. (Left as an exercise for the reader )
Heh, Yes - You have absolutely right - i don't even try to complicate this script more - i assumed (maybe wrongly) that usually videos are 16:9 and pictures 4:3 (sometimes videos 4:3 and pictures also 4:3), also proper colorspace should be detected and maybe modulo calculation - anyway - good starting point for play with avisynth for newcomer.

regards!
pandy is offline   Reply With Quote