Convert Videos (MP4, MPEG, or MOV) to WEBM

By  on  

In an effort to make the web and media more efficient, developers and corporations everywhere are investing effort in creating better file formats and delivery streams.  One of the more impressive video formats I've seen is the WEBM file format.  WEBM files are quite small but the quality is still impressive.  If you're ready to support and serve WEBM, here's how you can convert your traditional file format videos to WEBM!

You're going to use ffmpeg, as you could probably guess.  Thanks to a tip from the Theme Foundry, here's the shell command magic that will convert your video to WEBM:

ffmpeg -i trailer.mov -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis trailer.webm

A comparison of quality is the same but the comparison in file size is fractional.

Supporting WEBM on Apache Servers

You may need to add support to your Apache server for WEBM since it's a newer format. Here's how I added WEBM support via .htaccess:

AddType video/webm webm

WEBM will be a great format moving forward and I look forward to seeing our legacy formats leave while new formats take over.  It's a true sign that the future is mobile!

Recent Features

  • By
    Introducing MooTools Templated

    One major problem with creating UI components with the MooTools JavaScript framework is that there isn't a great way of allowing customization of template and ease of node creation. As of today, there are two ways of creating: new Element Madness The first way to create UI-driven...

  • By
    Write Better JavaScript with Promises

    You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...

Incredible Demos

  • By
    pointer Media Query

    As more devices emerge and differences in device interaction are implemented, the more important good CSS code will become.  In order to write good CSS, we need some indicator about device capabilities.  We've used CSS media queries thus far, with checks for max-width and pixel ratios.

  • By
    MooTools Flashlight Effect

    Another reason that I love Twitter so much is that I'm able to check out what fellow developers think is interesting. Chris Coyier posted about a flashlight effect he found built with jQuery. While I agree with Chris that it's a little corny, it...

Discussion

  1. MaxArt

    WebM is indeed an impressive format that only needs some wider support, starting from Microsoft – but it won’t happen any time soon, I guess. Same story for WebP, that could replace png, jpeg and even animated gifs.

    • Supposedly mozjpeg is better than webp too!

  2. Hi,

    Is there anyway to create webm video from pptx?

  3. Bushwazi

    First time commenter, long time reader…

    I used FireFogg to generate webm videos as well: http://firefogg.org/

  4. Tonya Rose

    Awesome! I just learned how to edit webm files from this: http://www.videostudiopro.com/en/pages/webm-file/ and I wanted to convert some mp4 files to webm and practice a bit. I tried your way and it works great! Thanks for the tip!

  5. Shifflett Kristen

    Thank you for these instructions, really helpful!! I used to convert MP4 video to Webm video with Acethinker video converter, It is a cloud based software to convert videos without install any software in your device. Share it here as an alternative method.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!