How to dealing with live sources clocks?

Simon Guillot simon at
Tue Jan 31 20:46:41 UTC 2023


I have two custom sources, a camera and a GPS and I am looking for a way to synchronise them.
Each GPS frame has a timestamp (in microseconds). Each video frame is timestamped by the
driver. I need both of these to share a common reference so that I can have them roughly synchronised
downstream, and be able refer to a timestamp when they are stored in our data format.

I have watched Nicolas Dufresne's talk [1] as well as Edward Hervey's [2], and read the related pages
of the doc. However, I still don't really see how to proceed in the right way.

My understanding was that each custom source element should use the clock it was assigned by the
pipeline to compute the buffers' timestamps.

I thought I had to instantiate a new GstClock for each of my source then use gst_clock_add_observation
or similar to get the parameters needed for the computation, but it looks like this class is only meant
to be subclassed.

Do I need to create two subclasses of GstClock?

On the other hand, v4l2src uses the system's time directly, and the conversation is done in a rather
manual fashion as opposed to using ready made objects.

Any suggestion of plugins I should look into that would be similar to my use case?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list