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 Current »

Get archive contents

Get list of archives the recording is performed to:

GET http://IP-Address:port/prefix/archive/list/{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/archive/list/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0

Sample response:

{
   "archives" : [
      {
         "default" : true,
         "name" : "hosts/SERVER1/MultimediaStorage.AliceBlue/MultimediaStorage"
      },
      {
         "default" : false,
         "name" : "hosts/SERVER1/MultimediaStorage.AntiqueWhite/MultimediaStorage"
      }
   ]
}
ParameterDescription
default

true − default archive.

false – not a default archive.

nameArchive name.

Get archive contents:

GET http://IP-Address:port/prefix/archive/contents/intervals/{VIDEOSOURCEID}/{ENDTIME}/{BEGINTIME} – get archive contents starting at BEGINTIME and ending at ENDTIME.

{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".

If BEGINTIME is not specified, infinite future is considered. If ENDTIME is not specified too, infinite past is considered. The words "past" and "future" can be used to set infinite past and infinite future as well.

Interval sequence corresponds to the ratio between specified BEGINTIME and ENDTIME (in ascending order if BEGINTIME<ENDTIME, and in descending order if ENDTIME<BEGINTIME). Start and end points of interval are returned in its common order, i.e. the interval start time is less than the interval end time or equal to it.

Set time in the YYYYMMDDTHHMMSS format in the timezone UTC+0.

ParameterRequiredDescription
limitNo

The number of intervals in the response, the default value is 100.

scaleNo

The minimum time separation between two intervals at which they will be treated as two different intervals (not merged), the default value is 0.

archiveNoThe name of the archive from which the intervals are to be retrieved. If not specified, the intervals are retrieved from the default archive.

Sample request:

GET http://127.0.0.1:80/archive/contents/intervals/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0/past/future

Sample response:

{
   "intervals": [
      {
         "begin": "20200512T105111.089000",
         "end": "20200521T121106.032000"
      },
      {
         "begin": "20200430T052909.842000",
         "end": "20200430T063733.242000"
      }
   ],
   "more": true
}
ParameterDescription
intervals

An array containing intervals.

Note

Time is returned in the UTC format.

more

true – the server did not return all intervals because the limit was exceeded (limit parameter).

false – the server returned all intervals from the specified time interval.

Get info about archive

Archive depth

GET http://IP-Aaddress:port/prefix/archive/statistics/depth/{VIDEOSOURCEID}to get the information about the archive depth.

{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
archiveNo

The name of the archive from the request to get the list of the archives (see Get archive contents). If not specified, the default archive is used

thresholdNo

Maximum duration of the interval between records in the archive. If the interval between records exceeds the value of the threshold parameter, then the records will be considered split and a new interval will be formed. The threshold parameter is set in days, the default value is 1 day

Sample request 1:

GET http://127.0.0.1:80/archive/statistics/depth/SERVER1/DeviceIpint.23/SourceEndpoint.video:0:0

Sample response:

{
  "start": "20160823T141333.778000"
  ,"end": "20160824T065142"
}

Sample request 2:

GET http://127.0.0.1:80/archive/statistics/depth/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0?archive=hosts/SERVER1/MultimediaStorage.AliceBlue/MultimediaStorage

Sample response:

{
  "start": "20210910T070448.179000"
  ,"end": "20210910T072838"
}
ParameterDescription
startInterval start
endInterval end

Sample request 3:

GET http://127.0.0.1:80/archive/statistics/depth/SERVER1/DeviceIpint.11/SourceEndpoint.video:0:1?threshold=2&archive=hosts%2FSERVER1%2FMultimediaStorage.AliceBlue%2FMultimediaStorage&bundle=archive

{
  "start": "20230506T125443.056000"
  ,"end": "20230804T065741.643000"
}

Recording capacity to specific camera archive

GET http://IP-Address:port/prefix/archive/statistics/capacity/{VIDEOSOURCEID}/{ENDTIME}/{BEGINTIME}to get the information about the recording capacity to specific camera archive starting at BEGINTIME and ending at ENDTIME.

Note

The ENDTIME and BEGINTIME syntax is described in Get archive contents.

ParameterRequiredDescription
archiveNo

The name of the archive from the request to get the list of the archives (see Get archive contents). If not specified, the default archive is used

Sample request:

GET http://127.0.0.1:80/archive/statistics/capacity/SERVER1/DeviceIpint.23/SourceEndpoint.video:0:0/past/future?archive=hosts/SERVER1/MultimediaStorage.AntiqueWhite/MultimediaStorage

Sample response:

{
  "size": 520093696
  ,"duration": 32345
}
ParameterDescription

size

Archive size (in bytes) within the specified period

duration

Archive duration (in seconds) within the specified period

Attention!

Since calculating the exact value is a high-runner process, the value is calculated approximately, and the margin of error may be a few percent.

Get info about archive damage

GET http://IP-Address:port/prefix/archive/health/{HOSTNAME}/{ENDTIME}/{BEGINTIME}

{HOSTNAME} − Server name.

Note

The ENDTIME and BEGINTIME syntax is described in Get archive contents section.

ParameterRequiredDescription
archiveNo

Archive name from the request to get the list of archives (see Get archive contents).

healthNo

0 − there is an archive damage, 1 − no archive damage.


Important!

If the request does not contain the archive or health parameters, then the response will contain all values of these parameters.

Sample request:

GET http://127.0.0.1:80/archive/health/SERVER/past/future?archive=hosts/SERVER/MultimediaStorage.AliceBlue/MultimediaStorage&health=0

Sample response:

{
"events" : [
{
"data" : {
"archive" : "D:/archiveAliceBlue.afs",
"health" : 0
},
"timestamp" : "20180907T101637.361014"
},
{
"data" : {
"archive" : "D:/archiveAliceBlue.afs",
"health" : 0
},
"timestamp" : "20180907T102726.750134"
}
]
}

where,

timestamp − the time of archive damage detection (UTC +0).

Get archive stream


On page:

Important!

You can get audio from x64 Server only.

You can't get audio in MJPEG format.

Get archive stream from default archive

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

{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".

{STARTTIME} − time in ISO format. Set the timezone to UTC+0. 

ParameterRequiredDescription
speed NoPlayback speed, values can be negative.
formatNoParameter values are 'mjpeg', 'rtsp', 'mp4', 'hls'. If the format is not specified, 'rtsp' is selected or it is not recognized, then the native format is selected by server to prevent additional encoding. If the native format is not supported by client, server selects WebM.
idNoUnique identifier of archive stream (optional). It is used to get stream info or control the stream.

w

h

No

w – frame width, h – frame height.

frNo

fps.

Important!

This parameter is relevant only for MJPEG video.

enable_token_auth No

Get 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

Sample request:

GET http://127.0.0.1:80/archive/media/Server1/DeviceIpint.1/SourceEndpoint.video:0:0/20110608T060141.375?format=rtsp&speed=1&w=640&h=480&enable_token_auth=1&valid_token_hours=1

Important!

HLS archive video becomes available in 30 seconds after getting the response.

Sample response:

{
    "http": {
        "description": "RTP/RTSP/HTTP/TCP",
        "path": "archive/hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0/20110608T060141.375000?speed=1&id=a865fcea-cfe6-44a1-bf7b-9e6a94c44a53&exp=20200525T171234&nonce=1&hmac=wVlyHvZkB2TnqftTfYugtwmZ7g8=",
        "port": "8554"
    },
    "httpproxy": {
        "description": "RTP/RTSP/HTTP/TCP Current Http Port",
        "path": "rtspproxy/archive/hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0/20110608T060141.375000?speed=1&id=a865fcea-cfe6-44a1-bf7b-9e6a94c44a53&exp=20200525T171234&nonce=2&hmac=BVICx8NVV4yijwqc0Q6Xzji41Rg="
    },
    "rtsp": {
        "description": "RTP/UDP or RTP/RTSP/TCP",
        "path": "archive/hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0/20110608T060141.375000?speed=1&id=a865fcea-cfe6-44a1-bf7b-9e6a94c44a53&exp=20200525T171234&nonce=1&hmac=wVlyHvZkB2TnqftTfYugtwmZ7g8=",
        "port": "554"
    }
}

Assign ID to the stream

Assign ID to the stream to receive information about this stream.

http://IP-Address:port/prefix/archive/media/VIDEOSOURCEID/STARTTIME/20140723T120000.000?format=rtsp&speed=1&w=640&h=480&id=f03c6ccf-b181-4844-b09c-9a19e6920fd3

It is possible to use other values consisting of latin letters and digits. It is recommended to use the UUID function (see Get unique identifier).

RTSP archive video

GET rtsp://login:password@IP-Address:554/archive/hosts/SERVER1/DeviceIpint.0/SourceEndpoint.video:0:0/20160907T050548.723000Z?speed=1

Speed parametr is mandatory: playback speed.

Examples:

  • speed = 1 − forward playback, normal speed;
  • speed = -1 − back playback, normal speed;
  • speed = 4 − fast playback, speed 4х;
  • speed = -8 − fast-rewind playback, speed 8x.

HTTP archive video

ffplay.exe -v debug "http://login:password@IP-Address:80/archive/media/SERVER1/DeviceIpint.4/SourceEndpoint.video:0:0/20170112T113526?w=1600&h=0&speed=1".

Tunneling RTSP over HTTP

ffplay -rtsp_transport http "rtsp://login:password@IP-Address:8554/rtspproxy/archive/hosts/SERVER1/DeviceIpint.4/SourceEndpoint.video:0:0/20170115T113526".

For VLC: GET rtsp://login:password@IP-Address:8554/rtspproxy/archive/hosts/SERVER1/DeviceIpint.4/SourceEndpoint.video:0:0/20170115T113526

H.264 archive video

To get H.264 archive video use RTSP protocol:

GET rtsp://login:password@IP-Address:554/archive/hosts/SERVER1/DeviceIpint.4/SourceEndpoint.video:0:0/20170112T113526

or tunneling RTSP over HTTP:

GET rtsp://login:password@IP-Address:80/rtspproxy/archive/hosts/SERVER1/DeviceIpint.4/SourceEndpoint.video:0:0/20170115T113526


Get the archive stream information

Control archive stream

Review video footage by frame

Working with bookmarks

Get bookmarks from archive

GET http://IP-Address:port/prefix/archive/contents/bookmarks/{HOSTNAME}/{ENDTIME}/{BEGINTIME}

{HOSTNAME} − Server name.

Note

The ENDTIME and BEGINTIME syntax is described in Get archive contents section.


ParameterRequiredDescription

threshold

No

Results offset by the specified number. For example, if a query with offset=0 returned 100 results, then in order to get the next results, it is necessary to run a query with offset=100. If the second query returned 250 results, then in order to get the next results, it is necessary to run a query with offset=350, etc.

limitNoReceived bookmarks limit. The default value is 100.

Sample request:

GET http://127.0.0.1:80/archive/contents/bookmarks/Server1/future/past

Sample response: 

{
    "archives": [
        {
            "friendly_name": "AliceBlue",
            "storage": "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage"
        }
    ],
    "cameras": [
        {
            "endpoint": "hosts/Server1/DeviceIpint.7/SourceEndpoint.video:0:0",
            "friendly_name": "Camera"
        }
    ],
    "events": [
        {
            "archBegin": "2019-03-19T10:06:54.295Z",
            "archEnd": "2019-03-19T13:02:41.243Z",
            "begins_at": "20190319T114843.000",
            "boundary": "((0.4989775;0.4169492);(75.49898;13.41695))",
            "comment": "comment",
            "endpoint": "hosts/Server1/DeviceIpint.7/SourceEndpoint.video:0:0",
            "ends_at": "20190319T115638.000",
            "geometry": "f49fa526-c320-404a-9da2-7a090759a717;None;147",
            "group_id": "b686e57c-a4e8-44dd-b17e-8c1b805a1b6e",
            "id": "7843d488-67e2-4140-ab17-0016e4ba22bc",
            "is_protected": false,
            "storage_id": "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage",
            "timestamp": "20190319T130332.110491",
            "user_id": "root"
        },
        {
            "begins_at": "20190319T121747.999",
            "boundary": "((0.4989775;0.4169492);(75.49898;13.41695))",
            "comment": "protected",
            "endpoint": "hosts/Server1/DeviceIpint.7/SourceEndpoint.video:0:0",
            "ends_at": "20190319T123101.145",
            "geometry": "4cbf8979-4234-4a9a-9838-3026bd4ec496;None;147",
            "group_id": "2e184409-ed77-41bb-85d1-92d78d35c882",
            "id": "a792a895-00fd-48f9-9bd4-99e572f1579d",
            "is_protected": true,
            "storage_id": "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage",
            "timestamp": "20190319T130339.722000",
            "user_id": "root"
        }
]
ParameterDescription
archivesArray of archives that contain the bookmarks.
camerasArray of bookmarked cameras.
begins_atCorrespond to the bookmark beginning and ending.
ends_at
commentCommentary.
endpointSource.
is_protected

If the value is true then the record is protected from overwriting (see Protecting video footage from FIFO overwriting).

storage_idArchive.
timestampDate of the bookmark adding.
user id

User who added the bookmark.

Edit bookmarks

POST http://IP-Address:port/prefix/archive/contents/bookmarks/

The request body must contain the data from the GET request (see Get bookmarks from archive), and the hostname parameter:

[
        {
            "archBegin": "2019-03-19T10:06:54.295Z",
            "archEnd": "2019-03-19T13:02:41.243Z",
            "begins_at": "20190319T114843.000",
            "boundary": "((0.4989775;0.4169492);(75.49898;13.41695))",
            "comment": "comment_new",
            "endpoint": "hosts/Server1/DeviceIpint.7/SourceEndpoint.video:0:0",
            "ends_at": "20190319T115638.000",
            "geometry": "f49fa526-c320-404a-9da2-7a090759a717;None;147",
            "group_id": "b686e57c-a4e8-44dd-b17e-8c1b805a1b6e",
            "id": "7843d488-67e2-4140-ab17-0016e4ba22bc",
            "is_protected": false,
            "storage_id": "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage",
            "timestamp": "20190319T130332.110491",
            "user_id": "root",
			"hostname": "Server1"
        }
]

You can edit the following parameters:

  • begins_at,
  • ends_at,

  • comment,

  • is_protected,

  • endpoint,

  • storage_id.

To delete a comment or a bookmark, it is necessary to clear the endpoint and storage_id parameter values.

[
        {
            "archBegin": "2019-03-19T10:06:54.295Z",
            "archEnd": "2019-03-19T13:02:41.243Z",
            "begins_at": "20190319T114843.000",
            "boundary": "((0.4989775;0.4169492);(75.49898;13.41695))",
            "comment": "comment_new",
            "endpoint": "",
            "ends_at": "20190319T115638.000",
            "geometry": "f49fa526-c320-404a-9da2-7a090759a717;None;147",
            "group_id": "b686e57c-a4e8-44dd-b17e-8c1b805a1b6e",
            "id": "7843d488-67e2-4140-ab17-0016e4ba22bc",
            "is_protected": false,
            "storage_id": "",
            "timestamp": "20190319T130332.110491",
            "user_id": "root",
			"hostname": "Server1"
        }
]

Create bookmarks

POST http://IPaddress:port/prefix/archive/contents/bookmarks/create

The request body must contain the JSON with the begins_at, ends_atcomment, is_protectedendpoint and storage_id parameters (see Get bookmarks from archive):

[
	{
		"begins_at":"20190226T102523.000",
		"comment":"text",
		"ends_at":"20190226T102646.000",
		"is_protected":true, 
		"endpoint":"hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0",
		"storage_id":"hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage"
	}
]

JSON for creating a group bookmark:

[
	{
		"begins_at":"20190226T102523.000",
		"comment":"text",
		"ends_at":"20190226T102646.000",
		"is_protected":true, 
		"endpoint":"hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0",
		"storage_id":"hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage"
	},
	{   "endpoint":"hosts/Server1/DeviceIpint.2/SourceEndpoint.video:0:0",
		"storage_id":"hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage"
	}
]

A group bookmark will be linked to several cameras, however the begins_at, ends_atcomment and is_protected parameters are taken from the first array of elements.

Attention!

A group bookmark in a GET request (see Get bookmarks from archive) will look like several bookmarks with different endpoint and storage_id parameters.

To edit a group bookmark (see Edit bookmarks), it is necessary to edit all single bookmarks at the same time, and make sure that all their other parameters except endpoint and storage_id match.

Delete video from archive

DELETE http://IP-Address:port/prefix/archive/contents/bookmarks/
ParametrRequiredDescription
begins_atYesParameters must strictly match the created bookmark (see Get bookmarks from archive).
ends_atYes
storage_idYes
endpointYes

The bookmark itself will not be deleted.

Sample request:

DELETE http://127.0.0.1:80/archive/contents/bookmarks/?begins_at=20190320T114213.645&ends_at=20190320T114700.481&storage_id=hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage&endpoint=hosts/Server1/DeviceIpint.7/SourceEndpoint.video:0:0


Archive search

General interface

Search request

Search by one source

Method: POST http://IP-Address:port/prefix/search/{auto|face|vmda|stranger|heatmap}/{DETECTORID}/{BEGINTIME/ENDTIME}

  • auto|face|vmda|stranger|heatmap – search type. The request body must include the "query" function if "vmda" search type is used (see Forensic Search MomentQuest (VMDA) API).
  • DETECTORID – endpoint detection tool ternary ID (HOSTNAME/AVDetector.ID/EventSupplier for auto and face search, HOSTNAME/AVDetector.ID/SourceEndpoint.vmda for vmda, see Get list of detection tools).

Note

The ENDTIME and BEGINTIME syntax is described in Get archive contents section.

A request for search on a single computer is also supported for auto and face search, the request structure is as follows:

http://localhost/prefix/search/(auto|face)/{HOSTNAME}/{BEGINTIME}/{ENDTIME}

HOSTNAME – Server name.

Search by multiple sources

Method: POST http://IP-Address:port/prefix/search/{auto|face|vmda|stranger|heatmap}/{BEGINTIME/ENDTIME}

This search type always accepts JSON in the POST body that is to include at least one section of the form:

"sources": [
		"hosts/AVDetector.1/EventSupplier"
	]

When the search request is performed, JSON is to include image in base64 format.

{
	"sources": [
					"hosts/AVDetector.1/EventSupplier",
					"hosts/AVDetector.2/EventSupplier"
			],
    "image" : "base64 encoded image"
}

Result

The request will return either error or response like:

HTTP/1.1 202 Accepted
Connection: Close
Location: /search/(auto|face|vmda|stranger|heatmap)/GUID 
Cache-Control: no-cache

Receiving the Accepted code does not guarantee successful execution of the search. This code only shows that the command has been taken to process.

ParameterDescription
LocationIdentifier for future access to search results. Example: /search/vmda/3dc15b75-6463-4eb1-ab2d-0eb0a8f54bd3

Error codes:

Error codeDescription
400Incorrect request.
500Internal Server error.

Search results request

GET http://IP-Address:port/search/{auto|face|vmda|stranger|heatmap}/{GUID}/result

The /search/(auto|face|vmda)/GUID part is a result of the POST command (see Search request).

ParameterRequiredDescription
limitNoMaximum number of events returned by the request. uint32_t::max() by default.
offsetNoResults offset by the specified number. For example, if a query with offset=0 returned 100 results, then in order to get the next results, it is necessary to run a query with offset=100. If the second query returned 250 results, then in order to get the next results, it is necessary to run a query with offset=350, etc.

Sample request:

http://127.0.0.1:80/search/face/49ded146-3912-4a2f-8e70-6ecfbcdacdea/result?offset=0&limit=10

Returned result depends on the search type.

The request can return two successful statuses:

StatusDescription
206Search is not over. Repeat search results requests until status code 200 is returned. Set delays between repeated requests in order to reduce computational burden.
200Search is over.

Error codes:

ErrorDescription
400Incorrect request.
404The offset value is greater than current quantity of results or requested search ID (GUID) not found.

Search completion

Method: DELETE http://IP-Address:port/search/(auto|face|vmda)/GUID

The /search/(auto|face|vmda)/GUID part is a result of the POST command (see Search request).

The command terminates the search operation and deallocates resources. Search results are not available after it is executed.

Error codes:

ErrorDescription
400Incorrect request


Face search API

The POST request (see Search request) used for search start must contain binary data of searched face in jpеg format.

Note

All face detection triggerings are stored in the t_json_event database table.

The t_face_vector table stores the vectors of faces recognized by the detection tool.

The t_face_listed table stores the face images added to the list of people.

ParameterRequiredDescription
accuracyNo

The accuracy parameter is a recognition rate from range [0, 1] (1 – complete match). This parameter is specified additionally in the search line or in the request body. Otherwise, the default value 0.9 will be used.

Attention!

The parameter value specified in the request body has higher priority.

Attention!

If the body of the POST request is empty, then the search will return all the results for the recognized faces. The accuracy parameter value in this case will be 0.

Sample request:

POST http://127.0.0.1:80/search/face/SERVER1/AVDetector.2/EventSupplier/past/future?accuracy=0.7

GET http://127.0.0.1:80/search/face/2e69ba76-23f1-4d07-a812-fee86e994b8e/result

Sample response:

{
   "events" : [
      {
         "accuracy" : 0.90591877698898315,
         "origin" : "hosts/SERVER1/DeviceIpint.2/SourceEndpoint.video:0:0", "position" : {
         "bottom" : 0.10694444444444445, "left" : 0.69687500000000002, "right" : 0.74687500000000007, "top" : 0.018055555555555554
      },
      "timestamp" : "20160914T085307.499000"
      },
      {
         "accuracy" : 0.90591877698898315,
         "origin" : "hosts/SERVER1/DeviceIpint.2/SourceEndpoint.video:0:0", "position" : {
         "bottom" : 0.10694444444444445, "left" : 0.69687500000000002, "right" : 0.74687500000000007, "top" : 0.018055555555555554
      },
         "timestamp" : "20160914T085830.392000"
      }
   ]
}
ParameterDescription
originСamera channel to take analyzed video stream from.
timestampTime stamp of a video frame with a face detected by the detection tool.
accuracyRecognition accuracy ranged [0,1], with 1 corresponding to full match.
positionCoordinates of a frame border enclosing face on a video frame.

LPR search API

The POST request (see Search request) used for search start must contain the following JSON:

{
   "plate": "mask"
}

The plate parameter sets a search mask. The mask format corresponds to the one used in GUI (see LPR search).

Attention!

If the body of POST request is empty, then the search will return all the results for the recognized license plates.

ParameterRequiredDescription
result_typeNo

result_type=full means detailed response

Sample request:

POST http://127.0.0.1:80/search/auto/SERVER1/AVDetector.2/EventSupplier/past/future?result_type=full or POST http://127.0.0.1:80/search/auto/SERVER1/AVDetector.2/EventSupplier/past/future

GET http://127.0.0.1:80/search/auto/2e69ba76-23f1-4d07-a812-fee86e994b8e/result

Sample response:

      {
         "origin": "hosts/SERVER1/DeviceIpint.3/SourceEndpoint.video:0:0",
         "plates": [
            "A035AF95"
         ],
         "position": {
            "bottom": 0.86805555555555558,
            "left": 0.31805555555555554,
            "right": 0.49027777777777776,
            "top": 0.81944444444444442
         },
         "timestamp": "20190912T105500.925000"
}
ParameterDescription
originCamera channel to take analyzed video stream from
timestampTime stamp of a frame with a license plate detected by the detection tool
platesList of supposed hypotheses
positionCoordinates of the recognized LP frame

Detailed response:

{
   "events" : [
      {
         "Direction" : 0,
         "Hypotheses" : [
            {
               "OCRQuality" : 50,
               "PlateCountry" : "us",
               "PlateFull" : "A035AF95",
               "PlateRectangle" : [
                  0.40104166666666669,
                  0.52941176470588236,
                  0.45000000000000001,
                  0.55147058823529416
               ],
               "TimeBest" : "20180730T094220.010000"
            },
            {
               "OCRQuality" : 32,
               "PlateCountry" : "us",
               "PlateFull" : "*E733X*9",
               "PlateRectangle" : [
                  0.40104166666666669,
                  0.52941176470588236,
                  0.45000000000000001,
                  0.55147058823529416
               ],
               "TimeBest" : "20180730T094220.010000"
            },
            {
               "OCRQuality" : 38,
               "PlateCountry" : "us",
               "PlateFull" : "E733XA***",
               "PlateRectangle" : [
                  0.40104166666666669,
                  0.52941176470588236,
                  0.45000000000000001,
                  0.55147058823529416
               ],
               "TimeBest" : "20180730T094220.010000"
            }
         ],
         "TimeBegin" : "20180730T094219.610000",
         "TimeEnd" : "20180730T094220.050000",
         "detector_type" : "plateRecognized",
         "origin_id" : "hosts/Server1/DeviceIpint.2/SourceEndpoint.video:0:0",
         "phase" : 0,
         "timestamp" : "20180730T094220.010000",
         "ts_vector_body" : "E733XA97 EZERZER 7ONEZER 3TWOZER 3THRZER XFOUZER AFIVZER 9SIXZER 7SEVZER 8LENGTHZER *E733X*9 *ZERONE EONEONE 7TWOONE 3THRONE 3FOUONE XFIVONE *SIXONE 9SEVONE 8LENGTHONE E733XA*** EZERTWO 7ONETWO 3TWOTWO 3THRTWO XFOUTWO AFIVTWO *SIXTWO *SEVTWO *EIGTWO 9LENGTHTWO"
      },

Sample request to receive events via Web-Socket:

ws://root:root@localhost/events?schema=proto

ParameterDescription
schemaschema=proto means detailed response

Sample detailed response:

{
    "objects": [
        {
            "body": {
                "@type": "type.googleapis.com/Grundig.bl.events.DetectorEvent",
                "details": [
                    {
                        "autoRecognitionResultEx": {
                            "direction": {
                                "value": "Outgoing"
                            },
                            "headlightsStatus": {
                                "value": "Disabled"
                            },
                            "hypotheses": [
                                {
                                    "country": "Denmark",
                                    "ocrQuality": 99,
                                    "plateFull": "CJ97139",
                                    "plateRectangle": {
                                        "h": 0.03703703703703709,
                                        "w": 0.067708333333333315,
                                        "x": 0.31302083333333336,
                                        "y": 0.96296296296296291
                                    },
                                    "plateState": "NA",
                                    "timeBest": "20230623T124816.295000"
                                }
                            ],
                            "plateType": {
                                "value": "EUnitedNations"
                            },
                            "timeBegin": "2023-06-23T12:48:16.295Z",
                            "timeEnd": "2023-06-23T12:48:16.295Z",
                            "vehicleBrand": {
                                "value": "Mercedes Benz"
                            },
                            "vehicleClass": {
                                "value": "Car"
                            },
                            "vehicleColor": {
                                "value": "Gray"
                            },
                            "vehicleModel": {
                                "value": "GLS Klasse"
                            }
                        }
                    },
                    {
                        "autoRecognitionResult": {
                            "direction": "Outgoing",
                            "headlightsStatus": "Disabled",
                            "hypotheses": [
                                {
                                    "country": "Denmark",
                                    "ocrQuality": 99,
                                    "plateFull": "CJ97139",
                                    "plateRectangle": {
                                        "h": 0.03703703703703709,
                                        "w": 0.067708333333333315,
                                        "x": 0.31302083333333336,
                                        "y": 0.96296296296296291
                                    },
                                    "plateState": "NA",
                                    "timeBest": "20230623T124816.295000"
                                }
                            ],
                            "plateType": "EUnitedNations",
                            "timeBegin": "20230623T124816.295000",
                            "timeEnd": "20230623T124816.295000",
                            "vehicleBrand": "Mercedes Benz",
                            "vehicleClass": "Car",
                            "vehicleColor": "Gray",
                            "vehicleModel": "GLS Klasse"
                        }
                    }
                ],
                "detectorDeprecated": "hosts/TEST/AVDetector.1/EventSupplier",
                "detectorExt": {
                    "accessPoint": "hosts/TEST/AVDetector.1/EventSupplier",
                    "friendlyName": "1.\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 (RR)"
                },
                "detectorsGroup": [
                    "DG_LPR_DETECTOR"
                ],
                "eventType": "plateRecognized",
                "guid": "d6650759-e89b-43dd-a610-459a6e421ccc",
                "nodeInfo": {
                    "friendlyName": "TEST",
                    "name": "TEST"
                },
                "originDeprecated": "hosts/TEST/DeviceIpint.1/SourceEndpoint.video:0:0",
                "originExt": {
                    "accessPoint": "hosts/TEST/DeviceIpint.1/SourceEndpoint.video:0:0",
                    "friendlyName": "1.\u041a\u0430\u043c\u0435\u0440\u0430"
                },
                "timestamp": "20230623T124816.295000"
            },
            "eventName": "Grundig.bl.events.DetectorEvent",
            "eventType": "ET_DetectorEvent",
            "localization": {
                "text": "\u041a\u0430\u043c\u0435\u0440\u0430 \"1.\u041a\u0430\u043c\u0435\u0440\u0430\". \u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440\u0430 \"1.\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 (RR)\", \u041d\u043e\u043c\u0435\u0440 \"CJ97139\", \u0441\u0442\u0440\u0430\u043d\u0430 \"Denmark\", \u043a\u043b\u0430\u0441\u0441 \"\u0410\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\", \u0446\u0432\u0435\u0442 \"Gray\", \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \"Mercedes Benz\", \u043c\u043e\u0434\u0435\u043b\u044c \"GLS Klasse\", \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0444\u0430\u0440 \"\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u044b\" \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f: \u0422\u0438\u043f \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440\u0430 = \"\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440\""
            },
            "requiredPermissions": {
                "requiredObjectPermissions": [
                    {
                        "accessPoint": "hosts/TEST/DeviceIpint.1/SourceEndpoint.video:0:0",
                        "cameraAccess": "CAMERA_ACCESS_ONLY_ARCHIVE"
                    }
                ]
            },
            "subjects": [
                "hosts/TEST/DeviceIpint.1/SourceEndpoint.video:0:0",
                "hosts/TEST/AVDetector.1/EventSupplier"
            ]
        }
    ]
}
ParameterDescription
vehicleBrandVehicle manufacturer
vehicleClassVehicle class
vehicleColorVehicle color
vehicleModelVehicle model

Forensic Search MomentQuest (VMDA) API

The POST request (see Search request) for search start must contain JSON of one of the following types:
  1. Constructor describing parameters for metadata database request.

    There are three logical parts of the search request:

    1. Request type (queryType, see Types of requests and their parameters).

    2. Parameters specific for the specified type of request (figures, queryProperties, see Additional conditions).

    3. Additional filter conditions (objectProperties, conditions, see Additional conditions).

  2. Direct request in metadata database language.

    {
     "query": "figure fZone=polygon(0.4647676,0.3973333,0.7946027,0.5493333,0.8650675,0.7946666,0.4647676,0.7946666); figure fDir=(ellipses(-10000, -10000, 10000, 10000) -        ellipses(-0, -0, 0, 0));set r = group[obj=vmda_object] { res = or(fZone((obj.left + obj.right) / 2, obj.bottom)) }; result = r.res;"
    }

Important!

If input JSON has both the constructor and the direct request sections, the direct request has higher priority.

Important!

If the body of POST request is empty, then the search will return all alarm intervals.

Note

To perform search in offline analytics data, use the following request:

POST /search/vmda/SERVER-NAME/OfflineAnalytics.c95ad5a581094845995ee28a7f097797/SourceEndpoint.vmda:AVDetector:1/past/future

This request will be performed even if C-Werk archive is removed, but VMDA metadata is saved.

Object ID is to be specified without the hosts/ prefix.

Valid request: /search/vmda/SERVER-NAME/OfflineAnalytics...

Invalid request: /search/vmda/hosts/SERVER-NAME/OfflineAnalytics...

The search result is the following JSON response:

{
	"intervals" : [
		{
			"endTime" : "20210228T124302.313000",
			"positions" : [
				{ 
					"bottom" : 0.60026908397674561, 
					"left" : 0.42527302742004397, 
					"right" : 0.48125132560729983, 
					"top" : 0.50307014942169193 
				}
							],
			"startTime" : "20210228T124256.673000"
		},
		{
			"endTime" : "20210228T124259.513000",
			"positions" : [
				{ 
					"bottom" : 0.45109353065490726, 
					"left" : 0.41891927719116212, 
					"right" : 0.4565316200256348, 
					"top" : 0.34989043235778811 }
							],
				"startTime" : "20210228T124256.673000"
				}
					]
}

where Intervals is a set of time intervals for which the search condition is fulfilled.


Additional conditions

Types of requests and their parameters

'Familiar face'-'stranger' face search API

This search type compares every recognized face with all faces in the camera database over 30 days (or for the current archive depth if it is less than 30 days) and sets the number of days over which this face was recognized by the camera. The search decides if this is a “familiar face” or a “stranger” by the specified criteria.

The POST request is used for search start (see Search request), search type is stranger, request body is empty.

The following parameters are available:

ParameterRequiredDescription
accuracyNo

Sets face similarity level in the range [0,1] (1 means complete match). If this parameter is not set, then the default value (0.9) is in use. If the compared face was in the camera field of view on a specific day and it was recognized with accuracy that is not less than specified one, then this face is considered to be present on that day. Otherwise, the algorithm considers this face was absent on that day. 

Important!

The accuracy parameter value can also be specified in the request body. In this case, it has higher priority over the value specified in the search line.

thresholdNo

Defines the threshold value to recognize a face as a “stranger”. The value is set in the range from 0 to 1 and it defines the number of days within which the face was absent to be considered as a “stranger”: 30-30*threshold. For instance, the value 0.8 means “the required object appeared in the search area within (30 - 30 * 0.8 = 6) days”. All faces that appeared within 6 and more days will be defined as “familiar faces”, others – as “strangers”.

Important!

The threshold and op parameters should only be used together. If any of parameters is not set or has incorrect value, then both parameters will be ignored.

opNoDefines search direction.
Allowable values:
lt – “familiar face” search (based on threshold parameter).
gt – “stranger” search.

Sample request:

POST http://127.0.0.1:80/search/stranger/SERVER1/AVDetector.2/EventSupplier/past/future?accuracy=0.7

GET http://127.0.0.1:80/search/stranger/2e69ba76-23f1-4d07-a812-fee86e994b8e/result

Sample response:

{
   "events" : [
      {
         "rate" : 0.90591877698898315,
         "origin" : "hosts/SERVER1/DeviceIpint.2/SourceEndpoint.video:0:0",
         "position" : {
            "bottom" : 0.10694444444444445,
            "left" : 0.69687500000000002,
            "right" : 0.74687500000000007,
            "top" : 0.018055555555555554
         },
         "timestamp" : "20160914T085307.499000"
      },
      {
         "rate" : 0.90591877698898315,
         "origin" : "hosts/SERVER1/DeviceIpint.2/SourceEndpoint.video:0:0",
         "position" : {
            "bottom" : 0.10694444444444445,
            "left" : 0.69687500000000002,
            "right" : 0.74687500000000007,
            "top" : 0.018055555555555554
         },
         "timestamp" : "20160914T085830.392000"
      }
}
ParameterDescription
originCamera channel to take analyzed video stream from.
timestampTime stamp of a frame with a face detected by the detection tool.
rateRate of identifying a face as a “stranger”, the value in the [0,1] range. 1 means a complete stranger.
positionCoordinates of a frame border enclosing face on a video frame.

Define 'familiar face'-'stranger' attribute from image


The body of POST request used for search start must contain binary data of searched face in jpеg format. The request itself can be represented in two ways:

  1. POST http://IP-Address:port/prefix/faceAppearanceRate/{DETECTORID}/{BEGINTIME}/{ENDTIME}

    DETECTORID – endpoint detection tool ternary ID (HOSTNAME/AVDetector.ID/EventSupplier for auto and face search, HOSTNAME/AVDetector.ID/SourceEndpoint.vmda for vmda, see Get list of detection tools).

    Note

    The ENDTIME and BEGINTIME syntax is described in Get archive contents section.

  2. POST http://IP-Address:port/prefix/faceAppearanceRate/{HOSTNAME}/{BEGINTIME}/{ENDTIME}

    HOSTNAME – Server name.

ParameterRequiredDescription
accuracyNoDetection accuracy in the range [0,1] (1 means complete match). If this parameter is not set, then the default value (0.9) is in use.

Sample request:

POST http://127.0.0.1:80/faceAppearanceRate/SERVER1/AVDetector.2/EventSupplier/past/future?accuracy=0.7

Sample response:

{
  "rate": 0.13333334028720856
}
ParameterDescription
rateRate of identifying a face as a “stranger”, the value in the [0,1] range. 1 means a complete stranger.


Heat Map API

POST http://IP-address:port/prefix/search/heatmap/{DETECTORID}/{BEGINTIME}/{ENDTIME}

DETECTORID – endpoint detection tool ternary ID (HOSTNAME/AVDetector.ID/EventSupplier for auto and face search, HOSTNAME/AVDetector.ID/SourceEndpoint.vmda for vmda, see Get list of detection tools).

Note

ENDTIME, BEGINTIME is the time in ISO format; it specifies the Heat Map interval.

The ENDTIME and BEGINTIME syntax is described in Get archive contents section.

The request body may contain the size of the searched image:

{
 "mask_size":{
            "height":1080,
            "width":1920
            }
}

Sample request:

POST http://127.0.0.1:80/search/heatmap/SERVER1/AVDetector.2/SourceEndpoint.vmda/past/future

GET http://127.0.0.1:80/search/heatmap/35ff5989-42ee-4446-bfde-f91375df67d3/result

where 35ff5989-42ee-4446-bfde-f91375df67d3 is the GUID from the Location field of the response.

Sample response:

Access-Control-Allow-Origin →*
Cache-Control →no-cache
Connection →Close
Location →/search/heatmap/35ff5989-42ee-4446-bfde-f91375df67d3

Calendar search API

Get a list of the calendar days when the video was recorded

GET http://IP-Address:port/prefix/archive/calendar/{VIDEOSOURCEID}/{BEGINTIME}/{ENDTIME}

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

Note

The ENDTIME and BEGINTIME syntax is described in Get archive contents.

ParameterRequiredDescription
archiveNoThe name of the archive in the "hosts/SERVER1/MultimediaStorage.AliceBlue/MultimediaStorage" format (see Get archive contents). If the value is not specified, the default archive will be used for searching

Request example:

GET http://127.0.0.1/archive/calendar/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0/20211028T120000/20211102T210000

Response example:

[
    3844368000000,
    3844454400000,
    3844540800000,
    3844627200000,
    3844713600000,
    3844800000000
]

The response is presented as calendar days in milliseconds. They are counted from January 1, 1900, 0 hours 0 minutes. In this example, the days are from October 28 to November 02, 2021.

Content

  • No labels