跪拜 Guibai
← Back to the summary

SRS Replaces a Rack of Streaming Servers with One Binary

image.png

SRS is a domestically developed, open-source, high-performance streaming media server that supports protocols such as RTMP, WebRTC, HLS, HTTP-FLV, SRT, and GB28181. A single service meets the needs of live streaming, RTC, security surveillance, mini-programs, and other scenarios. This article quickly walks you through SRS's advantages, deployment methods, and production practices.

Anyone who has worked on live streaming businesses knows: pushing streams, transcoding, distribution, low latency, WebRTC, and surveillance access—every link can be a pitfall.

What's more troublesome is that different scenarios require different solutions.

Live streaming uses RTMP, interactive co-hosting uses WebRTC, surveillance requires GB28181, and mini-programs need HLS/HTTP-FLV.

The final result is:

Self-hosting means maintaining a pile of components.

Is there a solution where:

One server handles multi-protocol live streaming;

Latency is reduced to milliseconds;

It's free for commercial use, and you control the entire live streaming chain yourself?

The answer is what we're introducing today:

SRS (Simple Realtime Server).

A streaming media server developed by a domestic developer, open-sourced under the MIT license, and already validated in numerous live streaming, security surveillance, and RTC scenarios.

What is SRS

Many people encountering streaming media for the first time are intimidated by various terms:

RTMP, WebRTC, HLS, SRT, transcoding, CDN, media server...

It feels like building a live streaming platform requires setting up a whole "aviation system."

But in reality, what most businesses truly need is:

Someone to take the video stream from a camera or client and reliably push it to more users.

What SRS does is act as this "video traffic hub."

You can think of it as:

The Nginx of the video world.

Ordinary Nginx handles HTTP request forwarding.

SRS handles:

Problems that previously required multiple services can now be covered by a single SRS service.

Why SRS Became Popular?

One Service Handles 6 Major Protocols

Traditional live streaming architecture:

3fc43504cb59b6a73bf78a856b43bf1b.png

Maintenance costs are very high.

Traditional Nginx-RTMP:

Whereas SRS:

image.png

One core service connects the entire audio/video ecosystem.

MIT License, Free for Commercial Use

The biggest problem for many startup teams early on:

It's not that they lack the technology.

It's that they're afraid to use it.

Worried about:

SRS uses:

The MIT open-source license.

This means:

For startup teams:

What's saved isn't just server costs.

But also:

The human resource cost of developing streaming media infrastructure from scratch.

Strong Performance

Many people mistakenly believe:

Open source = poor performance.

SRS is exactly the opposite.

It has been heavily optimized for real-time audio/video scenarios.

In actual business:

A single machine can support:

Ten-thousand-level playback connections.

Of course, the final capacity depends on:

But for:

It can run at a very low cost.

Friendly Chinese Ecosystem

This point is very important.

Many foreign audio/video projects:

Have strong technology.

But:

SRS comes from a domestic team.

Advantages:

For domestic development teams:

When encountering problems, answers can be found quickly.

What Can SRS Do?

Self-built Live Streaming Platform

For example:

The traditional way:

Purchase cloud live streaming services.

Annual cost:

Tens of thousands to hundreds of thousands of yuan.

Using SRS:

Server costs are under your own control.

Real-time Co-hosting Interaction

The biggest upgrade for live streaming:

Is not playback.

It's interaction.

For example:

Using:

SRS + WebRTC

Achieves:

Hundred-millisecond level real-time interaction.

Security Surveillance Platform

Traditional cameras:

Heavily use the GB28181 protocol.

Previously:

Integration difficulty was very high.

Now:

Camera → GB28181 → SRS → Web Playback

Directly achieves:

WeChat Mini-Program Live Streaming

Mini-program live streaming typically requires:

SRS directly provides protocol output.

The backend only needs to:

Manage:

The media link is handed over to SRS.

SRS Minimal Deployment

The official provides a Docker one-click startup command:

docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \
    registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5

Push Stream Test

Using:

OBS / FFmpeg

Push stream address:

rtmp://your-server-IP/live/test

For example:

ffmpeg \
-re \
-i demo.mp4 \
-c copy \
-f flv \
rtmp://127.0.0.1/live/test

Playback:

Open http://IP:8080/players/srs_player.html and enter the following address in the URL, then click play.

HTTP-FLV:

http://IP:8080/live/test.flv

At this point:

A complete live streaming server is already up and running.

SRS Common Pitfall Guide

Cannot Play on Public Network

Reason:

Server ports are not open.

Need to open:

1935
1985
8080

Cloud server security group:

Must be checked.

CPU Suddenly Explodes

Reason:

Transcoding is enabled.

For example:

Input:

1080P

Output:

720P+480P+360P

CPU pressure is enormous.

Suggestion:

Unify the encoding format in advance.

What if a Single Machine Can't Handle the Load

Don't switch technologies immediately.

Optimize first:

Summary

Previously:

Building a live streaming platform.

Meant:

Buying cloud services.

Setting up complex architecture.

Investing heavily in R&D.

Now:

A single SRS.

Allows ordinary development teams to also have:

80ms low latency, one service supporting 6 major protocols, MIT free commercial use, ten-thousand-level concurrency capability.

This is the greatest value of SRS.

If you are working on:

Live streaming platforms, video conferencing, security platforms, mini-program live streaming, or internal enterprise audio/video systems,

SRS is worth adding to your technology selection list.

Comments

Top 1 from juejin.cn, machine-translated. The original thread is authoritative.

用户209098753339

Is there any difference between this and ZLMediaKit?