hope somebody finds this useful. I did a search for a script/plugin that could do this and didn't find anything. Let me know if you find any issues with the script or if you have any suggestions.
Code:
######
##
## Target Resize v0.1 by xekon
##
## Resizes by target width or height while maintaining aspect ratio and staying codec compliant
##
## Usage: Import("Tresize-v0.1.avsi")
## resize clip to 640 px wide: TresizeW(tw=640)
## resize clip to 480 px tall: TresizeH(th=480)
##
####
function TresizeW(clip input, int "tw", int "cMod") {
tw = Default(tw, 640)#Width
cMod = Default(cMod, 2)#codec Mod
inH = input.height
inW = input.width
AR = (float(inW) / float(inH))
th = int(float(tw) / AR)
th = ((th / cMod) * cMod)
Spline64Resize(input, tw, th)
}
function TresizeH(clip input, int "th", int "cMod") {
th = Default(th, 480)#Height
cMod = Default(cMod, 2)#codec Mod
inH = input.height
inW = input.width
AR = (float(inW) / float(inH))
tw = int(float(th) * AR)
tw = ((tw / cMod) * cMod)
Spline64Resize(input, tw, th)
}