title: VLC Webcam Streaming: How to go from a single stream to parallel streaming efficiently?
body: <p>I've long used <a href="http://www.yawcam.com/" rel="nofollow">Yawcam</a> for my basic webcam streaming needs with great success. Recently, I've come across a project for a non-profit at which I volunteer where they would like to stream a webcam on their public page. I'm trying to make the system as simple and well-supported as possible for when I finally can't support it anymore.</p>
  
  <p>With this philosophy in mind, I'm attempting to transition to VLC as it's support is just fantastic all over the web. I've written a little command that seems to get the job done (I'm new to this so I apologize if it's poorly written):</p>
  
  <pre><code>"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy dshow:// :dshow-vdev="HD 720P Webcam" :dshow-adev=:live-caching=300 :sout=#transcode{vcodec=theo,vb=800,scale=1,width=600,height=480,acodec=mp3}:http{mux=ogg,dst=127.0.0.1:8081/desktop.ogg} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
  </code></pre>
  
  <p>I took these elements from a few different sources on the web and in VLC generated commands.</p>
  
  <p>My HTML file is very simple and uses the <strong>video</strong> tag.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Video Test&lt;/title&gt;
          &lt;meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"&gt;
          &lt;META HTTP-EQUIV="Pragma" CONTENT="no-cache"&gt;
      &lt;/head&gt;
      &lt;body&gt;
           &lt;video id="video" src="http://localhost:8081/desktop.ogg" type="video/ogg; codecs=theora" autoplay="autoplay"&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This works great! There's about a 2 second delay on my current machine, but that shouldn't matter much for the current application (although suggestions about how to reduce that down to more like ~100-200ms would be very welcome).</p>
  
  <p>What I don't know how to do (I'm an embedded systems engineer, not a web developer), is use these concepts to make the system efficiently accessible by many users at once. Based on how it works now, I assume this is a point-to-point connection. As such, the webcam would need to be connected to the server (at the moment just a PC on my desk). Obviously I'm not hosting a server that can handle the sort of traffic they're hoping for. Is there some server side code that could run where it connects to the webcam and forwards the stream on to whoever requests access? I haven't looked at their servers, but I'm pretty sure they have some sort of linux computer hosted out of the animal shelter.</p>
  
  <p>I'm hoping to make the architecture:</p>
  
  <p>PC Running Webcam Hosting Single Stream -> Web Server Reads Stream and Forwards to Requesters-> Users Receive Stream</p>
  
  <p>I know I've got big knowledge gaps, but I'm a quick study if anyone can point me to references that might guide me in the right direction!</p>
  
  <p>Thanks so much for any advice!</p>