Avisek
Avisek

Reputation: 383

openCV waitkey() not responding, and runtime VIDIOC_QUERYMENU: Invalid argument

I'm trying to do basic video capture from a webcam. I got this very basic code from this opencv blog and I'm compiling it with

 g++ `pkg-config --cflags opencv` test2.cpp `pkg-config --libs opencv`

And when I run it, it shows me these messages

VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument

but it does run. However, the program is supposed to exit when the esc key is pressed. Because of this line

if(waitKey(30) == 27)

But it does not. I tried changing it in the program, to some other key, like 'q', but it still doesn't work when I run the program.

if(waitKey(30) == 'q')

While running, it seems that waitkey() just isn't responding.

EDIT : waitKey() works. When I copied it, for some reason it became waitkey(). However, the invalid argument messages are still being shown

Upvotes: 2

Views: 4089

Answers (1)

SRF
SRF

Reputation: 979

OpenCV sometimes does not work well with some cameras. That code in that blog work fine with my webcam without any warning messages

Upvotes: -1

Related Questions