Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG converted mp4 file does not play in firefox and chrome

I have used FFMPEG command to convert flv video file to mp4 and use html5 video tag and play video in browser. But after the video is converted to mp4 using ffmpeg it does not play in firefox and chrome browser. It displays a error saying 'No video with supported format and MIME type found'. I have added the code below, Please help.

cmd /C ffmpeg -i INPUT_FILE_PATH -y -ar 22050 -ab 512 -b 800k -f mp4 -s 514*362 OUTPUT_FILE.mp4"
like image 279
stanley Avatar asked Jan 17 '14 10:01

stanley


1 Answers

This is what you need. I recently found myself fighting the same problem.

Add this to your command:

-pix_fmt yuv420p

If you don't specify the pix_fmt it defaults to yuv444p which doesn't seem to be compatible with current browsers.

The full command I'm successfully testing with is:

ffmpeg -y -i "INPUT-FILE" -c:v libx264 -preset slow -crf 22 -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k "OUTPUT-FILE"

Put your input, output paths inside the quotes and try that to get started. Plays in current IE, Firefox, and Chrome. I'm using the built in aac encoder for audio.

like image 99
LoneSpawn Avatar answered Sep 29 '22 12:09

LoneSpawn