An .avi is not going to do you much good for local playback.
The current codec champ is H264. You will need to change the Profile level to 4.1, then set your frame size, FPS, and PAR to match your source video. Choose 2 pass VBR with a target bitrate of about 3 Mbps with a maximum of 4 Mbps.
You may have to experiment with Keyframe distances.