Here is a basic script I use to convert my video clips to a mpg perfectly suited for my Gigabeat :
for movie in *.avi ;
do mencoder "$movie" -of mpeg -oac lavc -lavcopts acodec=mp2:abitrate=192 -af resample=44100:0:0 -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=500 -vf scale,harddup -ofps 25 -zoom -xy 320 -o "$movie.mpg"
done
If you have another target, just change the 320 to your screen width and lower the vbitrate to an apropriate value (not mandatory).
This is opened to suggestions.
1st improvement could be not to limit to avi (I just happened to have only avis today when I made this script) by replacing *.avi by just *
2nd would be to remove the .avi extension and replace it with .rb.mpg to indicate a rockbox-ready mpg file (I don't know how to do this)
Note that I have a Pentium-M 1.6GHz and 768 Mo of RAM and this mencoder line is processing extremely fast, between 110 and 150 fps (5 to 6 times faster to encode than the duration of the clip).
I would like to post this on the wiki, but I think it is not polished enough for it. So I'm asking for some ideas to improve it.