Camera

Authentication

HTTP Basic / Digest authentication is required. The user must have permission to configure system.

Network Camera Source

Network Camera Source Attributes

NameFormatDescription
idNumberNetwork Camera So urce ID
nameTextName
addressTextAddress
macTextMAC Address
locationTextLatitude, Longitude
channelsChannel ListChannel 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

NameFormatDescription
idintegerCamera ID
namestringName
addressstringAddress
locationstringLatitude, Longitude
sourceintegerNetwork Camera Source ID
channelintegerNetwork Camera Source Channel ID
connectedbooleanCamera is connected
has_signalbooleanCamera signal is valid
has_ptzbooleanPTZ is available
recordingbooleanRecording is working
force_recordingbooleanForce recording is working
ptz_presetsarrayPTZ presest settings
ptz_toursarrayPTZ tour settings
streamingbooleanCamera streaming is enabled
http_urlstringCamera HTTP URL
notestringCamera Note
osdobjectCamera OSD settings
ptz_typestringPTZ Type (AUTO / NONE / PTZ / ZOOM)
purposestringCamera Purpose
shapestringCamera Shape (BULLET / DOME / BOX / PTZ)
dewapstringCamera 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

NameFormatDescription
textTextText to show
sizeNumberText size
colorTextText color
locationTextText location

The following is a list of values for the location attribute.

NameDescription
top-lefttop left
top-centertop center
top-righttop right
bottom-leftbottom left
bottom-centerbottom center
bottom-rightbottom 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

NameFormatDescription
enableBoolEnable
screen_modeNumberScreen Mode
start_degreeNumberStart Degree
degree_extentNumberDegree Extent

The following is a list of values for the screen_mode attribute.

ValueDescription
0Single View
1Quad 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
  },
  ...
}