I'm using a RPI2 and a USB webcam (Microsoft HD3000) to record video.

Now, I'm doing extensive testing and I see that when I record long video (10-12 hours) I sometimes see an error in dmesg.

uvcvideo: Non-zero status (-5) in status completion handler.

After this error, my camera is not working anymore. I have to restart my program to fix the error.

My program is using OpenCV 2.4.1 or 2.4.11 (I tried both). I'm using cvQueryFrame() to get the pictures and cvCreateVideoWriter()/cvWriteFrame() to record the video to a USB dongle (32 GB).

I also tried to enable some uvcvideo driver options but I still have the problem after a few hours.

sudo nano /etc/modprobe.d/uvcvideo.conf
options uvcvideo nodrop=1
options uvcvideo timeout=5000
options uvcvideo quirks=0x80

Any idea what could cause the problem ?

What would be the best way to catch the problem and deal with it ?

  • As per the first comment to the answer the problem has "gone away" and thus there can't be reproduced. I don't know what flag to use in this case. – MadMike Feb 21 '17 at 12:44

I cannot answer what the problem is, but have a simpler setup with exactly the same error message. I am using Pi Zero to stream cheap USB webcam 320x240 video to connected LCD: https://www.raspberrypi.org/forums/viewtopic.php?p=1045564#p1045564

The gstreamer command is this:

pi@raspberrypi02:~ $ gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240, framerate=30/1 ! videoconvert ! fbdevsink device=/dev/fb1

The error message can be seen via "dmesg" after display went black:

[  975.037445] uvcvideo: Non-zero status (-5) in status completion handler.

So this time problem occured after 16 minutes, that is the typical time, although the camera did work >2h sometimes.

After this error, my camera is not working anymore. I have to restart my program to fix the error.

Restarting gstreamer command alone does not help. I have to "sudo rmmod" modules fbtft_device, fb_ili9341 and then fbtft in that order, and start framebuffer again via:

sudo modprobe fbtft_device name=rpi-display gpios=reset:23,dc:24,led:18 rotate=90

So it is the framebuffer module that seems to be responsible as in your case.


  • I upgraded to Raspbian (2016-05-27). That is Kernel: Linux rpi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux. I'm also now using OpenCV 3.1 with C++ API. The problem does not occurs anymore. I compiled OpenCV from source by following this procedure: pyimagesearch.com/2015/10/26/… – ssinfod Oct 11 '16 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.