n3wbi3
27th July 2005, 01:10
I want to resize any .avi to 220x176 (letterboxed), so they can be played back on my iRiver H340. This is the script I wrote:
function iRiver_Resize(clip temp_clip)
{
hor = 220.
ver = 176.
y = Height(temp_clip)
x = Width (temp_clip)
factor = x/hor
y = Floor(y/factor)
a = y%4
b = 4-a
y = y+b
border = Floor((ver-y)/2.)
hor = Floor(hor)
temp_clip = BilinearResize(temp_clip, hor, y).AddBorders(0, border, 0, border).ConvertToYV12.ChangeFPS(10)
return(temp_clip)
}
AVISource("Filename.avi").iRiver_Resize
The output has stripes (as in the attachment) and false colours in it. When resizing to 160x144 (both dividable by 16), the output looks good. If I AddBorders to match 220x176, it's looking crappy again.
I tried Bilinear-, Bicubic- and LanczosResize.
Is there a possibility to resize to resolutions that are closer to the desired one? Or is there a mistake in my script?
function iRiver_Resize(clip temp_clip)
{
hor = 220.
ver = 176.
y = Height(temp_clip)
x = Width (temp_clip)
factor = x/hor
y = Floor(y/factor)
a = y%4
b = 4-a
y = y+b
border = Floor((ver-y)/2.)
hor = Floor(hor)
temp_clip = BilinearResize(temp_clip, hor, y).AddBorders(0, border, 0, border).ConvertToYV12.ChangeFPS(10)
return(temp_clip)
}
AVISource("Filename.avi").iRiver_Resize
The output has stripes (as in the attachment) and false colours in it. When resizing to 160x144 (both dividable by 16), the output looks good. If I AddBorders to match 220x176, it's looking crappy again.
I tried Bilinear-, Bicubic- and LanczosResize.
Is there a possibility to resize to resolutions that are closer to the desired one? Or is there a mistake in my script?