Open topic with navigation
The And ESP engine compares two tracks to identify combinations of events. The engine produces an output track containing the identified record pairs.
To detect events in the second track that occur only after (or at the same time as) events in the first track, use the AndThen engine. For more information, see Identify Time-Related Events in Two Tracks–AndThen Engine.
For example, you might want to identify all the times that a specific person appears in conjunction with a specific product. There are several ways you can accomplish this, but all involve the And ESP 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.|
||(Optional) The maximum difference in time between a record in the first track to a record in the second, for the records to be considered a pair. If you are processing images or documents this parameter is ignored.|
||(Optional) The minimum difference in time between a record in the first track to a record in the second, for the records to be considered a pair. The default value is the negative of the
For more details about these parameters, including the values that they accept, refer to the Media Server Reference.
(Optional) To add custom logic that discards pairs of records unless they meet additional conditions, set the
LuaScript parameter so that Media Server runs a Lua script to filter the results. For information about writing the script, see Write a Lua Script for an ESP Engine.
||The path and file name of a Lua script to run.|
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 named
BreakingNewsSyria.Output. This track contains speech-to-text records that contain the word "Syria", and OCR records that match the string "Breaking News". However, the records are only included when they occur within two seconds (2000 milliseconds) of the other record type.
ESP filter tasks are used to filter the OCR and speech-to-text results, before those results are passed to the "and" ESP task.
[EventProcessing] EventProcessingEngine0=BreakingNews EventProcessingEngine1=Syria EventProcessingEngine2=BreakingNewsSyria [BreakingNews] Type=filter Input=ocr.result RequiredString=Breaking News [Syria] Type=filter Input=speechtotext.result RequiredSubString=Syria [BreakingNewsSyria] Type=and Input0=BreakingNews.output Input1=Syria.output MaxTimeInterval=2000ms