Cameras
Endpoint: https://server:port/api/cameras
Supported actions: GET, POST, DELETE, PATCH
Examples:
GET https://server:port/api/cameras
GET https://server:port/api/cameras/c6d6ef81-2dfe-411a-8bee-e16137b1b135
PATCH https://server:port/api/cameras/c6d6ef81-2dfe-411a-8bee-e16137b1b135
POST https://server:port/api/cameras
DELETE https://server:port/api/cameras/c6d6ef81-2dfe-411a-8bee-e16137b1b135
Permissions:
GET: accessSettings
POST: addCameras
DELETE: addCameras
PATCH: configureCameras
POST Request content to add a new ONVIF camera:
POST https://server:port/api/cameras
{
"name": "Camera 1",
"host": "192.168.10.21",
"username": "camera_username",
"password": "camera_password",
"connectAutomatically": true,
"type": "onvif"
}
POST Response:
{
"enabled": true,
"host": "192.168.10.21",
"id": "d4f94eb9-0eb6-472b-a718-566ac60116d4",
"name": "Camera 1",
"number": 0,
"onvif": {
"httpPort": 80,
"primaryStreamProfile": "",
"profiles": [],
"secondaryStreamProfile": ""
},
"rtsp": null,
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"type": "onvif",
"username": "camera_username"
}
POST Request content to add a new RTSP camera with empty RTSP paths:
POST https://server:port/api/cameras
{
"name": "Camera 2",
"host": "192.168.10.22",
"username": "camera_username",
"password": "camera_password",
"connectAutomatically": false,
"type": "rtsp"
}
POST Response:
{
"enabled": true,
"host": "192.168.10.22",
"id": "875a4195-17fa-4cae-bc8b-02f1c6a46f9c",
"name": "Camera 2",
"number": 0,
"onvif": null,
"rtsp": {
"primary": {
"path": "",
"port": 554
},
"secondary": {
"path": "",
"port": 554
},
},
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "transcode",
"targetResolution": "1:4"
},
"type": "rtsp",
"username": "camera_username"
}
PATCH Request content to set parameters for an added RTSP camera:
PATCH https://server:port/api/cameras/875a4195-17fa-4cae-bc8b-02f1c6a46f9c
{
"enabled": true,
"host": "192.168.20.22",
"name": "Camera 2 modified",
"number": 2,
"rtsp": {
"primary": {
"path": "track1",
"port": 554
},
"secondary": {
"path": "track2",
"port": 554
},
},
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"password": "camera_password_modified"
}
PATCH Response:
{
"enabled": true,
"host": "192.168.20.22",
"id": "875a4195-17fa-4cae-bc8b-02f1c6a46f9c",
"name": "Camera 2 modified",
"number": 2,
"onvif": null,
"rtsp": {
"primary": {
"path": "track1",
"port": 554
},
"secondary": {
"path": "track2",
"port": 554
},
},
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"type": "rtsp",
"username": "camera_username"
}
PATCH Request content to set parameters for an added ONVIF camera:
PATCH https://server:port/api/cameras/d4f94eb9-0eb6-472b-a718-566ac60116d4
{
"enabled": true,
"host": "192.168.20.21",
"name": "Camera 1 modified",
"number": 1,
"onvif": {
"httpPort": 80,
"primaryStreamProfile": "Profile1",
"secondaryStreamProfile": "Profile2"
},
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"ptz": {
"enabled": true,
"xspeed": 5,
"yspeed": 0,
"zspeed": 5
},
"username": "camera_username_modified",
"password": "camera_password_modified"
}
PATCH Response:
{
"enabled": true,
"host": "192.168.20.21",
"id": "d4f94eb9-0eb6-472b-a718-566ac60116d4",
"name": "Camera 1 modified",
"number": 1,
"onvif": {
"httpPort": 80,
"primaryStreamProfile": "Profile1",
"profiles": [
"Profile1",
"Profile2",
"Profile3"
],
"secondaryStreamProfile": "Profile2"
},
"ptz": {
"enabled": true,
"xspeed": 5,
"yspeed": 0,
"zspeed": 5
},
"rtsp": null,
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"type": "onvif",
"username": "camera_username_modified"
}
Notes:
Profiles array might be empty, if the camera is not yet connected. Use GET to receive profiles.
secondaryStream.targetResolution only affects transcoded stream resolution if secondaryStream.source option "transcode" is selected
- secondaryStream.source value options: “disabled”, “camera”, “transcode”
- secondaryStream.targetResolution value options: “1:2”, “1:4”, “1:8”
- type value options: “onvif”, “rtsp”
To get an (preview) image from the camera, Snapshots endpoint or RTSP server can be used.
If the RTSP server is enabled:
- Camera stream address: rtsp://<ip>:<port>/<camera uuid>
- Camera stream without transcoding to mpeg-4: rtsp://<ip>:<port>/<camera uuid>?live=true
Comments
0 comments
Please sign in to leave a comment.