title: HTML5 solution to upload a webcam/camera video stream to server
body: <p>Using <a href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html" rel="noreferrer">getUserMedia</a> I can capture video stream from client's webcam/camera. And using <code>video</code> tag I can show it on client's browser. Code:</p>
  
  <pre><code>&lt;video autoplay&gt;&lt;/video&gt;
  
  &lt;script type="text/javascript"&gt;
      window.URL = window.URL || window.webkitURL;
      navigator.getUserMedia  = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
  
      var video = $('video')[0];
  
      var failed = function(e) {
          console.log('Denied!', e);
      };
  
      if( navigator.getUserMedia ) {
          navigator.getUserMedia( {video: true, audio: true}, function( stream ) {
                  video.src = window.URL.createObjectURL(stream);
              }, failed
          )
      } else {
          console.log( 'Not supported!' );
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Now is it possible to send this video stream, either as a realtime feed or after user has done recording and decided to upload, to a server?</p>
  
  <p>I found few examples of:</p>
  
  <ul>
  <li><a href="http://dathor.blogspot.in/2011/04/html5-websockets-sending-binary-data.html" rel="noreferrer">sending binary images to server over websocket</a></li>
  <li><a href="http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/" rel="noreferrer">Periodically capture frame of streaming video and send that as image</a></li>
  </ul>