Identify Time-Related Events in Two Tracks–AndThen Engine

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.

NOTE:

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

  1. Create a new configuration to send to Media Server with the process action, or open an existing configuration that you want to modify.

  2. In the [EventProcessing] section, add a new task by setting the EventProcessingEngineN parameter. You can give the task any name, for example:

    [EventProcessing]
    EventProcessingEngine0=AndThen
  3. Create a new configuration section for the task and set the following parameters:

    Type The ESP engine to use. Set this parameter to andthen.
    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.

    NOTE:

    The events to detect in the Input1 track must occur after, or at the same time as, the events to detect in the Input0 track.

    MaxTimeInterval (Optional) The maximum time from the record in the first track to the record in the second track. (The engine compares the timestamp values.)
    MinTimeInterval

    (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.

    LuaScript (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.

  4. Save and close the configuration file. HPE recommends that you save your configuration files in the location specified by the ConfigDirectory parameter.

Example

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.

[EventProcessing]
EventProcessingEngine0=RedLightBreach
[RedLightBreach]
Type=andthen
Input0=sceneanalysis.ResultWithSource
Input1=numberplate.ResultWithSource
MaxTimeInterval=5000ms

_HP_HTML5_bannerTitle.htm