RTP header timestamp

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version5
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) Question
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

For rtsp streams, I want to extract the rtp header timestamp (cl.cam.ac.uk/~jac22/books/mm/book/node159.html) in deepstream.
Currently, deepstream provides ntp timestamp for the frame using the RTCP is not available, However, I want the raw value of the rtp header timestamp.

How can I achieve it and attach to my custom metadata / frame metadata?

Do you mean to extract the 32bit timestamp in https://tools.ietf.org/html/rfc6184#section-5.1?
Why do you need such rtp timestamp?

Correct. I need the 32 bit timestamp.
The RTSP streams from cameras are fed to a custom video management station. The VMS encodes the timestamp information in rtp packet and provides inputs to the Application. We need to extract and provide the same timestamp in the metadata.

The gstreamer plugins only provide common functions according to the spec.

The RTP header can be parse with the gstreamer RTP interfaces. https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/tree/master/gst-libs/gst/rtp

Perhaps you need to customize your own rtp payload depay plugin with the RTP interfaces.

1 Like

Thanks for the information. I will look into it. Also, could you also share some insights on how nvstreammux plugin calculates the ntp timestamp using the RTCP sender reports?

Since, the RTCP packets are sent are sent much less frequently than the RTP packets, so how we receive timestamp for every frame?

Also, I assume the nvstreammux plugin reads the GstRTCPBuffer and reading the GstRTPBuffer will be similar so I could implement a similar structure.

No, GstRTCPBuffer is handled by gstreamer RTP interfaces, it has nothing to do with nvstreammux. nvstreammux never read GstRTCPBuffer. nvsrteammux never calculate the NTP timestamp either. It only uses NTP timestamp to synchronize the stream with local system time.

You can find Gstreamer RTP interfaces here:https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/tree/master/gst-libs/gst/rtp
The only GstRTCPBuffer read sample I can found in GStreamer for you is https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/blob/master/gst/rtpmanager/gstrtpbin.c

Have you worked this out? I also want to get the rtp header timestamp out. Is it possible for you to share some experience on this?

FYI, DeepStream 4.0.1 actually have some code related to RTCP & RTP timestamp synchronization. In file “sources/apps/apps-common/src/deepstream_source_bin.c”, function “deepstream_rtp_bin_handle_sync”.