title: Read RTSP Stream from UDP sink using Python OpenCV and GStreamer
body: <p>We're developing a software to stream videos from two different cameras with RTSP using GStreamer. To simplify the acquisition process, we're using OpenCV with Python 3.</p>
  <p>The problem is: we wanna push the stream to UDP sink, republish it over our LAN as a RTSP Stream and than read it in another PC. But we can't get this to work.</p>
  <p>This is the Python code that gets the camera images and starts the streaming with <code>udpsink</code>. In this case we're accessing our local webcam so that the code may be straightforwardly tested by anyone.</p>
  <pre><code>import cv2
  import time
  from multiprocessing import Process
  
  def send():
      video_writer = cv2.VideoWriter(
          'appsrc ! '
          'videoconvert ! '
          'x264enc tune=zerolatency speed-preset=superfast ! '
          'rtph264pay ! '
          'udpsink host=127.0.0.1 port=5000',
          cv2.CAP_GSTREAMER, 0, 1, (640, 480), True)
  
      video_getter = cv2.VideoCapture(0)
  
      while True:
  
          if video_getter.isOpened():
              ret, frame = video_getter.read()
              video_writer.write(frame)
              # cv2.imshow('send', data_to_stream)
              time.sleep(0.1)   
  
  if __name__ == '__main__':
      s = Process(target=send)
      s.start()
      s.join()
      cv2.destroyAllWindows()
  </code></pre>
  <p>When running this, we only get one warning:</p>
  <pre><code>[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
  </code></pre>
  <p>Then we try to republish the stream over our LAN as RTSP using the <code>examples/test-launch</code> from GStreamer</p>
  <pre><code>./test-launch &quot; udpsrc port=5000 ! h264parse ! rtph264pay name=pay0 pt=96&quot;
  </code></pre>
  <p>This gives us no errors but the default message</p>
  <pre><code>stream ready at rtsp://127.0.0.1:8554/test
  </code></pre>
  <p>And then VLC fails to open the stream at this address.</p>
  <pre><code>                     ~$ vlc -v rtsp://127.0.0.1:8554/test
  VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
  [000055f5dacf3b10] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
  Qt: Session management error: None of the authentication protocols specified are supported
  [00007f5ea40010f0] live555 demux error: Failed to connect with rtsp://127.0.0.1:8554/test
  [00007f5ea4003120] satip stream error: Failed to setup RTSP session
  </code></pre>
  <p>I guess it's something with our pipelines, but I really don't get what it could be.
  Any help will be appreciated. Thanks in advance.</p>