Using ffmpeg to encode video with webm

A good friend asked me the other day whether or not ffmpeg supported the new webm (Google VP8) video format.   As it turns out, ffmpeg 0.6 and above does support encoding VP8 video (the actual video codec) and Ogg Theora Vorbis audio (the audio codec) and packaging the two together in a webm container that can be used to embed video for HTML 5 browsers.

Going back to my previous ffmpeg example where I took a bunch of images and stitched them into video in mpeg-4 format I will throw together a quick example where we create a video in webm format.

The command line parameters I am using with ffmpeg:
\ffmpeg\bin\ffmpeg -r 10 -b 1800 -i img%04d.jpg -f webm test1800.webm

So following the previous example, I already have a folder with all my images, etc.  The difference between the two command lines is the new -f webm option I included.  This will tell ffmpeg to force the format to webm on the encoded file.  You can see the results of the output here:

This is not a very serious example, but it should give you a little to go off of.  Also note, encoding for webm takes longer than say, mpeg4.


5 thoughts on “Using ffmpeg to encode video with webm

  1. “VP8 is not ready for prime-time; the spec is a pile of copy-pasted C code and the encoder’s interface is lacking in features and buggy. They aren’t even ready to finalize the bitstream format, let alone switch the world over to VP8.

    With the lack of a real spec, the VP8 software basically is the spec–and with the spec being “final”, any bugs are now set in stone. Such bugs have already been found and Google has rejected fixes.”

  2. Just google search Step by Step Guide on How to Convert MP4, AVI, FLV, WMV to WebM on Mac and Windows?

    you will find a powerful WebM Converter which is both a professional WebM encoder and a powerful WebM
    decoder. As a WebM encoder, it can encode and convert various videos to
    WebM for HTML5 video like MP4 to WebM, AVI to WebM, WMV to WebM, MOV to
    WebM, MPG to WebM, FLV to WebM, MKV to WebM, etc. As a WebM decoder, it
    can convert WebM to many other videos such as MP4, MOV, AVI, 3GP, FLV,
    H.264, MKV, WMV, RM, Xvid, DivX, etc., and it can also extract music
    from WebM/VP8 and save as OGG, MP3, AAC, AC3, WAV, WMA, etc

  3. Hi!

    I have the same problem at my vexxhost-servers …

    I’m using:
    /usr/local/vencode/bin/ffmpeg -r 8 -f image2 -i www/ -f webm -b 500k -y www/

    But it’s not working?!?

    Any idea what is going wron there?!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s