Assign/edit a script for processing events from a video camera
The dialog is used to select and assign Python scripts for processing events coming from remote video cameras.
The Python programming language has a large set of plug-ins and provides the user with an easy-to-use and extensive toolkit (including mathematical calculations, processing of text and graphic data, work with a network, with databases, and more). When processing events from remote cameras, Python scripts can perform a wide range of tasks, for example, saving information about video analytics events into a user database, receiving and saving a snapshot from a video camera when an event occurs, sending event notifications by e-mail. Examples of scripts and their purposes are described in the section «Examples of Python scripts for processing events from a video camera».
The user can select the events for which processing the scripts will be called in the «Setting up an event filter» dialog. The «Assign/Edit Script» dialog is used to enter script parameters. The parameters include: path to the file with the script, name of the script, the function to be called, and the arguments to call it.
The following modes are available in the dialog:
- Apply the specified settings;
- Open a dialog to select the path to the file with the script;
The «Event types» field contains a list of events that the script will be assigned to process. Using the «Script Selection» menu, you can select a script from previously assigned ones, or indicate that you want to select a new script. Fields «File Path» and «Function to call» are obligatory for filling. When selecting previously assigned scripts, their parameters can be edited by the user.
After specifying the path to the file, in it search of called functions is carried out. These functions are searched for by the presence of a comment like «#caption: Function name« in the line with the function declaration. The user can choose which function to assign for running, by using the pop-up menu that opens by pressing the left mouse button on the «Function to call» field.
In the «Script Arguments» field, the user can specify one or more arguments separated by the «;» character. The format of the arguments is determined by the purpose of the script. For example, the name of the database where information about events will be recorded, the e-mail address for sending notifications, and others can be passed as arguments.
For the visual conformity of dialog to object-camera on a map, the color of a window's frame coincides with the color of object specified in the semantics, and the video camera name is indicated in dialog heading.
After applying the settings, the script will be automatically started every time when the corresponding event notifications are received from the camera.