Skip to main content
Skip table of contents

Получить диaпазоны DVR: Stream.Dvr.Ranges

Метод и параметры

Метод Stream.Dvr.Ranges позволяет получить диапазоны DVR каждого потока, где осуществлялась запись.

string Stream.Dvr.Ranges(CamerasObject camerasunsigned ttl)

Параметры

CamerasObject cameras REQUIRED – список камер

object CamerasObject

array cameras.camera-uid-0 = ["0", "1"] – диапазоны для camera-uid-0.


array cameras.camera-uid-1 = ["2", "3"] – диапазоны для camera-uid-1.


unsigned ttl – время, в течении которого будет доступен диапазон. Если указан 0, то время жизни не ограничивается.

POST /api/

JSON-RPC
JSON
{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Ranges",
    "params": {
        "cameras": {
            "camera-uid-0": [
                "0",
                "1"
            ],
            "camera-uid-1": [
                "2",
                "3"
            ]
        },
        "ttl": 0
    },
    "id": 1
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/' \
	--header 'Content-Length: 315' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--header 'Authorization: Bearer <api-authorization-token>' \
	--header 'Content-Length: <Длина данных>' \
	--data '{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Ranges",
    "params": {
        "cameras": {
            "camera-uid-0": [
                "0",
                "1"
            ],
            "camera-uid-1": [
                "2",
                "3"
            ]
        },
        "ttl": 0
    },
    "id": 1
}'
PHP
PHP
$data = array (
  'jsonrpc' => '2.0',
  'method' => 'Stream.Dvr.Ranges',
  'params' => 
  array (
    'cameras' => 
    array (
      'camera-uid-0' => 
      array (
        0 => '0',
        1 => '1',
      ),
      'camera-uid-1' => 
      array (
        0 => '2',
        1 => '3',
      ),
    ),
    'ttl' => 0,
  ),
  'id' => 1,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json\r
Authorization: Bearer <api-authorization-token>\r
Content-Length: <Длина данных>",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/', false, $context);

200 OK

Список объектов с началом и окончанием диапазона архива потока

JSON
[
    "<stream-uid-1>",
    "<stream-uid-N>"
]

400 Bad Request

Ошибка json-rpc

JSON
{
    "error": {
        "code": -32601,
        "message": "Method not found"
    }
}

500 Internal Server Error

Ошибка сервера

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.