ZM 1.25.0 Performance Patch - Completed

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.24.4 Performance Patch - Completed

Post by mastertheknife »

Hi everyone,

Its been quiet lately, mostly because i have been very busy with work. I no longer have as much time as in the past to work on this, so i only work few hours a week on this so far.

So far i fixed various bugs in the Blobs motion detection method when used with the patch (Thanks MitchCapper for the assistance and testing) and now working on getting the analysis images to work right with the patch.
This one is a lot of work and so far i can't get it to work properly:
Image

but i'm slowly making a progress:
Image

I also removed the need for the -msse2 flag by using GCC's __target__ attribute, which requires GCC 4.4 and newer, otherwise ignored.

I won't update the patch for 1.24.4 anymore because updating 3 separate repositories (1.24.4, 1.25.0 and SVN) is more time consuming, than targeting only the SVN version, which the patch should make it into (ZM 1.25.1) when i think its ready.
If anyone is interested in my progress, its here under the branch perfpatch.
https://github.com/mastertheknife/ZoneMinder-kfir
Its also possible to download patched source here (ZM from SVN with my changes already applied ontop of it) here:
https://github.com/mastertheknife/ZoneM ... /perfpatch

mastertheknife :D
Last edited by mastertheknife on Wed Feb 01, 2012 5:44 am, edited 2 times in total.
Kfir Itzhak.
alecano23
Posts: 22
Joined: Thu Oct 23, 2008 1:47 pm

Re: ZM 1.24.4 Performance Patch - Completed

Post by alecano23 »

Hi mastertheknife

I usually use PICO2000 with BT878 CHIPSET, I cant use RGB24 because it is not supported by the hard, Wich is the other palette u recommend me for use with this patch???? I also want to save up disk space and the processor performance of course !!!!
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.24.4 Performance Patch - Completed

Post by mastertheknife »

alecano23 wrote:Hi mastertheknife

I usually use PICO2000 with BT878 CHIPSET, I cant use RGB24 because it is not supported by the hard, Wich is the other palette u recommend me for use with this patch???? I also want to save up disk space and the processor performance of course !!!!
BGR24, but for that to work, you need to install libjpeg-turbo.

mastertheknife
Kfir Itzhak.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.25.0 Performance Patch - Completed

Post by mastertheknife »

Hi all,

I finally located the cause for the analysis image corruption when using this patch and its now fixed.
The git repository was updated to contain the fixed code.
After being confirmed by others that its fixed, i will submit this patch to Phil and it will be included in ZM 1.25.1

Image

mastertheknife :D
Kfir Itzhak.
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

I have this up and running.
I installed lib-jpeg turbo befor I even knew about your patched zone minder, how do I get this to work with jpegturbo or does it already ?
Thanks….
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.25.0 Performance Patch - Completed

Post by mastertheknife »

tibetfreedom wrote:I have this up and running.
I installed lib-jpeg turbo befor I even knew about your patched zone minder, how do I get this to work with jpegturbo or does it already ?
Thanks….
libjpeg-turbo is only needed in certain configurations. If everything is working right, its either not needed or already working.
Don't worry :D

mastertheknife
Kfir Itzhak.
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

Hi This is great I have installed one clean version but this happened when I upgraded another system…

What should I do here ?

root@CCTV:~# /usr/bin/zmupdate.pl

Initiating database upgrade to version 1.25.0 from version 1.24.3

Please ensure that ZoneMinder is stopped on your system prior to upgrading the database.
Press enter to continue or ctrl-C to stop :

Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /tmp/zm if you have a lot of events.
Press 'y' for a backup or 'n' to continue : n

Upgrading database to version 1.25.0
Loading config from DB
No option 'ZM_LOCAL_BGR_INVERT' found, removing at /usr/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_Y_IMAGE_DELTAS' found, removing at /usr/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_EXTRA_DEBUG' found, removing at /usr/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_EXTRA_DEBUG_TARGET' found, removing at /usr/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_EXTRA_DEBUG_LEVEL' found, removing at /usr/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
No option 'ZM_EXTRA_DEBUG_LOG' found, removing at /usr/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89, <STDIN> line 2.
Saving config to DB

Database successfully upgraded from version 1.24.3.

Converting filters from PHP to JSON format
PurgeWhenFull - complete
1500purge - complete
Conversion complete
ERROR 1142 (42000) at line 10: CREATE command denied to user 'zmuser'@'localhost' for table 'Logs'
Output:
Command 'mysql -hlocalhost -uzmuser -pzmpass zm < /root/newzm/mastertheknife-ZoneMinder-kfir-7d750a7/db/zm_update-1.24.4.sql' exited with status: 1
root@CCTV:~#
User avatar
nightcrawler
Posts: 71
Joined: Fri Aug 12, 2011 9:54 am
Location: the netherlands

Re: ZM 1.25.0 Performance Patch - Completed

Post by nightcrawler »

ERROR 1142 (42000) at line 10: CREATE command denied to user 'zmuser'@'localhost' for table 'Logs'
He, now thats just an very basic SQL/DB error that pff!
You used an mysql user that don't have create (or alter) rights to run the upgrade. So alter the script to an admin DB user (like root) or give the zmuser (witch is an default Zoneminder username) Create rights.

To do that go to phpmyadmin, ZM database > tab RIGHTS > edit rights from zmuser.

Or from the unix command line: (user ROOT or change to an DB admin user..)

Code: Select all

mysql -u ROOT -p PASSWORD
;
REVOKE ALL PRIVILEGES ON `zm`.* FROM 'zmuser'@'localhost';  GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ON `zm`.* TO 'zmuser'@'localhost';
EXIT
Last edited by nightcrawler on Sat Nov 12, 2011 6:36 pm, edited 1 time in total.
Zoneminder @Ubuntu 11 server, ZM 1.25.0 , FFMPEG, 4 Analoge cameras, 1.6ghz P4mobile, 2GB ram, 60GB-HDD.
I also have an (homeseer) domotica system up-and-running with touchscreens,light controllers,weather forecast etc.
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

nightcrawler wrote:
ERROR 1142 (42000) at line 10: CREATE command denied to user 'zmuser'@'localhost' for table 'Logs'
He, now thats just an very basic SQL/DB error that pff!
You used an mysql user that don't have create (or alter) rights to run the upgrade. So alter the script to an admin DB user (like root) or give the zmuser (witch is an default Zoneminder username) Create rights.

To do that go to phpmyadmin, ZM database > tab RIGHTS > edit rights from zmuser.
Thanks yes I realised that after I posted…
Now I am stuck with no images coming up at all.
I had lib-jpeg turbo installed before the upgrade… Do I need to do anything to enable it in the new upgrade ?
No images seem to be showing at all…
I have altered the settings of each camera as suggested and also deleted a camera and re instated, but still no joy...
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

Oh I see what is wrong,
In the logs there it says

2011-11-12 19:07:14.308547 web_php 26614 ERR socket_sendto( /tmp/zm/zms-206990s.sock ) failed: No such file or directory zm/includes/functions.php 2322
2011-11-12 19:07:09.443100 web_js 26614 ERR TypeError: 'undefined' is not a function undefined
2011-11-12 19:07:09.325349 zms 27253 ERR Terminating, last frame sent time 1321124829.167867 secs more than maximum of 10.000000 zm_monitor.cpp 3683
2011-11-12 19:07:09.292417 zms 27253 ERR libjpeg-turbo is required for JPEG encoding directly from RGB32 source zm_image.cpp 810

so I guess it is not installed, it was before the upgrade…

What have I missed ?
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

tibetfreedom wrote:Oh I see what is wrong,
In the logs there it says

2011-11-12 19:07:14.308547 web_php 26614 ERR socket_sendto( /tmp/zm/zms-206990s.sock ) failed: No such file or directory zm/includes/functions.php 2322
2011-11-12 19:07:09.443100 web_js 26614 ERR TypeError: 'undefined' is not a function undefined
2011-11-12 19:07:09.325349 zms 27253 ERR Terminating, last frame sent time 1321124829.167867 secs more than maximum of 10.000000 zm_monitor.cpp 3683
2011-11-12 19:07:09.292417 zms 27253 ERR libjpeg-turbo is required for JPEG encoding directly from RGB32 source zm_image.cpp 810

so I guess it is not installed, it was before the upgrade…

What have I missed ?
also if I manually stop and start zm I see this…


root@CCTV:~# service zm stop
$Stopping ZoneMinder:
No option 'ZM_CPU_EXTENSIONS' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_LEVEL_SYSLOG' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_LEVEL_FILE' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_LEVEL_WEBLOG' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_LEVEL_DATABASE' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_DATABASE_LIMIT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_DEBUG' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_DEBUG_TARGET' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_DEBUG_LEVEL' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_DEBUG_FILE' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_CHECK_PERIOD' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_ALERT_WAR_COUNT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_ALERT_ERR_COUNT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_ALERT_FAT_COUNT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_ALARM_WAR_COUNT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_ALARM_ERR_COUNT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_LOG_ALARM_FAT_COUNT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_PROTOCOL' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_HOST' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_PORT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_USER' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_PASS' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_LOC_DIR' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_REM_DIR' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_TIMEOUT' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
No option 'ZM_UPLOAD_DEBUG' found, removing at /usr/local/share/perl/5.10.1/ZoneMinder/ConfigAdmin.pm line 89.
success
[: 61: 0 !=: unexpected operator

/etc/init.d/zm: 61:  : not found
root@CCTV:~#
root@CCTV:~# service zm start
Starting ZoneMinder:
success
[: 61: 0 !=: unexpected operator

touch: cannot touch `/var/lock/subsys/zm': No such file or directory
/etc/init.d/zm: 61:  : not found
root@CCTV:~#
root@CCTV:~#
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

I have reinstalled libjpeg-turbo and I am still getting this…
very odd.
I have deleted my database and loaded the default database…

camera's running fine on 24 bit but on 32 bit colour I get these errors…


2011-11-12 22:39:53.487628 web_php 29621 ERR socket_sendto( /tmp/zm/zms-175486s.sock ) failed: No such file or directory zm/includes/functions.php 2322
2011-11-12 22:39:51.551345 zms 29873 ERR Terminating, last frame sent time 1321137591.291831 secs more than maximum of 10.000000 zm_monitor.cpp 3683
2011-11-12 22:39:51.531519 zms 29873 ERR Unable to send stream frame: Success zm_monitor.cpp 3423
2011-11-12 22:39:51.531253 zms 29873 ERR libjpeg-turbo is required for JPEG encoding directly from RGB32 source zm_image.cpp 1053
2011-11-12 22:39:51.297339 zms 29873 ERR Attempt to directly assign buffer from an undersized buffer of size: 461552 zm_image.cpp 320
2011-11-12 22:39:45.429375 web_php 29621 ERR socket_sendto( /tmp/zm/zms-175486s.sock ) failed: No such file or directory zm/includes/functions.php 2322
2011-11-12 22:39:42.006890 zms 29872 ERR Terminating, last frame sent time 1321137581.983201 secs more than maximum of 10.000000 zm_monitor.cpp 3683
2011-11-12 22:39:41.987047 zms 29872 ERR Unable to send stream frame: Success zm_monitor.cpp 3423
2011-11-12 22:39:41.986751 zms 29872 ERR libjpeg-turbo is required for JPEG encoding directly from RGB32 source zm_image.cpp 1053
2011-11-12 22:39:41.680331 zms 29871 ERR Terminating, last frame sent time 1321137581.659815 secs more than maximum of 10.000000 zm_monitor.cpp 3683
2011-11-12 22:39:41.660526 zms 29871 ERR libjpeg-turbo is required for JPEG encoding directly from RGB32 source zm_image.cpp 810
2011-11-12 22:39:41.660350 zms 29871 ERR Unable to send stream frame: Success zm_monitor.cpp 3423
2011-11-12 22:39:41.659892 zms 29871 ERR libjpeg-turbo is required for JPEG encoding directly from RGB32 source
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed - Only able to u

Post by tibetfreedom »

Hi,
I am only able to produce 24 bit video and not using BGR or GRB ….
Something wrong…
all ok f I don't use any 32 bit settings...
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM 1.25.0 Performance Patch - Completed

Post by mastertheknife »

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
Kfir Itzhak.
tibetfreedom
Posts: 163
Joined: Fri Oct 22, 2010 11:21 am

Re: ZM 1.25.0 Performance Patch - Completed

Post by tibetfreedom »

[quote=

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

mastertheknife[/quote]

One I think, I have recompiled it a few times but have made a clean install only on 3 occasions, would this be an issue ?
Post Reply