Web Interface Improvements / Backend minor fixes
Posted: Tue May 19, 2009 12:18 am
***The below fixes were integrated into 1.24.2 the patch below is outdated***
Another round of various fixes and additions to help the stability of the web interface primarily.
All Live View: Stats would sometimes stop updating when watching events/streams, this should automatically fix itself now (fps/alarm status/new events)
All: Additional error checking and error messages both in the backend and web frontend.
All Live View: Immediately after an event ends the event list will refresh to show the new event rather than waiting for it to refresh on its own
ALL: nph-zms doesn't seem to work but zms does, this may be fixed in certain cases
ALL: zma would crash with certain zone setups, fixed in certain cases
ALL: For ffmpeg remote cameras the Path contains the entire URL and auth str this would get chopped off if > 64 chars
IE: Progress ticker wouldn't always properly update
IE: Alert sound would loop forever
IE: Cambozola applet will no longer cause local disk space to fill up. To enable this under config you should set Cambozola reload under Config->Images to some number of seconds. Generally 6-15 minutes (360-900 seconds) should work well without having your drive fill up too far.
Details:
zma crash - an improperly placed else if was causing, in certain situations, the hi_x variable of a range would not get set and would cause it to segfault.
nph-zms expected argv[0] to contain a full path to itself, however in many situations it would only get its name as argv[0] so changed the search to not require a '/' to be valid.
IE: Progress ticker and a few other text updates were broken due to using getText, a call IE doesn't support. switched to innerHTML which all modern browsers support reading on.
Stats stopping - A new watchdog system that will wait for up to double the timeout for a stream to return data. If it doesn't it will fire another request to get it going again.
IE: Sound loop - having something hidden in IE doesn't cause it not to play, instead IE now uses play/pause commands on the media player.
IE: Cambozola - It writes the mjpeg stream to cache which java stores on your hard drive, even at medium resolution of 640x480 you can very quickly fill up local storage if you keep live view open. To fix this we just reload the applet after a user specified amount of time, there is a quick flicker but it only needs to occur every few minutes. It will only reload the applet if it is playing and live.
Note there are two SQL changes that took place that are NOT automatically applied to your database if you apply this patch, the first is the change in the monitors table for the length of the Path var, this will not harm anything if it isn't done, the second however is more important and thats the addition of the cambozola config variable. Even if you don't want to use this you should apply it, for this reason to do it you should run "mysql zm" or go into the zone minder database and then run:
The patch is at: http://mitchcapper.com/web_fixes_etc.patch
To apply this patch in your ZM checkout folder just do patch -p0 < zm_web_fixes.patch if you want to check if it will work against the dryrun option like: patch -p0 --dry-run < zm_web_fixes.patch . This is meant to be applied against trunk, it builds upon some of the other functions that are only in trunk, however it may also work if you just apply my other patch + this.
I am currently working on a fairly large patchset + external application that should help with exporting more data from ZM/act as a start to an API. In short it will allow for much easier setup and debugging of zones for motion detection. It will show the live video feed next to the motion detection frames, along with the active alarm detection stats (how many pixels the backend is finding etc). The idea being you can in real time have someone or something cause motion in the frame that you want to capture (or not capture) and see what values for threshold, alarm pixels, filter, blob, etc are being caused and just your zones as needed. A screenshot of it is below
all 3 windows are streaming mjpeg feeds and the stats are updated at the same fps so it should make setting up zones easier.
As always feeback is welcomed along with any questions etc.
Another round of various fixes and additions to help the stability of the web interface primarily.
All Live View: Stats would sometimes stop updating when watching events/streams, this should automatically fix itself now (fps/alarm status/new events)
All: Additional error checking and error messages both in the backend and web frontend.
All Live View: Immediately after an event ends the event list will refresh to show the new event rather than waiting for it to refresh on its own
ALL: nph-zms doesn't seem to work but zms does, this may be fixed in certain cases
ALL: zma would crash with certain zone setups, fixed in certain cases
ALL: For ffmpeg remote cameras the Path contains the entire URL and auth str this would get chopped off if > 64 chars
IE: Progress ticker wouldn't always properly update
IE: Alert sound would loop forever
IE: Cambozola applet will no longer cause local disk space to fill up. To enable this under config you should set Cambozola reload under Config->Images to some number of seconds. Generally 6-15 minutes (360-900 seconds) should work well without having your drive fill up too far.
Details:
zma crash - an improperly placed else if was causing, in certain situations, the hi_x variable of a range would not get set and would cause it to segfault.
nph-zms expected argv[0] to contain a full path to itself, however in many situations it would only get its name as argv[0] so changed the search to not require a '/' to be valid.
IE: Progress ticker and a few other text updates were broken due to using getText, a call IE doesn't support. switched to innerHTML which all modern browsers support reading on.
Stats stopping - A new watchdog system that will wait for up to double the timeout for a stream to return data. If it doesn't it will fire another request to get it going again.
IE: Sound loop - having something hidden in IE doesn't cause it not to play, instead IE now uses play/pause commands on the media player.
IE: Cambozola - It writes the mjpeg stream to cache which java stores on your hard drive, even at medium resolution of 640x480 you can very quickly fill up local storage if you keep live view open. To fix this we just reload the applet after a user specified amount of time, there is a quick flicker but it only needs to occur every few minutes. It will only reload the applet if it is playing and live.
Note there are two SQL changes that took place that are NOT automatically applied to your database if you apply this patch, the first is the change in the monitors table for the length of the Path var, this will not harm anything if it isn't done, the second however is more important and thats the addition of the cambozola config variable. Even if you don't want to use this you should apply it, for this reason to do it you should run "mysql zm" or go into the zone minder database and then run:
Code: Select all
insert into Config set Id = 182, Name = 'ZM_RELOAD_CAMBOZOLA', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'After how many seconds should Cambozola be reloaded in live view', Help = 'Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive.', Category = 'images', Readonly = '0', Requires = '';
To apply this patch in your ZM checkout folder just do patch -p0 < zm_web_fixes.patch if you want to check if it will work against the dryrun option like: patch -p0 --dry-run < zm_web_fixes.patch . This is meant to be applied against trunk, it builds upon some of the other functions that are only in trunk, however it may also work if you just apply my other patch + this.
I am currently working on a fairly large patchset + external application that should help with exporting more data from ZM/act as a start to an API. In short it will allow for much easier setup and debugging of zones for motion detection. It will show the live video feed next to the motion detection frames, along with the active alarm detection stats (how many pixels the backend is finding etc). The idea being you can in real time have someone or something cause motion in the frame that you want to capture (or not capture) and see what values for threshold, alarm pixels, filter, blob, etc are being caused and just your zones as needed. A screenshot of it is below
all 3 windows are streaming mjpeg feeds and the stats are updated at the same fps so it should make setting up zones easier.
As always feeback is welcomed along with any questions etc.