Rexxer

Some tips for me and other

Zoneminder

I have a card Kodicom 4400R and IP-camera Hikvision DS-2CD2012-I.

I looked for a free video surveillance system and found it: Zoneminder.

Firstly, I tried to install it on CentOS 6.4 (i686) from the source.

But after fighting with different errors I decided to install it on Ububntu 13.04 Desktop. So:

Install LAMP:

sudo apt-get install tasksel
sudo tasksel install lamp-server

Install Postfix:

sudo apt-get install postfix

Install Zoneminder.

sudo add-apt-repository ppa:iconnor/zoneminder
sudo apt-get update
sudo apt-get install zoneminder

Configure Apache for Zoneminder:

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

Check that /etc/php5/apache2/php.ini

short_open_tag = On

Start services:

sudo /etc/init.d/apache2 start

sudo /etc/init.d/zoneminder start

Login to http://localhost/zm/

You can see an empty console. Click on the Add New Monitor.

 

Source type = local – I will use the card Kodicom 4400R,

Function = Monitor – I will only view it.

Go to the Source tab:

 

Device path = /dev/video0 – I will use the device video0

Device channel = 0 – I will use the first channel on the card.

That’s all for internal card.

Screenshots for the IP-camera:

 

I will use ffmpeg module with motion detection.

 

There is a trick with source path. For my Hikvision camera it’s:

rtsp://admin:password@192.168.1.2/Streaming/Channels/1?tcp

Be careful – ?tcp in the end means I will use TCP protocol. It will have a red error screen if you won’t pick it. Hikvision camera streams with UDP by default.

Now you can check the image from the camera by clicking on it’s name.

That’s I have:

 

The red underline means you can click on it and view/edit the parameters.

You can review records in Events.

 

Click on the Show Filter Window to configure e-mail alerts.

 

After changing rules you need to restart Zoneminder: sudo /etc/init.d/zoneminder restart

You can configure motion detection zones in Zones – there is nothing special.

Now You can get alerts on your e-mail by motion detection.

P.S.:

I have the card Orient SDVR-604 also – the clone of Kodicom 4400R.

For using it I have added the next in the configs:

Created this: /etc/modprobe.d/bttv.conf

Add this to it: options bttv card=0x84,0x84,0x84,0x84 tuner=4,4,4,4 autoload=0

This mean I use 4 chips card without tuner.

You will see only blue screen without correct card’s number.

P.S.S.:

1. If you see access denied for /dev/video0 in the log – just run the next command (add user video to the group www-data):

sudo usermod -a -G video www-data

2. Add this to ZM e-mail to get the video: %EV%

3. When You are using a BTTV (bt8x8) card, You can have troubles using KODICOM 4400 and similar cards with ZoneMinder. The issue is using Video4Linux multibuffer option (in default ZM config). In this case video channels using the same /dev/video_ can interfere each other. For example – using channel 0 and 12 on /dev/video0 shows on both cameras the same picture. Turn off V4L_MULTI_BUFFER in options –> config for proper streaming.

And you can enumerate them all from /dev/video0(1-16)

4. I couldn’t see the realtime video – nothing. I compared 2 installations of ZM and found out the cgiload module was missed. It was cured by: sudo a2enmod cgi

5. I bought a new colour NTSC (other – PAL) car park camera and had some issues with getting image from it. I resolved it with changing 24 bit colour on all the cameras. The same situation with resolution – it have to be the same on all cameras – I changed it from 320×240 to 640×480 successfully although cameras had different systems PAL/NTSC and TV-lines (420/580).Else you will get issues on all cameras. So, if you use bt8x8 card you have to have the same config for all cameras.

6. I noticed that video was interlaced. I changed CAPTURES_PER_FRAME from 1 to 4 and the image became much better.

Links:

http://avreg.net/howto_linux-capture-cards.html

http://avreg.net/howto_linux-capture-cards_bttv.html

http://www.zoneminder.com/wiki/index.php/Kodicom_8800

http://www.zoneminder.com/wiki/index.php/Ubuntu_Server_12.04_64-bit_with_Zoneminder_1.25.0_the_easy_way

http://www.howtoforge.com/forums/showthread.php?t=50199

P.S.: Last time I installed ZM in this way: http://www.zoneminder.com/wiki/index.php/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.26.5_the_easy_way
– recommended.

Some another tips:

To resolve the permissions issues:

sudo chmod 666 /dev/video0
sudo chmod 4755 /usr/bin/zmfix

In Config – Paths. Change ZM_PATH_ZMS from nph-zms to zms – it will make video capture better.

Use avconv as the path for ffmpeg in new Ubuntu: Options – Images – PATH_FFMPEG = avconv

 

 

Leave a Reply