Core Concepts
Understanding the fundamental components of LiveGo will help you configure and use it effectively.
Streaming Model: Publisher and Players
LiveGo operates on a simple publisher-player model:
-
Publisher (Ingest): A client that sends a live video stream to the LiveGo server. This is typically done using the RTMP protocol. Common publishers include software like OBS Studio, FFmpeg, or hardware encoders.
-
LiveGo Server (Transmuxing): The server receives the incoming stream (e.g., RTMP). It doesn't re-encode the video (transcoding), but it repackages it into different container formats (transmuxing) to serve various players. For example, it takes the H264 video and AAC audio from an FLV container (via RTMP) and puts them into TS segments for HLS delivery.
-
Players (Egress): Clients that connect to the LiveGo server to watch the live stream. Players can connect using different protocols like RTMP, HTTP-FLV, or HLS, depending on their capabilities and latency requirements.
Supported Protocols Explained
RTMP (Real-Time Messaging Protocol)
- Role: Primarily used for ingesting streams from encoders to the server.
- Characteristics: RTMP is a TCP-based protocol designed for low-latency streaming. It's the de-facto standard for professional encoders and streaming software.
- In LiveGo: The RTMP server listens on port
1935
by default and is the entry point for your live broadcasts.
HTTP-FLV
- Role: Used for delivering low-latency streams to players, especially in web browsers.
- Characteristics: It works by streaming an FLV file over a persistent HTTP connection. This method achieves latency comparable to RTMP but is more firewall-friendly as it uses standard HTTP ports.
- In LiveGo: The HTTP-FLV server listens on port
7001
by default. It's an excellent choice for web-based players likeflv.js
.
HLS (HTTP Live Streaming)
- Role: Used for delivering adaptive bitrate streams with high compatibility.
- Characteristics: HLS works by breaking the stream into small video chunks (MPEG-TS files) and serving them over HTTP with a playlist file (
.m3u8
). It's supported natively on almost all modern devices (iOS, Android, macOS, Windows, and web browsers). Its main drawback is higher latency (typically 10-30 seconds) due to the chunk-based nature. - In LiveGo: The HLS server listens on port
7002
by default.
Stream Identification
A stream in LiveGo is identified by a URL structure, typically /{appname}/{streamname}
.
appname
: An application name to group streams. The default islive
.streamname
: The unique name for a specific stream, likemovie
orevent1
.
For publishing, a unique and secret channelkey
is used instead of the streamname
to prevent unauthorized streaming. The API maps this secret channelkey
back to the public streamname
for playback.