title: Why can I stream h264 encoded video from webcam to BOTH display and file, but NOT raw video?
body: <p>I want to stream raw video from a Logitech C920 webcam and while <strong>both</strong> displaying and saving the video to file using GStreamer 1.0. </p>
  
  <p>This works if I stream h264 encoded video from the camera (the camera provides hardware encoded h264), but it fails if I stream raw video from the camera. However, if I only display, or only save to file, streaming raw video works.</p>
  
  <p>Why does it work with a h264 video stream but not with a raw video stream?</p>
  
  <p>h264 encoded video stream from camera to BOTH display and file (WORKS):</p>
  
  <pre><code>gst-launch-1.0 -v v4l2src device=/dev/video0 \
      ! video/x-h264,width=640,height=480,framerate=15/1 ! tee name=t \
      t. ! queue ! h264parse ! avdec_h264 ! xvimagesink sync=false \
      t. ! queue ! h264parse ! matroskamux \
      ! filesink location='h264_dual.mkv' sync=false
  </code></pre>
  
  <p>raw video stream from camera to ONLY display (WORKS):</p>
  
  <pre><code>gst-launch-1.0 -v v4l2src device=/dev/video0 \
      ! video/x-raw,format=YUY2,width=640,height=480,framerate=15/1 \
      ! xvimagesink sync=false
  </code></pre>
  
  <p>raw video stream from camera to ONLY file (WORKS):</p>
  
  <pre><code>gst-launch-1.0 -v v4l2src device=/dev/video0 \
      ! video/x-raw,format=YUY2,width=640,height=480,framerate=15/1 \
      ! videoconvert ! x264enc ! matroskamux \
      ! filesink location='raw_single.mkv' sync=false
  </code></pre>
  
  <p>raw video stream from camera to BOTH display and file (FAILS):</p>
  
  <pre><code>gst-launch-1.0 -v v4l2src device=/dev/video0 \
      ! video/x-raw,format=YUY2,width=640,height=480,framerate=15/1 \
      ! tee name=t \
      t. ! queue ! xvimagesink sync=false \
      t. ! queue ! videoconvert ! x264enc ! h264parse ! matroskamux \
      ! filesink location='raw_dual.mkv' sync=false
  </code></pre>
  
  <p>The last command (raw video to both display and file) fails without any warnings or errors. The gst-launch terminal output is exactly the same as when only writing to file. The xvimage window appears and displays an image from the camera, but the image does not change (i.e. it is frozen). A zero bytes file appears too.</p>
  
  <p>I have tried multiple versions of the above commands, but I think those are the minimal commands that can reproduce the problem.</p>
  
  <p>Does anyone understand what I am doing wrong?</p>