Friday 21 May 2010

Viewing and converting to WebM video

Here are my notes on using the newly released WebM video format sponsored by Google and released on 19 May 2010. See http://webmproject.blogspot.com/2010/05/introducing-webm-open-web-media-project.html

WebM viewer programs for Windows

Chromium build 47798
Labs Opera build 21868
Media Player Classic build 1.1.796.0 MPC Compiler VS 2005 FFmpeg Compiler GCC 4.3.2

WebM encoding methods

Download the DirectShow filters from http://code.google.com/p/webm/downloads/list and register them as described in http://www.webmproject.org/tools/

Download the ffmpeg.exe Windows binary from http://micksam7.com/blog/index.php/?p=743 linked from http://tempvariable.blogspot.com/2010/05/converting-video-to-webm-format.html

You now have a few ways to transcode existing videos to WebM:

ffmpeg command line

ffmpeg.exe -i test.avi -b 50k -aq 30 -threads 2 -ab 32k -aq 60 -ac 2 testavi.webm


The "-ac 2" appears to be essential when the audio stream is mono, the other options can be varied.

ffmpeg.exe -i test.avi -vstats_file file.vstats -v 1 -loglevel 1 -ac 2 nullout.webm


The above command line logs each encoded frame's video statistics to the file.vstats


ffmpeg.exe -i stereo.flv -b 400k -ab 60k stereoflvb400ab60.webm


The above command line encodes a stereo FLV input into a 400 kbps VP8 video strean and a 60 kbps Vorbis audio stream

ffmpeg.exe -i stereo.flv -vb 120k -ab 96k -ac 2 stereoflvb120ab96.webm


The
above command line encodes the same stereo FLV input into a 120 kbps VP8 video strean and a 96 kbps Vorbis audio stream

GraphEdit

This is more difficult; all that works for me is transcoding video without sound, all my attempts at including vorbis lead to assertion errors in the DirectShow filters. An example and more details are at http://www.youtube.com/watch?v=voLjKGU3VSQ

Sorenson Squish

You need to subscribe to Sorenson for a free Developer account and then install first Java and then the Sorenson plugin that lets you transcode videos to webm. This is awkward as the plugin uploads the result to the 360 web site which you then need to download again to your computer. However I found it worked for more videos than did GraphEdit, but fewer than the recently built ffmpeg.exe binary.

Wildform Flix WebM

Wildform is offering a free webm encoder. Download it from http://www.wildform.com/products/flix/ . It has a windows interface but it uses a set of preset encodings which you need to examine and change to suit the input video you are encoding. In particular as a default it changes the frame rate, frame size, and bitrates. Click the "Vid/Aud" tab and change these to your required settings before clicking the encode button. I enabled "Use Source Dimensions" and "Use source FPS". Click File/Save settings as" to save the settings for future encodings. I found it produced playable output videos with these limitations:
  • FLV input causes it to crash
  • pressing play in the interface can cause it to crash, so always use an external player
  • output size appears to be larger than ffmpeg.exe produces, I am unsure why
Edited at 06:00 2010-05-22 UTC to add the following:

VLC with WebM support


A Windows installer for the Video LAN media player is available at http://people.videolan.org/~jb/webm/
It tests well with WebM videos I transcoded using the new ffmpeg.exe, but I have not yet tested how well it encodes videos to WebM.

YouTube WebM support

* The first 23 seconds of Big Buck Bunny uploaded as 1080p transcoding to YouTube as http://www.youtube.com/watch?v=jdqvZ2dP6AQ - YouTube only shows 360 and 720p choices

The above is the uploaded WebM transcoding but embedded in a low resolution Flash player, click the following link to go directly to the YouTube page with more choices: Big Buck Bunny at 1080p WebM

* The same 23 seconds uploaded as the original Theora OGG to http://www.youtube.com/watch?v=qzfWVYJNmAM - YouTube shows four choices: 360, 480, 720p and 1080p


The above is the uploaded Theora OGG clip (not WebM) embedded in a Flash player, click the following link to get a choice of all four sizes: Big Buck Bunny at 1080p

Command lines used to transcode the OGG to WebM:

oggz-chop.exe --end 23.083 --output b_23_083.ogv big_buck_bunny_1080p_stereo.ogg

ffmpeg.exe -i b_23_083.ogv -acodec copy -aspect 16:9 -b 4000k bbb23_083aspect16_9b4000.webm

No comments:

Post a Comment