Playing RTSP Stream from own C++ program

kostya primenko_k at mail.ru
Mon Jul 29 04:28:23 PDT 2013


I have network camera that streams video via RTSP.
When I use following command:

/*GST_DEBUG=rtspsrc:5 GST_DEBUG_NO_COLOR=1 gst-launch rtspsrc
location=rtsp://192.168.0.10/live1.sdp ! fakesink*/

Everything seems all right.
But when I compile my own program, that should do the same, error occurred:

/gstrtspsrc.c:2238:new_manager_pad:<rtspsrc0> got new manager pad
<rtpbin0:recv_rtp_src_0_3752911058_96>
0:00:01.024414062   237   0x120420 DEBUG                rtspsrc
gstrtspsrc.c:2246:new_manager_pad:<rtspsrc0> stream: 0, SSRC 2147483647, PT
96
0:00:01.025939941   237   0x120420 DEBUG                rtspsrc
gstrtspsrc.c:2270:new_manager_pad:<rtspsrc0> stream 0xe4870, container 0,
disabled 0, added 1
0:00:01.026092529   237   0x120420 DEBUG                rtspsrc
gstrtspsrc.c:2270:new_manager_pad:<rtspsrc0> stream 0xe5988, container 0,
disabled 0, added 0
*0:00:01.027526855   237    0xe8a58 DEBUG                rtspsrc
gstrtspsrc.c:6458:gst_rtspsrc_handle_message:<rtspsrc0> got error from
udpsrc1*
0:00:01.027679443   237    0xe8a58 DEBUG                rtspsrc
gstrtspsrc.c:6472:gst_rtspsrc_handle_message:<rtspsrc0> combined flows: ok
0:00:02.970184326   237    0xed400 DEBUG                rtspsrc
gstrtspsrc.c:2386:on_ssrc_active:<rtspsrc0> source in session 0 is active/

In gst-launch pipeline these lines correspond to following:

/gstrtspsrc.c:2238:new_manager_pad:<rtspsrc0> got new manager pad
<rtpbin0:recv_rtp_src_0_1522166720_96>
0:00:00.924499511   250   0x122408 DEBUG                rtspsrc
gstrtspsrc.c:2246:new_manager_pad:<rtspsrc0> stream: 0, SSRC 1522166720, PT
96
0:00:00.930236816   250   0x122408 DEBUG                rtspsrc
gstrtspsrc.c:2270:new_manager_pad:<rtspsrc0> stream 0xe9468, container 0,
disabled 0, added 1
0:00:00.930480956   250   0x122408 DEBUG                rtspsrc
gstrtspsrc.c:2270:new_manager_pad:<rtspsrc0> stream 0xea188, container 0,
disabled 0, added 0
*0:00:00.934020995   250   0x127520 DEBUG                rtspsrc
gstrtspsrc.c:2095:gst_rtspsrc_handle_src_query:<rtspsrc0> pad
rtspsrc0:recv_rtp_src_0_1522166720_96 received query latency
0:00:00.934844970   250   0x127520 DEBUG                rtspsrc
gstrtspsrc.c:1983:gst_rtspsrc_handle_src_event:<rtspsrc0> pad
rtspsrc0:recv_rtp_src_0_1522166720_96 received event latency*
0:00:02.901428222   250    0xedf80 DEBUG                rtspsrc
gstrtspsrc.c:2386:on_ssrc_active:<rtspsrc0> source in session 0 is active/

Source code of program:
==========================================================================================
#include <gst/gst.h>

int main(int argc, char *argv[])
{
    gst_init (NULL,NULL);

    GstElement *bin = gst_pipeline_new(NULL);
    g_assert(bin);

    GstElement *src = gst_element_factory_make("rtspsrc", NULL);
    g_assert(src);
    g_object_set(src, "location", "rtsp://192.168.0.10/live1.sdp");

    GstElement *sink = gst_element_factory_make("fakesink", NULL);
    g_assert(sink);

    gst_bin_add_many(GST_BIN(bin), src, sink, NULL);
    gst_element_link_many(src, sink, NULL);

    gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING);

    while(1)
        ;
}
=========================================================================================

Why does this happen?





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Playing-RTSP-Stream-from-own-C-program-tp4661325.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list