'GStreamer: How to recover RTP frame sending time

I am trying to figure out frame sending time for each frame in RTP video stream. I have managed to recover the NTP time from the RTCP-SR and the corresponding RTP time, but how can I find out the original RTP timestamps in the RTP stream so that I can correlate?

The GST document mentioned GstReferenceTimestampMeta, which seems to fit my requirement with timestamp information in Gst.Buffer. However, being a newbie, I have not been able to understand what this means and how to achieve it.

The reference is stored as a Gst.Caps in reference. Examples of valid references would be timestamp/x-drivername-stream for timestamps that are locally generated by some driver named drivername when generating the stream, e.g. based on a frame counter, or timestamp/x-ntp, host=pool.ntp.org, port=123 for timestamps based on a specific NTP server.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source