Examples of Python scripts for processing events from a video camera

Print Previous page Top page Next page

 

The folder C:\Users\Public\Documents\panorama\py_base14\ contains examples of scripts (senddb.py and sendmail.py) for processing events received from the video camera.

The senddb.py script receives a snapshot from the video camera at the time of the event and saves the snapshot and information about the event into a database in SQLITE format. The database template (file videoevents.sqlite) is located in the directory with the map of Noginsk at the following path

C:\Users\Public\Documents\panorama\Panorama14\data\noginsk\userbase

 

When assigning the senddb.py script to handle events, you must specify the value «SendEventDB» in the «Function to call» field, and the full path to the file with the database in the «Script Arguments» field.

 

The sendmail.py script receives a snapshot from the video camera at the time of the event and sends the snapshot and information about the event by e-mail.

 

In the script, the user needs to specify the settings for logging into the email account:

 

# data for email

APPACCOUNT = 'user@mail.ru'

APPPWD = 'userpassword'

SERVER = 'smtp.mail.ru'

PORT = 465

 

When assigning the sendmail.py script to handle events, you must specify the value «SendEventEmail» in the «Function to call» field and the email address where notifications will be sent in the «Script Arguments» field.

 

After assigning to the selected events, the scripts will be automatically run each time the camera receives notifications about these events.

 

To write their own scripts, the user has access to API functions for working with notifications about events from video cameras. The function prototypes are declared as imported scripts cameventapi.py and camtype.py located in the C:\Users\Public\Documents\panorama\py_mapapi14.