Page 1 of 1

Webcam Image Corruption?

Posted: Fri Feb 22, 2013 8:06 am
by snakeboy
I have been running v1.25.0 of ZoneMinder with 5 connected IP cams (D-Link DCS910's) without a problem for several months now. (Running on Ubuntu [headless] Server: 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux according to uname -a)
I recently came across an old webcam I was about to throw away, and instead decided to add it as an additional camera feed to my server. It connects up, gets detected correctly and does not give any errors in the logs, but the view it generates is always garbled. Like this:

Image

lsusb output says:

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 041e:4029 Creative Technology, Ltd Webcam Live!

v4l-info /dev/video0
video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 1
description : "JPEG"
pixelformat : 0x4745504a [JPEG]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 320
fmt.pix.height : 240
fmt.pix.pixelformat : 0x4745504a [JPEG]
fmt.pix.field : NONE
fmt.pix.bytesperline : 320
fmt.pix.sizeimage : 29390
fmt.pix.colorspace : JPEG
fmt.pix.priv : 1

On the Source tab, I am using these settings as per above:

Device Path: /dev/video0
Capture Method: Video For Linux version 2
Device Channel: 0
Device Format: PAL
Capture Palette: JPEG
Capture Width: 320
Capture Height: 240
Preserve Aspect Ratio: (Unticked)
Orientation: Normal

Of course I have tried ALL the available Device Format options as well as ALL the Capture Palette options in the hope of getting lucky and finding the one that works, but it appears that NONE of them do.

Following various suggestions online after googling (For example: http://forums.fedoraforum.org/archive/i ... 54003.html). I have still not been able to resolve this.

I really don't want to have to toss out this perfectly working (under windows) webcam when it should be possible to get it to work with ZoneMinder, but unless I can find a way to get it to actually produce an image, it's not much use to me.

I'd appreciate any help I can get. If you require additional info not already posted, don't hesitate to ask.

Re: Webcam Image Corruption?

Posted: Sat Feb 23, 2013 4:51 pm
by bsliv
If you find a solution to this issue, please post it. I'm in a similar situation. My webcam used to work in ZM until I upgraded both ZM and Ubuntu. My webcam continues to work in Cheese and another webcam program.

Re: Webcam Image Corruption?

Posted: Mon Feb 25, 2013 2:02 pm
by snakeboy
bsliv wrote:If you find a solution to this issue, please post it. I'm in a similar situation. My webcam used to work in ZM until I upgraded both ZM and Ubuntu. My webcam continues to work in Cheese and another webcam program.
I sure will, but with no suggestions forthcoming here, I'm afraid I'm out of idea's on my own. I've tried everything I can think of and think I may now have to simply resign this cam to the bin and get something that will work.

If I ever get any further with this, I will add it here. Good luck with your issue, please do the same, it may help me too.

Re: Webcam Image Corruption?

Posted: Wed Feb 27, 2013 9:31 pm
by jameswilson
Have you tried v4l 1 in the source settings?

Re: Webcam Image Corruption?

Posted: Sun Mar 03, 2013 12:02 pm
by axelm
I was looking at zm_local_camera.cpp and apparently for V4L2_PIX_FMT_JPEG you need to have libswscale and v4l2.

Nextime's repo includes mastertheknife's perfomance patch and there is an option for JPEG palette.