hi japie,
i was testing your script during last few days and here are some thoughts:
if a movie is non standard size (not 4:3 and not 16:9) i'm getting unusable results - the movie is either stretched too much or too narrow. so i tried to experimend with mplayer option -vop expand=x:y. this option i use when i want to display subtitles but i don't want them right inside of the movie but in the black border that is created around the movie. i have a little script on my system that recalculates size of any movie into 4:3 size by adding the black bars. so i implemented this into your script. the line with mplayer looks something like this:
mplayer -really-quiet -vop expand=${width}:$((${width}/4*3)) ......an so on
of course, any movie that you pass onto the script is now 4:3 so you no longer need to decide what type of rescaling method yuvscaler uses because it's allways doing RESAMPLE.
this thing also has side effect that if you encode also subtitles into the movie they are using also the lower black bar, not just the movie (those who don't like it may set it in mplayer with some parameters otherwise, i think)
i haven't tested this into details so there might be some flaw to this whole thing but i think it might give you something to work on. one thing that seems to be problematic is that with the math going on there you can end up with height that is not multiplication of 8 and the encoder crashes then, i think i had some crashes like that but it could have been caused also by other stuff. of course i might be totally mistaken here since my knowledge of video encoding is very limited.
there is also one tiny problem with the script - when you check for mplayer playable extension .mov (quicktime) is not there so you should add it there.
i would also suggest adding option to encode the movie in SVCD resolution. i tried it and i think the results are excellent although encoding time is horrible
you may also consider adding option to create ksvcd (mpeg2 kvcd) but i'm no expert in mpeg1/mpeg2 and have no idea if there is any benefit in this. would there be much difference between mpeg2-ksvcd and mpeg1-kvcd with svcd resolution?
that would be about it. sorry for this mess of a message, i just wrote what came into my head