Putting NTP/PTP timestamps on RTP as metadata

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Putting NTP/PTP timestamps on RTP as metadata

Toon Heyrman
I'm trying to put NTP/PTP timestamps on a RTP stream as metadata, just as
information for the receiver to do some things with.
The sender is a RTSP server and will be synced with a NTP or PTP server.

I found some things about this subject.
1. Someone who edited code of the gst-plugins-bad/gst/onvif to add these
timestamps as metadata to the stream. He uses elements to add the timestamps
to the buffers.
http://gstreamer-devel.966125.n4.nabble.com/Transmit-absolute-time-td4674058.html
<http://gstreamer-devel.966125.n4.nabble.com/Transmit-absolute-time-td4674058.html>  
2. I see in the gstreamer code something with RFC6051, in
gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.c is a function
gst_rtp_hdrext_set_ntp_64 that is adding an extension to the RTP packets
with a timestamp.

Is it a good idea to use 2 in a 1 scenario? So putting the NTP extension on
RTP via a gstreamer element on the server side? And how will the element
know the timestamps to use?
For the moment I get the clock in the main application, like this:
gst_ntp_cleck_new with the ntp server
gst_clock_wait_for_sync untill I get synced
gst_rtsp_media_factory_set_clock with the clock
gst_rtsp_media_factory_set_publish_clock_mode with
GST_RTSP_PUBLISH_CLOCK_MODE_AND_OFFSET

Can someone push me in the right direction?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Putting NTP/PTP timestamps on RTP as metadata

Toon Heyrman
I managed to add a NTP timestamp to the RTP packets. It was by using the
rtponviftimestamp element of gst-plugins-bad.

Simple pipeline example that worked for me:
GST_DEBUG="*onvif*:2" gst/1.14/gst-rtsp-server/examples/test-netclock "(
videotestsrc is-live=true ! x264enc ! rtph264pay pt=96 ! rtponviftimestamp
ntp-offset=-1 name=pay0 )"

This pipeline gives me the RTP header extension 0xabac and 32bit seconds and
32 bit second fraction (value / 2^32).

But I still see a warning:
GLib-GObject-WARNING **: g_object_get_is_valid_property: object class
'GstRtpOnvifTimestamp' has no property named 'pt'

giving the payloader the name 'pay0' instead of the rtponviftimestamp isn't
working.
Can anyone help me with this warning?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel