Timestamp for v4l2 image capture
Asked Answered
L

1

7

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

Lenoir answered 21/4, 2012 at 17:58 Comment(0)
L
6

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

Lenoir answered 22/4, 2012 at 8:37 Comment(1)
Does that mean this timestamp is a camera clock timestamp, or a host timestamp?Kampong

© 2022 - 2024 — McMap. All rights reserved.