Skip to main content
Skip table of contents

GetStreamInfo

Получить информацию о потоке

GET /api/streams/{stream-uid}/
Body
stream-uidoptional
uid
Уникальный идентификатор виртуальной камеры {@hint:uid}
tokenrequired
string
Токен авторизации API запросов. см. Mediaserver/Web API/Authorization/CreateApiToken
Response
200
Возвращает JSON объект с информацией о потоке
JSON
{
                "camera_uid": "stream-uid",
                "status": "active",
                "type": "primary",
                "enabled": true,
                "access": "private",
                "stream_name": "stream-uid",
                "uid": "stream-uid",
                "whitelist": "",
                "config": {
                    "file": "/opt/sn/media-server/streams/stream-uid.ini",
                    "source": "CONFIGURATION PARAMETERS OF STREAM"
                },
                "dvr": {
                    "storage": "/storage/",
                    "on-demand": false,
                    "record_to": 1676481440,
                    "duration_archive": 86400,
                    "enable": true,
                    "storage_path": "/storage/stream-uid/",
                    "records_path": "/storage/stream-uid/records/",
                    "record_duration": 86400,
                    "ranges_count": 80,
                    "pause": false,
                    "duration_chunk": 120,
                    "record_from": 1676395040,
                    "ranges_memory": 2560
                },
                "source": {
                    "ping": 54,
                    "sdp": "{SDP PARAMETERS}",
                    "url": "rtsp://admin:admin@192.168.7.34:554/Streaming/Channels/101"
                },
                "entry": "stream",
                "tracks": {
                    "video": {
                        "track_id": "trackID=video",
                        "clock_rate": 90000,
                        "codec": "H264",
                        "pt": 96,
                        "sps": 50,
                        "level": "5",
                        "width": 2688,
                        "pps": 4,
                        "height": 1520,
                        "profile": "Main",
                        "vps": 0,
                        "proto": "RTP/AVP"
                    },
                    "enabled": [
                        "video",
                        "audio"
                    ],
                    "audio": {
                        "proto": "RTP/AVP",
                        "clock_rate": 8000,
                        "codec": "PCMU",
                        "track_id": "trackID=audio",
                        "bitspersample": 8,
                        "pt": 0,
                        "channels": 1
                    }
                },
                "cluster": {
                    "node-id": 111,
                    "secondaries": [
                        "node-host-2"
                    ],
                    "primary": "node-host-1",
                    "cluster-id": 100
                },
                "limit": 0,
                "broadcast": {
                    "urls": {
                        "hls_live_ios": {
                            "url": "https://node-host-1:8443/live/stream-uid/playlist_ios.m3u8",
                            "name": "Live HLS (iOS)",
                            "args": {}
                        },
                        "hls_dvr": {
                            "url": "https://node-host-1:8443/dvr/stream-uid/playlist_ios.m3u8",
                            "name": "DVR HLS",
                            "args": [
                                "timestamp",
                                "duration",
                                "time"
                            ]
                        },
                        "rtsp_dvr": {
                            "url": "rtsp://node-host-1:5554/dvr/stream-uid/",
                            "name": "DVR RTSP",
                            "args": [
                                "timestamp",
                                "duration",
                                "time",
                                "speed"
                            ]
                        },
                        "preview": {
                            "url": "https://node-host-1:8443/live/stream-uid/preview.mp4",
                            "name": "Preview (mp4)",
                            "args": {}
                        },
                        "hls_live": {
                            "url": "https://node-host-1:8443/live/stream-uid/playlist.m3u8",
                            "name": "Live HLS",
                            "args": {}
                        },
                        "rtsp_live": {
                            "url": "rtsp://node-host-1:5554/live/stream-uid/",
                            "name": "Live RTSP",
                            "args": {}
                        },
                        "hls_dvr_ios": {
                            "url": "https://node-host-1:8443/dvr/stream-uid/playlist_ios.m3u8",
                            "name": "DVR HLS (iOS)",
                            "args": [
                                "timestamp",
                                "duration",
                                "time"
                            ]
                        },
                        "export": {
                            "url": "https://node-host-1:8443/dvr/stream-uid/record.mp4",
                            "name": "DVR export (mp4)",
                            "args": [
                                "timestamp",
                                "duration",
                                "time"
                            ]
                        },
                        "screenshot": {
                            "url": "https://node-host-1:8443/dvr/stream-uid/screenshot.mp4",
                            "name": "Screenshot (mp4)",
                            "args": [
                                "timestamp",
                                "time"
                            ]
                        }
                    },
                    "proto": [
                        "rtsp",
                        "hls"
                    ],
                    "paused": false
                },
                "reconnect": {
                    "attempts": 500,
                    "delay": 1800,
                    "timeout": 10
                },
                "stats": {
                    "reconnect_attempt": 0,
                    "clients_count": 0,
                    "ping_time": 1676481439,
                    "start_time": 1676480352,
                    "bitrate_in": 213432,
                    "reconnect_time": 0,
                    "reconnect_total": 68,
                    "bitrate_out": 0,
                    "bytes_in": 6374841007
                }
            }
404
Камера с таким UID не найдена
403
Ошибка авторизации. Неверный или отсутствует токен доступа к API см. Mediaserver/Web API/Authorization/CreateApiToken

primary - Первичный поток (основной), медиасервер всегда захватывает этот поток secondary - Вторичный поток, медиасервер является резервным этого потока. Если основной серевер станет недоступен, то вторичный сервер начнет захват этого потока.

Пример
JSON
curl -k --location --request GET 'https://localhost:8080/api/streams/{stream-uid}/?token=string'
JavaScript errors detected

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

If this problem persists, please contact our support.