Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 Source 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
commonObjectSettings shared by every screen mode
crop_inNumberSingle View inner crop
crop_outNumberSingle View outer crop
start_degreeNumberSingle View Start Degree
degree_extentNumberSingle View Degree Extent
quadArrayQuad View settings for each screen
sphericalObjectSpherical Single View settings
spherical_quadArraySpherical Quad View settings for each screen

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

ValueDescription
0Single View
1Quad View
2Spherical Single View
3Spherical 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.

The crop_in and crop_out attributes are ratios of the radius from 0 to 1.

The following are the properties of the common object.

NameFormatDescription
center_xNumberHorizontal center shift, ratio of the width
center_yNumberVertical center shift, ratio of the height
radius_xNumberAdded to the distance to the nearest edge, ratio of the width
radius_yNumberAdded to the distance to the nearest edge, ratio of the height
tiltNumberMount tilt from vertical in radians, 0 to π/6
tilt_directionNumberAzimuth on the source image toward which the tilt pushes the floor, in radians: 0 is up, π/2 is left

The center_x, center_y, radius_x and radius_y attributes extend from -0.5 to 0.5. A value outside this range is set to 0. Every attribute defaults to 0.

A positive radius_x or radius_y extends the lens circle past the nearest image edge, for a camera whose lens circle is cut off by the image. The part of the circle outside the image is shown black in the dewarped view.

tilt is clamped to 0 to π/6, and tilt_direction is wrapped into 0 to 2π.

The following are the properties of each item of the quad array.

NameFormatDescription
channelNumberScreen number from 0 to 3
crop_inNumberInner crop
crop_outNumberOuter crop
start_degreeNumberStart Degree
degree_extentNumberDegree Extent

The following are the properties of the spherical object and of each item of the spherical_quad array.

NameFormatDescription
channelNumberScreen number from 0 to 3, spherical_quad only
pitchNumberPitch in radians, from -π/2 to π/2
rollNumberRoll in radians, from -2π to 2π
zoomNumberZoom, from 0.1 to 1.0, 1.0 is the default

PUT replaces every dewarp setting, and an attribute that is left out is set to its default value.

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":1,
    "common":{
      "center_x":0.0233,
      "radius_x":-0.1201,
      "radius_y":-0.0074,
      "tilt":0.1449,
      "tilt_direction":1.5882
    }
  }
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id":1,
  "name":"Camera 1",
  ...
  "dewarp":{
    "enable":true,
    "screen_mode":1,
    "common":{
      "center_x":0.0233,
      "center_y":0,
      "radius_x":-0.1201,
      "radius_y":-0.0074,
      "tilt":0.1449,
      "tilt_direction":1.5882
    },
    "crop_in":0,
    "crop_out":0,
    "start_degree":0,
    "degree_extent":90,
    "quad":[
      { "channel":0, "crop_in":0, "crop_out":0, "start_degree":90, "degree_extent":90 },
      { "channel":1, "crop_in":0, "crop_out":0, "start_degree":0, "degree_extent":90 },
      { "channel":2, "crop_in":0, "crop_out":0, "start_degree":270, "degree_extent":90 },
      { "channel":3, "crop_in":0, "crop_out":0, "start_degree":180, "degree_extent":90 }
    ],
    "spherical":{ "pitch":0, "roll":0, "zoom":1 },
    "spherical_quad":[
      { "channel":0, "pitch":0, "roll":0, "zoom":1 },
      { "channel":1, "pitch":0, "roll":0, "zoom":1 },
      { "channel":2, "pitch":0, "roll":0, "zoom":1 },
      { "channel":3, "pitch":0, "roll":0, "zoom":1 }
    ]
  },
  ...
}

The response always carries every dewarp attribute, including those left at their default values.