Making the "start time" of a source available to gstreamer

Graham Leggett minfrin at sharp.fm
Thu Dec 17 05:46:46 PST 2015


On 17 Dec 2015, at 3:34 PM, Tim Müller <tim at centricular.com> wrote:

>> Do I attach this start time to each buffer as metadata, or should I
>> place a message on a bus?
> 
> I think it would be best to first look at what is required exactly and
> why just writing the current time in the file header is not sufficient.
> Then we can work backwards from there to see how to best implement it.

I need to embed the time+date in a jpeg, which in turn as being transferred via PUT to an endpoint, and this bit is easy, just put it in EXIF. Where I am stuck is where I get the time+date from.

In theory, the time+date is the “start time” of the stream, plus the PTS for each frame.

If the stream comes from a file, then the “start time” might be the creation timestamp of the file. I would need to modify the filesrc to pick up the creation time and [do something with it].

If the stream comes from udp and then passed to rtpbin, then the “start time” might be the system time when the stream was started. Again, where do I get the system time from in this case? Do I just get the time+date off the wallclock?

> Posting a message on the bus is unlikely to be useful, since messages
> are usually just for applications and not picked up by other elements
> (with the exception of higher-level bin/pipeline abstractions perhaps).

So if I added metadata to the buffer as follows would this metadata make it through the pipeline, or would it be lost along the way?

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBuffer.html#gst-buffer-add-meta

Regards,
Graham
—



More information about the gstreamer-devel mailing list