Converting AVI to MP4 with ffmpeg

Simple commands to convert video formats:

This command will provide an mp4 of lower quality.

ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

To maintain the video quality try adjusting the parameters: (-crf parameter will control quality – 23 is the ffmpeg default. The lower the number the higher quality the video will be, it will also take longer to convert.

ffmpeg -i input.avi -c:v libx264 -crf 19 -preset slow -c:a libfaac -b:a 192k -ac 2 out.mp4

avconv

Another tip for converting mkv files to mp4.

avconv -i input.mkv -codec copy output.mp4

FFMPEG Resources