I am using FFMPEG to convert a video to .mp4, ,ogg, .webm so that it may be viewed in all HTML5 capable browsers using the video tag. The problem is that I manage to convert the video to the 3 required formats but it does not display the video in the video tag, all I get is IE9: red cross, Firefox: Grey cross, could it be a problem with the conversion or is it something to do with the way I am adding them to the source of the video tag. Here is what I have done:
-
FFmpeg command line(s):
ffmpeg -i test.mp4 test.mp4 ffmpeg -i test.mp4 test.ogg ffmpeg -i test.mp4 test.webm -
Here is the video tag:
<video id="video" height="340" width="470" onplaying="PlayVideoFromVid('PAUSE')" onpause="PlayVideoFromVid('PLAY')" onended="ResetVideo()" preload="true" autobuffer="true" controls="true"> <source src="test.ogg" type="video/ogg"></source> <source src="test.mp4" type="video/mp4"></source> </video> -
Webconfig lines for the video support:
<staticContent> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> <mimeMap fileExtension=".ogg" mimeType="audio/ogg" /> <mimeMap fileExtension=".oga" mimeType="audio/ogg" /> <mimeMap fileExtension=".ogv" mimeType="video/ogg" /> <mimeMap fileExtension=".webm" mimeType="video/webm" /> </staticContent>
It would be great if someone could send me the required parameters for ffmpeg to convert the video to the 3 required formats and an example of how they setting the source in the video tag to display them again. And any other advise would be great like how to set the quality up etc when doing the conversion.
Thanks in advance.
Sorted it out, thanks for all the help 🙂 I found the following:
1. You need to download the latest ffmpeg + the presets:
ffmpeg.arrozcru.org/autobuilds/ffmpeg/mingw32/static/
2. You need to create a HOME environmetal variable:
(a) http://www.moosechips.com/2009/08/installing-ffmpeg-binary-in-windows/
(b) http://www.itechtalk.com/thread3595.html
3. Copy the presets under the environmental variable folder
4. You need to use the following commands to convert using ffmpeg:
For mp4 (H.264 / ACC):
For webm (VP8 / Vorbis):
For ogv (Theora / Vorbis):