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.

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 27th June 2007, 04:31 PM
PatMcLJr Offline
Registered User
 
Join Date: Apr 2005
Location: earth
Posts: 1,187
Thank You. I havn't tried this yet but Zoneminder looks pretty cool and now if I can use a USB camera to try it out, that would be very cool.
__________________
x--x--x
http://www.gnu.org/philosophy/free-sw.html
Freedom is never Free.
Pat Jr.
Reply With Quote
  #3  
Old 29th June 2007, 09:11 PM
InfRecursion Offline
Registered User
 
Join Date: Jan 2005
Posts: 214
When I get down to the "make install" portion, I get this error...

[root@pandora ZoneMinder-1.22.3]# make install
Making install in src
make[1]: Entering directory `/home/myuserid/ZoneMinder-1.22.3/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/usr/include -g -O2 -MT zm_event.o -MD -MP -MF ".deps/zm_event.Tpo" -c -o zm_event.o zm_event.cpp; \
then mv -f ".deps/zm_event.Tpo" ".deps/zm_event.Po"; else rm -f ".deps/zm_event.Tpo"; exit 1; fi
/usr/include/ffmpeg/avformat.h: In function ‘void av_init_packet(AVPacket*)’:
/usr/include/ffmpeg/avformat.h:66: error: ‘INT64_C’ was not declared in this scope
make[1]: *** [zm_event.o] Error 1
make[1]: Leaving directory `/home/myuserid/ZoneMinder-1.22.3/src'
make: *** [install-recursive] Error 1

Looks to be a problem with avformat.h regarding variable declaration, any suggestions on how to remedy this without editing the source code that "suppose to work"?

Thanks!
Reply With Quote
  #4  
Old 30th June 2007, 12:12 PM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
What version of ffmpeg have you got? I got mine from linva repo.

And you dont need ffmpeg to have a working ZoneMinder install, its just an extra feature / option. Try remove the option: "--with-ffmpeg=/usr/local" when running ./configure
Reply With Quote
  #5  
Old 30th June 2007, 12:24 PM
Stian1979 Offline
Registered User
 
Join Date: Dec 2006
Location: Taipei Taiwan
Age: 35
Posts: 401
Quote:
Originally Posted by icy-flame

Now you have to create the database structure:
Code:
# mysql mysql < db/zm_create.sql -p
Now I'm stuck. I runn into alot of problems trough this how to, but this time I can not find out how to get around it

[root@localhost ZoneMinder-1.22.3]# mysql mysql < db/zm_create.sql -p
-bash: db/zm_create.sql: Ingen slik fil eller filkatalog(no sutch file or folder)

It's probartly really simple, but I can not figure it out.

Please help since I'm on a deadline from my gf after we had a brake in last week and she is eager to get a securety camera up and running. If she find out I still did not make it work when she come home anny moment now I gues I have to sleep on the sofa.
__________________
smolt profile

Without fedoraforum.org I would still be using Windows

Can annyone borow me some space on a ftp server?
Reply With Quote
  #6  
Old 30th June 2007, 08:22 PM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
try to cd into the db folder, see if the file zm_create.sql actually exist? if it doesnt maybe you have not download / extract it right?

If it does, try to import using the full path, somethine like this:

mysql mysql < "/path-to/ZoneMinder-1.22.3/db/zm_create.sql" -p

Alternatively, if you played with phpMyAdmin before and have a working install at hand, you can import the sql script from there.
Reply With Quote
  #7  
Old 1st July 2007, 04:48 AM
Stian1979 Offline
Registered User
 
Join Date: Dec 2006
Location: Taipei Taiwan
Age: 35
Posts: 401
Quote:
Originally Posted by icy-flame
try to cd into the db folder, see if the file zm_create.sql actually exist? if it doesnt maybe you have not download / extract it right?

If it does, try to import using the full path, somethine like this:

mysql mysql < "/path-to/ZoneMinder-1.22.3/db/zm_create.sql" -p

Alternatively, if you played with phpMyAdmin before and have a working install at hand, you can import the sql script from there.
Where do I find the db folder? I'm stupid with computers and only try to make this work because I just had a bastard breking into my apartment.
__________________
smolt profile

Without fedoraforum.org I would still be using Windows

Can annyone borow me some space on a ftp server?
Reply With Quote
  #8  
Old 1st July 2007, 09:06 AM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
So I take it you slept on the sofa last night then?

The path "db/zm_create.sql" should be relative to your ZoneMinder source dir, the one thats created when you did "tar -xzf ZoneMinder-1.2x.x.tar.gz"

to find the sql file's full pat, try:

# updatedb
then
# locate db/zm_create.sql

that should give you some hints. The updatedb command might take a while to complete.

Just a reminder, ZoneMinder does require a working apache (httpd) and mysqld server, if you have never done it before, it might take some time to learn how to handle the services and their configurations.
Reply With Quote
  #9  
Old 1st July 2007, 05:29 PM
Stian1979 Offline
Registered User
 
Join Date: Dec 2006
Location: Taipei Taiwan
Age: 35
Posts: 401
Ok I got futher after starting httpd and mysql, but it stops again.

[root@localhost ZoneMinder-1.22.3]# make install
make: *** No rule to make target `install'. Stop.

I started all ower again and still get stuck at the same place and a reboot did not help eather.
__________________
smolt profile

Without fedoraforum.org I would still be using Windows

Can annyone borow me some space on a ftp server?
Reply With Quote
  #10  
Old 1st July 2007, 05:44 PM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
sounds like your ./configure hasnt done properly, whats the output like? does it gives you any errors anywhere?
Reply With Quote
  #11  
Old 1st July 2007, 06:31 PM
Stian1979 Offline
Registered User
 
Join Date: Dec 2006
Location: Taipei Taiwan
Age: 35
Posts: 401
I can not see anny Error mesages.

./configure --with-webdir=/var/www/ZM \

./configure --with-libarch=lib64

./configure --with-cgidir=/var/www/cgi-bin \

./configure --with-ffmpeg=/usr/local \

ZM_DB_PASS=mypassword \

ZM_DB_NAME=ZMDB \

ZM_DB_USER=ZM

mkdir /var/www/ZM

updatedb

locate db/zm_create.sql > /root/ZoneMinder-1.22.3/db/zm_create.sql.in
/home/Stian/Download/ZoneMinder-1.22.3/db/zm_create.sql.in
/root/ZoneMinder-1.22.3/db/zm_create.sql.in


mysql mysql < /root/ZoneMinder-1.22.3/db/zm_create.sql.in

mysql mysql -p
Enter password:

grant select,insert,update,delete on ZMDB.* to 'ZM'@localhost identified by 'mypassword';

quit

mysqladmin reload -p
Enter password:

make install
make: *** No rule to make target `install'. Stop.

This is what I have done in exsact order.

If I store this video image on the local hardisk it could be just stolen if annyone find out they are recorded, annyone interested in having my backup on there ftp if I store your backup on my ftp? I gues there must be some way to make the video image record on two places at the same time.
__________________
smolt profile

Without fedoraforum.org I would still be using Windows

Can annyone borow me some space on a ftp server?

Last edited by Stian1979; 1st July 2007 at 06:40 PM.
Reply With Quote
  #12  
Old 1st July 2007, 07:34 PM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
You run all the configure options in one line, for example:

./configure --with-webdir=/var/www/ZM --with-libarch=lib64 --with-cgidir=/var/www/cgi-bin --with-ffmpeg=/usr/local ZM_DB_PASS=mypassword ZM_DB_NAME=ZMDB ZM_DB_USER=ZM

the configure utility should then print out the configure results. have have good look at its output, see if there any error or warning there.

and you dont have to run updatedb everytime, updatedb is only necessary when you want to locate new files.
Reply With Quote
  #13  
Old 1st July 2007, 07:55 PM
Stian1979 Offline
Registered User
 
Join Date: Dec 2006
Location: Taipei Taiwan
Age: 35
Posts: 401
That got my install running,

/usr/include/ffmpeg/avformat.h: In function ‘void av_init_packet(AVPacket*)’:
/usr/include/ffmpeg/avformat.h:66: error: ‘INT64_C’ was not declared in this sco pe
make[1]: *** [zm_event.o] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.22.3/src'
make: *** [install-recursive] Error 1

I gues I'm unlucky or something or maybe just too stupid

Gues that is why I'm a mecanic and not a computer engineer

I installed the ffmpeg using yum and I have the Linva repo enabled so I gues it came from there.
__________________
smolt profile

Without fedoraforum.org I would still be using Windows

Can annyone borow me some space on a ftp server?

Last edited by Stian1979; 1st July 2007 at 07:59 PM.
Reply With Quote
  #14  
Old 1st July 2007, 08:07 PM
icy-flame Offline
Registered User
 
Join Date: Feb 2006
Location: 00000000-0009FFFF
Posts: 135
Quote:
Originally Posted by icy-flame
What version of ffmpeg have you got? I got mine from linva repo.

And you dont need ffmpeg to have a working ZoneMinder install, its just an extra feature / option. Try remove the option: "--with-ffmpeg=/usr/local" when running ./configure

You seem to have the same problem as InfRecursion, what versions are your ffmpeg-devel and ffmpeg-libs? you can check it by doing "rpm -q ffmpeg-devel" forexample. Alternatively you can just leave out the ffmpeg function, i have mine running but never found a need for it.
Reply With Quote
  #15  
Old 1st July 2007, 08:17 PM
Stian1979 Offline
Registered User
 
Join Date: Dec 2006
Location: Taipei Taiwan
Age: 35
Posts: 401
ffmpeg-devel-0.4.9-0.37.20070503.lvn7

If I don't nead it I will try to leave it out.

How do you start zoneminder by the way? do I start from comand line or?

I can find avformat.h in /usr/include/ffmpeg, but not avformat.h:66: if there is sutch a thing.

I tryed to start again from ./configure -the ffmpeg, but I get the same error so I gues I just have to do it all over again after a reboot.
__________________
smolt profile

Without fedoraforum.org I would still be using Windows

Can annyone borow me some space on a ftp server?

Last edited by Stian1979; 1st July 2007 at 08:28 PM.
Reply With Quote
Reply

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: 11:11 (Saturday, 01-11-2014)

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
Narathiwat Photos on Instagram - Novocherkassk Travel Photos - Lensk Photos on Instagram