Capture RTCP Sender Report with rtpbin/rtspsrc

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Capture RTCP Sender Report with rtpbin/rtspsrc

mdbtfu
Hi,

I'm developping a program that displays the images of an IP camera. The camera's clock is synchronised with an NTP server and I would like to get the NTP timestamp of the RTCP sender report (as described in the RFC 1889 https://tools.ietf.org/html/rfc1889#section-6.3.1).

I found some topics about this but none gave me the solution to my problem.


Here is my pipeline :

gst-launch-1.0 rtpbin name=rtpbin latency=200 rtspsrc location="rtsp://172.29.179.179:554/0" latency=1 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink udpsrc port=6970 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=49900 host=172.29.179.179 sync=true async=false


And here is the code I use.

       
**************

        // Initialisation of GStreamer
        gst_init(NULL, NULL);
        GMainLoop *loop = g_main_loop_new(NULL, NULL);

        // Create pipeline
        string str_pipeline = "rtpbin name=rtpbin latency=200";
        str_pipeline += " rtspsrc location=rtsp://172.29.179.179:554/0 caps=video/x-raw-rgb !";
        str_pipeline += " rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! avdec_h264 ! videoconvert ! videoscale ! autovideosink";
        str_pipeline += " udpsrc name=udpsrc port=6970 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=49900 host=172.29.179.179 sync=true async=false";

        // Parse pipeline
        GError * message = NULL;
        GstElement *pipeline = gst_parse_launch(str_pipeline.c_str(), &message);

        // Set bus to get messages
        GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
        gst_bus_add_watch(bus, camera_bus_callback, NULL);
        gst_object_unref(bus);

        // Set pipeline to play
        gst_element_set_state(pipeline, GST_STATE_PLAYING);

        // Iterate
        g_main_loop_run(loop);
       
        gst_element_set_state(pipeline, GST_STATE_NULL);
        gst_object_unref(pipeline);
        g_main_loop_unref(loop);
       
**************
       

I've read the documentation of rtpbin and rtspsrc and didn't understand how to get the sender report. Which signal from rtpbin or rtspsrc should I use?
       

I would be really thankful for any help!

Thibaud