webcam capture fails VIDIOC_QUERYMENU: Invalid argument error

asked 2013-10-01 15:14:56 -0600

normad gravatar image

Hi,

im working on an olinuxino-mini board running the arch-arm rootfs with kernel 3.7 and im trying to capture an image from a webcam and save it.

however when i compile and run my code

VideoCapture cap(0);

if(!cap.isOpened()) {
    cout << "Cannot open camera device" << endl;
    return -1;
} else {
    cout << "Camera Found!!" << endl;
    return -1;
}

Mat frame;

cap.read(frame);
if(frame.empty()) {
    cout << "No image captured" << endl;
}

if(imwrite("/mnt/pen/3.jpeg",frame)) {
    cout << "Image succesfullt written" << endl;
}
return 0;

i get the following output on the screen

VIDIOC_QUERYMENU: Invalid argument VIDIOC_QUERYMENU: Invalid argument VIDIOC_QUERYMENU: Invalid argument Camera Found!!

but my camera works just fine with fswebcam.

any help is greatly appreciated :)

edit retag flag offensive close merge delete