Add a way to retrieve original frame timestamp on v4l/libv4l (Patch #722)


Added by Mitar M over 6 years ago. Updated over 4 years ago.


Status:Open Start date:
Priority:Low Due date:
Assignee:- % Done:

0%

Category:highgui-camera
Target version:Next Hackathon
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

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 QueryFrame call there

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.


001-capture-timestamp.patch (5.7 kB) Mitar M, 2010-11-30 03:48 am

009-capture-timestamp.patch (2.4 kB) Mitar M, 2010-11-30 03:48 am


History

Updated by Alexander Shishkov over 5 years ago

  • Description changed from Linux adds also a timestamp when capturing a frame with v4l/libv4l. This is t... to Linux adds also a timestamp when capturing a frame with v4l/libv4l. This is t... More

Updated by Kirill Kornyakov about 5 years ago

  • Tracker changed from Feature to Patch

Updated by Alexander Shishkov about 5 years ago

  • Priority changed from High to Normal
  • Target version deleted ()

Updated by Alexander Shishkov about 5 years ago

  • Priority changed from Normal to Low

Updated by Alexander Shishkov about 5 years ago

  • Target version deleted ()

Updated by Andrey Kamaev almost 5 years ago

  • Category changed from highgui-images to highgui-camera

Updated by Vadim Pisarevsky over 4 years ago

  • Target version deleted ()

Updated by Kirill Kornyakov over 4 years ago

  • Target version set to Next Hackathon

Also available in: Atom PDF