title: Live Streaming to Browser
body: <p>I'm a bit at my wits end here.</p>
  
  <p>I want to stream a live video broadcast to a web browser.</p>
  
  <p>Currently I use ffmpeg to stream a directshow live source as a webm stream to node.js which then forwards the stream to the http request from the <code>&lt;video&gt;</code> element. So far everything works. </p>
  
  <p>live source -> ffmpeg -> POST [webm] -> node.js -> GET [webm] -> video tag</p>
  
  <p>My problem is that the source clock and the web clients clock doesn't exactly match each other (not that surprising). For video this is not a problem, dropping or duplicating a frame every now and then is not noticeable. However, with audio it is another issue. From what I've been able to figure out so far Chrome (or any other browser) does not perform any form of audio resampling compensation (e.g. <code>swr_set_compensation</code> from ffmpeg) to compensate this mismatch. Instead I get quite audible audio distortions (a loud beep) when the playback buffer runs out of samples.</p>
  
  <p>My question is whether it is possible to achieve proper playback (with <strong>audio</strong>) of a live source in a web browser? </p>
  
  <p>I haven't tried using silverlight or flash for playback yet. Would that possibly work better?</p>