I use standard MPEG4 as opposed to XviD or DivX.
First I prepare.
(dumo audio to wav) (mplayer <file.avi> -vc null -vo null -ao pcm:fast)
(dump video to lossless) (mencoder <file.avi> -nosound -ovc lavc -noskip -vf harddup -lavcopts vcodec=huffyuv:format=422p -o <outfile>) -- [file.avi can be dvd://#title#, if ripping from dvd].
Audio: MP3-VBR, downsampled to 24k (encoded with "lame --resample 24 -v -h <infile> <outfile>")
Video: Encoded with mencoder (mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3
redia=2:dia=2:vmax_b_frames=0:vb_strategy=1
recmp=2:cmp=2:subcmp=2
reme=2:qns=2:vpass=#:vbitrate=# -vf scale=#:#,harddup -noskip -ofps # -o <outfile.avi> <infile.avi>)
Then mux the video and audio streams togehter, with (mencoder -ovc copy -oac copy -audiofile <outfile.mp3> <outfile.avi> -noskip -mc 0 -o <muxed.avi>)
I always do two passes, rarely change the FPS, but it depends. And what I scale to is also variable, as I like to preserve my aspect ratios. Bitrate.... I don't really have a rule for that, I just choose what I think is right for whatever it is I am encoding. I do not always use qns, as it really effects the encoding time.