I had to take a promotional video for work and make it available for a targeted marketing campaign. The requirement was pretty simple, make it available to any HTML browser. The challenge was the the original file was only made available as an MP4. And we have no tools/budget to convert this to the other video formats HTML5 browsers may expect.
What is the right way to convert video to encoding that works well in all HTML5 formats? That depends, but I'll show you one way that worked for me in this case.
After a little digging, seems it is really easy to get HTML5 video converted from an MP4 source video using FFMpeg from a command prompt in Windows. I was successful using the examples below on Windows 8.1
For Webm I use the following.
ffmpeg -i SourceVideo.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output.webm
for ogv I use this.
ffmpeg -i SourceVideo.mp4 -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 output.ogv
In this example, "SourceVideo.mp4" is my original video, and "Output.*" is my new video after conversion.
If you need the ogg file to be named with an ogg extension, just rename it - it will still work.
Comments
Post a Comment