USB Camera in zoneminder

Forum for questions and support relating to the 1.24.x releases only.
Locked
brononius
Posts: 15
Joined: Thu Aug 16, 2012 5:10 am

USB Camera in zoneminder

Post by brononius »

Hey,

I'm trying to add a usb webcamera into a working zoneminder (works for 4 IP-camera's).
I've got 3 different USB camera's connected to my Ubuntu server.


When i check on console:
zmu -d /dev/video0 -q -v -U admin -P admin -V1

Code: Select all

Video Device: /dev/video0
Video Capabilities
  Name: USB 2.0 Camera
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 0
  Maximum Height: 0
  Minimum Width: 48
  Minimum Height: 32
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 320
  Height: 240
Picture Attributes
  Palette: 8 - YUYV
  Colour Depth: 16
  Brightness: 21959
  Hue: 32768
  Colour :44127
  Contrast: 0
  Whiteness: 39056
Channel 0 Attributes
  Name: Camera 1
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
zmu -d /dev/video2 -q -v -U admin -P admin -V2

Code: Select all

Video Device: /dev/video2
General Capabilities
  Driver: sn9c102
  Card: SN9C1xx PC Camera
  Bus: usb-0000:00:1a.2-2
  Version: 1.1.47
  Type: 0x5000001
    Supports video capture (X)
    Does not support video output
    Does not support frame buffer overlay
    Does not support VBI capture
    Does not support VBI output
    Does not support sliced VBI capture
    Does not support sliced VBI output
    Does not support video output overlay
    Does not have tuner
    Does not have audio in and/or out
    Does not have radio
    Supports read/write i/o (X)
    Does not support async i/o
    Supports streaming i/o (X)
    Standards:
  Formats:
    bayer rgb (BA81)
    compressed (S910)
Crop Capabilities
  Bounds: 640 x 480
  Default: 640 x 480
  Current: 640 x 480
Inputs: 1
  Input 0
    Name: Camera
    Type: Camera
    Audioset: 00000000
    Standards: 0x0
    Power on  (X)
    Signal detected  (X)
    Colour Signal detected 
    Horizontal Lock detected 

zmu -d /dev/video3 -q -v -U admin -P admin -V1

Code: Select all

Video Device: /dev/video3
Video Capabilities
  Name: WebCam Live!   
  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: 640
  Height: 480
Picture Attributes
  Palette: 0 - Unknown
  Colour Depth: 8
  Brightness: 32896
  Hue: 0
  Colour :0
  Contrast: 32768
  Whiteness: 39321
Channel 0 Attributes
  Name: zc3xx
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL

So i've added 3 local camera's in zoneminder:
  • Video0: dev/video0 - device channel 0 - device format PAL - device palette YUYV
  • Video2: dev/video2 - device channel 0 - device format PAL - device palette RGB24
  • Video3: dev/video3 - device channel 0 - device format PAL - device palette RGB24



This is the error i see in the logs (exit status 6)

tail -f zmdc.log
11/06/2012 14:37:39.724149 zmdc[10324].INF [Starting pending process, zmc -d /dev/video0]
11/06/2012 14:37:39.724724 zmdc[10324].INF ['zmc -d /dev/video0' starting at 12/11/06 14:37:39, pid = 27149]
11/06/2012 14:37:39.758369 zmdc[10324].WAR [Can't find process with command of 'zma -m 6']
11/06/2012 14:37:39.886703 zmdc[10324].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
11/06/2012 14:37:44.060793 zmdc[10324].INF [Starting pending process, zmc -d /dev/video0]
11/06/2012 14:37:44.061523 zmdc[10324].INF ['zmc -d /dev/video0' starting at 12/11/06 14:37:44, pid = 27207]
11/06/2012 14:37:44.220205 zmdc[10324].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
11/06/2012 14:37:54.040100 zmdc[10324].INF [Starting pending process, zmc -d /dev/video0]
11/06/2012 14:37:54.040851 zmdc[10324].INF ['zmc -d /dev/video0' starting at 12/11/06 14:37:54, pid = 27496]
11/06/2012 14:37:54.206279 zmdc[10324].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
11/06/2012 14:38:14.035965 zmdc[10324].INF [Starting pending process, zmc -d /dev/video0]
11/06/2012 14:38:14.036754 zmdc[10324].INF ['zmc -d /dev/video0' starting at 12/11/06 14:38:14, pid = 28050]
11/06/2012 14:38:14.201500 zmdc[10324].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
11/06/2012 14:38:44.074618 zmdc[10324].INF [Starting pending process, zmc -d /dev/video3]
11/06/2012 14:38:44.075344 zmdc[10324].INF ['zmc -d /dev/video3' starting at 12/11/06 14:38:44, pid = 28802]
11/06/2012 14:38:44.075628 zmdc[10324].INF [Starting pending process, zmc -d /dev/video2]
11/06/2012 14:38:44.076041 zmdc[10324].INF ['zmc -d /dev/video2' starting at 12/11/06 14:38:44, pid = 28803]
11/06/2012 14:38:44.147870 zmdc[10324].ERR ['zmc -d /dev/video2' exited abnormally, exit status 6]
11/06/2012 14:38:44.175350 zmdc[10324].ERR ['zmc -d /dev/video3' exited abnormally, exit status 6]
11/06/2012 14:38:54.095285 zmdc[10324].INF [Starting pending process, zmc -d /dev/video0]
11/06/2012 14:38:54.096023 zmdc[10324].INF ['zmc -d /dev/video0' starting at 12/11/06 14:38:54, pid = 28982]
11/06/2012 14:38:54.271569 zmdc[10324].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
11/06/2012 14:39:52.068835 zmdc[10324].INF [Starting pending process, zmc -m 1]
I've tried different setting in zoneminder (channel ID and ), but couldn't get them to work.
Any idea what else i can do?
bf65
Posts: 1
Joined: Sun Nov 11, 2012 10:26 pm

Re: USB Camera in zoneminder

Post by bf65 »

I found the solution to my webcam problem on this

1. Increase shared memory maximum
Open the file “/etc/sysctl.conf”, and paste this 2 line at the bottom of the file.
# Increase the maximum shared memory
kernel.shmmax = 167772160
save, and restart your machine.
If still no luck, continue to the next step:

2. Edit zmdc.pl
added the libs to zmdc.pl and it worked great
We need to edit zoneminder source to point the video driver.
Open file ” /usr/bin/zmdc.pl” (the location on some machine, might be different)
and add this code, right before the “my @daemons =….” (about line 64).

$ENV{LD_PRELOAD} = ‘/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so’;
$ENV{LD_PRELOAD} = ‘/usr/lib/i386-linux-gnu/libv4l/v4l2convert.so’;
S-cape
Posts: 17
Joined: Thu Mar 08, 2012 8:45 am

Re: USB Camera in zoneminder

Post by S-cape »

Hi bf65
So how many webcam have you got running on your system?
Locked