Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The GetEventDescription method  The GetLinkedObjects method Next page


The SaveToFile method is used to save to a file the frame from the camera that is received in the data parameter of the FRAME_SENT event.

Syntax for method invocation:

function SaveToFile (path: String, data: String, param : Boolean)

You can also save the frame using the GET_FRAME reaction of the CAM object. To do this, you must specify the path for saving the file with the frame in the path parameter of this reaction. The FRAME_SENT event is created in the system if the GET_FRAME reaction doesn't have the path parameter. In the data parameter of the FRAME_SENT event, the frame that must be saved using the SaveToFile method is stored.

The reaction allows you to export a frame even if the camera is not displaying in the Video surveillance monitor.

Method argument:

  1. path is a required argument. It specifies the full path to save the file with a frame.
  2. data is a required argument. It specifies data to save to a file.
  3. param is a required argument. It determines whether to transcode from base64 format before saving. Possible parameter values:
    1. true—transcode from base64 before saving;
    2. falsesave the string without transcoding.

Time of frame saving depends on the reference frame rate. The higher the reference frame rate, the shorter the time.

Example. When a frame is received from Camera 1, save it to the test.jpg file on disk D:

if (Event.SourceType == "CAM" && Event.SourceId == "1" && Event.Action == "FRAME_SENT")
 {
 SaveToFile("D:\\test.jpg",Event.GetParam("data"),true);
 }
  • No labels