I am trying to use v4l2_buffer's timestamp value (type timeval) to synchronize images captured from a UVC webcam to external events.
However the timestamp is not the same as the system time, or the up time, etc:
printf("image captured at %ld, %ld\n",
buffer->timestamp.tv_sec,
buffer->timestamp.tv_usec);
struct timeval tv;
gettimeofday(&tv, 0);
printf("current time %ld, %ld\n", tv.tv_sec, tv.tv_usec);
Results in
image captured at 367746, 476270
current time 1335083395, 11225
My uptime is 10 days.