title: Corrupted video frames when streaming H264 over RTSP
body: <p>When I stream H264 video over RTSP and use VLC to view the video feed, the video feed is corrupted (partly green but moving objects are still detected). However, if I stop the VLC and restart it again, the video feed is no longer corrupted. Why is it so, and how can I remedy this issue? Thanks!</p>
  
  <p>The H264 is coming natively from a USB camera into a Raspberry Pi. Below is the code within the crontab of the Pi for launching the g-streamer and RTSP server. </p>
  
  <p><code>@reboot bash /home/pi/gst-rtsp-server/examples/test-launch '( v4l2src device=/dev/video1 ! video/x-h264, width=320, height=240, framerate=20/1 ! h264parse ! rtph264pay name=pay0 pt=98 config-interval=10 )'</code></p>
  
  <p>The Raspberry Pi is connected over a network. I am using VLC on another computer to view the video feed.</p>
  
  <p><code>vlc rtsp://10.146.0.57:8554/test</code></p>
  
  <p>If I reboot the Pi, the video feed on the VLC will be corrupted. I can still see moving objects in the video feed but there will be green and purple pixels all over. </p>
  
  <p>However, if I close the VLC and start VLC again, the issue is gone. The video feed is clean.</p>
  
  <p>The output of VLC:
  <code>
  [0000557c34211570] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
  Created new TCP socket 35 for connection
  libEGL warning: DRI2: failed to authenticate
  libEGL warning: DRI2: failed to authenticate
  [00007fd9b800df20] main decoder error: buffer deadlock prevented
  </code></p>