Camera
Authentication
HTTP Basic / Digest authentication is required. The user must have permission to configure system.
Network Camera Source
Network Camera Source Attributes
Name | Format | Description |
---|---|---|
id | Number | Network Camera So urce ID |
name | Text | Name |
address | Text | Address |
mac | Text | MAC Address |
location | Text | Latitude, Longitude |
channels | Channel List | Channel List |
Network Camera List
GET /api/sources
The following is an example of getting a list of network cameras.
Request:
GET /api/sources HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"sources": [
{
"id": 1,
"name": "netcam1",
"address": "192.168.0.101",
"mac": "12:34:56:78:90:ab",
"location": "37.484410, 126.893265",
"channels": [ { "id": 1, "name": "Channel 1" } ]
},
{
"id": 2,
"name": "netcam2",
"address": "192.168.0.102",
"mac": "12:34:56:78:90:ac",
"location": "",
"channels": [ { "id": 1, "name": "Channel 1" } ]
},
{
"id": 3,
"name": "netcam3",
"address": "192.168.0.103",
"mac": "12:34:56:78:90:ad",
"location": "",
"channels": [
{ "id": 1, "name": "Channel 1" },
{ "id": 2, "name": "Channel 2" },
{ "id": 3, "name": "Channel 3" },
{ "id": 4, "name": "Channel 4" }
]
},
{
"id": 4,
"name": "netcam4",
"address": "192.168.0.104",
"mac": "12:34:56:78:90:ae",
"location": "",
"channels": [ { "id": 1, "name": "Channel 1" } ]
}
]
}
Change Network Camera Source Credentials
Specifies the user
/ password
properties.
PUT /api/sources/1
The following is an example of modifying the password for a Network Camera Source with an id
of 1.
Request:
PUT /api/sources/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{ "password": "PassWord1" }
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"netcam1",
"address": "192.168.0.101",
"mac": "12:34:56:78:90:ab",
"location": "37.484410, 126.893265",
"channels": [ { "id": 1, "name": "Channel 1" } ]
}
Change multiple Network Camera Sources
PUT /api/sources
The following is an example of modifying the password for multiple network camera sources.
Request:
PUT /api/sources HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{
"sources": [
{ "id": 1, "password": "PassWord1" },
{ "id": 2, "password": "PassWord2" }
]
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"sources": [
{
"id": 1,
"name": "netcam1",
"address": "192.168.0.101",
"mac": "12:34:56:78:90:ab",
"location": "37.484410, 126.893265",
"channels": [ { "id": 1, "name": "Channel 1" } ]
},
{
"id": 2,
"name": "netcam2",
"address": "192.168.0.102",
"mac": "12:34:56:78:90:ac",
"location": "",
"channels": [ { "id": 1, "name": "Channel 1" } ]
},
]
}
Camera
Name | Format | Description |
---|---|---|
id | integer | Camera ID |
name | string | Name |
address | string | Address |
location | string | Latitude, Longitude |
source | integer | Network Camera Source ID |
channel | integer | Network Camera Source Channel ID |
connected | boolean | Camera is connected |
has_signal | boolean | Camera signal is valid |
has_ptz | boolean | PTZ is available |
recording | boolean | Recording is working |
force_recording | boolean | Force recording is working |
ptz_presets | array | PTZ presest settings |
ptz_tours | array | PTZ tour settings |
streaming | boolean | Camera streaming is enabled |
http_url | string | Camera HTTP URL |
note | string | Camera Note |
osd | object | Camera OSD settings |
ptz_type | string | PTZ Type (AUTO / NONE / PTZ / ZOOM) |
purpose | string | Camera Purpose |
shape | string | Camera Shape (BULLET / DOME / BOX / PTZ) |
dewap | string | Camera Dewarping |
The source
and channel
values start at 1. If the value of source
is 0, then Network Camera Source
is not used.
Camera List
GET /api/cameras
Here's an example to get a list of cameras:
Request:
GET /api/cameras HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"cameras":[
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.484410, 126.893265",
"source":1,
"channel":1,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true,
"ptz_presets": [],
"ptz_tours": [],
"http_url": "http:\/\/192.168.90.123\/",
"note": "parking spot",
"ptz_type":"PTZ",
"purpose":"도로 교통 방범",
"dewarp":{
"enable":true,
"screen_mode":0,
"start_degree":0,
"degree_extent":90
},
"shape":"DOME",
},
{
"id":2,
"name":"Camera 2",
"address": "192.168.0.102",
"location": "",
"source":2,
"channel":1,
"connected":false,
"streaming": true,
"has_signal":false,
"has_ptz":true,
"ptz_presets": [],
"ptz_tours": [],
"http_url": "http:\/\/192.168.0.102\/",
"note": "",
"ptz_type":"AUTO",
"purpose":"",
"dewarp":{
"enable":true,
"screen_mode":0,
"start_degree":0,
"degree_extent":90
},
"shape":"BULLET",
},
{
"id":3,
"name":"Camera 3",
"address": "192.168.0.103",
"location": "",
"source":3,
"channel":1,
"connected":false,
"streaming": true,
"has_signal":false,
"has_ptz":false,
"ptz_presets": [],
"ptz_tours": [],
"http_url": "http:\/\/192.168.0.103\/",
"note": "",
"ptz_type":"PTZ",
"purpose":"",
"dewarp":{
"enable":false,
"screen_mode":1,
"start_degree":0,
"degree_extent":90
},
"shape":"BULLET",
},
{
"id":4,
"name":"Camera 4",
"address": "192.168.0.104",
"location": "",
"source":1,
"channel":4,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true,
"ptz_presets": [],
"ptz_tours": [],
"http_url": "http:\/\/192.168.90.124\/",
"note": "",
"ptz_type":"PTZ",
"purpose":"",
"dewarp":{
"enable":false,
"screen_mode":1,
"start_degree":0,
"degree_extent":90
},
"shape":"BULLET",
}
]
}
Camera Information
GET /api/cameras/1
The following is an example of getting information about a camera with an id
of 1.
Request:
GET /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.484410, 126.893265",
"source":1,
"channel":1,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true,
"http_url": "http:\/\/192.168.90.123\/",
"note": "parking spot"
}
Modify Camera
Camera Source
The source
and channel
must be used together.
PUT /api/cameras/1
The following example modifies the Network Camera Source and Channel used by the camera with an id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{ "source": 2, "channel": 3 }
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.484410, 126.893265",
"source":2,
"channel":3,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true
}
Camera Location
Specifies the location
property.
PUT /api/cameras/1
The following example modifies the location of a camera with an id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{ "location": "37.000000, 126.893265" }
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.000000, 126.893265"
}
Camera Streaming Enable
Specifies the streaming
attribute.
PUT /api/cameras/1
The following example disables streaming for the camera with an id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{ "streaming": false }
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"streaming": false
}
Camera Credentials
Specifies the user
/ password
properties.
PUT /api/cameras/1
The following example modifies the password for a camera with an id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{ "password": "PassWord1" }
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
}
Camera PTZ Preset Settings
Specifies the ptz_presets
property.
PUT /api/cameras/1
The following example sets the PTZ preset name for the camera with id
of 1.
The order of the ptz_presets
array is preset 1 through preset N.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{
"ptz_presets": [
{
"name": "1-preset"
},
{
"name": "2-preset"
},
{
"name": "3-preset"
},
{
"name": "4-preset"
},
{
"name": "5-preset"
},
{
"name": "6-preset"
}
]
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.484410, 126.893265",
"source":1,
"channel":1,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true,
"ptz_presets": [
{
"name": "1-preset"
},
{
"name": "2-preset"
},
{
"name": "3-preset"
},
{
"name": "4-preset"
},
{
"name": "5-preset"
},
{
"name": "6-preset"
}
],
"ptz_tours": [],
"http_url": "http:\/\/192.168.90.123\/",
"note": "parking spot"
}
Camera PTZ Tour Settings
Specifies the ptz_tours
property.
PUT /api/cameras/1
The following example sets the PTZ tours for the camera with id
of 1.
The order of the ptz_tours
array is tour 1 through tour N.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{
"ptz_tours": [
{
"name": "Tour 1",
"ptz": [
{
"preset": 1,
"duration": 5,
"speed": 50
},
{
"preset": 2,
"duration": 5,
"speed": 50
},
{
"preset": 3,
"duration": 5,
"speed": 50
},
{
"preset": 4,
"duration": 5,
"speed": 50
},
{
"preset": 5,
"duration": 5,
"speed": 50
},
{
"preset": 6,
"duration": 5,
"speed": 50
}
],
"restart": true,
"restart_timeout": 60
}
]
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.484410, 126.893265",
"source":1,
"channel":1,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true,
"ptz_presets": [
{
"name": "Tour 1",
"ptz": [
{
"preset": 1,
"duration": 5,
"speed": 50
},
{
"preset": 2,
"duration": 5,
"speed": 50
},
{
"preset": 3,
"duration": 5,
"speed": 50
},
{
"preset": 4,
"duration": 5,
"speed": 50
},
{
"preset": 5,
"duration": 5,
"speed": 50
},
{
"preset": 6,
"duration": 5,
"speed": 50
}
],
"restart": true,
"restart_timeout": 60
}
],
"ptz_tours": [],
"http_url": "http:\/\/192.168.90.123\/",
"note": "parking spot"
}
Camera OSD Settings
Specify the osd
property.
The following are the camera OSD properties
Name | Format | Description |
---|---|---|
text | Text | Text to show |
size | Number | Text size |
color | Text | Text color |
location | Text | Text location |
The following is a list of values for the location
attribute.
Name | Description |
---|---|
top-left | top left |
top-center | top center |
top-right | top right |
bottom-left | bottom left |
bottom-center | bottom center |
bottom-right | bottom right |
PUT /api/cameras/1
The following example sets the OSD for the camera with id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{
"osd": [{
"text": "Camera OSD Test",
"size": 40,
"color": "#ffffff",
"location": "top-left"
}]
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
"location": "37.484410, 126.893265",
"source":1,
"channel":1,
"connected":true,
"streaming": true,
"has_signal":true,
"has_ptz":true,
"ptz_presets": [],
"ptz_tours": [],
"http_url": "http:\/\/192.168.90.123\/",
"note": "",
"osd": [{
"text": "Camera OSD Test",
"size": 40,
"color": "#ffffff",
"location": "top-left"
}]
}
Camera Reboot
Specifies the reboot
property.
PUT /api/cameras/1
The following example reboots the camera with id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: [Basic Authentication]
Content-Type: application/json
{ "reboot": true }
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
"address": "192.168.0.101",
}
Camera Dewarping
Specifies the dewarp
property.
The following are the camera Dewarping properties
Name | Format | Description |
---|---|---|
enable | Bool | Enable |
screen_mode | Number | Screen Mode |
start_degree | Number | Start Degree |
degree_extent | Number | Degree Extent |
The following is a list of values for the screen_mode
attribute.
Value | Description |
---|---|
0 | Single View |
1 | Quad View |
The start_degree
attribute extents from 0 to 360.
The degree_extent
attribute is greater than 0 and less than or equal to 360.
PUT /api/cameras/1
The following example modifies the dewarp of a camera with an id
of 1.
Request:
PUT /api/cameras/1 HTTP/1.1
Host: demo.emstone.com
Authorization: Basic
Content-Type: application/json
{
"dewarp":{
"enable":true,
"screen_mode":0,
}
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"Camera 1",
...
"dewarp":{
"enable":true,
"screen_mode":0,
"start_degree":0,
"degree_extent":90
},
...
}