A very strange problem occurred when using a USB camera in Ubuntu.

Source: Internet
Author: User
A few days ago, when I wrote a video chat function to a project, I encountered a very strange problem. in Backtrack5 (ubuntu10.04), I used Qt + openCV to collect camera data and then encoded the data for transmission. after compiling openCV2.3, there is no problem. you can collect images normally...

 

A few days ago, when I wrote a video chat function to a project, I encountered a very strange problem. in Backtrack5 (ubuntu10.04), I used Qt + openCV to collect camera data and then encoded the data for transmission. after compiling openCV2.3, the camera data can be normally collected. but the strange thing is that, after I restart the host and switch to another system (windows system), I will restart it again for a while, switch back to Backtrack5. at this time, the program I wrote earlier cannot run.

 

During this period, I did not perform any operations except to switch the system once, that is, a Backtrack5-> win7-> Backtrack5 process, so my program could not run, found in this sentence

 

IplImage * cvimage = cvQueryFrame (camera );

No data is captured, and cvimage becomes a wild pointer. Then, when cvimage is used, it becomes wrong.

At first, I thought it was a problem with the camera that no data was captured, but a new one, the problem still persists.

 

Then I doubt whether it is a problem with the USB driver, but when I plug in the USB flash drive, it works well ....

 

Enter lsusb in the command line to find the camera, but ls/dev/video0 shows that the file does not exist... this makes me very suspicious of the camera

 

Is there a problem with the driver.

 

Continue to follow the sixth sense of men, download a driver written by a French doctor, but Baidu wrote another article saying that this predecessor wrote

 

Has been integrated into the Linux kernel.

 

There is a problem ....

 

I can only switch to win7 to continue writing... everything is normal under win7. I have a saying that the problem is always solved by mistake. my feet

 

When I accidentally kicked the power cord and shut down the machine, I rushed to a G7 Cup while there was a gap in the boot process. when I came back, I should go to the BackTrack5 desktop.

 

At this time, I run my code and everything is normal. the video data can be displayed normally and input on the terminal.

 

When ls/dev/video0 is not displayed, the file cannot be found, but the yellow word shows video0. ...... I think it is a coincidence that I did not remember this.

 

Today, this strange problem occurs again... after I shut down the system, I run the program well and it is the same as before ..

 

This time I switched to XP and directly turned on the camera to display it normally, and then switched back to the BackTrack5 OK program again. it's not a coincidence.

 

Summary:

 

When the BackTrack5 (Ubuntu10.04) suddenly fails to use the camera... switch to windows and use any program to open the camera once.

 

It is displayed normally, and then you can restart and switch to your ubuntu to continue the code ......

 

Although the problem is solved, I still don't understand the principle. Baidu Google has found many similar problems for a long time, but there is no clear answer,

 

Basically, there will be no more information.

 

Hope Daniel can help explain it.

 

From the column wzg_j

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.