filter on new completed event

Forum for questions and support relating to the 1.28.x releases only.
Locked
Ritmo2k
Posts: 20
Joined: Fri Apr 03, 2009 3:18 pm

filter on new completed event

Post by Ritmo2k »

Is it possible to trigger a filter when an event is complete? Or, does a facility exist to order filter execution?

I can not get the event viewer to function so my last approach is provide the events on a share accessible to the users. I would like to encode and remove the event however I am not sure of the best approach. Two events? Or one event that removes the file system data after encoding it?

Thanks.
Ritmo2k
Posts: 20
Joined: Fri Apr 03, 2009 3:18 pm

Re: filter on new completed event

Post by Ritmo2k »

While I have solved my monitor live view issue, I am still stuck on an approach to order events. Is it really only feasible to have a single scripted event if for example you wanted to encode then delete? I was hoping to encode for archival but delete later to leave the event viewer somewhat populated but I am not sure how to trigger the video creation soon after the event is complete?

Thanks.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: filter on new completed event

Post by knight-of-ni »

I found your messages hard to understand. Describing what screen you are looking at, in terms of what buttons you clicked on, would help. That's probably why no one else has responded yet.

You can sort events either ascending or descending. Can you describe what screen you are looking at?

ZoneMinder does not have an "encode" function. What do you mean by that?
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Ritmo2k
Posts: 20
Joined: Fri Apr 03, 2009 3:18 pm

Re: filter on new completed event

Post by Ritmo2k »

Hi,
Yeah you are right, that was vague. What I meant was when setting up an Event Filter, such as the shipped PurgeWhenFull.

What I was hoping to do was create a filter that triggered when an event was complete, that is, the end time migrates from null to a value and a new event has been started for that given monitor. Right now I am using a db trigger defined as after update on zm.Events.

I am currently using the PurgeWhenFull filter to maintain disk size, but as an event is created I want to perform some video encoding and archiving and possibly followed by deletion of the event data.

It does not appear I can create a filter that is aware of a new event being complete, and it also does not look like I can create two filters and assure they fire in a specific order. Maybe something exists to handle this?

Thanks for taking the time to respond.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: filter on new completed event

Post by knight-of-ni »

If you are looking to run a filter based on an event associated to a specific monitor then use "Monitor Id" from the drop down under the filter screen. You can add any of "Cause", "Avg Score", "Max Score", "Total Score", "Alarm Frames" and likely other properties to narrow down the criteria so the filter only matches specific events with that monitor, rather than all events with that monitor. Knowing exactly what kind of event you are looking to activate the filter would help here.

Nearly all the various of zoneminder binaries and perl scripts can be directly executed from the command line.
For example:
[abauer@localhost conf.d]$ sudo zmfilter.pl --help
[sudo] password for abauer:
Unknown option: help
Usage:
zmfilter.pl [-f <filter name>,--filter=<filter name>] | -v, --version

Options:
-f{filter name}, --filter={filter name} - The name of a specific filter to run
-v, --version - Print ZoneMinder version
Once you create a filter, you can let zoneminder run it, or you can run it directly from the command line whenever or however you want.

Within the first filter, you can enable "Execute command on all matches" and then call the second filter. I don't know if chaining filters this way would be better, as opposed to calling both filters yourself from a script. It likely depends on what you are trying to do.

Note another option called "Create video for all matches", which allows zoneminder to auto-generate a video file using ffmpeg/avconv. I don't know if this is what you mean by "encode" or not.

I'm still not sure exactly what two filters you want to run back-to-back, but if you are trying to generate a video and then delete the original event afterwards then this sounds doable. You might be able to do these steps from a single filter.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Ritmo2k
Posts: 20
Joined: Fri Apr 03, 2009 3:18 pm

Re: filter on new completed event

Post by Ritmo2k »

Ok that was good to know. I think I could accomplish what I need if I could trigger when an event is complete. That is to say for a given a monitor, when the section length has been reached and the event has its EndTime written to the Events table.

Is that possible?

Thanks!
Locked