[gst-devel] V4L2 real timestamps

Daniel Crews daniel.crews at gmail.com
Wed Feb 17 16:07:28 CET 2010


Short version: I need some advice on the best way to timestamp frames
of video coming from a v4l2 web cam.

Long Version: I'm trying to gather real time data from web cams on
multiple computers, and gstreamer seems the best way to do it. Get the
image stream (v4l2src), process it with a custom plug-in for feature
detection, and then dump the info out through a gobject bus to a gtk
app for collection. However, I need to have time information for each
frame on something like the order of millisecond precision so that the
data for each frame can be fit into a time line and be compared from
computer to computer. As far as I can tell from the documentation, the
buffer timestamps in gstreamer seem to be meant for syncing video and
audio rather than true time stamping, and I'm not sure if the v4l2src
makes use of even that....

The Theory: So far as I can figure my best bet would be to write a
custom v4l2src that time stamps the frames with a precision clock of
some kind in C, and then pass that meta-data out the gobject bus with
the blob data. The precision clocks would be difficult to truly sync
to the same time, but I could just store offsets from a known common
event to sync the time data from different computers at the central
collector instead. But I've no idea what I'm doing here and may well
be horribly mistaken. I would appreciate any guidance I can get if
anyone would like to help me.
--




More information about the gstreamer-devel mailing list