I looked everywhere here and on google - there is no valid command that works for IE9. some how IE9 is missing something. All that I tried worked everywhere else: chrome,safari,mobile device etc... I want one command that will convert it and I can use it in every device suppose to support mp4 in HTML5 video tag.
I use this commands:
ffmpeg -i movie.mov -vcodec copy -acodec copy out.mp4
ffmpeg -i movie.mov -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p outa.mp4
ffmpeg -i movie.mov -b:V 1500k -vcodec libx264 -preset fast -g 30 adel.mp4
ffmpeg -i movie.mov -acodec aac -strict experimental -ac 2 -ab 160k -vcodec libx264 -preset slow -f mp4 -crf 22 lamlam.mp4
ffmpeg -i movie.mov -acodec aac -strict experimental -ac 2 -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -f mp4 -threads 0 adiel.mp4
etc.. again all this commands produce a valid mp4 file which works on chrome,safari etc... and works even when I launch them in windows itself using window media player. When I put this file in the video tag (I am using http://videojs.com/) in IE9 it isn't working !
<div class="vidoco-content" style="margin-top: 20px;">
<video id="divVid" class="video-js vjs-default-skin vidoco-center" controls preload="none" width="600" height="400" poster="<?php echo(DOMAIN); ?>static/test.jpg">
<source src="<?php echo(DOMAIN); ?>static/out.mp4" type="video/mp4" />
</video>
If I use the software miro video converter to convert the same mov file to mp4 - it converted fine and I can play it in IE9! miro converter is also using embedd ffmpeg inside it so I am sure it's only a metter of the right ffmpeg command and parameters. In my apache htaccess I set the correct mime types for my files and I see it indeed correct when looking in IE developer tools:
AddType audio/aac .aac
AddType audio/mp4 .mp4 .m4a
AddType audio/mpeg .mp1 .mp2 .mp3 .mpg .mpeg
AddType audio/ogg .oga .ogg
AddType audio/wav .wav
AddType audio/webm .webm
AddType video/mp4 .mp4 .m4v
AddType video/ogg .ogv
AddType video/webm .webm
I am struggling with this for a long time so any help would be much appreciated.
Thanks!
from orig link...
WebM is fully supported in ffmpeg 0.6 and later. On the command line, run ffmpeg with no parameters and verify that it was compiled with VP8 support:
If you don’t see the magic words “
--enable-libvorbis
” and “--enable-libvpx
” you don’t have the right version of ffmpeg. (If you compiled ffmpeg yourself, check to see if you have two versions installed. That’s fine, they won’t conflict with each other. You’ll just need to use the full path of the VP8-enabled version of ffmpeg.)I’m going to do a two-pass encode. Pass 1 just scans through the input video file (-i pr6.dv) and writes out some statistics to a log file (which will be auto-named pr6.dv-0.log). I specify the video codec with the -vcodec parameter:
Most of the ffmpeg command line has nothing to do with VP8 or WebM. libvpx does support a number of VP8-specific options that you can pass to ffmpeg, but I don’t yet know how any of them work. Once I find a good explanation of them, I’ll link it here and incorporate them into the narrative if it’s worthwhile to do so.
For the second pass, ffmpeg will read the statistics it wrote during the first pass and actually do the encoding of the video and the audio. It will write out a .webm file.
There are five important parameters here:
-vcodec libvpx
specifies that we’re encoding with the VP8 video codec. WebM always uses VP8 video.-b 614400
specifies the bitrate. Unlike other formats, libvpx expects the bitrate in actual bits, not kilobits. If you want a 600 kbps video, multiply 600 by 1024 to get 614400.-s 320x240
specifies the target size, width by height.-aspect 4:3
specifies the aspect ratio of the video. Standard definition video is usually 4:3, but most high-definition video is 16:9 or 16:10. In my testing, I found that I had to specify this explicitly on the command line, instead of relying on ffmpeg to autodetect it.-acodec libvorbis
specifies that we’re encoding with the Vorbis audio codec. WebM always uses Vorbis audio.My issue was the pixel formatting.
Adding
-pix_fmt yuv420p
fixed it in IE for me.For
ffmpeg
: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
:EDIT: I found the solution! Here is a ZIP with a working demo that I tested on IE 9 and Firefox!
http://www.mediafire.com/download/kyavlpudybg0bc1/HTML5_video.zip
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:
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.
Had the same problem a while ago, and i successfully resolved in this way:
First , download the latest version of ffmpeg (or build from the official github repository (https://github.com/FFmpeg/FFmpeg ), if you want to make some experimentation).
Then try this:
Hope this will help out!
A Primary journey to ffmpeg
Follow the instructions to install Ffmpeg Binary In Windows
If you use libx264 presets (by using the -vpre flag) you need to do the following setup.
*NOTE: libfaac is not included in the build since libfaac is considered to be a non-free plugin
Remember to set the HOME environmental variable in windows
For mp4 (H.264 / ACC):
For webm (VP8 / Vorbis):
For ogv (Theora / Vorbis):
I spent many hours trying to figure that one out. I finally found how to do this properly using avconv (or ffmpeg)
Convert the video to MPEG4 using H.264 codec. You don't need anything fancy, just let avconv do the job for you:
Move the file info to the file header, so the browser can start playing it as soon as it starts to download it. THIS IS THE KEY FOR IE9!!!
qt-faststart
is a Quicktime utilities that also support H.264/ACC file format. It is part oflibav-tools
package.