title: Setting up an USB webcam RTSP stream with GStreamer
body: <p>I'm using GStreamer to send the camera feed of <code>/dev/video1</code> (Raspberry Pi's usb webcam) through a RTSP server that I can connect with another Raspberry Pi.</p>
  <p>Result of <code>v4l2-ctl -d /dev/video1 --list-formats</code>:</p>
  <pre><code>ioctl: VIDIOC_ENUM_FMT
      Type: Video Capture
  
      [0]: 'MJPG' (Motion-JPEG, compressed)
      [1]: 'YUYV' (YUYV 4:2:2)
  </code></pre>
  <p>The pipeline I'm using is</p>
  <pre><code>./gst-rtsp-launch --port 8555 '( v4l2src device='/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! rtpjpegpay name=pay0 pt=96 )' --gst-debug-level=3`
  </code></pre>
  <p>When running it, and letting the other machine connect, the console gives this message:</p>
  <pre><code>0:00:02.097412343  3234 0xb4c1c0c0 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:&lt;appsrc0:src&gt; Creating random stream-id, consider implementing a deterministic way of creating a stream-id
  0:00:02.102907578  3234 0xb5a07600 WARN                 v4l2src gstv4l2src.c:692:gst_v4l2src_query:&lt;v4l2src0&gt; Can't give latency since framerate isn't fixated !
  0:00:02.170888076  3234 0xb4c1b980 WARN          v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:&lt;v4l2src0:pool:src&gt; Uncertain or not enough buffers, enabling copy threshold
  0:00:02.410829991  3234  0x166ba90 FIXME              rtspmedia rtsp-media.c:3581:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
  0:00:02.414457433  3234  0x166ba90 FIXME              rtspmedia rtsp-media.c:3581:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
  0:00:02.414551635  3234  0x166ba90 WARN               rtspmedia rtsp-media.c:3607:gst_rtsp_media_suspend: media 0xb5a34130 was not prepared
  0:00:03.878249884  3234  0x166ba90 WARN               rtspmedia rtsp-media.c:3868:gst_rtsp_media_set_state: media 0xb5a34130 was not prepared
  </code></pre>
  <p>On the client Raspberry Pi, using VLC on the static IP <code>vlc rtsp://192.168.0.10:8555/video</code>, gives this error (and triggers the previous one in the other board):</p>
  <pre><code>mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
  mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
  mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
  mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
  mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
  mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
  mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
  mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
  mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x909bcaa0 (EINVAL)
  Falha de segmentação
  </code></pre>
  <p>The last line means &quot;Segmentation fault&quot;. The screen in the client board flickers black before giving this error, and the board connect to the webcam only shows this error after the client connected.</p>
  <p>Connecting to localhost on the same board using <code>vlc rtsp://127.0.0.1:8555/video</code> works for a little bit, then it breaks.</p>
  <p>How can I fix this pipeline, so the video can be shown correctly through connection between the two boards?</p>