开源流媒体服务端
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Winlin 2e4014ae1c
Proxy: Support proxy server for SRS. v7.0.16 (#4158)
Please note that the proxy server is a new architecture or the next
version of the Origin Cluster, which allows the publication of multiple
streams. The SRS origin cluster consists of a group of origin servers
designed to handle a large number of streams.

```text
                         +-----------------------+
                     +---+ SRS Proxy(Deployment) +------+---------------------+
+-----------------+  |   +-----------+-----------+      +                     +
| LB(K8s Service) +--+               +(Redis/MESH)      + SRS Origin Servers  +
+-----------------+  |   +-----------+-----------+      +    (Deployment)     +
                     +---+ SRS Proxy(Deployment) +------+---------------------+
                         +-----------------------+
```

The new origin cluster is designed as a collection of proxy servers. For
more information, see [Discussion
#3634](https://github.com/ossrs/srs/discussions/3634). If you prefer to
use the old origin cluster, please switch to a version before SRS 6.0.

A proxy server can be used for a set of origin servers, which are
isolated and dedicated origin servers. The main improvement in the new
architecture is to store the state for origin servers in the proxy
server, rather than using MESH to communicate between origin servers.
With a proxy server, you can deploy origin servers as stateless servers,
such as in a Kubernetes (K8s) deployment.

Now that the proxy server is a stateful server, it uses Redis to store
the states. For faster development, we use Go to develop the proxy
server, instead of C/C++. Therefore, the proxy server itself is also
stateless, with all states stored in the Redis server or cluster. This
makes the new origin cluster architecture very powerful and robust.

The proxy server is also an architecture designed to solve multiple
process bottlenecks. You can run hundreds of SRS origin servers with one
proxy server on the same machine. This solution can utilize multi-core
machines, such as servers with 128 CPUs. Thus, we can keep SRS
single-threaded and very simple. See
https://github.com/ossrs/srs/discussions/3665#discussioncomment-6474441
for details.

```text
                                       +--------------------+
                               +-------+ SRS Origin Server  +
                               +       +--------------------+
                               +
+-----------------------+      +       +--------------------+
+ SRS Proxy(Deployment) +------+-------+ SRS Origin Server  +
+-----------------------+      +       +--------------------+
                               +
                               +       +--------------------+
                               +-------+ SRS Origin Server  +
                                       +--------------------+
```

Keep in mind that the proxy server for the Origin Cluster is designed to
handle many streams. To address the issue of many viewers, we will
enhance the Edge Cluster to support more protocols.

```text
+------------------+                                               +--------------------+
+ SRS Edge Server  +--+                                    +-------+ SRS Origin Server  +
+------------------+  +                                    +       +--------------------+
                      +                                    +
+------------------+  +     +-----------------------+      +       +--------------------+
+ SRS Edge Server  +--+-----+ SRS Proxy(Deployment) +------+-------+ SRS Origin Server  +
+------------------+  +     +-----------------------+      +       +--------------------+
                      +                                    +
+------------------+  +                                    +       +--------------------+
+ SRS Edge Server  +--+                                    +-------+ SRS Origin Server  +
+------------------+                                               +--------------------+
```

With the new Origin Cluster and Edge Cluster, you have a media system
capable of supporting a large number of streams and viewers. For
example, you can publish 10,000 streams, each with 100,000 viewers.

---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
5 months ago
.github Release v6.0-a1, 6.0 alpha1, v6.0.155, 169636 lines. 5 months ago
.run Heartbeat: Report ports for proxy server. v5.0.215 v6.0.156 v7.0.15 (#4171) 5 months ago
proxy Proxy: Support proxy server for SRS. v7.0.16 (#4158) 5 months ago
trunk Proxy: Support proxy server for SRS. v7.0.16 (#4158) 5 months ago
.gitignore Windows: Support cygwin pipline and packager. v5.0.89 (#3257) 2 years ago
CONTRIBUTING.md How to be TOC of SRS. (#3393) 2 years ago
Dockerfile Dockerfile: Consistently use proper ENV syntax using equal sign. v6.0.140 (#4116) 6 months ago
LICENSE Switch to 2013-2024. v6.0.109 1 year ago
README.md Release v6.0-a1, 6.0 alpha1, v6.0.155, 169636 lines. 5 months ago
SECURITY.md Update SECURITY policy. 2 years ago

README.md

SRS(Simple Realtime Server)

SRS/6.0 (Hang) is a simple, high-efficiency, and real-time video server, supporting RTMP/WebRTC/HLS/HTTP-FLV/SRT/MPEG-DASH/GB28181, Linux/Windows/macOS, X86_64/ARMv7/AARCH64/M1/RISCV/LOONGARCH/MIPS, and essential features.

SRS Overview

Note: For more details on the single-node architecture for SRS, please visit the following link.

SRS is licenced under MIT, and some third-party libraries are distributed under their licenses.

Usage

Please check the Getting Started guide in English or Chinese. We highly recommend using SRS with docker:

docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \
    -p 8000:8000/udp -p 10080:10080/udp ossrs/srs:5

Tips: If you're in China, use this image registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 for faster speed.

Open http://localhost:8080/ to verify, and then stream using the following FFmpeg command:

ffmpeg -re -i ./doc/source.flv -c copy -f flv -y rtmp://localhost/live/livestream

Alternatively, stream by OBS using the following configuration:

  • Service: Custom
  • Server: rtmp://localhost/live
  • Stream Key: livestream

Play the following streams using media players:

If you'd like to use WebRTC, convert RTMP to WebRTC, or convert WebRTC to RTMP, please check out the wiki documentation in either English or Chinese.

To learn more about RTMP, HLS, HTTP-FLV, SRT, MPEG-DASH, WebRTC protocols, clustering, HTTP API, DVR, and transcoding, please check the documents in English or Chinese.

Sponsor

Would you like additional assistance from us? By becoming a sponsor or backer of SRS, we can provide you with the support you need:

  • Backer: $5 per month, online text chat support through Discord.
  • Sponsor: $100 per month, online text chat plus online meeting support.

Please visit OpenCollective to become a backer or sponsor, and send us a direct message on Discord. We are currently providing support to the developers listed below:

At SRS, our goal is to create a free, open-source community that helps developers all over the world build high-quality streaming and RTC platforms for their businesses.

Contributing

The authors, TOC(Technical Oversight Committee), and contributors are listed here. The TOC members who made significant contributions and maintained parts of SRS are listed below:

  • Winlin: Founder of the project, focusing on ST and Issues/PR. Responsible for architecture and maintenance.
  • ZhaoWenjie: One of the earliest contributors, focusing on HDS and Windows. Has expertise in client technology.
  • ShiWei: Specializes in SRT and H.265, maintaining SRT and FLV patches for FFmpeg. An expert in codecs and FFmpeg.
  • XiaoZhihong: Concentrates on WebRTC/QUIC and SRT, with expertise in network QoS. Contributed to ARM on ST and was the original contributor for WebRTC.
  • WuPengqiang: Focused on H.265, initially contributed to the FFmpeg module in SRS for transcoding AAC with OPUS for WebRTC.
  • XiaLixin: Specializes in GB28181, with expertise in live streaming and WebRTC.
  • LiPeng: Concentrates on WebRTC and contributes to memory management and smart pointers.
  • ChenGuanghua: Focused on WebRTC/QoS and introduced the Asan toolchain to SRS.
  • ChenHaibo: Specializes in GB28181 and HTTP API, contributing to patches for FFmpeg with WHIP.
  • ZhangJunqin: Focused on H.265, Prometheus Exporter, and API module.

A huge THANK YOU goes out to:

We're really thankful to everyone in the community for helping us find bugs and improve the project. To stay in touch and keep helping our community, please check out this guide.

LICENSE

FOSSA Status

SRS is licenced under MIT, and some third-party libraries are distributed under their licenses.

Releases

  • 2024-09-01, Release v6.0-a1, v6.0-a1, 6.0 alpha1, v6.0.155, 169636 lines.
  • 2024-07-27, Release v6.0-a0, v6.0-a0, 6.0 alpha0, v6.0.145, 169259 lines.
  • 2024-07-04, Release v6.0-d6, v6.0-d6, 6.0 dev6, v6.0.134, 168904 lines.
  • 2024-06-15, Release v6.0-d5, v6.0-d5, 6.0 dev5, v6.0.129, 168454 lines.
  • 2024-02-15, Release v6.0-d4, v6.0-d4, 6.0 dev4, v6.0.113, 167695 lines.
  • 2023-11-19, Release v6.0-d3, v6.0-d3, 6.0 dev3, v6.0.101, 167560 lines.
  • 2023-09-28, Release v6.0-d2, v6.0-d2, 6.0 dev2, v6.0.85, 167509 lines.
  • 2023-08-31, Release v6.0-d1, v6.0-d1, 6.0 dev1, v6.0.72, 167135 lines.
  • 2023-07-09, Release v6.0-d0, v6.0-d0, 6.0 dev0, v6.0.59, 166739 lines.
  • 2024-06-15, Release v5.0-r3, v5.0-r3, 5.0 release3, v5.0.213, 163585 lines.
  • 2024-04-03, Release v5.0-r2, v5.0-r2, 5.0 release2, v5.0.210, 163515 lines.
  • 2024-02-15, Release v5.0-r1, v5.0-r1, 5.0 release1, v5.0.208, 163441 lines.
  • 2023-12-30, Release v5.0-r0, v5.0-r0, 5.0 release0, v5.0.205, 163363 lines.
  • 2023-11-19, Release v5.0-b7, v5.0-b7, 5.0 beta7, v5.0.200, 163305 lines.
  • 2023-10-25, Release v5.0-b6, v5.0-b6, 5.0 beta6, v5.0.195, 163303 lines.
  • 2023-09-28, Release v5.0-b5, v5.0-b5, 5.0 beta5, v5.0.185, 163254 lines.
  • 2023-08-31, Release v5.0-b4, v5.0-b4, 5.0 beta4, v5.0.176, 162919 lines.
  • 2023-08-02, Release v5.0-b3, v5.0-b3, 5.0 beta3, v5.0.170, 162704 lines.
  • 2023-07-09, Release v5.0-b2, v5.0-b2, 5.0 beta2, v5.0.166, 162520 lines.
  • 2023-06-11, Release v5.0-b1, v5.0-b1, 5.0 beta1, v5.0.157, 162494 lines.
  • 2023-05-14, Release v5.0-b0, v5.0-b0, 5.0 beta0, v5.0.155, 162600 lines.
  • 2023-03-23, Release v5.0-a5, v5.0-a5, 5.0 alpha5, v5.0.148, 162066 lines.
  • 2023-02-12, Release v5.0-a4, v5.0-a4, 5.0 alpha4, v5.0.141, 161897 lines.
  • 2023-01-02, Release v5.0-a3, v5.0-a3, 5.0 alpha3, v5.0.128, 161327 lines.
  • 2022-12-18, Release v5.0-a2, v5.0-a2, 5.0 alpha2, v5.0.112, 161233 lines.
  • 2022-12-01, Release v5.0-a1, v5.0-a1, 5.0 alpha1, v5.0.100, 160817 lines.
  • 2022-11-25, Release v5.0-a0, v5.0-a0, 5.0 alpha0, v5.0.98, 159813 lines.
  • 2022-11-22, Release v4.0-r4, v4.0-r4, 4.0 release4, v4.0.268, 145482 lines.
  • 2022-09-16, Release v4.0-r3, v4.0-r3, 4.0 release3, v4.0.265, 145328 lines.
  • 2022-08-24, Release v4.0-r2, v4.0-r2, 4.0 release2, v4.0.257, 144890 lines.
  • 2022-06-29, Release v4.0-r1, v4.0-r1, 4.0 release1, v4.0.253, 144680 lines.
  • 2022-06-11, Release v4.0-r0, v4.0-r0, 4.0 release0, v4.0.252, 144680 lines.
  • 2020-06-27, Release v3.0-r0, 3.0 release0, 3.0.141, 122674 lines.
  • 2020-02-02, Release v3.0-b0, 3.0 beta0, 3.0.112, 121709 lines.
  • 2019-10-04, Release v3.0-a0, 3.0 alpha0, 3.0.56, 107946 lines.
  • 2017-03-03, Release v2.0-r0, 2.0 release0, 2.0.234, 86373 lines.
  • 2016-08-06, Release v2.0-b0, 2.0 beta0, 2.0.210, 89704 lines.
  • 2015-08-23, Release v2.0-a0, 2.0 alpha0, 2.0.185, 89022 lines.
  • 2014-12-05, Release v1.0-r0, all bug fixed, 1.0.10, 59391 lines.
  • 2014-10-09, Release v0.9.8, all bug fixed, 1.0.0, 59316 lines.
  • 2014-04-07, Release v0.9.1, live streaming. 30000 lines.
  • 2013-10-23, Release v0.1.0, rtmp. 8287 lines.
  • 2013-10-17, Created.

Features

Please read FEATURES.

Changelog

Please read CHANGELOG.

Performance

Please read PERFORMANCE.

Architecture

Please read ARCHITECTURE.

Ports

Please read PORTS.

APIs

Please read APIS.

Mirrors

Please read MIRRORS.

Dockers

Please read DOCKERS.

Beijing, 2013.10
Winlin