title: How to "tee" /dev/video in Linux?
body: <p>How can I "tee" the output of a /dev/videox device, so that the live video stream can be consumed by two programs at the same time? </p>
  
  <p>I want to send live video from /dev/video1:input=1:norm=NTSC to two programs at once (mplayer and mencoder), in order to get a non-laggy live view at the same time mencoder is recording.</p>
  
  <p>I know how to take the just-encoded output from mencoder and play it, but that introduces a delay of several frames (too much). I'm told VLC can do this, but also not without significant lag.</p>
  
  <p>The best I can do now is to have mplayer play it to the screen, and at time same time use "avconv -f x11grab" to grab the video off the display and encode it. That works (it doesn't add latency) but grabbing video off the display is slow - I end up with around 10 fps instead of 30.</p>
  
  <p>There must be some straightforward way to "tee" /dev/video1 into two virtual devices, so both mplayer and mencoder can read them at the same time (without one of them complaining that the device is "busy").</p>
  
  <p>What is that way?</p>