title: Writing into GStreamer pipeline from OpenCV does not work
body: <p>I wrote an RTSP server using the gst-rtsp-server library that is using the following pipeline:</p>
  
  <pre><code>udpsrc port=8553 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! x264enc tune=zerolatency ! rtph264pay name=pay0 pt=96
  </code></pre>
  
  <p>This outputs just fine in VLC media player when I feed the UDP source through command line:</p>
  
  <pre><code>gst-launch-1.0 -v videotestsrc ! video/x-raw,width=800,height=600,codec=h264,type=video ! videoscale ! videoconvert ! x264enc tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=8553
  </code></pre>
  
  <p>Instead of using the videotestsrc I want to read from webcam and process the image using OpenCV with GStreamer in Python. I have built OpenCV from source with GStreamer support.</p>
  
  <p>Unfortunately this does not work:</p>
  
  <pre class="lang-py prettyprint-override"><code>import cv2
  import numpy
  
  capture = cv2.VideoCapture(0)
  
  # Identical to command line pipeline but using appsrc
  output = cv2.VideoWriter('appsrc ! video/x-raw,width=800,height=600,codec=h264,type=video ! videoscale ! videoconvert ! x264enc tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=8553', 0, 30, (800, 600))
  
  while capture.isOpened():
      retval, frame = capture.read()
  
      if retval:
          frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
          output.write(frame)
  
          if cv2.waitKey(1):
              break
      else:
          break
  
  capture.release()
  output.release()
  </code></pre>
  
  <p>I am not getting any errors, but VLC does not display anything either. What am I doing wrong?</p>