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: Accessing settings POST: Adding/removing cameras DELETE: Adding/removing cameras PATCH: Configuring cameras
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:
{
"audio": {
"receive": false,
"recording": {
"enabled": true,
"highFrequency": 540,
"lowFrequency": 450,
"sensitivity": 100
}
},
"enabled": true,
"group": "",
"host": "192.168.10.21",
"id": "3fac93cc-644c-474d-a43e-95685b4c3a1b",
"info": {
"firmwareVersion": "",
"mac": "",
"manufacturer": "",
"model": "",
"serialNumber": ""
},
"name": "Camera 1",
"note": "",
"number": 0,
"onvif": {
"httpPort": 80,
"primaryStreamProfile": "",
"profiles": [],
"secondaryStreamProfile": "",
"wsTokenAuth": false
},
"ptz": {
"enabled": false,
"xspeed": 5,
"yspeed": 0,
"zspeed": 5
},
"rtsp": null,
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"state": {
"network": "no connection"
},
"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:
{
"audio": {
"receive": false,
"recording": {
"enabled": true,
"highFrequency": 540,
"lowFrequency": 450,
"sensitivity": 100
}
},
"enabled": true,
"group": "",
"host": "192.168.10.22",
"id": "0e978c06-e772-4fe8-8ae2-f1cef1fd14cc",
"info": {
"firmwareVersion": "",
"mac": "",
"manufacturer": "",
"model": "",
"serialNumber": ""
},
"name": "Camera 2",
"note": "",
"number": 0,
"onvif": null,
"ptz": {
"enabled": false,
"xspeed": 5,
"yspeed": 0,
"zspeed": 5
},
"rtsp": {
"primary": {
"path": "",
"port": 554
},
"secondary": {
"path": "",
"port": 554
}
},
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "transcode",
"targetResolution": "1:4"
},
"state": {
"network": "no connection"
},
"type": "rtsp",
"username": "camera_username"
}
PATCH Request content to set parameters for an added RTSP camera:
PATCH https://server:port/api/cameras/0e978c06-e772-4fe8-8ae2-f1cef1fd14cc
{
"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:
{
"audio": {
"receive": false,
"recording": {
"enabled": true,
"highFrequency": 540,
"lowFrequency": 450,
"sensitivity": 100
}
},
"enabled": true,
"group": "",
"host": "192.168.20.22",
"id": "0e978c06-e772-4fe8-8ae2-f1cef1fd14cc",
"info": {
"firmwareVersion": "",
"mac": "",
"manufacturer": "",
"model": "",
"serialNumber": ""
},
"name": "Camera 2 modified",
"note": "",
"number": 2,
"onvif": null,
"ptz": {
"enabled": false,
"xspeed": 5,
"yspeed": 0,
"zspeed": 5
},
"rtsp": {
"primary": {
"path": "track1",
"port": 554
},
"secondary": {
"path": "track2",
"port": 554
}
},
"secondaryStream": {
"encodingQuality": 30,
"fastScaling": false,
"source": "camera",
"targetResolution": "1:4"
},
"state": {
"network": "no connection"
},
"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.