title: Command-line streaming webcam with audio from Ubuntu server in WebM format
body: <p>I am trying to stream video and audio from my webcam connected to my headless Ubuntu server (running Maverick 10.10). I want to be able to stream in WebM format (VP8 video + OGG). Bandwidth is limited, and so the stream must be below 1Mbps.</p>
  
  <p>I have tried using FFmpeg. I am able to record WebM video from the webcam with the following:</p>
  
  <pre><code>ffmpeg -s 640x360 \
  -f video4linux2 -i /dev/video0 -isync -vcodec libvpx -vb 768000 -r 10 -vsync 1 \
  -f alsa -ac 1 -i hw:1,0 -acodec libvorbis -ab 32000 -ar 11025 \
  -f webm /var/www/telemed/test.webm 
  </code></pre>
  
  <p>However despite experimenting with all manner of vsync and async options, I can either get out of sync audio, or Benny Hill style fast-forward video with matching fast audio. I have also been unable to get this actually working with ffserver (by replacing the test.webm path and filename with the relevant feed filename).</p>
  
  <p>The objective is to get a live, audio + video feed which is viewable in a modern browser, in a tight bandwidth, using only open-source components. (None of that MP3 format legal chaff)</p>
  
  <p>My questions are therefore:
  How would you go about streaming webm from a webcam via Linux with in-sync audio? What software you use?</p>
  
  <p>Have you succeeded in encoding webm from a webcam with in-sync audio via FFmpeg? If so, what command did you issue?</p>
  
  <p>Is it worth persevering with FFmpeg + FFserver, or are there other more suitable command-line tools around (e.g. VLC which doesn't seem too well built for encoding)?</p>
  
  <p>Is something like Gstreamer + flumotion configurable from the command line? If so, where do I find command line documentation because flumotion doc is rather light on command line details?</p>
  
  <p>Thanks in advance!</p>