VIDIOC_DQBUF: No such device and VIDIOC_QUERYMENU: Invalid argument

asked 2016-07-27 07:15:47 -0600

crazymumu gravatar image

updated 2016-07-27 22:39:24 -0600

Hi I am use Logitech Webcam C270 connect to ODROID xu4(arm single board computer) installed ubuntu 14.04. Also opencv 2.4.8 installed.
When I run my code, first it's working and I can see the video stream.
Then firstly issue came:VIDIOC_QUERYMENU: Invalid argument
Then second issues came:VIDIOC_DQBUF: No such device
And I found the video stream stuck there.
My code:
1 #include <opencv2 opencv.hpp="">
2 #include <iostream>
3
4 int main( int argc, char** argv ) {
5 cv::namedWindow( "Example2_10", cv::WINDOW_AUTOSIZE);
6 cv::VideoCapture cap;
7 if (argc==1) {
8 cap.open(0);
9 } else {
10 cap.open(argv[1]);
11 }
12 if ( !cap.isOpened() ) { //check if we succeeded
13 std::cerr << "Couldn't open capture." << std::endl;
14 return -1;
15 }
16
17 cv::Mat frame;
18 while(1) {
19 cap>>frame;
20 if( !frame.data) break;
21 cv::imshow( "Example2_10", frame);
22 if( cv::waitKey(33) >=0) break;
23
24 }
25 }

Any suggestions?

edit retag flag offensive close merge delete