Free video security camera using

ZoneMinder 1.24.2+ CentOS-5.5-i386-netinstall +Logitech orbit af webcam setup+ Audio recording

 

  1.  download and burn a boot cd

    http://ftp.usf.edu/pub/centos/5.5/isos/i386/CentOS-5.5-i386-netinstall.iso

  2. boot with this cd with a pc have two hard drive. one for the os and other for the video files.
  3. choose installation method http
  4. Website Name: mirror.centos.org
    CentOS Directory: (for i386) /centos/5.5/os/i386
    CentOS Directory: (for 64 bit) /centos/5.5/os/x86_64

  5. select server and customize now options

  6. Then click "Next" to continue on

    Once presented with the custom package selection you need to un-check/check the following:

    Applications = Check only "Editors" and "Text Based Internet"
    Development = Check only "Development Libraries" and "Development Tools"
    Servers = Un-check everything
    Base System = Check only "Base" (you can check Administration Tools and System Tools if you need them, but they are not necessary)
    
  7. Now let the system finish installing

  8. Reboot all commands should be run as root

  9.  After the first reboot the setup screen should appear. If not then log into the system and type "setup"

  10.   

  11. Go into the "Firewall Configuration" disable the Security Level, and Disable SELinux

  12. Next we are going to disable a number of system services. Go back to the setup screen and go into "System Services"
    Un-Check or

  13. chkconfig apmd off
    chkconfig bluetooth off
    chkconfig cups off
    chkconfig hidd off
    chkconfig ip6tables off
    chkconfig iptables off
    chkconfig netfs off
    chkconfig nfslock off
    chkconfig pcscd off
    chkconfig portmap off
  14. Installing ZoneMinder 1.24.2

  15. First we need to download files and prepare the system

    # For i386 CentOS 5.x run:
    rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
    
    # For 64 bit CentOS 5.x run:
    rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
  16. cd  /root
    wget http://www2.zoneminder.com/downloads/ZoneMinder-1.24.2.tar.gz
    wget http://www.zoneminder.com/fileadmin/downloads/cambozola.jar
  17. # tip: Copy/paste two lines at a time
    yum -y install mysql mysql-server mysql-devel php php-gd php-mysql httpd gcc \
    pcre-devel gd mod_ssl glib2-devel gcc-c++ ntp gnutls-devel ImageMagick
    
    yum -y install libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools \
    perl-Date-Manip perl-LWP-UserAgent-Determined
    
    yum -y install perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap \
    perl-Module-Load subversion git yasm ffmpeg-devel ffmpeg alsa-utils
  18. yum -y update
    
    reboot   -or-   shutdown -r now
    
  19. 
    chkconfig httpd on 
    chkconfig mysqld on 
    chkconfig ntpd on 
    service httpd start 
    service mysqld start 
    service ntpd start
  20. cd /root/  # Or your work directory for this installation
    tar -zxvf ZoneMinder-1.24.2.tar.gz
    cd /root/ZoneMinder-1.24.2
    ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zm ZM_DB_PASS=zmpass ZM_SSL_LIB=openssl CPPFLAGS="-D__STDC_CONSTANT_MACROS"
    make
    make install
  21. By default ZM_DB_HOST=localhost, ZM_DB_NAME=zm, ZM_DB_USER=zmuser, and ZM_DB_PASS=zmpass.

  22. Mysql setup for zoneminder

  23. mysql 
    mysql> create database zm;
    
    mysql> grant CREATE, INSERT, SELECT, DELETE, UPDATE on zm.* to zm@localhost;
    
    mysql> SET PASSWORD FOR zm@localhost=PASSWORD('zmpass');
    
    mysql> exit
    

    >Bye

  24. mysql -u root  zm < /root/ZoneMinder-1.24.2/db/zm_create.sql
    
  25. cp /root/ZoneMinder-1.24.2/scripts/zm /etc/init.d/
    chmod +x /etc/init.d/zm
    chkconfig zm on
  26. cp /root/cambozola.jar /var/www/html/zm/
    
    chown apache:apache /var/www/html/zm/cambozola.jar
    
    service zm start
  27.  

  28. centos 5.5 have logitech orbit af webcamera driver.

  29. plug in the webcamera and reboot

  30. login again

  31. ifconfig and note the ipaddress

  32. logon to another pc and open  http://ipaddress-from-aboveline/zm

  33. create anew monitor and add device /dev/video with yuyv and 800X600 or 640x480 or 320x240 or 960x720 or  1600x1200 at 5 frame per sec

  34. change options->images-> PATH_FFMPEG Path to (optional) ffmpeg mpeg encoder (?) /usr/bin/ffmpeg.

  35. if you know how to get pan and tilt working let me know.

How to Record Audio when alarm occur

==============

===================

arecord -l to get the hardware id and channel

===================

card 1: U0x46d0x994 [USB Device 0x46d:0x994], device 0: USB Audio [USB Audio]

Subdevices: 1/1

Subdevice #0: subdevice #0

===================

change recording volume to 80 percent

alsamixer -c 1

=========

hw:1,0 number "1" is taken from card 1: U0x46d0x994 [USB Device from arecord -l and number "0" is from device 0: USB Audio

To Test audio recording

arecord -f cd -D hw:1,0 -c 1 -d 60 -r 16000 test.wav

========

setup zoneminder to record audio.

========

cd /usr/local/bin

wget http://www.malayalam.net/howto/zoneminder/zmaudio

wget http://www.malayalam.net/howto/zoneminder/Monitor-1

chmod a+x /usr/local/bin/zmaudio

chmod a+x /usr/local/bin/Monitor-1

/bin/echo "/usr/local/bin/zmaudio &" >> /etc/rc.local

/bin/mkdir /var/www/html/sound

chown apache:apache /var/www/html/sound

reboot

to see and hear recorded audio files http://ipaddress/sound/ click on it to listen

done. have fun.