Don't bother with that guide, give this a try:
I am going to assume you are using Ubuntu 11.04 on a server (no GUI). It is always important when you ask for help that you mention the distro and version you are using. It is also important to know rather or not it is 32 bit or 64 bit and rather it is a desktop or server. I will assume you already have networking properly setup on this machine as you have a previous version of zoneminder installed. These instructions will give you a special treat too, libjpeg-turbo. This will also get you to Zoneminder 1.24.4. There has been a recent change in version though it was never announced.
Very important, if you are on a different distro or different version of Ubuntu other than 11.04, stop now, do not follow these instructions, read what I wrote at the very end. If you originally installed zoneminder from a distro package, stop as well, we will need to do a little more work to get you going first before we build it from source. Lets get started, first you need to have root privilege, this will get you that:
Code: Select all
apt-get remove ffmpeg libavcodec-extra-52 libavformat-extra-52 libswscale-extra-0 libavfilter-extra-1
You may get an error message after following the above instruction. Don't worry about it, it only means that one of the packages was not installed.
Code: Select all
aptitude install build-essential linux-headers-`uname -r` automake perl libauthen-pam-perl \
libpam-runtime libio-pty-perl libmysqlclient-dev \
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
Code: Select all
export CFLAGS="-march=native -O2 -pipe" && \
export CXXFLAGS="${CFLAGS}" && \
export CPPFLAGS="${CFLAGS}"
If your system is 32 bit, do the following, if not skip this:
Code: Select all
wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.1.1/libjpeg-turbo_1.1.1_i386.deb?use_mirror=voxel
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
ln -s /opt/libjpeg-turbo/lib/libjpeg.a /usr/lib/i386-linux-gnu/libjpeg.a && \
ln -s /opt/libjpeg-turbo/include/jconfig.h /usr/include/i386-linux-gnu/jconfig.h && \
ln -s /opt/libjpeg-turbo/include/jerror.h /usr/include/i386-linux-gnu/jerror.h && \
ln -s /opt/libjpeg-turbo/include/jmorecfg.h /usr/include/i386-linux-gnu/jmorecfg.h && \
ln -s /opt/libjpeg-turbo/include/jpeglib.h /usr/include/i386-linux-gnu/jpeglib.h
echo "/opt/libjpeg-turbo/lib" > /etc/ld.so.conf.d/libjpeg-turbo.conf && \
echo "/usr/local/lib/i386-linux-gnu" > /etc/ld.so.conf.d/ffmpeg.conf && \
echo "LD_LIBRARY_PATH=/usr/local/lib/i386-linux-gnu:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH" >> /etc/bash.bashrc && \
echo "export LD_LIBRARY_PATH" >> /etc/bash.bashrc
ldconfig
If your system is 64 bit, do the following, if not skip this:
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
ln -s /opt/libjpeg-turbo/lib/libjpeg.a /usr/lib/amd64-linux-gnu/libjpeg.a && \
ln -s /opt/libjpeg-turbo/include/jconfig.h /usr/include/amd64-linux-gnu/jconfig.h && \
ln -s /opt/libjpeg-turbo/include/jerror.h /usr/include/amd64-linux-gnu/jerror.h && \
ln -s /opt/libjpeg-turbo/include/jmorecfg.h /usr/include/amd64-linux-gnu/jmorecfg.h && \
ln -s /opt/libjpeg-turbo/include/jpeglib.h /usr/include/amd64-linux-gnu/jpeglib.h
echo "/opt/libjpeg-turbo/lib" > /etc/ld.so.conf.d/libjpeg-turbo.conf && \
echo "/usr/local/lib/amd64-linux-gnu" > /etc/ld.so.conf.d/ffmpeg.conf && \
echo "LD_LIBRARY_PATH=/usr/local/lib/amd64-linux-gnu:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH" >> /etc/bash.bashrc && \
echo "export LD_LIBRARY_PATH" >> /etc/bash.bashrc
ldconfig
Lets install a few perl modules.
Code: Select all
perl -MCPAN -e shell
install CPAN
exit
perl -MCPAN -e shell
install YAML PHP::Serialization Module::Load X10::ActiveHome
exit
LC_ALL=C perl -MCPAN -e shell
install Sys::Mmap
install DBI
install DBD::mysql
exit
This is the horse that pulls the wagon when you want to export video. I will show you how to do it the high quality way without the blocked look exported video normally has.
Code: Select all
cd /usr/src && git clone git://git.videolan.org/x264
cd x264
./configure --enable-shared
make
make install
ldconfig
cd /usr/src && git clone git://git.videolan.org/ffmpeg.git
cd /usr/src/ffmpeg/ && ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libx264 --enable-libxvid --enable-x11grab --enable-shared
make
make install
make install-libs
cd /lib && ln -s /usr/local/lib/libswscale.so.0 && \
ln -s /usr/local/lib/libavformat.so.52 && \
ln -s /usr/local/lib/libavcodec.so.52 && \
ln -s /usr/local/lib/libavutil.so.50 && \
ln -s /usr/local/lib/libavdevice.so.52 &&\
ln -s /usr/local/lib/libx264.so.107
ldconfig
Now you have a nice ffmpeg to work with, lets get you the latest zoneminder set up in /var/www/zm. If your zoneminder is elswhere, make sure you change this path /var/www/zm in the following instructions to point to the locations of your zoneminder. Let me know if it is in another place too as a few more steps will be required that are not in this little guide. You already have a database, so we wont go over that part:
Code: Select all
cd /usr/src
svn co http://svn.zoneminder.com/svn/zm/trunk zm
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 CPPFLAGS="-D__STDC_CONSTANT_MACROS"
aclocal
automake
make
#####Follow the instructions below only if you do not have a zoneminder database:
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.
mysql -u root -p
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
quit
mysqladmin -p reload
####End of database instructions
make install
zmupdate.pl
You should be good unless your zoneminder is set up differently than what I am assuming here. If so, let me know and I or someone else here will add more to these instructions to get you where you need to be. If you are on a different distro other than Ubuntu or Debian, someone else will need to step in to help you. If you are running 10.10 or another version of Ubuntu, I can show you how to upgrade it. I am not leaving all the extra instructions unless you actually need them to avoid confusion and my spending more time here. These instructions are from various guides here with my own twists added to improve it further. I prefer to build from source as well, it is always the easiest to upgrade as you never have to wait for the distro to provide and updated package.