Documentation for C-Werk 2.0.

Previous page Next page

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Get list of video cameras and information about them

GET http://IP-address:port/prefix/camera/list—get all available original sources (cameras) of a domain.

The returned VIDEOSOURCEID identifiers will have the format as follows "HOSTNAME/ObjectType.Id/Endpoint.Name". Friendly name and other related metadata will also be received.

ParameterRequiredDescription
limitNoDetermines the maximum number of returned results, the default value is 1000
next_pageNoThe value of the nextPageToken parameter, which will be in the response if the request returns not all results. It is used to get the following values
filterNo

Allows getting a subset of the results in accordance with the filter. Currently, it can have the HOSTNAME or VIDEOSOURCEID values

Attention!

If Office is specified as the Server name, then the GET http://IP-address:port/prefix/camera/list?filter=Office request will receive all video cameras of the Office Server.

group_idsNo

List of the group identifiers to which the cameras should belong (see Get list of groups and their contents). It is possible to specify several identifiers using the separator "|". For example:

http://localhost:80/camera/list?group_ids=6af92229-43ff-0347-9dae-081bf9835733|b48111eb-64c5-294c-a69c-4adb07c954d1 

In this case, the response will contain all cameras that belong at least to one of the specified groups

Sample request:

GET http://127.0.0.1:80/camera/list?filter=Server1

Sample response:

{
    "cameras" :
    [
        {
            "accessPoint" : "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0",
            "archives" : [],
            "audioStreams" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.1/SourceEndpoint.audio:0",
                    "isActivated" : false
                }
            ],
            "azimuth" : "0",
            "camera_access" : "CAMERA_ACCESS_FULL",
            "comment" : "",
            "detectors" : [],
            "displayId" : "1",
            "displayName" : "Street",
            "enabled" : true,
            "groups" :
            [
                "e2f20843-7ce5-d04c-8a4f-826e8b16d39c"
            ],
            "ipAddress" : "0.0.0.0",
            "isActivated" : true,
            "latitude" : "0",
            "longitude" : "0",
            "model" : "TestDevice",
            "offlineDetectors" : [],
            "panomorph" : false,
            "ptzs" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.1/TelemetryControl.0",
                    "areaZoom" : false,
                    "focus" :
                    {
                        "isAbsolute" : false,
                        "isAuto" : false,
                        "isContinous" : true,
                        "isRelative" : false
                    },
                    "iris" :
                    {
                        "isAbsolute" : false,
                        "isAuto" : false,
                        "isContinous" : true,
                        "isRelative" : false
                    },
                    "is_active" : true,
                    "move" :
                    {
                        "isAbsolute" : false,
                        "isAuto" : false,
                        "isContinous" : true,
                        "isRelative" : false
                    },
                    "pointMove" : false,
                    "zoom" :
                    {
                        "isAbsolute" : false,
                        "isAuto" : false,
                        "isContinous" : true,
                        "isRelative" : false
                    }
                }
            ],
            "rays" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.1/EventSupplier.ray0:0",
                    "displayId" : "1.0.0",
                    "displayName" : "Ray",
                    "enabled" : true,
                    "isActivated" : true
                },
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.1/EventSupplier.ray0:1",
                    "displayId" : "1.0.1",
                    "displayName" : "Ray",
                    "enabled" : true,
                    "isActivated" : true
                }
            ],
            "textSources" : [],
            "vendor" : "Virtual",
            "videoStreams" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0"
                }
            ]
        },
        {
            "accessPoint" : "hosts/Server1/DeviceIpint.2/SourceEndpoint.video:0:0",
            "archives" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.2/SourceEndpoint.video:0:0",
                    "default" : false,
                    "incomplete" : false,
                    "isEmbedded" : false,
                    "storage" : "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage",
                    "storageDisplayName" : "AliceBlue"
                }
            ],
            "audioStreams" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.2/SourceEndpoint.audio:0",
                    "isActivated" : true
                }
            ],
            "azimuth" : "0",
            "camera_access" : "CAMERA_ACCESS_FULL",
            "comment" : "",
            "detectors" :
            [
                {
                    "accessPoint" : "hosts/Server1/AVDetector.1/EventSupplier",
                    "displayName" : "Face detection",
                    "events" :
                    [
                        "TargetList",
                        "faceAppeared"
                    ],
                    "isActivated" : false,
                    "parentDetector" : "",
                    "type" : "TvaFaceDetector"
                }
            ],
            "displayId" : "2",
            "displayName" : "Hall",
            "enabled" : true,
            "groups" :
            [
                "e2f20843-7ce5-d04c-8a4f-826e8b16d39c"
            ],
            "ipAddress" : "0.0.0.0",
            "isActivated" : true,
            "latitude" : "78.2379",
            "longitude" : "15.4466",
            "model" : "Virtual several streams",
            "offlineDetectors" : [],
            "panomorph" : false,
            "ptzs" : [],
            "rays" : [],
            "textSources" : [],
            "vendor" : "Virtual",
            "videoStreams" :
            [
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.2/SourceEndpoint.video:0:0"
                },
                {
                    "accessPoint" : "hosts/Server1/DeviceIpint.2/SourceEndpoint.video:0:1"
                }
            ]
        }
    ],
    "search_meta_data" :
    [
        {
            "matches" :
            [
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "score" : 0
        },
        {
            "matches" :
            [
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "score" : 0
        }
    ]
} 
ParameterParameter description
archives

List of archives to which the camera is connected

audioStreams

Audio stream

commentComment
camera_access

Access rights to the camera, where:

  • CAMERA_ACCESS_FULL—full access,
  • CAMERA_ACCESS_ONLY_ARCHIVEarchive only,
  • CAMERA_ACCESS_MONITORING_ON_PROTECTION—monitoring on protection,
  • CAMERA_ACCESS_MONITORING—monitoring,
  • CAMERA_ACCESS_ARCHIVE—monitoring/archive,
  • CAMERA_ACCESS_MONITORING_ARCHIVE_MANAGE—monitoring/archive/manage
detectorsList of created detection tools
displayIdFriendly identifier
displayNameName
groups

List of groups to which the camera belongs

ipAddressIP address
isActivated

Truethe object is enabled, Falsethe object is disabled

azimuth, latitude, longitude

The coordinates of the camera. Depending on the Server localization, the parameter values can be separated by either a period or a comma

modelModel
ptzs

PTZ devices, where:

  • is_activeindicates whether the PTZ object is activated,
  • pointMovePoint&Click support,
  • areaZoomAreazoom support
textSourcesEvent sources
vendorVendor
videoStreamsVideo streams
raysRays

Get camera live stream


On the page:

Attention!

  • You can get audio from x64 Server only.
  • You can't get audio in MJPEG format.

General information

GET http://IP-Address:port/prefix/live/media/{VIDEOSOURCEID}

{VIDEOSOURCEID}a three-component source endpoint ID (see Get list of video cameras and information about them). For instance, "SERVER1/DeviceIpint.3/SourceEndpoint.video:0:0".

Attention!

If no parameters are specified in the request, then the video will be received in the MJPEG format.

ParameterRequiredDescription
formatNo

Parameter values are "mp4", "hls".

Video can be received in the original format (without recompression) via HLS protocols. HLS protocol supports only H.264 format.

The "mp4" player allows to receive the original video in H.264 and H.265 formats. In all other cases the Server recompresses it to MJPEG format. 

Attention!

If video is requested in the format that differs from the original one, then recompression will be performed, therefore, Server load will increase.

w, hNo

wframe width, h—frame height.

Attention!

The mp4 video is transferred without scaling.

If the h and w values are greater than the size of the original video, the video will be received with the original size.

Zooming out of width and height is available only discretely—in 2, 4, 8 times, etc. If specified sizes are not corresponding to 1/2, 1/4 etc. of original video size, the video will be received with size divisible by the original video size close to specified values.

frNo

The FPS value.

Attention!

This parameter is relevant only for MJPEG video.

enable_token_auth No

Get authorized and signed links to video streams.

  • enable_token_auth—enable authorization by token = 1.
  • valid_token_hours—signature validation time (in hours). The maximum value is a week. The default value is 12 hours
valid_token_hoursNo

key_frames

No

1playback only by key frames;

0original frame rate (default)

authTokenNo

Connecting via C-Werk Cloud.

For example, https://c-werk.com/arpserver/25455_0/webclient/live/media/SERVER/DeviceIpint.1/SourceEndpoint.video:0:1?authToken=...

auth_tokenNo

Authorizing when connecting directly to the Server and authorizing by token.

For example, http://127.0.0.1:80/live/media/SERVER/DeviceIpint.1/SourceEndpoint.video:0:0?format=mp4&auth_token=...


Sample request
:

GET http://127.0.0.1:80/live/media/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?w=640&h=480&enable_token_auth=1&valid_token_hours=1

HLS video

HLS protocol video can be received in the original format only. The following parameters are used when receiving HLS protocol video:

ParameterRequiredDescription
keep_aliveNoTime in seconds in which the stream is to be kept alive
hls_timeNoThe segment length in seconds
hls_list_sizeNoThe maximum number of playlist entries. If set to 0, the list file will contain all segments
hls_wrapNoThe number after which the segment filename number wraps. If set to 0, the number will be never wrapped

Sample request:

GET http://127.0.0.1:80/live/media/SERVER1/DeviceIpint.23/SourceEndpoint.video:0:0?format=hls&keep_alive=60

Sample response:

{
    "keep_alive_seconds": 60,
    "keep_alive_url": "/live/media/hls/keep?stream_id=7e9d8c93-80e2-4521-9a54-cb854fe3cd2d",
    "stop_url": "/live/media/hls/stop?stream_id=7e9d8c93-80e2-4521-9a54-cb854fe3cd2d",
    "stream_url": "/hls/7e9d8c93-80e2-4521-9a54-cb854fe3cd2d/playout.m3u8"
}
ParameterDescription
keep_alive_secondsTime in seconds in which the stream is to be kept alive
keep_alive_url The url to keep the stream alive
stop_urlThe url to stop the stream
stream_urlThe url to access the list of segments

Attention!

HLS protocol video becomes available with some delay (about 20 seconds). This is due to a feature of the HLS protocol: after receiving the link, it forms a cache of several video segments, and only after that the video starts playing.

To playback video via HLS protocol, use the stream_url parameter from the response as follows:

ffplay "http://root:root@10.0.12.65:80/hls/c83b48d5-2ab7-49eb-91ef-593f808d4e51/playout.m3u8"

RTSP video

RTSP protocol video is sent in the original format only.

Request to get the structure of the RTSP link: http://login:password@IP-Address:Port/live/media/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?format=rtsp

Sample response:

{
    "http": {
        "description": "RTP/RTSP/HTTP/TCP",
        "path": "hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0",
        "port": "8554"
    },
    "rtsp": {
        "description": "RTP/UDP or RTP/RTSP/TCP",
        "path": "hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0",
        "port": "554"
    }
}

Request to get video: GET rtsp://login:password@IP-Address:554/hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0

Attention!

In some cases, the RTSP video can be streamed with artifacts. To fix this, change the TCP/IP settings using this reg file.

RTSP stream information:

GET http://IP-Address:port/prefix/rtsp/stat

HTTP video

ffplay.exe -v debug "http://login:password@IP-Address:8001/live/media/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?w=1600&h=0"

Attention!

HTTP sends video in mjpeg only, the w and h parameters are mandatory.

Tunneling RTSP over HTTP

See Configure tunneling RTSP over HTTP in VLC.

Video is sent over the tunnel in the original format.

Sample request:

ffplay -rtsp_transport http "rtsp://login:password@IP-Address:80/rtspproxy/hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0"

GET for VLC: rtsp://login:password@IP-Address:80/rtspproxy/hosts/Server1/DeviceIpint.23/SourceEndpoint.video:0:0

H.264 and H.265 video

To get live video in the original H.264 and H.265 formats, use mp4 format.

Sample request:

ffplay.exe "http://root:root@192.168.25.112:8001/live/media/Server1/DeviceIpint.61/SourceEndpoint.video:0:0?format=mp4"

Get camera snapshot

GET http://IP-Address:port/prefix/live/media/snapshot/{VIDEOSOURCEID}

{VIDEOSOURCEID} – three-component source endpoint ID (see Get list of video cameras and information about them). For instance, "SERVER1/DeviceIpint.3/SourceEndpoint.video:0:0".

ParameterRequiredDescription

w

h

No

w – frame width, h – frame height.

Note

If h and w values are more than size of original frame, the frame will be received with original size.

Zooming out of width and height is available only discretely – in 2, 4, 8 times, etc. If specified sizes are not corresponding to 1/2, 1/4 etc. of original frame size, the frame will be received with size divisible by the original frame size close to specified values.

crop_x

crop_y

crop_width

crop_height


No

crop_x – horizontal indent from the upper left corner. Possible values are 0 to 1. The default is 0.

crop_y – vertical indent from the upper left corner. Possible values are 0 to 1. The default is 0.

crop_width – the ratio of the original image width. Possible values are 0 to 1. The default is 1.

crop_height – the ratio of the original image hight. Possible values are 0 to 1. The default is 1.

Note

By default, the snapshot update period is 30 seconds. To change this value, create the NGP_SNAPSHOT_TIMEOUT system variable and set the required value in milliseconds (see Appendix 9. Creating system variable).

Sample request:

To get a snapshot in the original resolution: GET http://IP-Address:port/prefix/live/media/snapshot/Server1/DeviceIpint.23/SourceEndpoint.video:0:0.

To get a snapshot in 640*480 resolution: GET http://IP-Address:port/prefix/live/media/snapshot/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?w=640&h=480.

To get the right lower particle of a snapshot: GET http://IP-Address:port/prefix/live/media/snapshot/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?crop_x=0.5&crop_y=0.5&crop_width=0.5&crop_height=0.5.

To get the right lower particle of a snapshot in 640*480 resolution: GET http://IP-Address:port/prefix/live/media/snapshot/Server1/DeviceIpint.23/SourceEndpoint.video:0:0?w=640&h=480&crop_x=0.5&crop_y=0.5&crop_width=0.5&crop_height=0.5.


Get high and low quality streams

Configure tunneling RTSP over HTTP in VLC

Get list of groups and their contents

Get list of all available groups

GET http://IP-Address:port/prefix/group

Sample request:

GET http://127.0.0.1:80/group

Sample response:

{
   "groups" : [
      {
         "Brief" : "Group1",
         "Description" : "",
         "Id" : "35fc84a0-2280-4b30-acd2-cc8419a2dc68",
		 "groups" : [
            {
               "Brief" : "Group2",
               "Description" : "",
               "Id" : "dac24803-313c-43ab-aa9a-276922a55cb6",
			   "groups" : []
            },
            {
               "Brief" : "Group3",
               "Description" : "",
               "Id" : "13764152-6910-44b6-99b5-f74641ad4a14",
			   "groups" : [
                  {
                     "Brief" : "Group4",
                     "Description" : "Group4",
                     "Id" : "9a64e2a0-eb92-4adc-bc4f-81d30ceb6c2f",
					 "groups" : []
                  }
               ]
            }
         ]
      }
   ]
}

Get group contents

GET http://IP-Address:port/prefix/group/{GROUPID}.

GROUPID – value of the Id field received using the previous request.

Sample request:

GET http://127.0.0.1:80/group/9a64e2a0-eb92-4adc-bc4f-81d30ceb6c2f

Sample response:

{
   "members" : [ "hosts/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0" ]
}

Get list of groups containing specified camera

GET http://IP-Address:port/prefix/group/contains/{VIDEOSOURCEID}

{VIDEOSOURCEID} – three-component source endpoint ID (see Get list of video cameras and information about them). For instance, "SERVER1/DeviceIpint.3/SourceEndpoint.video:0:0".

Sample request:

GET http://127.0.0.1:80/group/contains/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0

Sample response:

{
   "groups" : [
      "35fc84a0-2280-4b30-acd2-cc8419a2dc68",
      "13764152-6910-44b6-99b5-f74641ad4a14",
      "dac24803-313c-43ab-aa9a-276922a55cb6"
   ]
}

Camera statistics

GET http://IP-Address:port/prefix/statistics/{VIDEOSOURCEID} − statistics for the certain camera.

{VIDEOSOURCEID} − three-component source endpoint ID (see Get list of video cameras and information about them). For instance, "SERVER1/DeviceIpint.3/SourceEndpoint.video:0:0".

Statistics for the several cameras: POST http://IP-Address:port/prefix/statistics/ + request body in the following format:

[ 
    "hosts/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0",
    "hosts/SERVER1/DeviceIpint.2/SourceEndpoint.video:0:0"
]
ParameterRequiredDescription
waterlevelNo

waterlevel = 1 − the response will contain the current water level value, if the water level detection is created for the camera (see Configuring Water level detection).

Request example:

GET http://127.0.0.1:80/statistics/Server1/DeviceIpint.1/SourceEndpoint.video:0:0

Response example:

{
  "bitrate": 592831,
  "fps": 2.278942490e+01,
  "width": 1280,
  "height": 720,
  "mediaType": 2,
  "streamType": 877088845
}

Content

  • No labels