Garbled video feed for USB webcam

Forum for questions and support relating to the 1.24.x releases only.
Locked
edamame16
Posts: 2
Joined: Mon Sep 13, 2010 7:45 pm

Garbled video feed for USB webcam

Post by edamame16 »

OS: Ubuntu 9.10 karmic, 2.6.31-22-server
Camera: USB, 05a9:a511 OmniVision Technologies, Inc. OV511+ Webcam

This is my first post. I would like to say thank you to the ZoneMinder team and all the others who have contributed to this forum. Without your contributions I would not have gotten this far.

I have ZoneMinder installed and the web application is running properly. The webcam was detected automatically after I plugged it in. I was lucky enough to not need to install any drivers. When I open the feed for my /dev/video0 device, the image is garbled, there are only black and white lines.

I have tried the camera on my Windows machine and I am able to see a clear image. I believe the hardware is functioning.

Here is a list of things I have tried.

Attempt: Changing "Capture Method" to "Video for Linux version 1"
Result: Image is just black.

Attempt: Changing the resolution from 320x240 to 640x480.
Result: Garbled image is larger.

Attempt: Trying every device format from PAL B to ATSC 16 VSB
Result: Same garbled image, but color varies. NTSC modes give the garbled image a green tint.

Here is my zmu -d /dev/video0 -q -v output

Code: Select all

Video Capabilities
  Name: USB Camera (05a9:a511)
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 640
  Maximum Height: 480
  Minimum Width: 48
  Minimum Height: 32
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 320
  Height: 240
Picture Attributes
  Palette: 0 - Unknown
  Colour Depth: 8
  Brightness: 32639
  Hue: 0
  Colour :32639
  Contrast: 32639
  Whiteness: 0
Channel 0 Attributes
  Name: ov519
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
Perhaps the USB driver loaded for the webcam is the issue?

Please let me know what other things I could try. Your help is greatly appreciated.
edamame16
Posts: 2
Joined: Mon Sep 13, 2010 7:45 pm

Post by edamame16 »

After trying several hundred different combinations of device formats and capture palettes I've decided to try another approach.

After some searching, I found another member (chrisp) who was experiencing a similar issue. He was able to get it working by using mjpeg-streamer instead. http://www.zoneminder.com/forums/viewtopic.php?p=57679

I'm getting errors when trying to run the mjpeg-streamer make file. I've tried searching for these errors and the only similar issue I have found is a OpenWRT thread (https://forum.openwrt.org/viewtopic.php?id=13977). It appears they fixed the issue by getting the latest mjpeg-streamer SVN release, however this thread was from 2008.

Why might be causing the make file to fail?

sudo make clean all

Code: Select all

make -C plugins/input_uvc clean
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/input_uvc'
rm -f *.a *.o core *~ *.so *.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/input_uvc'
make -C plugins/input_testpicture clean
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/input_testpicture'
rm -f *.a *.o core *~ *.so *.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/input_testpicture'
make -C plugins/output_file clean
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/output_file'
rm -f *.a *.o core *~ *.so *.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/output_file'
make -C plugins/output_http clean
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/output_http'
rm -f *.a *.o core *~ *.so *.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/output_http'
make -C plugins/output_autofocus clean
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/output_autofocus'
rm -f *.a *.o core *~ *.so *.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/output_autofocus'
make -C plugins/input_gspcav1 clean
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/input_gspcav1'
rm -f *.a *.o core *~ *.so *.lo
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/input_gspcav1'
rm -f *.a *.o mjpg_streamer core *~ *.so *.lo
gcc -O2 -DLINUX -D_GNU_SOURCE -Wall   -c -o mjpg_streamer.o mjpg_streamer.c
gcc -O2 -DLINUX -D_GNU_SOURCE -Wall   -c -o utils.o utils.c
utils.c: In function âdaemon_modeâ:
utils.c:69: warning: ignoring return value of âchdirâ, declared with attribute warn_unused_result
utils.c:75: warning: ignoring return value of âdupâ, declared with attribute warn_unused_result
utils.c:76: warning: ignoring return value of âdupâ, declared with attribute warn_unused_result
gcc -O2 -DLINUX -D_GNU_SOURCE -Wall -lpthread -ldl mjpg_streamer.o utils.o -o mjpg_streamer
chmod 755 mjpg_streamer
make -C plugins/input_uvc all
make[1]: Entering directory `/usr/src/mjpg-streamer-r63/plugins/input_uvc'
gcc -c -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o v4l2uvc.lo v4l2uvc.c
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:38:1: warning: "V4L2_CID_BACKLIGHT_COMPENSATION" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:886:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:39:1: warning: "V4L2_CID_POWER_LINE_FREQUENCY" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:877:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:40:1: warning: "V4L2_CID_SHARPNESS" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:885:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:41:1: warning: "V4L2_CID_HUE_AUTO" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:883:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:43:1: warning: "V4L2_CID_FOCUS_AUTO" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1136:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:44:1: warning: "V4L2_CID_FOCUS_ABSOLUTE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1134:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:45:1: warning: "V4L2_CID_FOCUS_RELATIVE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1135:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:47:1: warning: "V4L2_CID_PAN_RELATIVE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1126:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:48:1: warning: "V4L2_CID_TILT_RELATIVE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1127:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:51:1: warning: "V4L2_CID_EXPOSURE_AUTO" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1116:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:52:1: warning: "V4L2_CID_EXPOSURE_ABSOLUTE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1123:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:53:1: warning: "V4L2_CID_EXPOSURE_AUTO_PRIORITY" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:1124:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from v4l2uvc.c:27:
uvcvideo.h:56:1: warning: "V4L2_CID_WHITE_BALANCE_TEMPERATURE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from v4l2uvc.c:27:
/usr/include/linux/videodev2.h:884:1: warning: this is the location of the previous definition
gcc -c -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC -o jpeg_utils.lo jpeg_utils.c
jpeg_utils.c:27:21: error: jpeglib.h: No such file or directory
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:38:1: warning: "V4L2_CID_BACKLIGHT_COMPENSATION" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:886:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:39:1: warning: "V4L2_CID_POWER_LINE_FREQUENCY" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:877:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:40:1: warning: "V4L2_CID_SHARPNESS" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:885:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:41:1: warning: "V4L2_CID_HUE_AUTO" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:883:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:43:1: warning: "V4L2_CID_FOCUS_AUTO" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1136:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:44:1: warning: "V4L2_CID_FOCUS_ABSOLUTE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1134:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:45:1: warning: "V4L2_CID_FOCUS_RELATIVE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1135:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:47:1: warning: "V4L2_CID_PAN_RELATIVE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1126:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:48:1: warning: "V4L2_CID_TILT_RELATIVE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1127:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:51:1: warning: "V4L2_CID_EXPOSURE_AUTO" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1116:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:52:1: warning: "V4L2_CID_EXPOSURE_ABSOLUTE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1123:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:53:1: warning: "V4L2_CID_EXPOSURE_AUTO_PRIORITY" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:1124:1: warning: this is the location of the previous definition
In file included from v4l2uvc.h:36,
                 from jpeg_utils.c:30:
uvcvideo.h:56:1: warning: "V4L2_CID_WHITE_BALANCE_TEMPERATURE" redefined
In file included from /usr/include/linux/videodev.h:17,
                 from v4l2uvc.h:34,
                 from jpeg_utils.c:30:
/usr/include/linux/videodev2.h:884:1: warning: this is the location of the previous definition
jpeg_utils.c:35: error: field âpubâ has incomplete type
jpeg_utils.c:37: error: expected specifier-qualifier-list before âJOCTETâ
jpeg_utils.c:53: warning: return type defaults to âintâ
jpeg_utils.c: In function âMETHODDEFâ:
jpeg_utils.c:53: error: expected declaration specifiers before âinit_destinationâ
jpeg_utils.c:70: error: expected declaration specifiers before âMETHODDEFâ
jpeg_utils.c:89: error: expected declaration specifiers before âMETHODDEFâ
jpeg_utils.c:105: error: expected declaration specifiers before âGLOBALâ
jpeg_utils.c:133: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â{â token
jpeg_utils.c:199: error: expected â{â at end of input
make[1]: *** [jpeg_utils.lo] Error 1
make[1]: Leaving directory `/usr/src/mjpg-streamer-r63/plugins/input_uvc'
make: *** [input_uvc.so] Error 2
dtbaker
Posts: 2
Joined: Tue Oct 05, 2010 9:11 am
Location: AU

Post by dtbaker »

Did you manage to fix this issue?

I too have tried many combinations of zoneminder settings but only get fuzzy output. The camera works fine in other v4l applications like xawtv.

I successfully compiled mjpg-streamer however this does not recognise my camera.

Code: Select all

$ xawtv -hwscan
/dev/video0: OK                         [ -device /dev/video0 ]
    type : v4l2
    name : SN9C1xx PC Camera
    flags:  capture

Code: Select all

$ ./mjpg_streamer -o "output_http.so -p 8888" -i "input_uvc.so -d /dev/video0"
MJPG Streamer Version: svn rev: 113
 DBG(input_uvc.c, input_init(), 132): argv[0]=UVC webcam grabber
 DBG(input_uvc.c, input_init(), 132): argv[1]=-d
 DBG(input_uvc.c, input_init(), 132): argv[2]=/dev/video0
 DBG(input_uvc.c, input_init(), 187): case 2,3
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: MJPEG
i: The format asked unavailable, so the width 352 height 288 
The inpout device does not supports MJPEG mode
You may also try the YUV mode (-yuv option), but it requires a much more CPU power
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed
dtbaker
Posts: 2
Joined: Tue Oct 05, 2010 9:11 am
Location: AU

Post by dtbaker »

After compiling mjpg-streamer from SVN (and installing the jpeg/v4l dev dependancies) then doing a reboot my USB webcam worked just fine in zoneminder.

* shrug *
Locked