5.20 api camera snapshot

The /api/camera/snapshot function helps you download images from an internal or external IP camera connected to the intercom. Specify the video source, resolution and other parameters.

The function is part of the Camera service and the user must be assigned the Camera Monitoring privilege for authentication if required.

The GET or POST method can be used for this function.

Request parameters:

Parameter

Description

width

Mandatory parameter specifying the horizontal resolution of the JPEG image in pixels

height

Mandatory parameter specifying the vertical resolution of the JPEG image in pixels. The snapshot height and width must comply with one of the supported options (see api/camera/caps).

source

Optional parameter defining the video source (internal – internal camera, external – external IP camera). If the parameter is not included, the default video source included in the Hardware / Camera / Common settings section of the configuration web interface is selected.

fps

Optional parameter defining the frame rate. If the parameter is set to >= 1, the intercom sends images at the set frame rate using the http server push method.

time Optional parameter defining the snapshot time in the intercom memory. The time values must be within the intercom memory range: <-30, 0> seconds. When this parameter is used together with the fps parameter, the fps parameter is ignored and function returns only a single frame.

The reply is in the image/jpeg or multipart/x-mixed-replace (pro fps >= 1) format. If the request parameters are wrong, the function returns information in the application/json format. 

Example:

 GET /api/camera/snapshot?width=640&height=480&source=internal
 
 # following command returns a frame which was captured 5 seconds before the command was executed
 GET /api/camera/snapshot?width=640&height=480&source=internal&time=-5