How to get RTCP sender report from rtspsrc element?

Ben Rush ben at ben-rush.net
Tue Aug 31 13:18:50 UTC 2021


Hello

On Tue, Aug 31, 2021 at 1:30 AM 이병헌 via gstreamer-devel <
gstreamer-devel at lists.freedesktop.org> wrote:

> Hi.
> I’m new on gstreamer, and I have some problem with this issue for many
> days..
>
> I need to get absolute timestamp from multiple rtsp camera.
> And with some effort, I got to know that I can get absolute timestamp from
> "RTCP SR(sender report)” in RTSP packets
> But I can not find the proper way to get RTCP SR from rtspsrc element or
> rtpbin in gstreamer document..
> And actually I can not understand well about rtpbin’s role
> So my questions are
>
> 1. How to get RTCP SR with rtspsrc element or rtpbin element
>

With your pipeline, get the GstRTPSession:

rtpSession = gst_bin_get_by_name(GST_BIN(_pipeline->pipeline),
"rtpsession0");

Get the internal RTPSession from it:

GstElement* internalRtpSession;
g_object_get(rtpSession, "internal-session", &internalRtpSession, NULL);

Connect to on-receiving-rtcp:

g_signal_connect(internalRtpSession, "on-receiving-rtcp",
G_CALLBACK(on_rtcp_callback), NULL);

Iterate over the RTCP packets in the buffer:

GstRTCPBuffer rtcpBuffer = GST_RTCP_BUFFER_INIT;
gst_rtcp_buffer_map(buffer, GST_MAP_READ, &rtcpBuffer);
GstRTCPPacket rtcpPacket;
if (gst_rtcp_buffer_get_first_packet(&rtcpBuffer, &rtcpPacket))
{
while (gst_rtcp_packet_move_to_next(&rtcpPacket))
{
GstRTCPType type = gst_rtcp_packet_get_type(&rtcpPacket);

>
> 2. If I connect devices into rtpbin element, then does rtpbin sync sources
> from multiple device automatically?
> I mean, suppose If there are two rtsp camera CAM_1 CAM_2, and if I send
> PLAY request in same time on my client
> And if there have network delay, so client get packets of PLAY request of
> CAM_1 10 seconds more later than CAM_2
> Then does rtpbin element sync that 10 seconds automatically?
>

I'm not sure.


>
> Thanks for reading.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210831/496c1de3/attachment.htm>


More information about the gstreamer-devel mailing list