Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I would like to take snapshots from an USB webcam

Firs I check the device:

pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0ac8:332d Z-Star Microelectronics Corp. Vega USB 2.0 Camer

When I'm trying to grab an Image I'm receiving the following error:

pi@raspberrypi ~ $ fswebcam -d /dev/video0 -r 640x480 test.jpeg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Timed out waiting for frame!
No frames captured.

What can be the problem, I tested this method on Ubuntu with success. What can be the problem on Debian?

Using a USB Hub:

pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 006: ID 0ac8:332d Z-Star Microelectronics Corp. Vega USB 2.0 Camera
pi@raspberrypi ~ $ fswebcam -d /dev/video0 -r 640x480 test.jpeg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Timed out waiting for frame!
No frames captured.

This is the webcam.

enter image description here

share|improve this question
1  
Plugged directly into the Pi- Not enough power is my guess. Try using a compatibly power USB hub then try it. –  ppumkin Aug 24 '12 at 18:39
    
I just tried with an USB hub with the same success. –  run Aug 24 '12 at 18:45
    
Are you sure the usb hub works? Can you plug a keyboard and wireless in there and does it work on the Pi? It might detect it in the Pi but if you try to do something with it, it can start going wierd –  ppumkin Aug 24 '12 at 19:27
2  
I have same problem. Exact same hardware although the webcam is in a completely different housing. This webcam works without any problem on Ubuntu. Not working on Raspberry Pi. Tried both on a powered hub and directly connected. Webcam seems to be recognized in dmesg and is registered by uvcvideo. Using v4l-conf seems to show 'no overlay' error message. –  user1772 Oct 7 '12 at 21:01
1  
The issue is present here as well. Different housing, same camera. fswebcam behaves the same here, and motion often tells me: "[0] Thread 1 - Watchdog timeout, trying to do a graceful restart". I've tried both the latest Raspian and Arch. –  Derecho Jan 21 '13 at 18:53
show 2 more comments

4 Answers

up vote 3 down vote accepted

If you have not already done so, you should try updating your firmware and kernel, in case you are using the officially supported Debian distribution (aka Raspbian). Just follow the instruction you can find here. They just fixed many USB issues (the usb host driver still has a lot of issues left), so you would want to try that.

Also, you should check if the system reports any error through the dmesg command. There is a check-list you can follow to help pinpoint your problem: you can find it here.

share|improve this answer
add comment

I had the same problem with my webcam and solved it by replacing fswebcam with motion -- it can capture images periodically too. You just have to write snapshot_interval to make it work.

share|improve this answer
add comment

I've also experienced this issue when using an off-brand USB webcam I got off amazon for $4. It's (probably) due to the camera not getting enough power from the USB to capture.

Try a lower resolution like 320 by 240:

fswebcam -d /dev/video0 -r 320x240 test.jpeg

share|improve this answer
add comment

I had the same problem but was able to capture images running this as root (or sudo):

uvccapture -t0

share|improve this answer
    
Could you try and elaborate on your answer? Where you came across this solution, etc. –  kolin Mar 19 '13 at 8:26
add comment

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

protected by Jivings Mar 21 '13 at 21:45

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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