Live Streaming Overview
Live Streaming
AntCDN lets you ingest a live stream via RTMP or SRT, transcode it in real-time, and deliver a low-latency HLS playlist to viewers worldwide through the edge network.
How It Works
Your encoder (OBS / FFmpeg / hardware) │ RTMP or SRT + stream key ▼ AntCDN ingest ─→ real-time transcoding ─→ global edge delivery │ HLS playlist https://worker.antcdn.net/live/<edgeId>/master.m3u8Core Concepts
| Concept | Description |
|---|---|
| Stream | A live stream resource tied to an environment. Has a name, quality preset, and state. |
| Stream Key | Secret token embedded in the ingest URL. Rotate it to invalidate an old encoder session. |
| Edge ID | Public identifier used in the playback URL — safe to expose to viewers. |
| State | idle → connecting → live → ended. Your app can poll GET /streams/{id} to track state. |
Quick Integration (3 steps)
1 — Create a stream
POST https://api.antcdn.net/v1/live-streamsAuthorization: Bearer <api-key>Content-Type: application/json
{ "name": "My Live Show", "quality": "standard", "lowLatency": false, "recording": false}The response contains:
streamId— your stable resource IDstreamKey— shown once. Store it securely; rotate to get a new one.ingest.rtmpUrl/ingest.srtUrl— server addresses for your encoderplayback.hlsUrl— the HLS master playlist URL to give to viewers
2 — Start your encoder
Point OBS (or any RTMP/SRT software) at the ingest URL with the stream key. See Encoder Setup for a step-by-step guide.
3 — Play the stream
<video src="https://worker.antcdn.net/live/{edgeId}/master.m3u8" controls></video>Or use any HLS-capable player. See Playback for player examples.
Stream States
| State | Meaning |
|---|---|
idle | Stream created, no encoder connected |
connecting | Encoder connected, transcoder warming up |
live | Stream is running, HLS segments available |
ended | Encoder disconnected, stream finished |
error | Unexpected failure |
Poll GET /streams/{streamId} every 3–5 seconds to track state transitions in your UI.