Live WebM video streaming with Flumotion

The objective of this post is to setup live WebM streaming using Flumotion on a Linux box running Ubuntu (10.04 in this case).

WebM is a codec and container format based on the matroska container, it uses the Vorbis codec for audio and the VP8 codec for video. It is a royalty-free format for the Web. H.264 is an open standard but is encumbered with patents. Although Ogg is quite similar to WebM, Ogg suffers from FUD regarding its royalty-free standing.

Install Flumotion

We’ll install Flumotion version 0.8.1-1flu1~lucid1. Add package repository source ppa:flumotion-dev/flumotion to Synaptic Package Manager, reload and install the version indicated. You can also use:

sudo apt-add-repository ppa:flumotion-dev/flumotion

Build and install VP8 plugin and GStreamer

Ubuntu Natty Narwhal (11.04) includes version 0.10.32 of GStreamer. If you are using that or a newer version, just install package gst-plugins-bad, and jump to section Execute a test audio/video using Flumotion.

Install the following packages (and their dependencies) using Synaptics Package Manager or sudo apt-get install:

  • bison
  • flex
  • libasound2-dev
  • libglib2.0-dev
  • libx11-dev
  • libxml2-dev
  • libvorbis-dev
  • x11proto-video-dev
  • yasm (required to build VP8 lib from Google)

Execute the following commands to build and install VP8 codec lib version 0.9.6 from source:

sudo make install

The same sequence of commands is to be used for the following:

Prepare GStreamer

make install puts libraries under /usr/local/lib. We’ll have to add that path to the LD_LIBRARY_PATH environment variable. You can configure make to install libraries and binaries to /usr instead of /usr/local by passing --prefix=/usr option to the configure commands issued above.

We’ll need to rebuild the GStreamer plugins registry. Open a terminal and execute:

export LD_LIBRARY_PATH=/usr/local/lib
export GST_PLUGIN_SYSTEM_PATH=/usr/local/lib/gstreamer-0.10
rm ~/.gstreamer/registry*

Test that GStreamer is properly setup and can encode/decode WebM, using the following commands. This is not required for Flumotion to stream WebM, so skip this sanity check if you want.

gst-launch audiotestsrc ! audioconvert ! audio/x-raw-int,channels=2 ! alsasink

gst-launch videotestsrc ! autovideosink

gst-launch filesrc location=file.webm ! matroskademux name=d d. ! queue ! vp8dec ! ffmpegcolorspace ! autovideosink d. ! queue ! vorbisdec ! audioconvert ! audioresample ! alsasink

gst-launch ximagesrc ! video/x-raw-rgb,framerate=5/1 ! ffmpegcolorspace ! vp8enc ! queue ! mux. audiotestsrc ! audioconvert ! audioresample ! vorbisenc ! queue ! mux. webmmux name="mux" ! filesink location=desktop.webm

We are now ready to execute flumotion-admin to create a test WebM audio/video stream over HTTP. Use the same terminal session so that environment variables exported earlier are available to flumotion-admin. Without this you’ll get the following message when you setup live streaming:

Worker 'localhost' is missing GStreamer element 'vp8enc'. Please install the necessary GStreamer plug-ins that provide these elements and restart the worker.

Debug failure to load a GStreamer plugin

Things can go wrong when a GStreamer plugin is loaded, you may have need to troubleshoot such issues. Try loading that plugin using gst-inspect, for instance:

gst-inspect /usr/local/lib/gstreamer-0.10/

Set debug trace level to see detailed debug messages when the above command is executed:

export GST_DEBUG=5

Execute a test audio/video using Flumotion

Follow the manual, see section A Simple Example.

Play in Chrome using the video element

Create an html file with the following markup and open in Chrome:

  <video autoplay="true" controls="controls">
    <source src="" type="video/webm">


5 thoughts on “Live WebM video streaming with Flumotion

  1. on latest Fedora nothing to do at all just you have to do yum install flumotion and it does all these things and the admin app is ready to stream

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s