U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cambozo

Forum for questions and support relating to the 1.25.x releases only.
letsharehowto
Posts: 10
Joined: Sun Oct 24, 2010 11:31 am
Location: Sai Gon - Viet Nam

U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cambozo

Post by letsharehowto »

This is not mine. I use this: http://www.zoneminder.com/wiki/index.ph ... _Cambozola and this: http://www.zoneminder.com/wiki/index.ph ... t)_Desktop then I cut and paste. Because I cut and paste, some packets, ZM don't need it.

My dvr card like this: http://www.zoneminder.com/wiki/index.php/Kodicom_8800

Install new box with Ubuntu server 11.10 64bit. At software selection, select OpenSSH.

Create root account:

Code: Select all

sudo passwd root
And later do everything with root too.

Set static IP:

Code: Select all

nano /etc/network/interfaces
Cut and paste this quote into file:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
ctrl-o to save ctrl-x to exit nano

Restart NIC:

Code: Select all

sudo ifdown -a
sudo ifup -a
Update system software:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
Install bttv driver:

Code: Select all

nano /etc/modprobe.d/bttv.conf
Cut and paste this quote into file:
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: Select all

reboot
Do something for Zoneminder:

Code: Select all

export CFLAGS="-march=native -O2 -pipe" && export CXXFLAGS="${CFLAGS}" && export CPPFLAGS="${CFLAGS}"

Code: Select all

aptitude install acpid build-essential linux-headers-`uname -r` automake perl libauthen-pam-perl apache2 libpam-runtime libio-pty-perl libmysqlclient-dev php5 php5-cli libapache2-mod-php5 php5-mysql libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libjpeg62 libmime-perl libstdc++6 libwww-perl zlib1g zip unzip patch ntp openssl libpcre3-dev libssl-dev libjpeg-progs libcurl4-gnutls-dev munin munin-node libmime-lite-perl netpbm libbz2-dev subversion yasm libnet-ssleay-perl libauthen-pam-perl libio-pty-perl apt-show-versions git-core mysql-server mysql-client mc htop -y

Code: Select all

apt-get install libmysqlclient-dev libjpeg-dev libpcre3-dev build-essential -y
Install Webmin:

Code: Select all

wget http://downloads.sourceforge.net/project/webadmin/webmin/1.570/webmin_1.570_all.deb?use_mirror=voxel
mv webmin_1.570_all.deb\?use_mirror=voxel webmin_1.570_all.deb && dpkg -i webmin_1.570_all.deb
Install libjpeg-turbo (AMD64):

Code: Select all

wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.1.1/libjpeg-turbo_1.1.1_amd64.deb?use_mirror=voxel
mv libjpeg-turbo_1.1.1_amd64.deb?use_mirror=voxel libjpeg-turbo_1.1.1_amd64.deb && dpkg -i libjpeg-turbo_1.1.1_amd64.deb

Code: Select all

ln -s /opt/libjpeg-turbo/lib/libjpeg.a /usr/lib/libjpeg.a && ln -s /opt/libjpeg-turbo/include/jconfig.h /usr/include/jconfig.h && ln -s /opt/libjpeg-turbo/include/jerror.h /usr/include/jerror.h && ln -s /opt/libjpeg-turbo/include/jmorecfg.h /usr/include/jmorecfg.h && ln -s /opt/libjpeg-turbo/include/jpeglib.h /usr/include/jpeglib.h
Configure Lib Paths:

Code: Select all

echo "/opt/libjpeg-turbo/lib" > /etc/ld.so.conf.d/libjpeg-turbo.conf && echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf && echo "LD_LIBRARY_PATH=/usr/local/lib:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH" >> /etc/bash.bashrc && echo "export LD_LIBRARY_PATH" >> /etc/bash.bashrc

ldconfig
Install Perl Modules:

Code: Select all

perl -MCPAN -e shell

install CPAN

exit

Code: Select all

perl -MCPAN -e shell

install YAML PHP::Serialization Module::Load X10::ActiveHome

exit

Code: Select all

perl -MCPAN -e shell

install Sys::Mmap

install DBI

install DBD::mysql

install Date::Manip

install PHP::Serialization

exit
Install FFmpeg:

Code: Select all

apt-get install ffmpeg -y

Install Zoneminder:

Code: Select all

cd /usr/src && svn co http://svn.zoneminder.com/svn/zm/trunk zm

Code: Select all

cd /usr/src/zm && ./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass ZM_SSL_LIB=openssl --enable-debug=no --with-webgroup=www-data --with-webuser=www-data --enable-mmap=yes CPPFLAGS="-D__STDC_CONSTANT_MACROS ${CPPFLAGS}"

Code: Select all

autoconf

aclocal

automake

Code: Select all

make

Code: Select all

mysql -u root -p < db/zm_create.sql
Password that is requested is Mysql root password that was entered during install, not your ubuntu password.

Code: Select all

mysql -u root -p
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';

quit

Code: Select all

mysqladmin -p reload

Code: Select all

make install
Install Cambozola:

Code: Select all

cd /usr/src && wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
cp cambozola-0.92/dist/cambozola.jar /var/www/zm
Create Zoneminder startup script:

Code: Select all

nano -w /etc/init.d/zm
Paste everything BETWEEN the lines below.
#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 99 99

# Source function library.
#. /etc/rc.d/init.d/functions

prog=ZoneMinder
ZM_PATH_BIN="/usr/local/bin"
command="$ZM_PATH_BIN/zmpkg.pl"

start() {
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
return $RETVAL
}
stop() {
echo -n "Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}

case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
ctrl-o to save, ctrl-x to exit nano

Code: Select all

chmod 755 /etc/init.d/zm
Zoneminder Startup:

In firefox, go to https://YOUR_ZoneMinder.IP.ADDRESS.HERE:10000 to reach the Webmin interface.(Login with Ubuntu username and password)
In left menu, select System>Bootup and Shutdown. Tick the box next to zm and click StartNow and On Boot.

In left menu, select Servers>Apache Webserver. Click virtual server under Existing virtual hosts tab. Under Virtual Server Details, change Document Root to /var/www/zm and then save.
Click apply changes at top left of page.

Go to http://YOUR_ZoneMinder.IP.ADDRESS.HERE to reach the Zoneminder interface.

If you want better quality video, cut -r 25 in Option->Images->FFMPEG_OUTPUT_OPTIONS ad replace with:
-f mp4 -r 25 -b 2048k -vcodec mpeg4
Note: If you add New Monitor by hand, when you restart box, only Monitor 1 be green, monitor 2,3,4,5,6,7,8 still red. If you add New Monitor by Presets->BTTV Video (V4L2), PAL, 320x240->Save, everything works OK.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by mastertheknife »

Nice job!

However, this particular line is not needed anymore (starting with ZM 1.24.4 and newer):

Code: Select all

install PHP::Serialization
mastertheknife
Kfir Itzhak.
LWFVoo
Posts: 36
Joined: Thu May 26, 2011 11:02 pm

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by LWFVoo »

I have a 32-Bit system. Will I be OK if I just change all of the 64s to 32s (Find & Replace)? :D
User avatar
mmi
Posts: 111
Joined: Wed Jun 27, 2007 12:54 am

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by mmi »

i follow your tutorial and i don't have this two options: can_stream, stream_method
is this ok?
User avatar
mmi
Posts: 111
Joined: Wed Jun 27, 2007 12:54 am

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by mmi »

LWFVoo wrote:I have a 32-Bit system. Will I be OK if I just change all of the 64s to 32s (Find & Replace)? :D
yes, for me works for 32 bit with necessary changes
letsharehowto
Posts: 10
Joined: Sun Oct 24, 2010 11:31 am
Location: Sai Gon - Viet Nam

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by letsharehowto »

mmi wrote:i follow your tutorial and i don't have this two options: can_stream, stream_method
is this ok?
can_stream, stream_method in High B/W, Low B/W, Medium B/W, Phone B/W tab
User avatar
mmi
Posts: 111
Joined: Wed Jun 27, 2007 12:54 am

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by mmi »

can you tell me what is doing this:

"export CFLAGS="-march=native -O2 -pipe" && export CXXFLAGS="${CFLAGS}" && export CPPFLAGS="${CFLAGS}"
letsharehowto
Posts: 10
Joined: Sun Oct 24, 2010 11:31 am
Location: Sai Gon - Viet Nam

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by letsharehowto »

mmi wrote:can you tell me what is doing this:

"export CFLAGS="-march=native -O2 -pipe" && export CXXFLAGS="${CFLAGS}" && export CPPFLAGS="${CFLAGS}"
This is not mine. I use this: http://www.zoneminder.com/wiki/index.ph ... _Cambozola and this: http://www.zoneminder.com/wiki/index.ph ... ck_Meerkat)_Desktop then I cut and paste. Because I cut and paste, some packets, somethings , ZM don't need it.
LWFVoo
Posts: 36
Joined: Thu May 26, 2011 11:02 pm

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by LWFVoo »

letsharehowto wrote:Create root account:

Code: Select all

sudo passwd root
And later do everything with root too.
After success, would it be wise to remove the root account for security reasons? If so, what's the command?

Thanks.
LWFVoo
Posts: 36
Joined: Thu May 26, 2011 11:02 pm

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by LWFVoo »

mmi wrote:
LWFVoo wrote:I have a 32-Bit system. Will I be OK if I just change all of the 64s to 32s (Find & Replace)? :D
yes, for me works for 32 bit with necessary changes
For any one wondering what the necessary changes are...

64-Bit

Code: Select all

wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.1.1/libjpeg-turbo_1.1.1_amd64.deb?use_mirror=voxel
32-Bit

Code: Select all

wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.1.1/libjpeg-turbo_1.1.1_i386.deb?use_mirror=voxel
64-Bit

Code: Select all

mv libjpeg-turbo_1.1.1_amd64.deb?use_mirror=voxel libjpeg-turbo_1.1.1_amd64.deb && dpkg -i libjpeg-turbo_1.1.1_amd64.deb
32-Bit

Code: Select all

mv libjpeg-turbo_1.1.1_i386.deb?use_mirror=voxel libjpeg-turbo_1.1.1_i386.deb && dpkg -i libjpeg-turbo_1.1.1_i386.deb
LWFVoo
Posts: 36
Joined: Thu May 26, 2011 11:02 pm

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by LWFVoo »

To add a Monitor, select the pre-set BTTV Video (V4L2), PAL, 320x240 and set the drive path to...

Code: Select all

/dev/video0
If your camera looks like a thermal imaging camera (completely messed up colours), try changing the Capture Palette from YUV422P to YUYV. It worked for me. :D
Last edited by LWFVoo on Tue Nov 29, 2011 11:02 am, edited 1 time in total.
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by Jim March »

OK. I've run through all of this, but I can't get to the web interface.

I've tried going to the following links:

http://192.168.0.10:1000

https://192.168.0.10:1000

https://127.0.0.1:1000

http://127.0.0.1:1000

http://localhost:1000

https://localhost:1000

No joy on any of 'em. At:

http://192.168.0.10

...I get the standard Apache default startup text, so that part is working.

The command:

sudo zmpkg.pl start

...seems to work, but doesn't change anything. Can anybody tell me what's going on here?
Jim March
Posts: 88
Joined: Thu Oct 04, 2007 8:31 am

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by Jim March »

Nevermind, this works:

http://localhost/zm/

Sigh
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by bb99 »

Mostly getting back to basics always works!
LWFVoo
Posts: 36
Joined: Thu May 26, 2011 11:02 pm

Re: U Server 11.10 64bit, ZM 1.25 source, libjpeg-turbo, Cam

Post by LWFVoo »

I have two problems...
  • The card supports 25FPS on each channel. But I can't figure out a way to view a camera at 25FPS.
  • The card is PCI. My video card is also PCI. After going through this guide, my video card now seems to be disabled. My monitor (VDU) is switched on, but there's nothing on the screen. The monitor's constantly in sleep-mode as if there's no signal. Very weird. It's not much of a problem as I can still SSH.
Locked