What you need:

  1. The Ubuntu mini CD
  2. A linux and ZoneMinder-supported capture card
  3. A PC

Let’s start!

  1. Install Ubuntu
  2. After the base system is installed install ssh (always good to have) and ZoneMinder
  3.  

    user@ubuntu:~$ sudo apt-get install openssh-server zoneminder

  4. Add the www-data user to the ‘video’ group to access the video streams from the web interface:

    user@ubuntu:~$ sudo usermod -a -G video www-data

  5. Make Apache automatically start the ZoneMinder web interface and restart Apache:

    user@ubuntu:~$ sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/001-zoneminder
    Password:
    user@ubuntu:~$ sudo service apache2 restart

  6. At this point you should be able to open ZoneMinder’s web interface by pointing your browser to http://IP-OF-ZONEMINDER-SERVER/zm/
  7. Download Cambozola to be able to view the live streams from any Java enabled browser in case the Flash viewer does not work for you:

    user@ubuntu:~$ wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
    user@ubuntu:~$ tar -zxvf cambozola-latest.tar.gz
    user@ubuntu:~$ sudo cp cambozola-0.76/dist/cambozola.jar /usr/share/zoneminder/

    Please note: As of writing this cambozola version 0.76 is the latest one, hence if you get a newer version you should change to the respective directory.

  8. It’s time to add your cameras – it’s best to first read ZoneMinder’s defining a monitor documentation
  9. In the very likely event that you get black/blank screen when you try to view the live feed from your camera, then you should change your maximum allowed amount of shared memory and restart Apache and ZoneMinder:

    user@ubuntu:~$ sudo echo "256000000" > /proc/sys/kernel/shmmax
    user@ubuntu:~$ sudo service apache2 restart
    user@ubuntu:~$ sudo service zoneminder restart

    How to calculate that magic number (256000000 in my case) is discussed in this thread in the ZoneMinder’s forums. It’s best to read it and calculate the amount yourself, as this is highly dependent on the cameras that you intend to use.
    In order to add the change permanently you’ll need to edit /etc/sysctl.conf and add a line kernel.shmmax = 256000000 to it.
    If you are still getting no image you should check your cameras and how you set them and experiment with the Device format and Capture palette.

  10. You’re all set!

It might be a good idea to slightly tweak some configuration options. You can do that from the Web Interface’s options menu – it is located in the upper right corner, just below the load/disk-usage monitor and it took me quite a while to find it.

  1. Options -> Image -> OPT_CAMBOZOLA set to TICKED
  2. Options -> Image -> STREAM_METHOD set to mpeg

I plan to implement also a Live View monitor so stay tuned for the next HOWTO.

Pings/Trackbacks

  1. […] easy to install, since it’s a synaptec package and installs all the dependencies for you and used this guide. If you need any help let us know, hardest bit was getting the cameras to work, but all’s i […]

21 Comments on “HOWTO: Make a CCTV DVR with Ubuntu 10.04 and ZoneMinder”

  1. Scott said at 02:08 on July 18th, 2010:

    Thanks for the guide. I had trouble getting Zoneminder to work on my Ubuntu 10.04 system but after following your steps it is working great!

  2. Darin said at 02:15 on July 31st, 2010:

    Excellent tutorial, after many hours of trying to install zoneminder from many different guides, thanks to you I finally have it running! Thanks heaps ;o)

  3. luis said at 20:56 on August 26th, 2010:

    thancks, a lot!!!!

  4. Joe said at 17:45 on November 4th, 2010:

    I have installed zoneminder running apt-get install zoneminder and it installs correctly. I am able to connect from a wepage to it and setup video0 and video1 but nothing happens. The video screen opens but nothing plays. I am running a wintv-pvr 150 and wintv-pvr-250 card. I know both cards are working fine as i go under dmesg and see them installed with no errors. I also run: dmesg | grep Initialized

    [ 10.442558] ivtv0: Initialized card: Hauppauge WinTV PVR-150
    [ 11.513321] ivtv1: Initialized card: Hauppauge WinTV PVR-250

    under cd /dev i see this.

    video0
    video1
    video24
    video25
    video32
    video33

    i then test the video by typing.

    cat /dev/video0 > /home/joe/test_captureTEST5000.mpg (this plays back in vlc player fine)

    i then test video1.

    cat /dev/video1 > /home/joe/test_captureTEST6000.mpg (this one plays back in vlc player fine too.

    When i run v412-ctl -T, i get 99% signal on the video0, then i run v4l2-ctl –device=/dev/video1 -T and i get 99% on video1 signal too.

    Now i just need help on getting zoneminder to play the video as i setup video0 and video1 in zoneminder and it installed properly.

    i installed zoneminder by running. sudo apt-get install zoneminder

    thanks

  5. Georgi said at 18:06 on November 4th, 2010:

    Hey Joe,

    How far did you get with my tutorial? Do you mean to view the live feed in ZoneMinder, or do you mean to replay recordings or you haven’t setup the video feeds at all?

  6. Ross said at 15:04 on November 11th, 2010:

    I have installed zoneminder and my terminal says openssh is installed
    I copy and pasted from step 4 above “sudo usermod -a -G video www-data”,
    I copy and pasted from step 5 above “sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/001-zoneminder
    Password:”
    The terminal looked like this:
    ross@ross-desktop:~$ sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/001-zoneminder
    ln: creating symbolic link `/etc/apache2/sites-enabled/001-zoneminder’: File exists
    ross@ross-desktop:~$ Password: (PRESSED ENTER)
    Password: command not found
    If I put in a password or not the outcome is the same
    I’m not sure of what to do here
    I restarted apache and tried to open web interface anywaywith http://IP-OF-ZONEMINDER-SERVER/zm/ and then firefox converted it to http://www.ip-of-zoneminder-server.com/zm/but and came back with server not found.
    would appricate your help
    Thanks

  7. Georgi said at 17:18 on November 11th, 2010:

    @Ross:

    Nothing to worry about step 4 failing! It means that you actually have the link to auto-start zoneminder, so it’s all good

    As to not being able to open the web interface… well you have to replace IP-OF-ZONEMINDER-SERVER with the actual IP address of the server! If you’re trying to view the web interface from the same computer where you have zoneminder installed you can replace IP-OF-ZONEMINDER-SERVER with 127.0.0.1

    If you’re using different machine you’ll have to find out the IP address of your zoneminder. Just use google to see how you can find out the IP address. If you have a GUI (e.g. KDE or gnome) it’ll be in the control center, if you don’t have you’ll have to use the command line and the command ‘ifconfig’.

  8. joe said at 20:57 on November 23rd, 2010:

    Georgi,

    I did every step but #7 and still cant get it to work. I have posted on zoneminder forums and no one has helped me,.

    http://www.zoneminder.com/forums/viewtopic.php?t=16770

    http://www.zoneminder.com/forums/viewtopic.php?t=16696

    http://www.zoneminder.com/forums/viewtopic.php?t=16780

  9. Georgi said at 22:13 on November 23rd, 2010:

    @joe you should definitely get combozola. I had the same thing – i.e. blank screen before setting it up properly! You should also have java runtime environment (JRE) installed and enabled in the browser.
    I myself used Mac OS X to view cameras so it worked out nicely. Try out whether you can get combozola to show you the live feed and let me know.

  10. maikel said at 15:06 on March 20th, 2011:

    Thanks it works for me….!!!! keep on the good works!!!.

  11. serdar said at 02:28 on March 28th, 2011:

    Hopefully, i know how to do thanks to you!

  12. Pablo said at 06:13 on May 10th, 2011:

    I followed all the instructions, installed Java JRE, and combozola. I bring up the web GUI and added a monitor on /dev/video0, NTSC, RGB24, 320×240, using Video for Linux versions 1 and 2, but nothing. I just get a blank screen. I’m able to see video using:
    vlc v4l2:///dev/video0
    or record via:
    ffmpeg -f video4linux2 -s 320×240 -i /dev/video0 out.mpg

    What am I missing?

  13. Pablo said at 06:58 on May 10th, 2011:

    After changing to PAL, now I see Cambozola v0.92-0002 (c) Andy Wilcock, 2010 instead of the video. This is using STREAM_METHOD jpeg. If I change to mpeg, then I get nothing again.

  14. Georgi said at 10:36 on May 10th, 2011:

    Is it possible that you are missing or have disabled JAVA support on the viewer’s browser?

  15. Pablo said at 00:30 on May 11th, 2011:

    Not likely, tried it from 3 different machines.

  16. Pablo said at 05:30 on May 11th, 2011:

    Ok, I reinstalled everything, changed STREAM_METHOD to jpeg, still using PAL. I have OPT_CAMBOZOLA enabled. When I click on my Monitor, I get No main content type, instead of my video.

  17. Pablo said at 05:59 on May 11th, 2011:

    I was able to get it to work, using uvc_stream -f 7 -r 320×240 -p 8082

    Every once in a while, the monitor goes black, so I believe I have a memory issue, right?

  18. Christian said at 12:11 on August 3rd, 2011:

    Enter comment here.
    Wow! I learned so much tonight! And to think that I thought this would be plug and play! Well I’m going to do some more reading then roll up my sleeves and give her the old college try… thanks for all the pointers and commands!

  19. uno2xx said at 09:35 on September 8th, 2011:

    @joe

    try this code

    user@ubuntu:~$ sudo cp cambozola-*/dist/cambozola.jar /usr/share/zoneminder/

    use asterisk as a wildcard. instead of 0.76 because it is the version of cambozola.

  20. Ross said at 00:28 on February 11th, 2012:

    Works with Ubuntu 11.1 Zoneminder/Foscam

    R
    mcweb.co.nz

  21. Sathishkumar said at 15:57 on April 16th, 2012:

    This is nice tutorial. Its working for me after resolving lot of bugs..