Question

I have a Linux application that processes camera images. Currently I provide buffers to the v4l2 kernel subsystem that are filled with image data.

However I need to know, as exact as possible, when this frame was captured (by the camera). With buffers, I may not know precisely when this happened as I may not be able to process all frames in a timely manner (i.e. I may request an image at a time when it is already available for a few milliseconds).

What I am looking for is a way to determine (or estimate) the time an image was captured (or the age of it), e.g. by having the kernel record it somehow, or in worst case by not having images streamed to me but rather only sent upon my explicit request.

Environment: UVC web camera, Linux kernel 2.6.3x, V4L2 API

Was it helpful?

Solution

The v4l2_buffer structure has a timestamp field. But see also this question: Where does v4l2_buffer->timestamp value starts counting?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top