To merge avi files make sure they are all the exact same format. There are some programs that can merge avi files, but I will give you a walkthrough for virtual dub:
After opening vd
Choose file - open video file and select the first avi
Choose file - append video segment and select the next avi
Choose video: direct stream copy. (no need to alter the video data)
Choose audio: direct stream copy. (no need to change the audio)
Choose file: save file and give it a new name. (add .avi manually!)
Now just wait for it to be finished.
Then just go on over to the tutorials section by ChickenMan & insert your AVI files into tmpgenc to convert to mpeg.
Good luck