User avatar
raphaelm
Posts: 4
Joined: Thu Aug 02, 2012 10:55 am
Contact: Website

Webcam: Strange image artefacts

Thu Aug 02, 2012 11:02 am

Today I connected the old webcam I had lying about to my Raspberry Pi and tried to grab pictures from it. All I get are beautiful pictures like:

http://img.geeksfactory.de/i/raphael/webcam%20(1).jpg
and
https://twitter.com/_rami_/status/23097 ... to/1/large

Fractions of the pictures indeed are how my desk looks like from where the camera is, but they're not really what I aimed to achieve.

The Webcam is a Logitech QuickCam Communicate STX, and the pictures are grabbed with video4linux, it doesn't matter whether I use

Code: Select all

ffmpeg -f video4linux2 -s 640x480 -r 1 -i /dev/video0 -vframes 1 -f image2 webcam.jpg
or

Code: Select all

sudo vgrabbj -q 100 -i vga -o jpg -f webcam.jpg -e -d /dev/video0
I'm running Raspbian.

Does anyone know this problem or has an idea how to fix it?

User avatar
raphaelm
Posts: 4
Joined: Thu Aug 02, 2012 10:55 am
Contact: Website

Re: Webcam: Strange image artefacts

Thu Aug 02, 2012 12:41 pm

It seems to be impossible to click the link above (and to edit my psot), but it should aim to:

http://img.geeksfactory.de/i/raphael/webcam%20(1).jpg
Image

ASpotySpot
Posts: 16
Joined: Sun Jul 01, 2012 9:22 pm

Re: Webcam: Strange image artefacts

Thu Aug 02, 2012 3:27 pm

I'm having the exact same issue.

ASpotySpot
Posts: 16
Joined: Sun Jul 01, 2012 9:22 pm

Re: Webcam: Strange image artefacts

Thu Aug 02, 2012 4:16 pm

Using guvcview to get live stream of webcam I see I only get artifacts when the resolution is 320x240 or above. It works perfectly well at 176x144.
I don't know much about computers but this makes me think its either:
-Not enough power to webcam (don't have powered hub to test this out)
-RPi isn't powerful enough. (changing the ram split doesn't affect it in the slightest)

User avatar
raphaelm
Posts: 4
Joined: Thu Aug 02, 2012 10:55 am
Contact: Website

Re: Webcam: Strange image artefacts

Thu Aug 02, 2012 4:21 pm

In my case it doesn't even work with really low resolutions at all:

Code: Select all

pi@himbeere:/home/pi/www$ vgrabbj -q 100 -o jpg -i qsif -f webcam.jpg -d /dev/video0
Could not open configfile /usr/etc/vgrabbj.conf, ignoring
Device doesn't support width/height
Fatal Error (non-daemon), exiting...
There was no map allocated to be freed...
320x240 for example is "supported", but results in similarly bad images.

javatmn
Posts: 6
Joined: Fri Aug 03, 2012 8:14 am

Re: Webcam: Strange image artefacts

Fri Aug 03, 2012 8:18 am

Same issue here. This should be a v4l driver problem. I have seen several other posts here, all the same. When set resolution to 320x240 or below, the issue disappear. It only appears at resolution 640x480 or above. Sometimes the grabber hangs there, sometimes with "un-matched" sliced image returned. BTW, the dmesg output of mine is below(UVC driver)

[ 7.142952] usb 1-1.3: new high speed USB device number 4 using dwc_otg
[ 7.256292] usb 1-1.3: New USB device found, idVendor=090c, idProduct=71b3
[ 7.272837] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 7.298353] usb 1-1.3: Product: USB 2.0 PC Cam
[ 7.308987] usb 1-1.3: Manufacturer: Image Processor
[ 9.674816] Linux video capture interface: v2.00
[ 9.894125] uvcvideo: Found UVC 1.00 device USB 2.0 PC Cam (090c:71b3)
[ 10.214879] input: USB 2.0 PC Cam as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/input/input0
[ 10.556407] usbcore: registered new interface driver uvcvideo
[ 10.752865] USB Video Class driver (1.1.1)

User avatar
raphaelm
Posts: 4
Joined: Thu Aug 02, 2012 10:55 am
Contact: Website

Re: Webcam: Strange image artefacts

Fri Aug 03, 2012 8:28 am

It has to be a driver issue: With another Webcam I have it works totally fine.

ASpotySpot
Posts: 16
Joined: Sun Jul 01, 2012 9:22 pm

Re: Webcam: Strange image artefacts

Fri Aug 03, 2012 5:21 pm

My webcam, which has the artefact issue, works perfectly well on my Arch installation on my desktop (in fact better than it does on windows).
On the Pi I've only tried the webcam on Raspbian but will try it on arch later to see if the issue is isolated to Raspbian or all the Pi distros.

javatmn
Posts: 6
Joined: Fri Aug 03, 2012 8:14 am

Re: Webcam: Strange image artefacts

Wed Aug 15, 2012 9:58 am

Just realized that it might be usb power issue. Maybe i need to use self-powered USB hub.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Webcam: Strange image artefacts

Wed Aug 15, 2012 10:27 am

I tried an old webcam that I had lying around and I got the same problem.

I moved on to other projects (I have a never-ending list) but I remember that the "dmesg" command showed lots of errors.

Unfortunately, I can't find the webcam in my pile of junk, so I can't reproduce the errors. If somebody else is experiencing this problem, please post the last few lines of the command
dmesg

Note, this is not a power problem, I had my webcam running off a 10A USB supply.

Pi-Scan
Posts: 25
Joined: Fri Jul 06, 2012 9:16 pm

Re: Webcam: Strange image artefacts

Mon Sep 10, 2012 2:49 pm

Not all device are working on any powered hub.

Some won't work. I was having the same problem on mac osx with a cheap powered usb hub. Using another brand might fix things.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Webcam: Strange image artefacts

Mon Sep 10, 2012 4:58 pm

Most of my dozen or so webcams don't work with the Pi, although they work perfectly with Ubuntu on my main PC. I blame the USB implementation on the PI. Not a power issue, 2.5 Amp power supply via GPIO pins and short circuited polyfuses or my new Rev 2 does exactly the same. Fully updated drivers via rpi-update, tried practically every piece of Linux software I've found. Some USB webcams do work - a PS2 Eyetoy works OK on the Pi with occasional artifacts and a Microsoft VX-800 works at restricted resolution.

Some USB stuff including most webcams, doesn't work on the Pi. Things are improving gradually, later drivers have got rid of some problems altogether.

http://elinux.org/RPi_VerifiedPeriphera ... SB_Webcams

Long running USB problems thread :

http://www.raspberrypi.org/phpBB3/viewt ... 28&t=12097
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Return to “Troubleshooting”