Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'm actually experiencing a similar problem with OpenCV 3.2.

I had the exact same problem on Ubuntu 16.04 Minimal. So yesterday I switched to Debian Jessie and now the problem has evolved to the next stage ;)

Here's what you could try (what I did to troubleshoot and test).

sudo apt-get install fswebcam

After that, run this and check if it works:

sudo fswebcam -r 640x480 --jpeg 95 -D 1 test.jpg

The fun thing about fswebcam is that it actually gives you some nice debug information right there ;) So, hopefully, that program is able to grab the picture and save it for review. It was for me. If it still doesn't work, you might want to rebuild your OS, or switch to something else.

Now I went back to OpenCV and found out that I still get Select Timeout, but only once. After the timeout, I immediately get correct grab.

I'm actually experiencing a similar problem with OpenCV 3.2.

I had the exact same problem on Ubuntu 16.04 Minimal. So yesterday I switched to Debian Jessie and now the problem has evolved to the next stage ;)

Here's what you could try (what I did to troubleshoot and test).

sudo apt-get install fswebcam

After that, run this and check if it works:

sudo fswebcam -r 640x480 --jpeg 95 -D 1 test.jpg

The fun thing about fswebcam is that it actually gives you some nice debug information right there ;) So, hopefully, that program is able to grab the picture and save it for review. It was for me. If it still doesn't work, you might want to rebuild your OS, or switch to something else.

Now I went back to OpenCV and found out that I still get Select Timeout, but only once. After the timeout, I immediately get correct grab.

EDIT: I seem to have just fixed my issue. It was a bandwidth issue with the uvcvideo module.

# rmmod uvcvideo
# modprobe uvcvideo quirks=128 nodrop=1 timeout=6000

I added that to my .bash_profile, and I'm now succesfully grabbing 100 1600x1200 photo's @ 5FPS ;) I do occassionally get a Corrupted JPEG data: premature end of data segment, but so far, less than 10% of the time. I'm still looking into fixing those ;)