RTSP-Server: Can't get multiple streams per URI to work

Martin Scheffler martinscheffler at gmail.com
Mon Jun 8 04:15:05 PDT 2015

Hi all,
I am trying to get multiple streams in a single RTSP session to work.

I think I have the server side correct:

#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
int main(int argc, char* argv[])
    gst_init (&argc, &argv);
    GMainLoop* loop = g_main_loop_new(NULL, FALSE);
    GstRTSPServer* server = gst_rtsp_server_new ();

    GstRTSPMountPoints* mounts = gst_rtsp_server_get_mount_points (server);
    GstRTSPMediaFactory* factory = gst_rtsp_media_factory_new();
    gst_rtsp_media_factory_set_launch (factory, "( audiotestsrc freq=1000
is-live=true !  audioconvert ! rtpL16pay name=pay0  audiotestsrc freq=5000
!  audioconvert ! rtpL16pay name=pay1 )");
    gst_rtsp_media_factory_set_shared (factory, TRUE);
    gst_rtsp_mount_points_add_factory (mounts, "/test", factory);
    g_object_unref (mounts);
    gst_rtsp_server_attach (server, NULL);
    g_main_loop_run (loop);
 return 0;
I can listen to the first stream with this command line:
gst-launch-1.0.exe rtspsrc location=rtsp://localhost:8554/test !
rtpL16depay ! queue ! audioconvert ! autoaudiosink
But how can I listen to the second one (pay1)?
I tried this GStreamer command line:
gst-launch-1.0.exe rtspsrc location=rtsp://localhost:8554/test name=src
src.stream_1 ! rtpL16depay ! queue ! audioconvert ! autoaudiosink
but that does not work. The server gives out a warning "media 05bxxx was
not prepared" and the client shows a datastream error.
I can connect to the server with VLC (although an ancient version, maybe it
is too old)?
VLC shows the two audio channels and plays the second one. The server
0:02:32.239700172  3376   00547960 ERROR             rtspclient
rtsp-client.c:1279:handle_play_request: client 00545D58:
 no aggregate path /test/stream=1
0:02:32.241088051  3376   00547960 ERROR             rtspclient
rtsp-client.c:947:handle_teardown_request: client 00545D
58: no aggregate path /test/stream=1
0:02:32.281316632  3376   05BC7768 WARN                  udpsrc
gstudpsrc.c:552:gst_udpsrc_create:<udpsrc8> error: get a
vailable bytes failed
0:02:32.282693343  3376   05BC7768 WARN                 basesrc
gstbasesrc.c:2933:gst_base_src_loop:<udpsrc8> error: Int
ernal data flow error.
0:02:32.284821948  3376   05BC7768 WARN                 basesrc
gstbasesrc.c:2933:gst_base_src_loop:<udpsrc8> error: str
eaming task paused, reason error (-5)
0:02:32.291064085  3376   00547960 WARN               rtspmedia
rtsp-media.c:3068:gst_rtsp_media_set_state: media 05BE21
18 was not prepared
So any chance of getting this to work?
Thanks for your help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150608/cc261c93/attachment-0001.html>

More information about the gstreamer-devel mailing list