<div dir="auto">Hi,<div dir="auto">Give a look to the GST_TIME_FORMAT.</div><div dir="auto"><br></div><div dir="auto"><a href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstInfo.html#GST-TIME-FORMAT:CAPS">https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstInfo.html#GST-TIME-FORMAT:CAPS</a><br></div><div dir="auto"><br></div><div dir="auto">This is a simple way to print a GstClockTime to something readable. </div><div dir="auto"><br></div><div dir="auto">Best</div><div dir="auto">Matteo</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jul 7, 2018, 04:32 Antonio Ospite <<a href="mailto:ao2@ao2.it">ao2@ao2.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 7 Jul 2018 11:50:57 +0530<br>
Shubham Shrivastava <<a href="mailto:shubham333vm@gmail.com" target="_blank" rel="noreferrer">shubham333vm@gmail.com</a>> wrote:<br>
<br>
> timestamp: 178452710056<br>
[...]<br>
> <br>
> this type of output i got from<br>
> <br>
>       gst_structure_get_clock_time (s,"timestamp",&timestamp);<br>
[...]<br>
>    strptime("178452710056", "%s", &tm);<br>
<br>
Two issues here:<br>
<br>
1. the returned timestamp is relative to the structure field lifetime,<br>
   it does not refer to the system time.<br>
2. GstClockTime expresses time in nanoseconds, not seconds.<br>
<br>
Try using<br>
<a href="https://developer.gnome.org/glib/stable/glib-Date-and-Time-Functions.html#g-get-real-time" rel="noreferrer noreferrer" target="_blank">https://developer.gnome.org/glib/stable/glib-Date-and-Time-Functions.html#g-get-real-time</a><br>
and take care to convert units (g_get_real_time returns microseconds).<br>
<br>
Ciao,<br>
   Antonio<br>
<br>
-- <br>
Antonio Ospite<br>
<a href="https://ao2.it" rel="noreferrer noreferrer" target="_blank">https://ao2.it</a><br>
<a href="https://twitter.com/ao2it" rel="noreferrer noreferrer" target="_blank">https://twitter.com/ao2it</a><br>
<br>
A: Because it messes up the order in which people normally read text.<br>
   See <a href="http://en.wikipedia.org/wiki/Posting_style" rel="noreferrer noreferrer" target="_blank">http://en.wikipedia.org/wiki/Posting_style</a><br>
Q: Why is top-posting such a bad thing?<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>