Search code examples
streamgstreamerrtsp

gstreamer: cannot launch rtsp streaming


I am new to gstreamer. Although it sounds like a very entry-level question I couldn't find clear answer so far.

I try to launch server like below according to some example.

$ gst-launch-1.0 -v videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 ! udpsink rtsp://127.0.0.1:8554/test

Then I use VLC as client (on the same computer).

$ vlc rtsp://127.0.0.1:8554/test

VLC reports error of "Unable to connect...". But if I use "test-launch" in the first step, it works fine.

Another question is besides VLC, I try to launch client like this.

$ gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! ffdec_h264 ! xvimagesink

But gstreamer complains no element "ffdec_h264" and no element "xvimagesink".

For extra info, I installed "gstreamer" and "gst-plugins-base/good/bad/ugly", all from git (1.2 version).

Thank you so much for the hint.


Solution

  • ffdec_h264 is from gst-0.10, so you need to use avdec_h264 in gst-1.0 instead. By the other hand, I use to play autovideosink sync=false as pipeline sink in my udp stream.

    There is an example code in gst-rtsp-0.10.8/examples that can help you with the rstp stream server, but I suggest you receive the stream using udpsrc in gstreamer in order to reduce the delay (use -v option in the source to see caps parameter and configure it in the receiver).

    If you want VLC to play your rtsp stream you need to define the .sdp file according to your rtsp stream session.

    You should see this question for more info: GStreamer rtp stream to vlc