From f80a52f265936af8003e7ecda5a40b31b3239c8e Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 5 Mar 2021 07:58:32 +0800 Subject: [PATCH 1/2] Update README for docker --- README.md | 106 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 58ded9b82..bad93ce62 100755 --- a/README.md +++ b/README.md @@ -13,6 +13,56 @@ SRS is a RTMP/HLS/WebRTC/SRT/GB28181 streaming cluster, high efficiency, stable ## Usage +Recommend to run SRS by [docker][docker-srs4]: + +```bash +# From Aliyun CR, for developers in China. +docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \ + registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.76 + +# From docker hub, depends on your network. +docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \ + ossrs/srs:v4.0.76 +``` + +> Note: All [tags](https://github.com/ossrs/srs/tags) are available, such as +> `ossrs/srs:v3.0-r3` for tag [v3.0-r3](https://github.com/ossrs/srs/releases/tag/v3.0-r3), +> please check at [here](https://cr.console.aliyun.com/repository/cn-hangzhou/ossrs/srs/images) +> or [there](https://hub.docker.com/r/ossrs/srs/tags). + +> To enable WebRTC, user MUST set the env `CANDIDATE`, see [#307](https://github.com/ossrs/srs/issues/307#issue-76908382). + +If success, please open [http://localhost:8080/](http://localhost:8080/), then publish +[stream](https://github.com/ossrs/srs/blob/3.0release/trunk/doc/source.200kbps.768x320.flv) by: + +```bash +ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy \ + -f flv rtmp://127.0.0.1/live/livestream +``` + +> Note: If WebRTC enabled, you can publish by [H5](http://localhost:8080/players/rtc_publisher.html?autostart=true). + +Play the following streams by players: + +* VLC: rtmp://127.0.0.1/live/livestream +* H5: [http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv&port=8080&schema=http) +* H5: [http://localhost:8080/live/livestream.m3u8](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.m3u8&port=8080&schema=http) + +> The online demos and players are available on [ossrs.net](https://ossrs.net). + +Strongly recommend reading bellow wikis: + +* How to deliver RTMP streaming?([CN][v1_CN_SampleRTMP], [EN][v1_EN_SampleRTMP]) +* How to build RTMP Edge-Cluster?([CN][v3_CN_SampleRTMPCluster], [EN][v3_EN_SampleRTMPCluster]) +* How to build RTMP Origin-Cluster?([CN][v3_CN_SampleOriginCluster], [EN][v3_EN_SampleOriginCluster]) +* How to deliver HTTP-FLV streaming?([CN][v3_CN_SampleHttpFlv], [EN][v3_EN_SampleHttpFlv]) +* How to deliver HLS streaming?([CN][v3_CN_SampleHLS], [EN][v3_EN_SampleHLS]) +* How to deliver low-latency streaming?([CN][v3_CN_SampleRealtime], [EN][v3_EN_SampleRealtime]) +* Usage: How to play WebRTC from SRS? [#307](https://github.com/ossrs/srs/issues/307) +* Usage: How to publish WebRTC to SRS? [#307](https://github.com/ossrs/srs/issues/307) + +It's also very easy to build from source: + **>>> Step 1:** Get SRS. ``` @@ -39,52 +89,21 @@ git checkout 4.0release && git pull ./objs/srs -c conf/srs.conf ``` -**>>> Whatever**, you can also directly run SRS in [docker][docker-srs3]: - -``` -docker run -p 1935:1935 -p 1985:1985 -p 8080:8080 \ - registry.cn-hangzhou.aliyuncs.com/ossrs/srs:3 -``` - -> Note: Again, we use [ACR](https://cr.console.aliyun.com/) here, you can directly run in docker hub by `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]) -* Usage: How to create a RTMP-Origin Cluster?([CN][v3_CN_SampleOriginCluster], [EN][v3_EN_SampleOriginCluster]) -* Usage: How to delivery HTTP-FLV?([CN][v3_CN_SampleHttpFlv], [EN][v3_EN_SampleHttpFlv]) -* Usage: How to delivery HTTP-FLV Cluster?([CN][v3_CN_SampleHttpFlvCluster], [EN][v3_EN_SampleHttpFlvCluster]) -* Usage: How to delivery HLS?([CN][v3_CN_SampleHLS], [EN][v3_EN_SampleHLS]) -* Usage: How to publish GB28181 to SRS? [#1500](https://github.com/ossrs/srs/issues/1500#issuecomment-606695679) -* Usage: How to play WebRTC from SRS? [#307](https://github.com/ossrs/srs/issues/307) -* Usage: How to publish WebRTC to SRS? [#307](https://github.com/ossrs/srs/issues/307) -* Usage: How to publish SRT(Experimental) to SRS?([CN][v4_CN_SampleSRT], [EN][v4_EN_SampleSRT]) -* Usage: How to transode stream by FFMPEG?([CN][v2_CN_SampleFFMPEG], [EN][v2_EN_SampleFFMPEG]) -* Usage: How to forward stream to other servers?([CN][v3_CN_SampleForward], [EN][v3_EN_SampleForward]) -* Usage: How to enable low lantency live streaming?([CN][v3_CN_SampleRealtime], [EN][v3_EN_SampleRealtime]) -* Usage: How to ingest file/stream/device to SRS?([CN][v1_CN_SampleIngest], [EN][v1_EN_SampleIngest]) -* Usage: How to delivery DASH(Experimental)?([CN][v3_CN_SampleDASH], [EN][v3_EN_SampleDASH]) -* Usage: How to enable multiple processes? ([CN][v3_CN_REUSEPORT], [EN][v3_EN_REUSEPORT]) -* Usage: Want to contact us? ([CN][v1_CN_Contact], [EN][v1_EN_Contact]) Or file an issue [here](https://github.com/ossrs/srs/issues/new)? - -## Wiki - -Please select according to languages: + +Other documents: +* Usage: How to publish GB28181 to SRS? [#1500](https://github.com/ossrs/srs/issues/1500#issuecomment-606695679) +* Usage: How to delivery DASH(Experimental)?([CN][v3_CN_SampleDASH], [EN][v3_EN_SampleDASH]) +* Usage: How to transode RTMP stream by FFMPEG?([CN][v2_CN_SampleFFMPEG], [EN][v2_EN_SampleFFMPEG]) +* Usage: How to delivery HTTP FLV Live Streaming Cluster?([CN][v3_CN_SampleHttpFlvCluster], [EN][v3_EN_SampleHttpFlvCluster]) +* Usage: How to ingest file/stream/device to RTMP?([CN][v1_CN_SampleIngest], [EN][v1_EN_SampleIngest]) +* Usage: How to forward stream to other servers?([CN][v3_CN_SampleForward], [EN][v3_EN_SampleForward]) +* Usage: How to improve edge performance for multiple CPUs? ([CN][v3_CN_REUSEPORT], [EN][v3_EN_REUSEPORT]) +* Usage: How to file a bug or contact us? ([CN][v1_CN_Contact], [EN][v1_EN_Contact]) * [SRS 4.0 English Wiki][v4_EN_Home] * [SRS 4.0 Chinese Wiki][v4_CN_Home] -For previous versions, please read: - -* [SRS 3.0 English Wiki][v3_EN_Home] -* [SRS 3.0 Chinese Wiki][v3_CN_Home] -* [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. @@ -1273,7 +1292,7 @@ git clone https://github.com/ossrs/srs.git Supported operating systems and hardware: * All Linux, both 32 and 64 bits -* Other OS, such as Windows, please use [docker][docker-srs3]. +* Other OS, such as Windows, please use [docker][docker-srs4]. Beijing, 2013.10
Winlin @@ -1327,7 +1346,8 @@ Winlin [console]: http://ossrs.net:1985/console [player]: http://ossrs.net/players/srs_player.html [modules]: https://github.com/ossrs/srs/blob/develop/trunk/modules/readme.txt -[docker-srs3]: https://github.com/ossrs/srs-docker#srs3 +[docker-srs3]: https://github.com/ossrs/srs-docker/tree/v3#usage +[docker-srs4]: https://github.com/ossrs/srs-docker/tree/v4#usage [docker-dev]: https://github.com/ossrs/srs-docker/tree/dev#usage [v1_CN_Git]: https://github.com/ossrs/srs/wiki/v1_CN_Git From c143b6bfd0649bf23ee7df36137747e449145d4c Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 5 Mar 2021 09:53:15 +0800 Subject: [PATCH 2/2] Squash SRS3: Update README for docker --- README.md | 27 +++++++++++++++++++-------- trunk/src/core/srs_core_version3.hpp | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bad93ce62..0d258e561 100755 --- a/README.md +++ b/README.md @@ -16,13 +16,17 @@ SRS is a RTMP/HLS/WebRTC/SRT/GB28181 streaming cluster, high efficiency, stable Recommend to run SRS by [docker][docker-srs4]: ```bash -# From Aliyun CR, for developers in China. +docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \ + ossrs/srs:v4.0.76 + +# Or, for developers in China to speedup. docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \ registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.76 -# From docker hub, depends on your network. +# For macOS to enable WebRTC, other OS please see #307. docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \ - ossrs/srs:v4.0.76 + --env CANDIDATE=$(ifconfig en0 inet| grep 'inet '|awk '{print $2}') -p 8000:8000/udp \ + registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.76 ``` > Note: All [tags](https://github.com/ossrs/srs/tags) are available, such as @@ -32,21 +36,27 @@ docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \ > To enable WebRTC, user MUST set the env `CANDIDATE`, see [#307](https://github.com/ossrs/srs/issues/307#issue-76908382). -If success, please open [http://localhost:8080/](http://localhost:8080/), then publish +If it works, open [http://localhost:8080/](http://localhost:8080/) to check it, then publish [stream](https://github.com/ossrs/srs/blob/3.0release/trunk/doc/source.200kbps.768x320.flv) by: ```bash ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy \ - -f flv rtmp://127.0.0.1/live/livestream + -f flv rtmp://localhost/live/livestream + +# Or by FFmpeg docker +docker run --rm --network=host registry.cn-hangzhou.aliyuncs.com/ossrs/srs:encoder \ + ffmpeg -re -i ./doc/source.200kbps.768x320.flv -c copy \ + -f flv -y rtmp://localhost/live/livestream ``` > Note: If WebRTC enabled, you can publish by [H5](http://localhost:8080/players/rtc_publisher.html?autostart=true). Play the following streams by players: -* VLC: rtmp://127.0.0.1/live/livestream -* H5: [http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv&port=8080&schema=http) -* H5: [http://localhost:8080/live/livestream.m3u8](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.m3u8&port=8080&schema=http) +* VLC(RTMP): rtmp://localhost/live/livestream +* H5(HTTP-FLV): [http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv&port=8080&schema=http) +* H5(HLS): [http://localhost:8080/live/livestream.m3u8](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.m3u8&port=8080&schema=http) +* H5(WebRTC): [webrtc://localhost/live/livestream](http://localhost:8080/players/rtc_player.html?autostart=true) > The online demos and players are available on [ossrs.net](https://ossrs.net). @@ -247,6 +257,7 @@ Other documents: ## V3 changes +* v3.0, 2021-03-05, Refine usage to docker by default. 3.0.158 * v3.0, 2021-01-07, Change id from int to string for the statistics. 3.0.157 * v3.0, 2021-01-02, [3.0 release3(3.0.156)][r3.0r3] released. 122736 lines. * v3.0, 2020-12-26, For RTMP edge/forward, pass vhost in tcUrl, not in stream. 3.0.156 diff --git a/trunk/src/core/srs_core_version3.hpp b/trunk/src/core/srs_core_version3.hpp index a3d519d3f..b4c8f7273 100644 --- a/trunk/src/core/srs_core_version3.hpp +++ b/trunk/src/core/srs_core_version3.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION3_HPP #define SRS_CORE_VERSION3_HPP -#define SRS_VERSION3_REVISION 157 +#define SRS_VERSION3_REVISION 158 #endif