Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 28th April 2007, 07:14 PM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
HOW-TO Setup ZoneMinder with your USB webcam for security and surveillance

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
Code:
# make install
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

Last edited by icy-flame; 1st July 2007 at 09:01 PM.
Reply With Quote
 

Tags
howto, security, setup, surveillance, usb, webcam, zoneminder

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Asus F3t webcam help to setup? Rev_Flibble Hardware & Laptops 0 11th September 2007 02:21 AM
setup webcam Wiles Hardware & Laptops 1 2nd August 2007 08:57 PM
How to setup Webcam in fedora 5 yinglcs Using Fedora 5 18th April 2007 08:20 AM
Webcam setup slimdog360 Using Fedora 2 13th April 2006 12:55 AM
Wireless security - sufficient setup or not? accountnewb Servers & Networking 3 1st January 2005 11:00 PM


Current GMT-time: 08:44 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat