splitmuxsink conver 'running time' to absolute time

Sebastian Dröge sebastian at centricular.com
Fri Dec 11 00:42:12 PST 2015


On Fr, 2015-12-11 at 09:13 +0100, Rini van Zetten wrote:
> Hello,
> 
> We have an application which receives video over the lan using rtp.
> On the receiver the video is saved in files of 10 seconds using
> splitmuxsink.
> This works fine !
> 
> Now we want to save the start and stop time of each individual video
> file.
> I can 'capture' the "splitmuxsink-fragment-opened" and "splitmuxsink-
> fragment-opened" messages from splitmuxsink and read the running
> time. It seems the running time is a time in nanosecond since the
> stream started.
> 
> How can i convert that time to the absolute time the stream was
> captured ?

See gstreamer/docs/design/part-synchronisation.txt for details, but the
clock time corresponding to a running time can be calculated with

  clock_time = running_time - base_time

where base_time is the return value of gst_element_get_base_time().


Note that this only gives you a time corresponding to the pipeline's
clock. Which is not necessarily the same as the wall clock.

If you want to have the wall clock time, you could force a system clock
on the pipeline before starting (gst_pipeline_use_clock()) and set its
clock-type property to GST_CLOCK_TYPE_REALTIME.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151211/530dfc59/attachment.sig>


More information about the gstreamer-devel mailing list