You can use ffmpeg
. Check this answer: Convert AVI to MP4 keeping the same quality
Also, this page is good as well: http://andrebluehs.net/blog/converting-avi-to-mp4-with-ffmpeg/
ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4