Skip to main content
Skip table of contents

Генерация видеозаписи

Генерация видеозаписи

Видеозапись (архив) будет создана сразу и возвращена в ответе, далее асинхронно будет осуществлено скачивание части архива.

Ссылка на скачивание архива придет в пуше по Вебсокеты с типом archive_generated

Архив будет доступен для скачивания 3 часа и далее будет удален, для повторного скачивания использовать

POST /api/admin/v1/downloads

Параметры метода

Необходимые данные для генерации
JSON
{
    "to":"2023-03-20T13:05:49Z",
    "from":"2023-03-20T13:00:49Z",
    "camera_id":1
}

string from, дата, от которой будет генерироваться архив


string to, дата, до которой будет генерироваться архив


int camera_id, id камеры, по которой будет генерироваться архив

200 OK

Успешный ответ

JSON
{
    "name": "г. Город, ул. Улица 1, file.mp4",
    "type": "mp4",
    "url": "http://127.0.0.1:8080/storage/",
    "from": "2019-09-20 16:13:20",
    "to": "2019-09-20 16:22:27",
    "created_at": "2019-09-20T17:00:00.000000Z",
    "updated_at": "2023-02-10T15:09:25.000000Z",
    "is_file_exists": true,
    "stream": {
        "id": 1,
        "type": "high",
        "camera_id": 1,
        "status": null,
        "url": "rtsp://admin:456redko@192.168.204.13:554/Streaming/Channels/101",
        "bitrate": null,
        "resolution": null,
        "output_rate": null,
        "ip": "192.168.204.13",
        "uuid": "fecb93a5-0c0e-4515-9115-633c45994b29",
        "sound": null,
        "streams_count": null,
        "created_at": "2023-02-03T08:29:06.000000Z",
        "updated_at": "2023-02-03T08:29:06.000000Z",
        "is_preview_from_server": true,
        "is_archive_from_server": null,
        "is_enabled": true,
        "is_can_transfer": true,
        "source": "manual",
        "is_sound_enabled": null,
        "reconnect_attempt": null,
        "reconnect_total": null,
        "reconnect_time": null,
        "disconnections_count": 0,
        "camera": {
            "id": 1,
            "group_id": 2,
            "status": "initial",
            "type": "media_server_v2",
            "start_at": null,
            "created_at": "2023-02-03T08:29:06.000000Z",
            "name": "Камера 1",
            "can_edit": true,
            "origin": null,
            "user_type": "individual",
            "shared_from": null,
            "ip": "192.168.204.13",
            "lat": null,
            "lng": null,
            "azimuth": null,
            "is_sensitive": 0,
            "is_public": 0,
            "is_ip_reserved": false,
            "count_issues": 0,
            "source": "manual",
            "archive_storage_days": null,
            "is_archive_recording": false,
            "archive_recording_type": "fulltime",
            "is_increased_reconnect": 0,
            "is_sound_enabled": true,
            "is_bridge": false,
            "can_change_archive_timetable": true,
            "is_auto_create_streams": false,
            "is_provisioning_enable": false,
            "is_can_manage_archive_storage_days": true,
            "is_editable": true,
            "status_changed_at": null,
            "is_intercom": false,
            "deleted_at": null
        },
        "is_actual": true,
        "condition": "active",
        "stopped_at": ""
    }
}

401 Unauthorized

Токен авторизации не передан или не валидный Получение токена

402 Payment Required

Ошибка лицензии

422 Unprocessable Entity

Возвращает JSON объект с ошибкой. Валидация

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/downloads' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "from": "string",
    "to": "string"
}'
PHP
PHP
$data = array (
  'from' => 'string',
  'to' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/downloads', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.