The AndNotThen engine compares two tracks and produces a track containing records from the first track for events that are not followed within a specified time interval by events in the second track.
Note: The AndNotThen engine enforces the order of events in the two tracks: the first track's event is considered isolated only if an event in the second track does not occur after (or at the same time as) it. If you want to consider events in the second track occurring both before or after events in the first track, use the AndNot engine (see Identify Isolated Events–AndNot Engine).
To identify isolated events
Create a new configuration or open an existing configuration to send to Media Server with the process
action. Alternatively, you can modify the Media Server configuration file (mediaserver.cfg
).
In the [EventProcessing]
section, add a new task by setting the EventProcessingEngineN
parameter. You can give the task any name, for example:
[EventProcessing]
EventProcessingEngine0=MyAndNotThen
Create a configuration section for the task and set the following parameters:
Type
|
The ESP engine to use. Set this parameter to and NotThen . |
Input0
|
The first input track. This track must be an output track produced by another task. |
Input1
|
The second input track. This track must be an output track produced by another task. |
MaxTimeInterval
|
The maximum time in milliseconds from the record in the first track to the record in the second track. (The engine compares the timestamp values.) If an event in the second track occurs within this time interval from the event in the first track, the engine discards the event in the first track. |
MinTimeInterval
|
(Optional) The minimum time in milliseconds from the record in the first track to the record in the second track. (The engine compares the timestamp values.) |
LuaScript
|
(Optional) The name of a Lua script that defines conditions for a discarding a record from the first track. For information about writing the script, see Write a Lua Script for an ESP Engine. |
For more information about these parameters, including the values that they accept, refer to the Media Server Reference.
Save and close the configuration file. If you modified the Media Server configuration file, you must restart Media Server for your changes to take effect.
Example
The following example produces an output track containing records produced when a number plate is not detected within thirty seconds (30,000 milliseconds) of a barrier being raised. The AndNot engine takes tracks produced by SceneAnalysis and NumberPlate engines. The SceneAnalysis output track contains a record for every time a barrier is raised. The Numberplate output track contains a record for every number plate detected in the video. The AndNot engine output track contains all records from the SceneAnalysis output track that are not followed within thirty seconds by an event in the NumberPlate track.
[EventProcessing]
EventProcessingEngine0=Barrier
[Barrier] Type=andnotthen Input0=sceneanalysis.Result Input1=numberplate.Result MaxTimeInterval=30000
|