HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   High quality video security with Ubuntu server 10.10,Zoneminder 1.24.x,cheap DVR card (http://www.howtoforge.com/forums/showthread.php?t=49657)

letsharehowto 26th October 2010 07:44

High quality video security with Ubuntu server 10.10,Zoneminder 1.24.x,cheap DVR card
 
1 Attachment(s)
Today I will tell you how to build video security system with Ubuntu server 10.10, Zoneminder 1.24.x, cheap DVR card, high quality video output.

My box:
-Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz, 2 cores
-Memory: 2G
-Dvr card: http://picasaweb.google.com/letsharehowto/DvrCard#

We have 4 step:

-Install Ubuntu server.
-Install bttv driver.
-Install Zoneminder.
-Config Zoneminder.

1/-Install Ubuntu server:

Set up new box Ubuntu server 10.10. If you don't know, you can google.
-When box get dhcp IP address, press Cancel, then input IP manual. In my case, my IP is: 192.168.1.75. Netmask: 255.255.255.0. Gateway: 192.168.1.1. Name server address: 192.168.1.1.
-When box ask software to install, only choose OpenSSH.
Finish install, reboot box.

Logon and enable root account.

Code:

sudo passwd root
Exit then logon with root and latter do everything with root too.

Update box:

Code:

apt-get update && apt-get upgrade -y
2/-Install bttv driver:

I have one dvr card and my card look like this card: http://www.zoneminder.com/wiki/index.php/Kodicom_8800.
Install bttv driver:

Code:

nano /etc/modprobe.d/bttv.conf
Cut and paste this quote into file then save and exit:

Quote:

options i2c-algo-bit bit_test=1
options bttv gbuffers=16 card=102,102,102,102,102,102,102,102 radio=0,0,0,0,0,0,0,0 tuner=4,4,4,4,4,4,4,4 chroma_agc=1 combfilter=2 full_luma_range=1 coring=1 autoload=0
Reboot box:

Code:

reboot
Logon with root. Make sure dvr card work:

Code:

ls /dev/video*
If it works, the quote like this:

Quote:

/dev/video0 /dev/video2 /dev/video4 /dev/video6
/dev/video1 /dev/video3 /dev/video5 /dev/video7
3/-Install zoneminder:

Make Pada scrip:

Code:

nano pada.sh
Cut and paste this quote into file then save and exit:

Quote:

#!/bin/sh
# ZoneMinder 1.24.2 installation script
#
# Copyright (C) 2010 Chris "Pada" Kistner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

echo "--- Checking for root privileges..."
if [ "`whoami`" != "root" ]; then
echo Error: This script requires root access
exit 1
fi

echo "--- Installing extra codecs, which includes x264 support..."
apt-get -y install libavcodec-extra-52 libavformat-extra-52 libswscale-extra-0 libavfilter-extra-1

echo "--- Installing ZoneMinder..."
apt-get -y install zoneminder

echo "--- Adding ZoneMinder to Apache2..."
ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/zoneminder.conf
service apache2 restart

echo "--- Adding alias for zoneminder service and fixing ZoneMinder startup..."
ln -s /etc/init.d/zoneminder /etc/init.d/zm
update-rc.d -f zoneminder remove
update-rc.d -f zm remove
update-rc.d zm defaults 92
service zm restart

echo "--- Correcting SHM to 90% of memory..."
apt-get -y install coreutils bc
page_size=$(getconf PAGE_SIZE)
mem_bytes=$(awk '/MemTotal:/ { printf "%0.f",$2 * 1024}' /proc/meminfo)
mb=1048576
mem_bytes_mb=$(expr $mem_bytes / $mb)
shmmax=$(echo "$mem_bytes * 0.90" | bc | cut -f 1 -d '.')
shmmax_mb=$(expr $shmmax / $mb)
shmall=$(expr $mem_bytes / $page_size)
shmmax_cur=$(sysctl -n kernel.shmmax)
shmmax_cur_mb=$(expr $shmmax_cur / $mb)
shmall_cur=$(sysctl -n kernel.shmall)
echo "-- Total memory = $mem_bytes B = $mem_bytes_mb MB"
echo "-- Page size = $page_size B"
echo "-- Current kernel.shmmax = $shmmax_cur B = $shmmax_cur_mb MB"
echo "-- Current kernel.shmall = $shmall_cur pages"
if [ "$shmmax" -eq "$shmmax_cur" ] && [ "$shmall" -eq "$shmall_cur" ]; then
echo "-- Recommended shm values already set"
else
echo "-- Recommended: kernel.shmmax = $shmmax B = $shmmax_mb MB"
echo "-- Recommended: kernel.shmmall = $shmall pages"
file=/etc/sysctl.conf
if [ "`grep "^kernel\.shmmax" $file -c`" != "0" ]; then
echo "-- Replacing: kernel.shmmax in $file"
sed "s/^kernel\.shmmax.*$/kernel.shmmax=$shmmax/g" -i $file
else
echo "-- Adding: kernel.shmmax to $file"
echo kernel.shmmax=$shmmax >> $file
fi
if [ "`grep "^kernel\.shmall" /etc/sysctl.conf -c`" != "0" ]; then
echo "-- Replacing: kernel.shmall in $file"
sed "s/^kernel\.shmall.*$/kernel.shmall=$shmall/g" -i $file
else
echo "-- Adding: kernel.shmall to $file"
echo kernel.shmall=$shmall >> $file
fi
echo "-- Using: new sysctl values"
sysctl -p
fi

# Done
echo "--- Done."
Make pada.sh can execute:

Code:

chmod 744 pada.sh
Install Zoneminder:

Code:

./pada.sh
Add www-data user:

Code:

adduser www-data video
Reboot box:

Code:

reboot
4/-Config Zoneminder:

On client open Mozzilla web browser. At address type:

If Zoneminder works, the picture like this. (Make sure in the first line, at middle line like this: "ZoneMinder Console - Running - v1.24.2").

( http://picasaweb.google.com/letsharehowto/Running# )

Click Options.

Then click Paths tab.

Check USE_DEEP_STORAGE like this. Click Save button. You will see popup windows, don't worry, click OK button.

( http://picasaweb.google.com/letshare...72769608858962 )

Then click Images tab. Default JPEG_FILE_QUALITY is 70 , change to 100.

Delete everything at FFMPEG_OUTPUT_OPTIONS and replace with:

Quote:

-f mp4 -vcodec libx264 -vpre default -an -threads 0
Delete everything at FFMPEG_FORMATS and replace with:

Quote:

mp4 mpg mpeg wmv asf avi* mov swf 3gp**
When you done, click Save button. Then click Cancel.

( http://picasaweb.google.com/letshare...72787070731730 )

Restart Zoneminder: click Running -> choose Restart -> click Apply.

( http://picasaweb.google.com/letshare...artZoneminder# )

Add new monitor: click Add New Monitor button then follow my pictures, when finish click save button.

( http://picasaweb.google.com/letshare...AddNewMonitor# )

Download "HQ" movies: follow these pictures - look at mouse point.

( http://picasaweb.google.com/letshare...oad_HQ_Movies# )

You can download mysqltuner.pl from http://blog.mysqltuner.com/download to make mysql work smooth.

Thanks:

http://www.zoneminder.com
http://www.ubuntu.com
Chris "Pada" Kistner
http://blog.mysqltuner.com

jayoungh 6th November 2010 20:37

How about mpeg streaming instead of jpeg
 
In your instructions you use jpeg as the streaming method instead of mpeg. jpeg uses far more bandwidth than mpeg (I have seen it take about 10 times more bandwidth for jpeg). Do you or anyone have any working instructions for mpeg using swf?

I can get one camera to work using swf but no more than one. asf works a little better but it likes to stop updating after a few seconds.

jpeg streaming seems to be the most reliable and it doesn't have the tiling/blotchy/fuzzy effects that mpeg does but it uses such a high bandwidth. Would love to use mpeg reliably.

Thanks.

letsharehowto 13th November 2010 15:51

Quote:

asf works a little better but it likes to stop updating after a few seconds.
jpeg streaming seems to be the most reliable and it doesn't have the tiling/blotchy/fuzzy effects that mpeg does but it uses such a high bandwidth
Thank you for your share. You're right.

But I want to keep everything simple, default and easiest for somebody who want to setup zoneminder.

If you want to watch camera smooth and you don't mind about bandwidth via intranet, set:

- configured for High Bandwidth (Second line at midle).
- STREAM_METHOD: jpeg
- MPEG_LIVE_FORMAT: swf
- MPEG_REPLAY_FORMAT: swf

If you want to watch camera smooth via internet, set:

- configured for High Bandwidth (Second line at midle).
- STREAM_METHOD: mpeg
- MPEG_LIVE_FORMAT: asf
- MPEG_REPLAY_FORMAT: asf

Somebody knows better can share here.
Thanks.

nausser 2nd January 2011 20:39

Email via Gmail
 
Thank you very much for these instructions.
I would like to ask though, with this install, can you use the perl emailing funtions ZoneMinder has for gmail ssl? If so, can your provide full instructions like you have on this thread as well as detailed examples of email filters to send alarm frames and/or events?

Thank you in advance for any light you may be able to shed.


All times are GMT +2. The time now is 11:38.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.