Page 7 of 12

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Tue Nov 15, 2011 8:39 am
by tibetfreedom
mastertheknife wrote: Make sure to recompile ZoneMinder after installing libjpeg-turbo.

mastertheknife
libjpeg-turbo was always installed do I need to alter the configure commands ?

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Tue Nov 15, 2011 9:44 am
by tibetfreedom
mastertheknife wrote:ZoneMinder wasn't compiled against libjpeg-turbo. If you intend to use the BGR24 capture palette, or 32bit target format you need libjpeg-turbo installed and ZoneMinder compiled against libjpeg.h from libjpeg-turbo instead of stock libjpeg.h.
Make sure to recompile ZoneMinder after installing libjpeg-turbo.

About the no option found errors, do you have multiple versions of ZM installed?

mastertheknife
Oh, sorry I must have mis understood, I thought the whole thing was meant to use 32bit Colour space as in the tables you posted.
I think I am missing something and I don't understand.
I really appreciate the work you have done, I have the system running nicely using YUV420 24Bit Colour and PAL 640 * 480 which is better than It ever was, however I thought I could / should use 32 bit BGR with your setup for best results.
I must have misunderstood the instructions you gave, if you can be really patient with me can you explain where I went wrong.

Thanks.

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Nov 17, 2011 12:03 pm
by mastertheknife
Do you have a bt878 card? If yes, you are probably better off using BGR24, rather than YUV420 as your capture palette.
Does your processor have SSSE3? If yes, then BGR32+32bit target might be slightly faster than BGR24+24bit.

Anyways, if you are getting those libjpeg-turbo required errors, then ZM doesn't think you have libjpeg-turbo. Make sure you installed libjpeg-turbo properly, especially the step of symlinking the header files. After that, re-compile ZM and hopefully all is well.

mastertheknife

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Nov 17, 2011 12:09 pm
by tibetfreedom
mastertheknife wrote:Do you have a bt878 card? If yes, you are probably better off using BGR24, rather than YUV420 as your capture palette.
Does your processor have SSSE3? If yes, then BGR32+32bit target might be slightly faster than BGR24+24bit.

Anyways, if you are getting those libjpeg-turbo required errors, then ZM doesn't think you have libjpeg-turbo. Make sure you installed libjpeg-turbo properly, especially the step of symlinking the header files. After that, re-compile ZM and hopefully all is well.

mastertheknife
Thanks,
I can't set 32 bit anything, so I will recompile libjeg-turbo.
What sim link thing should I do ?
Also I may have two executables or installations running side by side, I shouldn't have as I used the same ./configure string as I used in the initial configuration, however upon a restart I get a database error and the web interface reports that, If I stop and start from the web interface It all works OK again apart from the libjpeg-turbo issue.
Thanks very much for your help over this.

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Nov 17, 2011 12:15 pm
by mastertheknife
If you want to have 2 versions of ZM installed at the same time, e.g. one stock one patched, its perfectly ok to use the same ./configure line. But if you do that, to switch versions, you need to stop ZM and run "sudo make install" on the version you want to run, and then start ZM.



About libjpeg-turbo, try running these commands:

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
After this, type "make" to recompile ZM and then "sudo make install" to install it.

mastertheknife

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Nov 17, 2011 12:29 pm
by tibetfreedom
mastertheknife wrote:If you want to have 2 versions of ZM installed at the same time, e.g. one stock one patched, its perfectly ok to use the same ./configure line. But if you do that, to switch versions, you need to stop ZM and run "sudo make install" on the version you want to run, and then start ZM.



About libjpeg-turbo, try running these commands:

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
After this, type "make" to recompile ZM and then "sudo make install" to install it.

mastertheknife
Thank you very much I will do this later.
I did do a make make install on the patched Zoneminder 1.5 but for some reason ( I suspect I have not altered the script to launch the correct version at boot time at ) upon a reboot zone minder fails (but Runs) and I have to stop it and start again.
I will do the stuff above and report back good or bad.
Thanks.
I have to say that even now the CPU utilisation is down but about 95% on the previous non patched version, this really is a vast improvement on performance, it would be nice to get 32 bit colour though.
Lastly yes I am using that capture card you mentioned.
Cheers

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Fri Nov 18, 2011 11:39 am
by tibetfreedom
mastertheknife wrote:If you want to have 2 versions of ZM installed at the same time, e.g. one stock one patched, its perfectly ok to use the same ./configure line. But if you do that, to switch versions, you need to stop ZM and run "sudo make install" on the version you want to run, and then start ZM.



About libjpeg-turbo, try running these commands:

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
After this, type "make" to recompile ZM and then "sudo make install" to install it.

mastertheknife

Odd looks like they already exist.

Code: Select all

root@CCTV:~# ln -s /opt/libjpeg-turbo/lib/libjpeg.a /usr/lib/libjpeg.a
ln: creating symbolic link `/usr/lib/libjpeg.a': File exists
root@CCTV:~# ln -s /opt/libjpeg-turbo/include/jconfig.h /usr/include/jconfig.h
ln: creating symbolic link `/usr/include/jconfig.h': File exists
root@CCTV:~# ln -s /opt/libjpeg-turbo/include/jerror.h /usr/include/jerror.h
ln: creating symbolic link `/usr/include/jerror.h': File exists
root@CCTV:~# ln -s /opt/libjpeg-turbo/include/jmorecfg.h /usr/include/jmorecfg.h
ln: creating symbolic link `/usr/include/jmorecfg.h': File exists
root@CCTV:~# ln -s /opt/libjpeg-turbo/include/jpeglib.h /usr/include/jpeglib.h
ln: creating symbolic link `/usr/include/jpeglib.h': File exists
I am wondering I think there are two versions running…
The patch here… where would a startup script launch it from…
My current script launches the old version I think…
Is the new version in the same location ? … ZM_PATH_BIN="/usr/local/bin"

Code: Select all

#!/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"
export LD_LIBRARY_PATH=/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH 
command="$ZM_PATH_BIN/zmpkg.pl"

start() {
        echo -n "Starting $prog: "
        $command start
        RETVAL=$?
        [ $RETVAL = 0 ] && echo success
        [ $RETVAL != 0 ] && echo failure
        echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/zm
        return $RETVAL
}
stop() {
        echo -n $"Stopping $prog: "
        $command stop
        RETVAL=$?
        [ $RETVAL = 0 ] && echo success
        [ $RETVAL != 0 ] && echo failure
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm
}
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

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Jan 26, 2012 11:37 am
by kazy
Hello,

I'm pretty new on linux and Zoneminder and i want to give a try to your Patch.
Seem to be a very great work !! Thx for this :)

Unfortunatly i have some troubles to make it work at home (certainly because of my newbi state :p )
here a quick list, if someone can give me some help
1) I don't see the ZM_CPU_EXTENSIONS option in zomeminder option windows

ps : sorry for parse post, problem with new comer restriction and URL detection >_<

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Jan 26, 2012 11:47 am
by kazy
2) I can't see anymore picture in monitor view i have the error
ava. net.SocketException: Unexpected end of file from server"
3) in log file i have this error message
Attempt to fetch integer value for ZM_BLEND_ALARMED_IMAGES, actual type is boolean. Try running 'zmupdate.pl -f' to reload config
and also this error
socket_sendto( /tmp/zm/zms-588298s.sock ) failed: No such file or directory
I have try to install the patch 3 times. But nothing have change.
thanks in advance for your help ;)

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Thu Jan 26, 2012 8:36 pm
by kazy
ok, all is fine now :p

Problem was my old ZM 1.24 installation + ffmpeg.
After a last try to apply the patch with correct ./configure "params", all seems to work fine.

ZM_CPU_EXTENSIONS and 32bits options are present.

I will test during 2-3 days to bring my feedback :p

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Sun Jan 29, 2012 10:49 am
by mastertheknife
Hi kazy,

Good to see you got it all sorted!

mastertheknife

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Mon Feb 06, 2012 8:47 pm
by tibetfreedom
You are attempting to use a format that requires libjpeg-turbo, but ZoneMinder was not compiled against libjpeg-turbo. Make sure that libjpeg-turbo's header files are used, and not standard libjpeg's header files.

Please I can't find out how to enable this… I have installed libjpeg-turbo, but have not either compiled gainst it or enabled it in the lib conf where ever that is……

can you do a simple how to on this… ?

I have compiled with the following…

Many Many thanks, your distro is still loads better than the standard non patched…

./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-libarch=lib --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-debug=yes --enable-crashtrace=yes ZM_SSL_LIB=openssl CPPFLAGS="-D__STDC_CONSTANT_MACROS"

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Mon Feb 06, 2012 8:50 pm
by tibetfreedom
still have this issue...

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Wed Feb 08, 2012 9:37 am
by kazy
I have use this guide to install zoneminder with ZM1.25 sources
http://www.zoneminder.com/wiki/index.ph ... _Cambozola

in this guide there are some change to make for libjpeg-turbo:

wget http://downloads.sourceforge.net/projec ... rror=voxel

mv libjpeg-turbo_1.1.0_amd64.deb?use_mirror=voxel libjpeg-turbo_1.1.0_amd64.deb && \
dpkg -i libjpeg-turbo_1.1.0_amd64.deb

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#
#######################
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

What's work for me


I have also use this configuration command:
./configure --prefix=/usr/local --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-libarch=/usr/local/lib --with-mysql=/usr/bin --with-ffmpeg=/usr/local/bin --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-debug=yes --enable-crashtrace=yes CPPFLAGS="-D__STDC_CONSTANT_MACROS")"

note that i have use
--prefix=/usr/local
and
--with-libarch=/usr/local/lib

I have compare params lines in zm.conf after installation with my files and libs location to find the good ./configure params to use for me :)

Re: ZM 1.25.0 Performance Patch - Completed

Posted: Fri Feb 10, 2012 1:18 pm
by mastertheknife
tibetfreedom wrote:You are attempting to use a format that requires libjpeg-turbo, but ZoneMinder was not compiled against libjpeg-turbo. Make sure that libjpeg-turbo's header files are used, and not standard libjpeg's header files.

Please I can't find out how to enable this… I have installed libjpeg-turbo, but have not either compiled gainst it or enabled it in the lib conf where ever that is……

can you do a simple how to on this… ?

I have compiled with the following…

Many Many thanks, your distro is still loads better than the standard non patched…

./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-libarch=lib --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-debug=yes --enable-crashtrace=yes ZM_SSL_LIB=openssl CPPFLAGS="-D__STDC_CONSTANT_MACROS"
Did you install libjpeg-turbo from the debian\ubuntu repository? if yes, then thats the issue. Their libjpeg-turbo package only provides the libraries, but not the header files.

mastertheknife