Merge Events Option

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.
Post Reply
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Merge Events Option

Post by Blazer »

It would be nice to have an option to "merge" several events into one. For instance the test ZM I have setup at work, often someone comes into the zone and either stops moving long enough to prematurely terminate an event, or perhaps they move out of the zone area just long enough, so that I end up having 3-4 events that really should be one "event".

It would be cool in the event viewer to have an option to merge events, basically you would check off the ones to merge and it would either create a new numeric event, or even prompt you for a custom name.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Noted. This has come up a couple of times before. The main thing that isn't a gimme is what to do if there is a gap between the events (ie. someone standing still for 5 minutes). There would be a jump in the middle of the event. Other than this there is no major reason why it couldn't be done at all, though increasing the post-event buffer size in the meantime might help.

Phil
User avatar
thelight
Posts: 54
Joined: Sat Jun 26, 2004 9:25 pm
Contact:

Post by thelight »

Maybe an option to have some kind of indication of which event is currently being viewed. Either by having the event number displayed in a corner, of by flashing up a white screen for a few frames to indicate moving from one event to the next.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think probably a couple of inter-event transition frames is the simplest way.

Phil
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

zoneminder wrote:Noted. This has come up a couple of times before. The main thing that isn't a gimme is what to do if there is a gap between the events (ie. someone standing still for 5 minutes). There would be a jump in the middle of the event. Other than this there is no major reason why it couldn't be done at all, though increasing the post-event buffer size in the meantime might help.
I agree the transition probably wouldn't be very graceful as far as true timeflow goes. I just thought it would be a nice way to combine several events to one.

For instance...someone comes into zone, and because they are reading a poster or something you have on their wall, they are mostly standing still, but also moving/swaying now and then....so to Zm this 2 minutes of the person standing there gets broken up into 5-6 events. It would be nice to be able to merge all of those into one event, and I could optionaly archive it with a custom name.

Another example is someone coming in and out of the zone, let's say they are stealing things or playing a prank. You could merge those 5-6 events into one and call it "theft #3" or whatever. It would also be easier to make a movie if you could first merge the events together.

Thanks for considering.
schuitz
Posts: 11
Joined: Thu Jun 01, 2006 11:26 pm

Post by schuitz »

I'll add my two bits here and bump this up.

I don't mind multiple events like this, but I was looking for a way to mod export so that events could be merged for the purposes of generating a single video. A cursory look through zmvideo.pl shows this is not trival, and the reasons why.

It seemed to me that the following new paradigm is logical: in addition to the alarm post_event_count, why not a new additional variable, say, alert_frame_count, which indicates the length of the ALERT state, independent of post_event_count. It should always be greater than or equal to post_event_count.

An example:
post_event_count = 10;
alert_frame_count = 80;

If we leave alert after 80 frames, just keep the 10 after the last alarmed frame. If we get a new alarmed frame within 80, keep them all. All events always have 10 frames of post-roll, but could have up to 80 frames of no activity in the middle.

After examining Monitor::Analyse(), it seemed to me this could be fairly straightforward to accomplish without altering the existing state machine. The only thing I couldn't figure out was whether it is trivial to discard those frames in between post_event_count and alert_frame_count. If you could provide some direction in this regard, I may go ahead and try out those code updates here.

MikeS
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

I did a test to 'join' events in a windows app but the problem can be the pre and post alarm eg
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20

Assume a pre and post of 5
camera goes into alarm at 1 stops at 5 but has 5 post and closes the event. We are now ar image 11, at image 14 a new event starts but we add 9,10,11,12,13,14 to the new event. so you end up with overlap, this gets worse with higher pre event counters. I did think about inserting says 4-5 frames of a static jpeg with the text Ending, event and starting new etc etc. But never got round to finishing it.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

It may be possible to eliminate duplicate frames by inspecting their timestamps in the database. However the precision of the db timestamp is less than that stored internally so you may end up not getting every single one, or missing the odd one. It should be better than not doing it as per your example though.

I do need to get on with this feature as I think it would be useful though.
Phil
schuitz
Posts: 11
Joined: Thu Jun 01, 2006 11:26 pm

Post by schuitz »

Having a merge button in the events window would certainly be nice. But do consider adding an independent length for the alert state anyhow. I suspect it would be much simpler to implement, and would obviate the need for a manual event merge function in most cases.

Cheers
MikeS
MrEvoMan
Posts: 55
Joined: Thu Apr 23, 2009 1:25 am

Post by MrEvoMan »

+1 for a "merge" button in the Events window. This should be easy enough, since you don't have to "guess" at merging them, but leave it up to the user.

Wouldn't it just be a simple rename and combine of directories?
MrEvoMan
Posts: 55
Joined: Thu Apr 23, 2009 1:25 am

Post by MrEvoMan »

I am currently working on a cgi addon perl script to do event merging functions.

There are a lot of things to consider, but I'm working my way through it.

It will provide a user-selectable list of events (similar to the event window now) which you can choose from non-archived, monitor sorted events to group and merge together.

It will then handle the file merging, directory movement, database updating and make it all work.

I have the first 1/2 of it done.
Post Reply