Add a way to retrieve original frame timestamp on v4l/libv4l (Patch #722)
Linux adds also a timestamp when capturing a frame with v4l/libv4l. This is the most precise timestamp of the frame you can get if you are interested in time when the frame was taken without any postprocessing (decoding, memory copying) delay. All phases afterwards add some (nondeterministic) delay and when the frame is finally available to OpenCV user it is hard to tell when exactly the frame was taken (which is useful if you have multiple cameras and want to synchronize them).
By loading a Linux kernel module as:
options uvcvideo clock=realtime
you even get real clock (and not just monotonous value) so this value is also useful if you want to sync frames with some external events. Or audio recording.
So it would be useful to make a way of retrieving this timestamp.I am attaching two patches which make this happen. They are not perfect as they:
- change API
- I didn't manage to make Python interface support this so I currently commented out the
Probably it would be better to just add a new field to
IplImage but this seemed even bigger change to me.
Probably such timestamp is available also on other systems. Or at least it would be good if it would be available.