@ -1,44 +1,19 @@
# Simple- RTMP- Server
# SRS

[](https://circleci.com/gh/ossrs/srs/tree/develop)
[](https://codecov.io/gh/ossrs/srs/branch/develop)
[](https://github.com/ossrs/srs/wiki/v1_CN_Contact#wechat)
SRS/3.0, [OuXuli][release3],是一个简单的流媒体直播集群,简单的快乐。< br / >
SRS is a simple live streaming cluster, a simple joy.
Download binaries from github.io: [Centos6-x86_64][centos0], [more...][more0]< br / >
Download binaries from ossrs.net: [Centos6-x86_64][centos1], [more...][more1]< br / >
About the wiki of SRS/3.0, please read [Chinese][srs_CN] or [English][srs_EN].
SRS(Simple RTMP Server) is a simple live streaming cluster, a simple joy.
> Remark: Although SRS is licenced under [MIT][LICENSE], but there are some depended libraries which are distributed using their own licenses, please read [License Mixing][LicenseMixing].
Enjoy it!
## Content
* [Usage ](#usage )
* [Wiki ](#srs-30-wiki )
* [Features ](#features )
* [v3.0 changes ](#v3-changes )
* [v2.0 changes ](#v2-changes )
* [v1.0 changes ](#v1-changes )
* [Releases ](#releases )
* [Compare ](#compare )
* [Performance ](#performance )
* [Architecture ](#architecture )
* [System Architecture ](#system-architecture )
* [Modularity Architecture ](#modularity-architecture )
* [Stream Architecture ](#stream-architecture )
* [Authors ](#authors )
* [Mirrors ](#mirrors )
* [System Requirements ](#system-requirements )
< a name = "product" > < / a >
## Usage
### Usage
< strong > Step 1:< / strong > Get SRS.
**Step 1:** Get SRS.
```
git clone https://github.com/ossrs/srs & &
@ -47,21 +22,29 @@ cd srs/trunk
> Note: Repository too large? Please clone from these [mirrors ](#mirrors ) instead.
< strong > Step 2:< / strong > Build SRS.
**Step 2:** Build SRS.
```
./configure & & make
```
> Remark: Recommend Centos6 64bits, for other OS recommend [docker][docker], please read wiki([CN][v3_CN_Build],[EN][v3_EN_Build]).
> Remark: Recommend Centos6 64bits, please read wiki([CN][v3_CN_Build],[EN][v3_EN_Build]).
< strong > Step 3:< / strong > Run SRS
> Note: You can also build SRS in docker, please read [docker][docker-dev].
**Step 3:** Run SRS
```
./objs/srs -c conf/srs.conf
```
< strong > From here, < / strong > strongly recommend to try other main use-scenarios:
**Whatever**, you can also directly run SRS in [docker][docker-srs3]:
```
docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:3
```
**From here,** strongly recommend to read bellow wikis:
* Usage: How to delivery RTMP?([CN][v1_CN_SampleRTMP], [EN][v1_EN_SampleRTMP])
* Usage: How to delivery RTMP Edge Cluster?([CN][v3_CN_SampleRTMPCluster], [EN][v3_EN_SampleRTMPCluster])
@ -78,14 +61,24 @@ cd srs/trunk
* Usage: How to publish h.264 raw stream as RTMP? ([CN][v3_CN_SrsLibrtmp2], [EN][v3_EN_SrsLibrtmp2])
* Usage: How to improve edge performance by multiple CPUs? ([CN][v3_CN_REUSEPORT], [EN][v3_EN_REUSEPORT])
* Usage: Why choose SRS? About the milestone and product plan? ([CN][v1_CN_Product], [EN][v1_EN_Product])
* Usage: How to file bug or chat with us? ([CN][v1_CN_Contact], [EN][v1_EN_Contact])
### SRS 3.0 wiki
< a name = "srs-30-wiki" > < / a >
## Wiki
Please select according to languages:
* [SRS 3.0 English][v3_EN_Home]
* [SRS 3.0 Chinese][v3_CN_Home]
### Features
* [SRS 3.0 English Wiki][v3_EN_Home]
* [SRS 3.0 Chinese Wiki][v3_CN_Home]
For previous versions, please read:
* [SRS 2.0 English Wiki][v2_EN_Home]
* [SRS 2.0 Chinese Wiki][v2_CN_Home]
* [SRS 1.0 English Wiki][v1_EN_Home]
* [SRS 1.0 Chinese Wiki][v1_CN_Home]
## Features
- [x] Using coroutine by ST, it's really simple and stupid enough.
- [x] Support cluster which consists of origin ([CN][v1_CN_DeliveryRTMP],[EN][v1_EN_DeliveryRTMP]) and edge([CN][v3_CN_Edge], [EN][v3_EN_Edge]) server and uses RTMP as default transport protocol.
@ -152,8 +145,14 @@ Please select according to languages:
< a name = "history" > < / a >
< a name = "change-logs" > < / a >
### V3 changes
## V3 changes
* < strong > v3.0, 2019-11-30, [3.0 alpha2(3.0.67)][r3.0a3] released. 110864 lines.< / strong >
* v3.0, 2019-12-01, Fix [#1501][bug #1501 ], use request coworker for origin cluster. 3.0.67
* < strong > v3.0, 2019-11-30, [3.0 alpha2(3.0.66)][r3.0a2] released. 110831 lines.< / strong >
* v3.0, 2019-11-30, Fix [#1501][bug #1501 ], use request coworker for origin cluster. 3.0.66
* v3.0, 2019-11-30, Random tid for docker. 3.0.65
* v3.0, 2019-11-30, Refine debug info for edge. 3.0.64
* v3.0, 2019-10-30, Cover protocol stack RTMP. 3.0.63
* v3.0, 2019-10-23, Cover JSON codec. 3.0.62
* v3.0, 2019-10-13, Use http://ossrs.net:8000 as homepage.
@ -223,8 +222,10 @@ Please select according to languages:
* v3.0, 2015-08-28, fix [#471][bug #471 ], api response the width and height. 3.0.2
* v3.0, 2015-08-25, fix [#367][bug #367 ], support nginx-rtmp exec. 3.0.1
### V2 changes
## V2 changes
* < strong > v2.0, 2019-11-29, [2.0 release7(2.0.265)][r2.0r7] released. 86994 lines.< / strong >
* v2.0, 2019-11-29, For [srs-docker ](https://github.com/ossrs/srs-docker/tree/master/2.0 ), install Cherrypy without sudo. 2.0.265
* v2.0, 2019-04-06, For [#1304][bug #1304 ], Default HSTRS to on. 2.0.264
* < strong > v2.0, 2019-04-05, [2.0 release6(2.0.263)][r2.0r6] released. 86994 lines.< / strong >
* v2.0, 2019-04-05, Merge [#1312][bug #1312 ], Fix GCC7 build error, this statement may fall through. 2.0.263
@ -462,7 +463,7 @@ Please select according to languages:
* v2.0, 2014-10-18, remove supports for OSX(darwin). 2.0.1.
* v2.0, 2014-10-16, revert github srs README to English. 2.0.0.
### V1 changes
## V1 changes
* < strong > v1.0, 2014-12-05, [1.0 release(1.0.10)][r1.0r0] released. 59391 lines.< / strong >
* < strong > v1.0, 2014-10-09, [1.0 beta(1.0.0)][r1.0b0] released. 59316 lines.< / strong >
@ -652,8 +653,10 @@ Please select according to languages:
* v0.1, 2013-10-18, support rtmp message2chunk protocol(send\_message).
* v0.1, 2013-10-17, support rtmp chunk2message protocol(recv\_message).
### Releases
## Releases
* 2019-11-30, [Release v3.0-a2][r3.0a3], 3.0 alpha2, 3.0.67, 110864 lines.
* 2019-11-30, [Release v3.0-a2][r3.0a2], 3.0 alpha2, 3.0.66, 110831 lines.
* 2019-10-07, [Release v3.0-a1][r3.0a1], 3.0 alpha1, 3.0.60, 107962 lines.
* 2019-10-04, [Release v3.0-a0][r3.0a0], 3.0 alpha0, 3.0.56, 107946 lines.
* 2017-03-03, [Release v2.0-r0][r2.0r0], 2.0 release0, 2.0.234, 86373 lines.
@ -689,11 +692,12 @@ Please select according to languages:
* 2013-10-23, [Release v0.1.0][r0.1], support [rtmp FMLE/FFMPEG publish][v1_CN_DeliveryRTMP], vp6. 8287 lines.
* 2013-10-17, Created.
### Compare
## Compare
Comparing with other media servers, SRS is much better and stronger, for details please read Product([CN][v1_CN_Compare]/[EN][v1_EN_Compare]).
#### Stream Delivery
< a name = "stream-delivery" > < / a >
**Stream Delivery**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
@ -705,7 +709,8 @@ Comparing with other media servers, SRS is much better and stronger, for details
| MPEG-DASH | Experiment| X | X | X | X |
| HTTP Server | Stable | Stable | X | X | Stable |
#### Cluster
< a name = "cluster" > < / a >
**Cluster**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
@ -715,8 +720,10 @@ Comparing with other media servers, SRS is much better and stronger, for details
| Reload | Stable | X | X | X | X |
| Forward | Stable | X | X | X | X |
| ATC | Stable | X | X | X | X |
| Docker | Stable | X | X | X | X |
#### Stream Service
< a name = "stream-service" > < / a >
**Stream Service**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
@ -732,7 +739,8 @@ Comparing with other media servers, SRS is much better and stronger, for details
| Security | Stable | Stable | X | X | Stable |
| Token Traverse| Stable | X | X | Stable | X |
#### Efficiency
< a name = "efficiency" > < / a >
**Efficiency**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
@ -741,7 +749,8 @@ Comparing with other media servers, SRS is much better and stronger, for details
| RTMP Latency| 0.1s | 3s | 3s | 3s | 3s |
| HLS Latency | 10s | 30s | X | 30s | 30s |
#### Stream Caster
< a name = "stream-caster" > < / a >
**Stream Caster**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
@ -750,21 +759,24 @@ Comparing with other media servers, SRS is much better and stronger, for details
| Push RTSP | Experiment| X | Stable | X | Stable |
| Push HTTP FLV | Experiment| X | X | X | X |
#### Debug System
< a name = "debug-system" > < / a >
**Debug System**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
| BW check | Stable | X | X | X | X |
| Tracable Log | Stable | X | X | X | X |
#### Docs
< a name = "docs" > < / a >
**Docs**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
| Demos | Stable | X | X | X | X |
| WIKI(EN+CN) | Stable | EN only | X | X | Stable |
#### Others
< a name = "others" > < / a >
**Others**
| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA |
| ----------- | ------- | ----- | --------- | -------- | ------ |
@ -780,15 +792,16 @@ Remark:
1. Security: The security includes access control, token authentication and referer check.
1. Reload: SRS and Nginx supports reload, but nginx-rtmp doesn't.
### Performance
## Performance
The performance benchmark data and corelative commits are listed here.
* See also: [Performance for x86/x64 Test Guide][v1_CN_Performance].
* See also: [Performance for RaspberryPi][v1_CN_RaspberryPi].
* For multiple processes performance, read [#775: REUSEPORT][bug #775 ] or OriginCluster([CN](v3_EN_OriginCluster)/[EN](v3_EN_OriginCluster) ) or [go-oryx][oryx].
* For multiple processes performance, read [#775: REUSEPORT][bug #775 ] or OriginCluster([CN][v3_EN_OriginCluster]/[EN][v3_EN_OriginCluster] ) or [go-oryx][oryx].
#### Play RTMP benchmark
< a name = "play-rtmp-benchmark" > < / a >
**Play RTMP benchmark**
The data for playing RTMP was benchmarked by [SB][srs-bench]:
@ -808,7 +821,8 @@ The data for playing RTMP was benchmarked by [SB][srs-bench]:
| 2014-12-05 | 2.0.57 | 9.0k(9000) | players | 90% | 468MB | [code][p11] |
| 2014-12-07 | 2.0.67 | 10k(10000) | players | 95% | 656MB | [code][p12] |
#### Publish RTMP benchmark
< a name = "publish-rtmp-benchmark" > < / a >
**Publish RTMP benchmark**
The data for publishing RTMP was benchmarked by [SB][srs-bench]:
@ -824,7 +838,8 @@ The data for publishing RTMP was benchmarked by [SB][srs-bench]:
| 2014-12-04 | 2.0.51 | 2.5k(2500) | publishers | 91% | 259MB | [code][p4] |
| 2014-12-04 | 2.0.52 | 4.0k(4000) | publishers | 80% | 331MB | [code][p5] |
#### Play HTTP FLV benchmark
< a name = "play-http-flv-benchmark" > < / a >
**Play HTTP FLV benchmark**
The data for playing HTTP FLV was benchmarked by [SB][srs-bench]:
@ -837,7 +852,8 @@ The data for playing HTTP FLV was benchmarked by [SB][srs-bench]:
| 2014-05-24 | 2.0.170 | 3.0k(3000) | players | 89% | 96MB | [code][p19] |
| 2014-05-25 | 2.0.171 | 6.0k(6000) | players | 84% | 297MB | [code][p20] |
#### Latency benchmark
< a name = "latency-benchmark" > < / a >
**Latency benchmark**
The latency between encoder and player with realtime config([CN][v3_CN_LowLatency], [EN][v3_EN_LowLatency]):
|
@ -854,7 +870,8 @@ We used FMLE as encoder for benchmark. The latency of server was 0.1s+,
and the bottleneck was the encoder. For more information, read
[bug #257 ][bug #257 -c0].
#### HLS overhead
< a name = "hls-overhead" > < / a >
**HLS overhead**
About the overhead of HLS overhead, we compared FFMPEG and SRS.
@ -890,7 +907,7 @@ SRS always use the simplest architecture to solve complex domain problems.
* Modularity arch: the main modularity of SRS.
* Stream arch: the stream dispatch arch of SRS.
### System Architecture
## System Architecture
```
+------------------------------------------------------+
@ -908,7 +925,7 @@ SRS always use the simplest architecture to solve complex domain problems.
+------------------------------------------------------+
```
### Modularity Architecture
## Modularity Architecture
```
+------------------------------------------------------+
@ -930,7 +947,7 @@ Remark:
1. Modules: SRS supports code-level modularity, read [modules][modules].
### Stream Architecture
## Stream Architecture
```
+---------+ +----------+
@ -972,7 +989,7 @@ Remark:
1. Streamer: Remuxs other protocols to RTMP, please read [Streamer][v2_CN_Streamer].
1. EXEC: Like NGINX-RTMP, EXEC forks external tools for events, please read [ng-exec][v3_CN_NgExec].
### AUTHORS
## AUTHORS
There are two types of people that have contributed to the SRS project:
@ -992,12 +1009,12 @@ A big THANK YOU goes to:
* [FFMPEG][FFMPEG] and [libx264][libx264] group for SRS to use as transcoder.
* Guido van Rossum for creating Python for api-server for SRS.
### Mirrors
## Mirrors
OSChina: [http://git.oschina.net /winlinvip/srs.oschina][oschina], the GIT usage([CN][v1_CN_Git], [EN][v1_EN_Git])
OSChina: [https://gitee.com /winlinvip/srs.oschina][oschina], the GIT usage([CN][v1_CN_Git], [EN][v1_EN_Git])
```
git clone https://git.oschina.net /winlinvip/srs.oschina.git
git clone https://gitee.com /winlinvip/srs.oschina.git
```
> Remark: For users in China, recomment to use mirror from CSDN or OSChina, because they are much faster.
@ -1014,13 +1031,12 @@ Gitlab: [https://gitlab.com/winlinvip/srs-gitlab][gitlab], the GIT usage([CN][v1
git clone https://gitlab.com/winlinvip/srs-gitlab.git
```
### System Requirements
## System Requirements
Supported operating systems and hardware:
* All Linux, both 32 and 64 bits
* Apple OSX(Darwin), both 32 and 64bits.
* All hardwares with x86/x86_64/arm/mips cpu.
* Other OS, such as Windows, please use [docker][docker-srs3].
Beijing, 2013.10< br / >
Winlin
@ -1064,7 +1080,7 @@ Winlin
[libx264]: http://www.videolan.org/
[srs]: https://github.com/ossrs/srs
[csdn]: https://code.csdn.net/winlinvip/srs-csdn
[oschina]: http://git.oschina.net /winlinvip/srs.oschina
[oschina]: https://gitee.com /winlinvip/srs.oschina
[srs-dolphin]: https://github.com/ossrs/srs-dolphin
[oryx]: https://github.com/ossrs/go-oryx
[srs-bench]: https://github.com/ossrs/srs-bench
@ -1074,7 +1090,8 @@ Winlin
[console]: http://ossrs.net:1985/console
[player]: http://ossrs.net:8000/players/srs_player.html
[modules]: https://github.com/ossrs/srs/blob/develop/trunk/modules/readme.txt
[docker]: https://github.com/ossrs/srs-docker/tree/centos#usage
[docker-srs3]: https://github.com/ossrs/srs-docker#srs3
[docker-dev]: https://github.com/ossrs/srs-docker/tree/dev#usage
[v1_CN_Git]: https://github.com/ossrs/srs/wiki/v1_CN_Git
[v1_EN_Git]: https://github.com/ossrs/srs/wiki/v1_EN_Git
@ -1112,10 +1129,14 @@ Winlin
[v1_EN_Sample]: https://github.com/ossrs/srs/wiki/v1_EN_Sample
[v1_CN_Product]: https://github.com/ossrs/srs/wiki/v1_CN_Product
[v1_EN_Product]: https://github.com/ossrs/srs/wiki/v1_EN_Product
[v1-wiki-cn]: https://github.com/ossrs/srs/wiki/v1-wiki-cn
[v1-wiki-en]: https://github.com/ossrs/srs/wiki/v1-wiki-en
[v2-wiki-cn]: https://github.com/ossrs/srs/wiki/v2-wiki-cn
[v2-wiki-en]: https://github.com/ossrs/srs/wiki/v2-wiki-en
[v1-wiki-cn]: https://github.com/ossrs/srs/wiki/v1_CN_Home
[v1-wiki-en]: https://github.com/ossrs/srs/wiki/v1_EN_Home
[v2-wiki-cn]: https://github.com/ossrs/srs/wiki/v2_CN_Home
[v2-wiki-en]: https://github.com/ossrs/srs/wiki/v2_EN_Home
[v1_CN_Home]: https://github.com/ossrs/srs/wiki/v1_CN_Home
[v1_EN_Home]: https://github.com/ossrs/srs/wiki/v1_EN_Home
[v2_CN_Home]: https://github.com/ossrs/srs/wiki/v2_CN_Home
[v2_EN_Home]: https://github.com/ossrs/srs/wiki/v2_EN_Home
[v3_CN_Home]: https://github.com/ossrs/srs/wiki/v3_CN_Home
[v3_EN_Home]: https://github.com/ossrs/srs/wiki/v3_EN_Home
[donation0]: http://winlinvip.github.io/srs.release/donation/index.html
@ -1489,6 +1510,7 @@ Winlin
[bug #1087 ]: https://github.com/ossrs/srs/issues/1087
[bug #1051 ]: https://github.com/ossrs/srs/issues/1051
[bug #1093 ]: https://github.com/ossrs/srs/issues/1093
[bug #1501 ]: https://github.com/ossrs/srs/issues/1501
[bug #xxxxxxxxxxxxx ]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx
[bug #1111 ]: https://github.com/ossrs/srs/issues/1111
@ -1497,8 +1519,11 @@ Winlin
[exo #828 ]: https://github.com/google/ExoPlayer/pull/828
[r3.0a3]: https://github.com/ossrs/srs/releases/tag/v3.0-a3
[r3.0a2]: https://github.com/ossrs/srs/releases/tag/v3.0-a2
[r3.0a1]: https://github.com/ossrs/srs/releases/tag/v3.0-a1
[r3.0a0]: https://github.com/ossrs/srs/releases/tag/v3.0-a0
[r2.0r7]: https://github.com/ossrs/srs/releases/tag/v2.0-r7
[r2.0r6]: https://github.com/ossrs/srs/releases/tag/v2.0-r6
[r2.0r5]: https://github.com/ossrs/srs/releases/tag/v2.0-r5
[r2.0r4]: https://github.com/ossrs/srs/releases/tag/v2.0-r4
@ -1540,6 +1565,8 @@ Winlin
[contact]: https://github.com/ossrs/srs/wiki/v1_CN_Contact
[v1_CN_Contact]: https://github.com/ossrs/srs/wiki/v1_CN_Contact
[v1_EN_Contact]: https://github.com/ossrs/srs/wiki/v1_EN_Contact
[more0]: http://winlinvip.github.io/srs.release/releases/
[more1]: http://ossrs.net:8000/srs.release/releases/