Open topic with navigation
The AndThen ESP engine compares two tracks to identify events in the second track that occur within a specific time interval after (or at the same time as) events in the first track. The engine produces a track containing the identified record pairs.
The AndThen engine enforces the order of events in the two tracks: events in the second track must occur after events in the first track. To detect events in two tracks that occur within a specified time interval, when the event order does not matter, use an And task. For more information, see Identify Time-Related Events in Two Tracks–And Engine.
To identify time-linked events in two tracks
Create a new configuration to send to Media Server with the
process action, or open an existing configuration that you want to modify.
[EventProcessing] section, add a new task by setting the
EventProcessingEngineN parameter. You can give the task any name, for example:
Create a new configuration section for the task and set the following parameters:
||The ESP engine to use. Set this parameter to
||The first input track. This track must be an output track produced by another task.|
The second input track. This track must be an output track produced by another task.
The events to detect in the
||(Optional) The maximum time from the record in the first track to the record in the second track. (The engine compares the timestamp values.)|
(Optional) The minimum time from the record in the first track to the record in the second track. (The engine compares the timestamp values.)
The default value is 0 (zero), meaning that the event in the second track must occur after (or at the same time as) the event in the first track.
||(Optional) The name of a Lua script that defines conditions that a record pair must meet in order to be included in the output track. For information about writing the script, see Write a Lua Script for an ESP Engine.|
For more information about these parameters and the values they accept, refer to the Media Server Reference.
Save and close the configuration file. HPE recommends that you save your configuration files in the location specified by the
The following example produces an output track (
RedLightBreach.Output) containing records produced when a number plate is detected up to five seconds (5000 milliseconds) after traffic lights turn red. The engine takes tracks produced by SceneAnalysis and NumberPlate engines. The SceneAnalysis output track contains a record for every time the traffic lights turned red. The Numberplate output track contains a record for every number plate detected in the video.
[RedLightBreach] Type=andthen Input0=sceneanalysis.ResultWithSource Input1=numberplate.ResultWithSource MaxTimeInterval=5000ms