Converting Video for Android using FFMPEG

The MP4 created by ffmpeg has the moov header at the tail. That is why you are getting this error message. ffmpeg can put the moov header in front (suitable for streaming).

Simply run:

ffmpeg -i <input> -c:v libx264 -c:a aac -movflags +faststart output.mp4

Also refer to Post processing in ffmpeg to move 'moov atom' in MP4 files (qt-faststart)


libfaac is not supported anymore, You can use this configuration:

ffmpeg -i <input> -s 480x320 -vcodec mpeg4 -acodec aac -strict -2 -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 <output>  

The solution that worked for me was:

ffmpeg -i <INPUT_VIDEO> -c:v libx264 -profile:v baseline -c:a libvo_aacenc -ar 44100 -ac 2 -b:a 128k -movflags faststart output.mp4

I'm using Ubuntu 16.04.1 LTS