Is there a particular reason you want to use avi? MP4 is the superior container.
At any count, I like MeGUI for endoding. And though it has a rather steep learning curve compared to many other choices, it also has many other useful tools and abilities.
For example, if you simply want to change the conatainer format, MeGUI can do that without recoding resulting in quality loss. Best of all, the process takes just seconds. 30seconds - 1 minute depending on file size.
Use TSMuxer (included with MeGUI in the tools) and Demux the Mp4 file.
This will give you the Raw video and Audio stream.
Next, open Megui, and under tools go to: Mexer -> Avi Muxer
In the window that pops up up, Video Input = the raw video stream you extracted Audio Input = the raw Audio stream you extracted.
name it, Que the job and start it.
Youll get a Avi file that has not been recompressed. All that changes is the container (Mp4 to AVI) with no quality loss from the original file.
This entire process will only take a couple minute in total, depending on the file size.
You really only want to recode or re-encode if you have the orginal, or very high quality source. When its already been compressed, compressing further always results in quality reduction. A re-Mux is the best option, or stick with the original format all together.