Filter may start before event closed

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
randoom
Posts: 9
Joined: Wed Jun 08, 2022 9:57 am

Filter may start before event closed

Post by randoom »

It looks like at 1.36 (had no problems at 1.34) filter may cause script execution before the video is finally stored on the disk.

I have buffers configured the following way

Code: Select all

Pre Event Image Count	
20
Post Event Image Count	
50
and this allows me to have more than a single alarm sequence at a single event.

For example, here's the log for the event which have 4 alarm sequences (not sure it's important, but ..).

Code: Select all

2022-06-08 07:26:11	zmc_m1		29004	INF	2929: 83152 - Closing event 187, alarm end	zm_monitor.cpp	2032
2022-06-08 07:26:11	zmc_m1		29004	INF	2929: 83152 - Left alarm state (187) - 113(19) images	zm_monitor.cpp	2027
2022-06-08 07:26:07	zmfilter_5		27426	INF	Executing 'cd /opt && ./telega3.sh /var/cache/zoneminder/events/1/2022-06-08/187'	zmfilter.pl	-
2022-06-08 07:26:06	zmc_m1		29004	INF	2929: 83102 - Gone into alert state	zm_monitor.cpp	2019
2022-06-08 07:26:06	zmc_dvideo0		27440	INF	Inside: 132500 - Capturing at 4.96 fps, capturing bandwidth 18293980bytes/sec Analysing at 4.96 fps	zm_monitor.cpp	1680
2022-06-08 07:26:05	zmc_m1		29000	INF	2929: 83100 - Capturing at 10.00 fps, capturing bandwidth 66395bytes/sec Analysing at 10.00 fps	zm_monitor.cpp	1680
2022-06-08 07:26:05	zmc_m1		29004	INF	2929: 83095 - Gone back into alarm state	zm_monitor.cpp	2003
2022-06-08 07:26:05	zmc_m1		29004	INF	2929: 83093 - Gone into alert state	zm_monitor.cpp	2019
2022-06-08 07:26:05	zmc_m1		29004	INF	2929: 83092 - Gone back into alarm state	zm_monitor.cpp	2003
2022-06-08 07:26:05	zmc_m1		29004	INF	2929: 83091 - Gone into alert state	zm_monitor.cpp	2019
2022-06-08 07:26:04	zmc_m1		29004	INF	2929: 83090 - Gone back into alarm state	zm_monitor.cpp	2003
2022-06-08 07:26:04	zmc_m1		29004	INF	2929: 83088 - Gone into alert state	zm_monitor.cpp	2019
2022-06-08 07:26:04	zmc_m1		29004	INF	2929: 83084 - Gone back into alarm state	zm_monitor.cpp	2003
2022-06-08 07:26:03	zmc_dvideo5		27444	INF	Outside: 267100 - Capturing at 9.91 fps, capturing bandwidth 9510783bytes/sec Analysing at 10.01 fps	zm_monitor.cpp	1680
2022-06-08 07:26:02	zmc_m1		29004	INF	2929: 83064 - Gone into alert state	zm_monitor.cpp	2019
2022-06-08 07:26:01	zmc_m1		51852	INF	some options not used, turn on debugging for a list.	zm_videostore.cpp	519
2022-06-08 07:26:01	zmc_m1		29004	INF	2929: 83058 - Opening new event 187, alarm start	zm_monitor.cpp	1987
And as you may see, the filter starts script execution before the event is closed and the video is finally stored on the disk.
Videofile attributes:

Code: Select all

Modify: 2022-06-08 07:26:11.378195196 +0300
Change: 2022-06-08 07:26:11.378195196 +0300
 Birth: 2022-06-08 07:26:01.814095998 +0300
Filter configured as

Code: Select all

Execute command on all matches - cd /opt && ./telega3.sh
Run filter in background - yes
Any ideas on how to fix this?
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Filter may start before event closed

Post by iconnor »

You need to add a condition like EndDateTime iS NOT NULL
randoom
Posts: 9
Joined: Wed Jun 08, 2022 9:57 am

Re: Filter may start before event closed

Post by randoom »

Thanks, will check.

But, is there any reason to start filter before event is closed? Should this be default behaviour?
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Filter may start before event closed

Post by iconnor »

It is perfectly reasonable to want a notification or something immediately upon event start.
randoom
Posts: 9
Joined: Wed Jun 08, 2022 9:57 am

Re: Filter may start before event closed

Post by randoom »

Thanks for the explanation.

BTW, how to configure filter to execute the script immediately on event close?

As far as I can see it takes some seconds from event closed to script execution

Code: Select all

2022-06-09 11:35:47	zmfilter_5		59677	INF	Executing 'cd /opt && ./telega3.sh /var/cache/zoneminder/events/1/2022-06-09/258'	zmfilter.pl	-
2022-06-09 11:35:41	zmc_m1		59684	INF	2929: 1097120 - Closing event 258, alarm end	zm_monitor.cpp	2032
Any ideas on how to execute script immediately?
Post Reply