Razorblade2000
30th August 2004, 20:07
I try to create a script that is able to resize every input to a resolution of 480*X while keeping the original aspect ratio :D
My problem: Some files give me a "Evaluate: Unrecognized exception" error in lines 19 and line 13 :(
I don't really know what might be the cause :(
Using the RC3 of avisynt 2.5.5
(maybe my lame comments will help you :D)
hope it's not still this: http://forum.doom9.org/showthread.php?s=&threadid=80737
##Select your source
directshowsource("D:\some.avi")
##This it the dll you need: http://www.videofringe.com/autocrop/
## this plugin should crop black borders so d2v input can also be resized correctly
Autocrop(0)
## replace the 0 by a 1 and you'll have the cropping values displayed via overlay
#The Maintainaspect stuff was done by CropsyX (doom 9 forum)... thx :D
#I think lanczos is the best method for rmvb... we can need any detail we get, don't we? :D
ResizeMaintainAspectWidth(480,"Lanczosresize")
##This is the nifty function which will detext and keep aspect ratio
function ResizeMaintainAspectWidth(clip c,int newwidth,string resizefn) {
nh=floor(eval(string(c.height)+". * "+string(newwidth)+". / "+string(c.width)+"."))
return eval(resizefn+"(c,"+string(newwidth)+","+string(nh)+")")
}
### the function works like this:
### the first line of the function gets your input (the new heigth):
# function ResizeMaintainAspectWidth(clip c,int newwidth,string resizefn) {
# "int newwidth"
### the width you want the video to have
# nh=floor(eval(string(c.height)+". * "+string(newwidth)+". / "+string(c.width)+"."))
### here comes the new variable nh (new heigth) -> heigth * (new width / old width)
### (new width / old width) is the factor the video will be shrunk, both horizontally and vertically
### --> the "heigth * (new width / old width)" will multiply the current heigth by this factor and therefore give you the new heigth
My problem: Some files give me a "Evaluate: Unrecognized exception" error in lines 19 and line 13 :(
I don't really know what might be the cause :(
Using the RC3 of avisynt 2.5.5
(maybe my lame comments will help you :D)
hope it's not still this: http://forum.doom9.org/showthread.php?s=&threadid=80737
##Select your source
directshowsource("D:\some.avi")
##This it the dll you need: http://www.videofringe.com/autocrop/
## this plugin should crop black borders so d2v input can also be resized correctly
Autocrop(0)
## replace the 0 by a 1 and you'll have the cropping values displayed via overlay
#The Maintainaspect stuff was done by CropsyX (doom 9 forum)... thx :D
#I think lanczos is the best method for rmvb... we can need any detail we get, don't we? :D
ResizeMaintainAspectWidth(480,"Lanczosresize")
##This is the nifty function which will detext and keep aspect ratio
function ResizeMaintainAspectWidth(clip c,int newwidth,string resizefn) {
nh=floor(eval(string(c.height)+". * "+string(newwidth)+". / "+string(c.width)+"."))
return eval(resizefn+"(c,"+string(newwidth)+","+string(nh)+")")
}
### the function works like this:
### the first line of the function gets your input (the new heigth):
# function ResizeMaintainAspectWidth(clip c,int newwidth,string resizefn) {
# "int newwidth"
### the width you want the video to have
# nh=floor(eval(string(c.height)+". * "+string(newwidth)+". / "+string(c.width)+"."))
### here comes the new variable nh (new heigth) -> heigth * (new width / old width)
### (new width / old width) is the factor the video will be shrunk, both horizontally and vertically
### --> the "heigth * (new width / old width)" will multiply the current heigth by this factor and therefore give you the new heigth