Ask Your Question
0

VideoCapture buffer

asked 2016-03-21 10:31:05 -0600

cookieWill gravatar image

Hi

I a am totally new here.

I am trying to read images from a webcam with VideoCapture (cap >> image;).

I found out there is a buffer of 5 frames, so when I want to read a frame it is in fact an old one stored in the buffer.

Do you know where does this come from (hardware, OS, OpenCV) ? Why is that ? Why is it 5 frames and can it be changed ?

edit retag flag offensive close merge delete

Comments

1

which opencv version / os is it ? (there are different implementations)

berak gravatar imageberak ( 2016-03-21 10:33:13 -0600 )edit

OpenCV 3.1 on Ubuntu 14.04

cookieWill gravatar imagecookieWill ( 2016-03-22 15:24:57 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-03-25 18:50:44 -0600

cookieWill gravatar image

So I found out that the implementation being used is in cap_v4l.cpp

There is this default constant "#define DEFAULT_V4L_BUFFERS 4". It is used to initialize a structure member that seems to be unreachable from outside.

Isn't that kind of a bad design ?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-03-21 10:31:05 -0600

Seen: 1,045 times

Last updated: Mar 25 '16