Skip to main content

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.m3u8

Core Concepts

ConceptDescription
StreamA live stream resource tied to an environment. Has a name, quality preset, and state.
Stream KeySecret token embedded in the ingest URL. Rotate it to invalidate an old encoder session.
Edge IDPublic identifier used in the playback URL — safe to expose to viewers.
Stateidle → 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-streams
Authorization: Bearer <api-key>
Content-Type: application/json
{
"name": "My Live Show",
"quality": "standard",
"lowLatency": false,
"recording": false
}

The response contains:

  • streamId — your stable resource ID
  • streamKey — shown once. Store it securely; rotate to get a new one.
  • ingest.rtmpUrl / ingest.srtUrl — server addresses for your encoder
  • playback.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

StateMeaning
idleStream created, no encoder connected
connectingEncoder connected, transcoder warming up
liveStream is running, HLS segments available
endedEncoder disconnected, stream finished
errorUnexpected failure

Poll GET /streams/{streamId} every 3–5 seconds to track state transitions in your UI.