I was very interested in converting avi files to mp4. Reading your post, I remembered this ffmpeg command:
ffmpeg -i input.avi -strict -2 output.mp4
The command
-strict -2
is necessitated by the AAC codec which is experimental, but works (libaac), if you add those two parameters. The output file is high-quality by default.