sudo apt-get install ffmpeg
Next, cd to the folder containing your MP4 files and run this command:
ffmpeg -i filename.mp4 -sameq -vcodec mpeg4 -acodec ac3 output.avi
Replace filename.mp4 with your own MP4 file. The generated avi file will be named output.avi, you can rename it to whatever you want.
That's it!
Evi