Ubuntu 10.04 Server 64-bit (with ffmpeg, etc.)

From ZoneMinder

Jump to: navigation, search

There is a pre-compiled package available for 10.04 LTS. Using the zoneminder package saves an unbelievable amount of time compared to trying to get all of the packages to install and compile, but there are still several steps needed to get a working system. This is what worked for me.

Contents

Install Ubuntu

Install 64 bit Ubuntu 10.04 LTS Server. Picked none of the optional units, but should probably select the OpenSSH server.

After installing Ubuntu, update it by running:

sudo apt-get update
sudo apt-get upgrade

Get the packages

Then, get the OpenSSH server and ZoneMinder:

sudo apt-get install openssh-server
sudo apt-get install zoneminder

Do not set a password for the MySQL server

Apache2 configuration

You will get Apache2, but you will need to connect the zoneminder files to apache.

First, you will need to edit /etc/zm/apache.conf. Add

ScriptAlias /cgi-bin /usr/share/zoneminder/cgi-bin

after the Alias /zm line, or else your streaming won't work, since the html produced by zoneminder expects /cgi-bin to be at the top of your Apache website.

Then, link the zoneminder apache.conf into the apache configuration:

sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf

Add the video group to the www-data user

Then, you need to include the www-data user (under which apache runs) in the video group, so it can access the video devices:

sudo adduser www-data video

Set shared memory configuration

Then, you need to set the shared memory sizes, or your capture daemons will not start. At the end of /etc/sysctl.conf, add:

kernel.shmall = 512000
kernel.shmmax = 1000000000

Those numbers worked for my 2 GB Ram setup. That .shmmax is 1GB, or half of my RAM. Be sure that your .shmmax does not exceed the RAM in your machine. There are several posts on this shared memory issue in the wiki.

Fix deprecated usage of ereg() in functions.php

Also, as of this writing, there are several usages of ereg() in /usr/share/zoneminder/includes/functions.php; you may get warnings about these. You can fix them by changing the calls to preg_match, and also changing the delimiters, as outlined in this posting: http://www.zoneminder.com/forums/viewtopic.php?p=57356

Reboot

Once you have made those changes, you should reboot your server:
sudo reboot

Start Zoneminder

Note that Zoneminder is started on bootup by the old rc.d system, but Ubuntu has migrated to the upstart system, and on my system, mysql (which is started by upstart) had not started by the time Zoneminder is started. Thus, I get error messages on the startup screen, and had to start zoneminder manually.

You can start zoneminder manually with:
sudo /etc/init.d/zoneminder start

Use "restart" instead of "start" to restart zoneminder.



Service Zoneminder on boot

Found the problem. Zoneminder was starting before mysql and so fail to start.

To fix that:

sudo update-rc.d -f zoneminder remove

sudo update-rc.d zoneminder defaults 92

regards gelevera.


Set up video sources

Now, you will have to set up your zoneminder configuration and your video sources. Point a browser to http://your.ip.address/zm and you should get the console screen, with no video sources configured. It might be best to get at least one video source working before setting up users. You configure zoneminder with the "options" link at the right of the console window. Zoneminder will not use users or logins until you set OPT_USE_AUTH on the System tab of the options window.

I used the Provideo PV183 8 port PCI video capture card from Bluecherry -- it was recognized by Ubuntu without any additional configuration, which you can verify by checking the system log:
grep bttv /var/log/syslog

You can also find the /dev/video0 etc. devices in the /dev directory.

As noted on the Troubleshooting page, http://www.zoneminder.com/wiki/index.php/Troubleshooting, you can use zmu to determine the available configuration values for the video device:
zmu -d /dev/video1 -q -v

If you have set up users, you may need to add username and password for zmu. Run zmu -? for help.

The troubleshooting page has lots of good advice on how to get your first video device working. In my setup, I plugged the hydra cable in the socket further away from the motherboard, and used the blue "VID2" video connector. I set the device path to /dev/video1, capture method to Video for Linux version 2, device channel 0, device format NTSC, capture palette to GREY initally, then to RGB555 for color, capture width 320, capture height 240, and preserve aspect ratio off. I left the other settings at the defaults.

You know that your configuration settings are good (and that ZoneMinder is running!) if the color of the device path changes from red to orange or green.

Once you have configured your first device, you can test that there are no permission problems by starting zmc using the www-data user:
sudo su www-data -c 'zmc --device /dev/video1'

If this is capturing, it should not return until you hit Ctrl-C. If it returns immediately, you have a problem.

If you are still having trouble, try turning on debug logging as suggested on the Troubleshooting page.

Other comments

A few other comments: Once you have everything working without zoneminder logins, you can turn on OPT_USE_AUTH. Once that is on and zoneminder has recognized it (may require a restart of zoneminder), there will be a user tab in the options window where you can add users. Note that, if you ever select one of the monitors to be a Restricted Monitors, you probably will never be able to add a new monitor using that login, even if you remove all the Restricted Monitors (which you probably won't be able to do if you use a Mac for your browser client)

Also, the System tab has a AUTH_RELAY option, which you can set to hashed or plain to protect your video stream. I have set up several zoneminder systems over the past four years, and in my experience, the hashed feature does not work and has never worked. If you select anything other than "none", you won't be able to view any streaming video.

This appears to be a problem with zms -- see this: http://www.zoneminder.com/forums/viewtopic.php?p=33110. When you try to access a video stream with the hashed option set, you the log shows these errors:

zms[10200]: INF [Debug Level = 0, Debug Log = <none>]
zms[10200]: Libgcrypt warning: missing initialization - please fix the application

If anyone knows how to get this to work (short of compiling the whole system from scratch), please post the instructions on the wiki.

Good luck!

Personal tools