title: NodeJS piping with ffmpeg
body: <p>I wanted to do a HTTP live stream on a screen cast with using ffmpeg, nodejs and html5 . I wanted it to be as real time as possible. However, I find that my video received by the client was behind by 1~2 seconds (On Chrome/Chromium). I am using vp8/webm as my codec.
  <br><br>
  I have eliminated the following factors as such:<br>
  1) Network: I have tried serving and receiving the video file locally by stating the video source to be 127.0.0.1:PORT or localhost:PORT 
  <br>
  2) ffmpeg encoding speed:I have tried outputting the file locally, it the "delay" seems to be negligible.
  <br>
  3) Chrome internal buffer. The buffer was accounted to be 0.07s~0.08s. 
  <br><br>
  On the nodeJS side, I have a child process that runs the ffmpeg command, and did a ffmpeg.stdout.pipe(res); &lt;-- ffmpeg is child_process.spawn(...)</p>
  
  <p><br>
  So it seems that the ffmpeg.std.pipe(res) of nodejs seems to be the one delaying the video stream. Am  I correct in assuming so ? Is there anyway that I may reduce the delay ? </p>