API Reference: Live Streaming
Endpoint untuk menonton stream lewat HTTP-TS, melihat stream dan koneksi klien, serta registrasi publisher RTMP bertoken.
← Kembali ke Live Streaming
Protokol keluaran, otentikasi RTMP, transcode on-demand.
Devices
Endpoint untuk mendaftarkan sumber stream.
Liodra tidak memiliki otentikasi API sendiri; batasi akses port 9080 di tingkat jaringan atau reverse proxy. Basis URL memakai variabel LIODRA_API_URL (default http://localhost:9080). Endpoint di halaman ini aktif pada semua konfigurasi (tidak bergantung flag fitur).
Menonton
Tonton Stream Live (HTTP-TS)
Path Parameters
{app}/{name}, mendukung app bertingkat (live/hls/camera_01) dan VoP (vop/youtube/youtube_test).
Query Parameters
true/1 mengaktifkan transcode HEVC ke H.264. Diabaikan untuk stream H.264.
Response Body
video/mp2t
application/json
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/play/ts/live/camera_front?transcode=true""string"{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Failed to connect to media engine"}{ "success": false, "error": "Too many on-demand streams, retry shortly", "details": "on-demand process limit reached (32/32 active)"}Stream dan Klien
Daftar Stream Aktif
Query Parameters
Indeks awal paginasi.
0Jumlah maksimum hasil.
10Response Body
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/streams"{ "success": true, "data": { "streams": [ { "app": "live", "name": "camera_front", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "clients": 1, "video": { "codec": "H264", "width": 1920, "height": 1080 } }, { "app": "vod", "name": "9876543210ab", "publish_url": "rtmp://127.0.0.1:1935/vod/9876543210ab?vhost=vod", "clients": 1, "video": { "codec": "HEVC", "width": 1920, "height": 1080 } } ] }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Daftar Klien
Response Body
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/clients"{ "success": true, "data": { "publishers": [ { "id": "54321", "vhost": "__defaultVhost__", "name": "camera_front", "stream": "vid-123456", "ip": "127.0.0.1", "type": "fmle-publish", "publish": true, "alive": 125.5, "app": "live", "play_url": "/api/v1/play/ts/live/camera_front?transcode=true", "send_bytes": 5000, "recv_bytes": 1000000, "kbps": { "recv_30s": 2500, "send_30s": 0 }, "device": { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "active" } } ], "subscribers": [ { "id": "98765", "vhost": "__defaultVhost__", "name": "camera_front", "stream": "vid-123456", "ip": "192.168.1.50", "type": "flv-play", "publish": false, "alive": 60, "app": "live", "play_url": "/api/v1/play/ts/live/camera_front?transcode=true", "send_bytes": 0, "recv_bytes": 500000, "kbps": { "recv_30s": 0, "send_30s": 1200 } } ] }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Detail Klien
Path Parameters
ID klien (lihat GET /api/v1/clients).
Response Body
application/json
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/clients/54321"{ "success": true, "data": { "client": { "id": "54321", "vhost": "__defaultVhost__", "name": "camera_front", "stream": "vid-123456", "ip": "127.0.0.1", "type": "fmle-publish", "publish": true, "alive": 125.5, "app": "live", "play_url": "/api/v1/play/ts/live/camera_front?transcode=true", "send_bytes": 5000, "recv_bytes": 1000000, "kbps": { "recv_30s": 2500, "send_30s": 0 }, "device": { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "active", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "message": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "last_seen": "2019-08-24T14:15:22Z", "error_count": 0, "restart_count": 0, "suspended": false, "uptime": "2h15m30s", "warning": "string", "srs_stream": { "id": "12345", "vhost": "__defaultVhost__", "app": "live", "name": "camera_front", "video": { "codec": "H264", "profile": "High", "level": "4.0" }, "audio": { "codec": "AAC", "sample_rate": 44100, "channels": 2 }, "clients": 3 } } } }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Putuskan Klien
curl -X DELETE "http://localhost:9080/api/v1/clients/54321"{ "code": 0}{ "code": 2049}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Otentikasi RTMP
Registrasi Publisher
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:9080/api/v1/register" \ -H "Content-Type: application/json" \ -d '{ "device_name": "lobby-cam-01", "channel": "live/mobile" }'{ "success": true, "data": { "device_name": "lobby-cam-01", "channel": "live/mobile", "rtmp_url": "rtmp://liodra.example.com:1935/live/mobile/lobby-cam-01?token=a1b2c3d4e5f60718293a4b5c6d7e8f90" }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Device already publishing"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Live Streaming
Menonton stream aktif lewat RTSP, RTMP, dan HTTP-TS, menerima publish RTMP dari luar dengan token, serta memantau koneksi klien.
Recordings & Playback
Cara Liodra merekam stream menjadi segmen DVR, menyajikan ketersediaan harian dan per jam, serta memutar atau mengunduh rekaman berdasarkan waktu.