Tutorial: A working example for rtsp output in c

Sure.

After compiling code by
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)

Then by running
./test-launch "videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96"

I got these message:
stream ready at rtsp://127.0.0.1:8554/test

Now by running this command in another terminal
gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink

I got these message:


Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
Additional debug info:
gstrtspsrc.c(6585): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Service Unavailable (503)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

And by opening stream in VLC , I got this error:


Your input can't be opened:

VLC is unable to open the MRL 'rtsp://MY_IP:8554/test'. Check the log for details.