gstclock and absolute time

Pazzo Da Legare pazzodalegare at gmail.com
Tue Jun 26 06:17:14 PDT 2012


Dear Josh,

Thank you very much for your links.

I thought I couldn't find the right parameter to instruct rtspsrc to
propagate the time downstream (or better to say to use the rtsp source
time as clock reference) I was more than sure that it would have been
possible, but now you confirm that a "crazy" idea to manage sr-message
is the only (known) way to extract source reference: I'm trying to
follow exactly the same approach trying to extract absolute time from
rtspsrc and send a metadata event (GST_EVENT_TAG) through my pipeline.
The point is how to correlate internal absolute time (what you can get
with gst_clock_get_time()) and ntptime of RTCP protocol without
_error_ (i.e. taking into account source->rtspsrc transmission time)?

I can intercept RtpSession information but I have no way to relate
(sr-ntptime, sr-rtptime) with the time (internal absolute time) of the
frame they are referring to. Any clue?

BR,
pz




2012/6/26 Josh Doe <josh at joshdoe.com>:
> On Tue, Jun 26, 2012 at 6:06 AM, Pazzo Da Legare
> <pazzodalegare at gmail.com> wrote:
>> Dear all,
>>
>> How can I convert gst_clock_get_time() value in an absolute time (with
>> year, month, day, ....). I'm playing with an rtsp camera, using
>> rtspsrc, and I would like to retrieve absolute time (ntp stream time)
>> across my pipeline. Is there an easy way to do that?
>>
>> from element's clock time now  (=Tue Jun 26 12:03:34 CEST 2012) I get
>> something like:
>>
>> 6112256969101111
>>
>> and it contains a bunch of thousands of seconds....
>>
>> I'm a little bit puzzled.
>
> gst_clock_get_time() will just give you a monotonically increasing
> integer. Subtracting the base time from that will give you the stream
> time:
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-clocks.html
>
> If you're talking about the ISO 8601 timestamps that indicate the
> absolute UTC time, this doesn't appear to be implemented currently:
> http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/rtsp/gstrtsprange.c#n249
> http://tools.ietf.org/html/rfc2326#page-18
>
> A few issues. Not all servers support absolute time ranges. You can
> only get an absolute time if you requested the range in the same
> format, so rtspsrc would need to be given this information. Or you
> could extract a time range from SDP. Either way, you'd need a way to
> get the time to the application.
>
> This last part is what I'm interested. For now I'm sending a
> GST_TAG_DATE_TIME event to indicate the start time of the stream, so a
> buffer absolute time can be calculated from this absolute time and the
> stream time. If there's a better way (GstMeta?) then I'd like to hear
> it.
>
> -Josh
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list