This patch includes the following improvements:
*Allow for longer camera Paths to avoid truncation that could occur
*Cameras eventually reach very slow FPS playback on streams until stream reconnects (if network is not 100%), this is fixed
*Zone minder would act like it was recording when in reality there were no new frames coming from a camera, it would even continue to timestamp the last frame making it somewhat hard to detect.
*If a stream was refreshed but the connKey did not change several items were broken including pausing (or anything with the swap) and stream stats (fps, status, etc), to enable this feature under options->Images, REDUCTION_FPS_RESET_TIME - set to a value other than 0, not anything overly low I use 240.
*If web client would run into a connection refused error when trying to get stats from zms (say its still starting up) we now wait a few seconds and try again before failing
*Added the start of an external web API for some items not previously publicly exposed, for example http://127.0.0.1/zm/?view=api&action=list_monitors will return a list of the monitors and their config.
*Added generic XML output instead of just ajax output. This can be used now on ALL ZM ajax calls to get XML back instead, all you have to do is say usexml=1 in the query string for example: http://127.0.0.1/zm/?view=request&reque ... c&usexml=1
This gives a very large external API that can now be used over XML rather than just JSON
*A few other minor things and IE fixes
The patch is at: http://mitchcapper.com/zmpatch090704.patch
To apply this patch in your ZM checkout folder just do patch -p0 < zmpatch090704.patch if you want to check if it will work against the dryrun option like: patch -p0 --dry-run < zmpatch090704.patch . This is meant to be applied against trunk, but also most likely applies clean against 1.24.2
Also one should do the following insert into the db:
Code: Select all
insert into Config set Id = 183, Name = 'ZM_REDUCTION_FPS_RESET_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'After how many seconds should the maxfps of a stream go back to normal after it has been throttled', Help = 'When a stream cannot send frames as fast as requested (generally due to too slow of a connection) it will throttle it back, unfortunately if the cause of this was only temporary the FPS will never pickup again. By setting this to a value greater than 0 it will automatically go back to the original FPS after X seconds from when the last throttle took place.', Category = 'image', Readonly = '0', Requires = '';
Some more information:
*Zone minder slows down the FPS (halving it) on a stream if it cannot send fast enough. This is all well and good, but if the cause of this is only temporary then your FPS is permanently lowered. IE if you are streaming at 20fps, then the network becomes congested the FPS may drop down to say 2 FPS, but once the congestion is resolved ZM never resets the FPS back up. Now there is a configuration variable for after X seconds it will reset the FPS back to the original amount.
*Zone minder did not properly check if a directory was able to be created or not in several places, causing minor issues specifically related to swap path creation.
*If the stream was refreshed but the connkey didnt change it would, in most cases, result in the swap directory and socket being removed by the old streaming process but this would not happen until after the new one had already been created causing the new one to lose its socket and swap dir. The two options to avoid this were to either A) if a process was already streaming for a specific connection key, terminate it or B) Don't delete the swap directory and socket if a new process has started already for our connKey when we exit. I took the second approach as A) would require signaling the process it needed to die, and possibly waiting awhile for items to timeout (not to mention it may be desireable to not require a different connkey each time). So now any time zms is streaming it obtains a read lock on a lock file for the connectionKey, when it terminates it then releases its read lock, waits 10 seconds (incase another zms is starting up, don't want one to startup while we are deleting items), and try to obtain a write lock on the lock file. If write lock is obtained then no one is reading it and we can erase the swap dir safely. If we cannot obtain a write lock just leave everything and bail out, the other process (which has a read lock) will do our cleanup when it terminates.
*Some minor SQL injection holes in the ajax status tool existed specifically around sorting and ordering. We now parse for ints where ints are needed, and properly parse out columns for order by rather than just taking the str from the input.
*IE doesn't support getText, so use innerHTML which is more stnadard
*The new api calls are exposed by api.php in web/skins/classic/views/ it exposes a few functions (zone_info,list_monitors,get_connkey,event_stats) that were not previously exposed by JSON.
*The new XML support for all json function calls was done with a few minor changes the major one being an xmlEncode function in functions.php and a global override that xml_encode_not_json (set when usexml=1) that, when jsonEncode is called will call xmlEncode instead of true.
As for my new app, it is pretty much ready, ive been slowed a bit lately due to a conflict issue with network traffic. Within a week or so an initial version will be released that is a decent windows client with the debugging talked about previously.