Stumble across
ZoneMinder the other day, can't resist to try it out. Hopefully my installation notes will be useful to someone else.
In this example I've used:
- FC6
- P4 1.7GHz 512MB RAM box
- cheap generic USB webcam from ebay
Three main steps here:
1. Find out the camera chipset model
2. Install the camera driver (spca5xx)
3. Install ZoneMinder
Step 1
If you do not have a webcam as yet, here is a good
list to start with
Code:
# yum install usbutils
# /sbin/lsusb
Bus 001 Device 007: ID 0ac8:305b Z-Star Microelectronics Corp.
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 0000:0000
So there is the camera chipset model, check for support of
0ac8:305b from spca5xx's
website
Step 2
Download the latest spca5xx driver from
http://mxhaard.free.fr/
Code:
$ wget http://mxhaard.free.fr/spca50x/Download/gspcav1-xxxxxxxx.tar.gz
$ tar -xzf gspcav1-xxxxxxxx.tar.gz
$ cd gspcav1-xxxxxxxx
$ make
# make install
# /sbin/modprobe gspca
To test the camera you can try the following programs:
camstream - Easiest to install, but not very stable in my case.
Code:
# yum install camstream
spcaview or spcagui from
http://mxhaard.free.fr/download.html
Same procedure as the driver to install.
Code:
$ wget http://mxhaard.free.fr/spca50x/Download/spcaxxxxxxxxxxx.tar.gz
$ tar -xzf spcaxxxxxxxxxxx.tar.gz
$ cd spcaxxxxxxxxxxx
$ make
# make install
You should be able to see see the video stram from your webcam by now.
Step 3
ZoneMinder does require a few services running, luckly they are all available
from Fedora repo. Namely you have to get at least the following working first:
Code:
# yum install httpd mysql-server mysql php php-gd php-mysql
Make sure httpd and mysqld are properly configured and started.
ZoneMinder also require a number of unusal libries.
Code:
# yum install mysql-devel libjpeg-devel pcre pcre-devel perl-MIME-Lite perl-Device-SerialPort netpbm ffmpeg-devel ffmpeg-libs perl-DateManip
Download and extract the latest version of ZoneMinder from
http://www.zoneminder.com/downloads/
Code:
$ wget http://www.zoneminder.com/downloads/ZoneMinder-1.2x.x.tar.gz
$ tar -xzf ZoneMinder-1.2x.x.tar.gz
$ cd ZoneMinder-1.2x.x
Config it with the correct path names and preference for your computer
Code:
$ ./configure --with-webdir=/var/www/html/ZM \ <-- Where the web content goes
--with-cgidir=/var/www/cgi-bin \ <--- Where the cgi-bin goes
--with-ffmpeg=/usr/local \ <--- Where the ffmpeg executable lives
ZM_DB_PASS=SomethingDifficult \ <--- Database password
ZM_DB_NAME=ZMDB \ <--- Database name
ZM_DB_USER=ZM <-- Databaser user
Make a folder for it under your httpd document root
Code:
# mkdir /var/www/html/ZM
Now you have to create the database structure:
Code:
# mysql mysql < db/zm_create.sql -p
Make a user and grant it the right to use the db:
Code:
# mysql mysql -p
> grant select,insert,update,delete on ZMDB.* to 'ZM'@localhost identified by 'SomethingDifficult';
> quit
Make the changes take effect
Code:
# mysqladmin reload -p
Everything is ready, install ZoneMinder
ZoneMinder does come with a redhat style init.d script, but it doesnt get install normally,
Code:
# cp /home/charley/build/ZoneMinder-1.22.3/scripts/zm /etc/init.d/zm
# chmod 755 /etc/init.d/zm
# chkconfig --add zm
If want to play with high resolutions i.e. anything more than 320x240, you
should increase the share memory limit
Code:
# echo 134217728 >/proc/sys/kernel/shmall && echo 134217728 >/proc/sys/kernel/shmmax
Adding the following in
/etc/sysctl.conf will make the changes automatically at boot time
Code:
kernel.shmall = 134217728
kernel.shmmax = 134217728
You can test whether ZoneMinder can talk to the camera by:
Code:
$ zmu -d /dev/video0 -q -v
Video Capabilities
Name: Generic Zc0305b
Type: 1
Can capture
Video Channels: 1
Audio Channels: 0
Maximum Width: 640
Maximum Height: 480
Minimum Width: 176
Minimum Height: 144
Window Attributes
X Offset: 0
Y Offset: 0
Width: 640
Height: 480
Picture Attributes
Palette: 4 - 24bit RGB
Colour Depth: 24
Brightness: 32768
Hue: 0
Colour :0
Contrast: 32768
Whiteness: 0
Channel 0 Attributes
Name: ZC301-2
Channel: 0
Flags: 0
Type: 2 - Camera
Format: 0 - PAL
If all goes well, you should have a decent base setup of ZoneMinder at
http://localhost/ZM/zm.php