twig123
Posts: 11
Joined: Sun Mar 04, 2012 4:46 am

Unable to get Webcam working with Motion

Sun Aug 05, 2012 4:01 am

I'm having trouble getting my webcam to work with Motion on Debian Wheezy. I tried setting this up a while ago and didn't have any success. I figured I would try again today, so I ran apt-get update, apt-get upgrade as well as rpi-update but still get the same results.
How do I get my webcam working with my Raspberry Pi?

Webcam: Twinkle Cam (DC-2110)
Website: http://www.chicony.com.tw/dc-2110.htm
Resolutions: 352x288 / 176x144 / 320x240 / 160x120
Video Frame Rate: 30fps Video Image at QVGA

Directly connected to Raspberry Pi:

Code: Select all

pi@raspberrypi ~ $ sudo motion -n
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478784
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Thread 1 started
[1] cap.driver: "sonixb"
[1] cap.card: "USB camera"
[1] cap.bus_info: "usb-bcm2708_usb-1.3"
[1] cap.capabilities=0x05000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Test palette BA81 (176x144)
[1] Using palette BA81 (176x144) bytesperlines 176 sizeimage 25344 colorspace 00000008
[1] found control 0x00980900, "Brightness", range 0,255
[1]     "Brightness", default 127, current 127
[1] found control 0x00980911, "Exposure", range 0,1023
[1]     "Exposure", default 66, current 66
[1] found control 0x00980912, "Automatic Gain (and Exposure)", range 0,1
[1]     "Automatic Gain (and Exposure)", default 1, current 1
[1] found control 0x00980913, "Gain", range 0,255
[1]     "Gain", default 127, current 127
[1] mmap information:
[1] frames=4
[1] 0 length=28672
[1] 1 length=28672
[1] 2 length=28672
[1] 3 length=28672
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] v4l2_next: VIDIOC_DQBUF: EIO (s->pframe 2): Input/output error
[1] v4l2_next: VIDIOC_QBUF: Invalid argument
[1] Video device fatal error - Closing video device
[1] Closing video device /dev/video0
[1] File of type 8 saved to: /tmp/motion/01-20120804234233.swf
[1] File of type 1 saved to: /tmp/motion/01-20120804234233-01.jpg
[1] Retrying until successful connection with camera
Through Powered USB Hub (port 1):

Code: Select all

pi@raspberrypi ~ $ sudo motion -n
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478784
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Thread 1 started
[1] cap.driver: "sonixb"
[1] cap.card: "USB camera"
[1] cap.bus_info: "usb-bcm2708_usb-1.3.5"
[1] cap.capabilities=0x05000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Test palette BA81 (176x144)
[1] Using palette BA81 (176x144) bytesperlines 176 sizeimage 25344 colorspace 00        000008
[1] found control 0x00980900, "Brightness", range 0,255
[1]     "Brightness", default 127, current 127
[1] found control 0x00980911, "Exposure", range 0,1023
[1]     "Exposure", default 66, current 66
[1] found control 0x00980912, "Automatic Gain (and Exposure)", range 0,1
[1]     "Automatic Gain (and Exposure)", default 1, current 1
[1] found control 0x00980913, "Gain", range 0,255
[1]     "Gain", default 127, current 127
[1] mmap information:
[1] frames=4
[1] 0 length=28672
[1] 1 length=28672
[1] 2 length=28672
[1] 3 length=28672
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] v4l2_next: VIDIOC_QBUF: No such device
[1] Video device fatal error - Closing video device
[1] Closing video device /dev/video0
[1] File of type 8 saved to: /tmp/motion/01-20120804232547.swf
[1] Retrying until successful connection with camera
Through Powered USB Hub (port 5):
(Just to see if it didn't like the specific port)

Code: Select all

pi@raspberrypi ~ $ sudo motion -n
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478784
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Thread 1 started
[1] cap.driver: "sonixb"
[1] cap.card: "USB camera"
[1] cap.bus_info: "usb-bcm2708_usb-1.3.7"
[1] cap.capabilities=0x05000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Test palette BA81 (176x144)
[1] Using palette BA81 (176x144) bytesperlines 176 sizeimage 25344 colorspace 00000008
[1] found control 0x00980900, "Brightness", range 0,255
[1]     "Brightness", default 127, current 127
[1] found control 0x00980911, "Exposure", range 0,1023
[1]     "Exposure", default 66, current 66
[1] found control 0x00980912, "Automatic Gain (and Exposure)", range 0,1
[1]     "Automatic Gain (and Exposure)", default 1, current 1
[1] found control 0x00980913, "Gain", range 0,255
[1]     "Gain", default 127, current 127
[1] mmap information:
[1] frames=4
[1] 0 length=28672
[1] 1 length=28672
[1] 2 length=28672
[1] 3 length=28672
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] v4l2_next: VIDIOC_QBUF: No such device
[1] Video device fatal error - Closing video device
[1] Closing video device /dev/video0
[1] File of type 8 saved to: /tmp/motion/01-20120804233535.swf
[1] File of type 1 saved to: /tmp/motion/01-20120804233535-01.jpg
[1] Retrying until successful connection with camera

gordon77
Posts: 6121
Joined: Sun Aug 05, 2012 3:12 pm

Re: Unable to get Webcam working with Motion

Sun Aug 05, 2012 3:17 pm

I've tried fswebcam, luvcview, motion, uvccapture all to no avail

The only one that nearly works using a Logitech Express is fswebcam but it only seems to work for a couple of picture captures and then stops with errors, usually recovers after disconnecting the USB and reconnecting, or occasionally needs a reboot. very frustrating. :roll:

I've trawled the net and tried all the things I can find, using details of what other have done to get a working webcam, but no better. :roll:

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Unable to get Webcam working with Motion

Sun Aug 05, 2012 3:50 pm

tried ffmpeg ?

Code: Select all

ffmpeg -v verbose -r 5 -s 160x120 -f video4linux2 -i /dev/video0 temp.avi
Should write something to temp.avi
see how long that lasts for?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

twig123
Posts: 11
Joined: Sun Mar 04, 2012 4:46 am

Re: Unable to get Webcam working with Motion

Mon Aug 06, 2012 5:03 am

Well... I went out and bought a Logitech C525 and it works with almost no trouble. (I needed this up and going as I'm leaving for a trip).
The snag that I ran into was finding a resolution that actually worked with it. The full 1280x720 resolution made the poor Pi choke on it's own CPU... other 16:9 (smaller) resolutions made the video overscan and other strange things. I finally found 1024x576 and that seems to work pretty well (I also tried the default motion resolution, which worked, but it just crops the image instead of changing the resolution).

I got then got Jeremy's Motion Google Drive Uploader and Emailer all set up after a little trouble (Commands aren't the same for Debian Wheezy as Jeremy was using Arch). I can post the steps/modifications that needed to be done when I get back, if anyone is interested.

I would still like to figure out how to get my TwinkleCam working... but isn't a huge priority until I get back from my trip.

gordon77
Posts: 6121
Joined: Sun Aug 05, 2012 3:12 pm

Re: Unable to get Webcam working with Motion

Mon Aug 06, 2012 8:12 am

I've now tried a Microsoft VX-2000 webcam and so far it's working with fswebcam :)

maniac79
Posts: 4
Joined: Tue Oct 30, 2012 7:23 pm
Location: Germany, Dortmund
Contact: Website

Re: Unable to get Webcam working with Motion

Tue Oct 30, 2012 7:25 pm

Hey twig123, I just bought the same webcam (Logitech c525) as I was searching for something that works out of the box and it seems the c525 does. :) I would like to read your steps/modifications to the tutorial you linked to.

Regards

smith133
Posts: 1
Joined: Thu Mar 16, 2017 5:47 pm

Re: Unable to get Webcam working with Motion

Thu Mar 16, 2017 5:53 pm

Hi, I just bought webcam Logitech c525. I try capture the image using fswebcam and it works well. I want to make a video using raspistill but I do not know why it always print an error. Do you guys experiencing something like that ?

Error:
nmal: Cannot read camera info. Keeping the defaults for 0v5647

Thanks in advance
sorry if I make bad post, I am new at this. Thanks

Return to “Troubleshooting”