For ffmpeg
:
ffmpeg -i {input}.mov -vcodec h264 -acodec aac -strict -2 {output}.mp4
You may also add the -q:v
/-q:a
parameter to specify the quality of the video. You may also use HandBrake which is a simpler encoder than ffmpeg.
For HandBrake
:
handbrakecli -i {input}.mov -e x264 -E facc -o {output}.mp4
EDIT: I found the solution! Here is a ZIP with a working demo that I tested on IE 9 and Firefox!
Also, the above demo has a flash fallback, so it should work on IE8 and less.
Same ffmpeg
command used.
EDIT: I had to re-upload the video, since my hosting service is down for now. Now it is hosted on mediafire. I found they are the best file sharing service. Minimum ads, no registration, no 30 sec wait.
Also, check out this discussion on the videojs website: http://help.videojs.com/discussions/problems/1020-ffmpeg-command-produce-your-demonstration-video.
VERY IMPORTANT! Make sure to click the 'Allow Active Content' button to allow the video when running locally!
Video of the problem I have and my solution: See my demo mentioned above.
HTML code used while testing:
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>
I analyzed a working test video that w3schools provides (it works on IE), and I found out that they used HandBrake to encode the video.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'movie.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2010-05-11 10:32:06
encoder : HandBrake 0.9.4 2009112300
Duration: 00:00:12.61, start: 0.000000, bitrate: 202 kb/s
Chapter #0.0: start 0.000000, end 12.612000
Metadata:
title :
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240, 80 kb/s, 29.65 fps, 29.97 tbr, 90k tbn, 59.31 tbc
Metadata:
creation_time : 2010-05-11 10:32:06
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 115 kb/s
Metadata:
creation_time : 2010-05-11 10:32:06
Stream #0:2(und): Subtitle: mov_text (text / 0x74786574)
Metadata:
creation_time : 2010-05-11 10:32:06`