From 78f1ebfcb1c64bfdd7275ecf6954725f273c8c48 Mon Sep 17 00:00:00 2001 From: Winlin Date: Fri, 12 May 2023 17:18:30 +0800 Subject: [PATCH] Improve README and documents with AI. v5.0.153. v6.0.43 (#3538) * Improve README with AI and add new features 1. Update README file with AI to make it more informative and user-friendly 2. Add a detailed table of contents (TOC) with an introduction for easy navigation 3. Introduce an auto-detecting Automake feature that displays the correct installation command 4. Add support for SRT to HTTP-TS config file 5. Refine the WHIP delete location URL 6. Add support for disabling encryption for WHIP or WHEP This pull request aims to enhance the quality of the project by introducing innovative features and making the necessary updates. These updates will help users navigate the project more efficiently while also improving the overall project's quality. --------- Co-authored-by: ChenGH Co-authored-by: john --- README.md | 142 ++++++----- trunk/auto/depends.sh | 12 + trunk/conf/srt2ts.conf | 55 ++++ trunk/doc/CHANGELOG.md | 3 +- trunk/doc/PERFORMANCE.md | 359 +++------------------------ trunk/src/app/srs_app_rtc_api.cpp | 17 +- trunk/src/core/srs_core_version5.hpp | 2 +- trunk/src/core/srs_core_version6.hpp | 2 +- 8 files changed, 201 insertions(+), 391 deletions(-) create mode 100644 trunk/conf/srt2ts.conf diff --git a/README.md b/README.md index 99c4b89f8..ecca38f81 100755 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![](https://codecov.io/gh/ossrs/srs/branch/develop/graph/badge.svg?token=Zx2LhdtA39)](https://app.codecov.io/gh/ossrs/srs/tree/develop) [![](https://ossrs.net/wiki/images/wechat-badge4.svg)](https://ossrs.net/lts/zh-cn/contact#discussion) [![](https://img.shields.io/twitter/follow/srs_server?style=social)](https://twitter.com/srs_server) +[![](https://img.shields.io/badge/SRS-YouTube-red)](https://www.youtube.com/@srs_server) [![](https://badgen.net/discord/members/yZ4BnPmHAd)](https://discord.gg/yZ4BnPmHAd) [![](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fossrs%2Fsrs.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Fossrs%2Fsrs?ref=badge_small) [![](https://ossrs.net/wiki/images/srs-faq.svg)](https://ossrs.net/lts/zh-cn/faq) @@ -17,104 +18,113 @@ [![](https://api.securityscorecards.dev/projects/github.com/ossrs/srs/badge)](https://api.securityscorecards.dev/projects/github.com/ossrs/srs) [![](https://bestpractices.coreinfrastructure.org/projects/5619/badge)](https://bestpractices.coreinfrastructure.org/projects/5619) -SRS/6.0 ([Hang](https://ossrs.net/lts/zh-cn/product#release60)) is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT/MPEG-DASH/GB28181, Linux/Windows/macOS, X86_64/ARMv7/AARCH64/M1/RISCV/LOONGARCH/MIPS, and essential [features](trunk/doc/Features.md#features). +SRS/6.0 ([Hang](https://ossrs.net/lts/zh-cn/product#release60)) 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](trunk/doc/Features.md#features). [![SRS Overview](https://ossrs.net/wiki/images/SRS-SingleNode-4.0-sd.png?v=114)](https://ossrs.net/wiki/images/SRS-SingleNode-4.0-hd.png) -> Note: The single node architecture for SRS, for detail please see [here](https://www.figma.com/file/333POxVznQ8Wz1Rxlppn36/SRS-4.0-Server-Arch). +> Note: For more details on the single-node architecture for SRS, please visit the following [link](https://www.figma.com/file/333POxVznQ8Wz1Rxlppn36/SRS-4.0-Server-Arch). -SRS is licenced under [MIT](https://github.com/ossrs/srs/blob/develop/LICENSE) or [MulanPSL-2.0](https://spdx.org/licenses/MulanPSL-2.0.html), -and note that [MulanPSL-2.0 is compatible with Apache-2.0](https://www.apache.org/legal/resolved.html#category-a), -but some third-party libraries are distributed using their [own licenses](https://ossrs.io/lts/en-us/license). +SRS is licenced under [MIT](https://github.com/ossrs/srs/blob/develop/LICENSE) or [MulanPSL-2.0](https://spdx.org/licenses/MulanPSL-2.0.html). +Please note that while [MulanPSL-2.0 is compatible with Apache-2.0](https://www.apache.org/legal/resolved.html#category-a), +some third-party libraries are distributed under their [licenses](https://ossrs.io/lts/en-us/license). ## Usage -Please read guide [Getting Started](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started) or [中文文档:起步](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started). +Please refer to the [Getting Started](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started) or [中文文档:起步](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started) guide. -To build SRS from source: +To compile SRS from source: ``` git clone -b develop https://gitee.com/ossrs/srs.git && cd srs/trunk && ./configure && make && ./objs/srs -c conf/srs.conf ``` -Open [http://localhost:8080/](http://localhost:8080/) to check it, then publish -by [FFmpeg](https://ffmpeg.org/download.html) or [OBS](https://obsproject.com/download) as: +Open [http://localhost:8080/](http://localhost:8080/) to verify, and then stream using the following +[FFmpeg](https://ffmpeg.org/download.html) command: ```bash ffmpeg -re -i ./doc/source.flv -c copy -f flv -y rtmp://localhost/live/livestream ``` -Play the following streams by [players](https://ossrs.net): +Alternatively, stream by [OBS](https://obsproject.com/download) using the following configuration: -* RTMP (by [VLC](https://www.videolan.org/)): 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) +* Service: `Custom` +* Server: `rtmp://localhost/live` +* Stream Key: `livestream` -Note that if convert RTMP to WebRTC, please use [`rtmp2rtc.conf`](https://github.com/ossrs/srs/issues/2728#issuecomment-964686152): +Play the following streams using media players: -* H5(WebRTC): [webrtc://localhost/live/livestream](http://localhost:8080/players/rtc_player.html?autostart=true) +* To play an RTMP stream with URL `rtmp://localhost/live/livestream` on [VLC player](https://www.videolan.org/), open the player, go to Media > Open Network Stream, enter the URL and click Play. +* You can play HTTP-FLV stream URL [http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.flv) on a webpage using the srs-player, an HTML5-based player. +* Use srs-player for playing HLS stream with URL [http://localhost:8080/live/livestream.m3u8](http://localhost:8080/players/srs_player.html?autostart=true&stream=livestream.m3u8). -> Note: Besides of FFmpeg or OBS, it's also able to [publish by H5](http://localhost:8080/players/rtc_publisher.html?autostart=true) -> if **WebRTC([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/webrtc#rtc-to-rtmp))** is enabled, -> please remember to set the **CANDIDATE([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate) or [EN](https://ossrs.io/lts/en-us/docs/v4/doc/webrtc#config-candidate))** for WebRTC. +Please note that to convert RTMP to WebRTC, you should use the file [rtmp2rtc.conf](https://github.com/ossrs/srs/issues/2728#issuecomment-964686152). -> Highly recommend that directly run SRS by -> **docker([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started))**, -> **Cloud Virtual Machine([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started-cloud) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started-cloud))**, -> or **K8s([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started-k8s) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started-k8s))**, -> however it's also easy to build SRS from source code, for detail please see -> **Getting Started([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started))**. +* Use the srs-player to play the WebRTC stream with URL [http://localhost:1985/rtc/v1/whip-play/?app=live&stream=livestream](http://localhost:8080/players/whep.html?autostart=true) via WHEP. -> Note: If need HTTPS, by which WebRTC and modern browsers require, please read -> **HTTPS API([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/http-api#https-api) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/http-api#https-api))** -> and **HTTPS Callback([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/http-callback#https-callback) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/http-callback#https-callback))** -> and **HTTPS Live Streaming([CN](https://ossrs.io/lts/en-us/docs/v4/doc/delivery-http-flv#https-flv-live-stream) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/delivery-http-flv#https-flv-live-stream))**, -> however HTTPS proxy also works perfect with SRS such as Nginx. +> Note: In addition to FFmpeg or OBS, it is possible to [publish by H5](http://localhost:8080/players/whip.html) via WHIP as well. +> To enable WebRTC to publish and convert it to RTMP, please refer to the wiki([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/webrtc#rtc-to-rtmp)) documentation. +> It is essential to ensure the candidate([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate) or [EN](https://ossrs.io/lts/en-us/docs/v4/doc/webrtc#config-candidate)) +> is set correctly for WebRTC to avoid potential issues, as it can cause significant problems. + +> Note: It is highly recommended to run SRS directly with docker([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started)), +> CVM([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started-cloud) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started-cloud)), +> or K8s([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started-k8s) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started-k8s)). +> However, compiling SRS from source code is also possible and easy. For detailed instructions, please refer to the +> "Getting Started"([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/getting-started)) guide. + +> Note: If you require HTTPS for WebRTC and modern browsers, please refer to the HTTPS API([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/http-api#https-api) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/http-api#https-api)), +> HTTPS Callback([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/http-callback#https-callback) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/http-callback#https-callback)), +> and HTTPS Live Streaming([CN](https://ossrs.io/lts/en-us/docs/v4/doc/delivery-http-flv#https-flv-live-stream) / [EN](https://ossrs.io/lts/en-us/docs/v4/doc/delivery-http-flv#https-flv-live-stream)) +> documentation. Additionally, SRS works perfectly with an HTTPS proxy like Nginx. -From here, please read wikis: - -* How to deliver RTMP streaming?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-rtmp), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-rtmp)) -* How to deliver WebRTC streaming? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/webrtc)) -* How to covert RTMP to HTTP-FLV streaming?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http-flv), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-http-flv)) -* How to covert RTMP to HLS streaming?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls)) -* How to deliver low-latency streaming?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-realtime), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-realtime)) -* How to build RTMP Edge-Cluster?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-rtmp-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-rtmp-cluster)) -* How to build RTMP Origin-Cluster?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-origin-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-origin-cluster)) -* How to build HLS Edge-Cluster?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls-cluster)) - -Other important wiki: - -* Usage: How to deliver DASH(Experimental)?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-dash), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-dash)) -* Usage: How to transode RTMP stream by FFMPEG?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-ffmpeg), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-ffmpeg)) -* Usage: How to deliver HTTP FLV Live Streaming Cluster?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http-flvCluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-http-flvCluster)) -* Usage: How to deliver HLS by NGINX Cluster?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls-cluster)) -* Usage: How to ingest file/stream/device to RTMP?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-ingest), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-ingest)) -* Usage: How to forward stream to other servers?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-forward), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-forward)) -* Usage: How to improve edge performance for multiple CPUs? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/reuse-port)) -* Usage: How to file a bug or contact us? ([CN](https://ossrs.net/lts/zh-cn/contact), [EN](https://ossrs.io/lts/en-us/contact)) +Please refer to the following wikis for more information: + +* What are the steps to deliver RTMP streaming? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-rtmp), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-rtmp)) +* What is the process for delivering WebRTC streaming? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/webrtc)) +* What are the steps to convert RTMP to HTTP-FLV streaming? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http-flv), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-http-flv)) +* How can RTMP be converted to HLS streaming? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls)) +* What is the best approach for delivering low-latency streaming? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-realtime), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-realtime)) +* How can an RTMP Edge-Cluster be constructed? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-rtmp-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-rtmp-cluster)) +* What is the process for building an RTMP Origin-Cluster? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-origin-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-origin-cluster)) +* How can an HLS Edge-Cluster be set up?([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls-cluster)) + +Here are some other important wikis: + +* Usage: What is the method for delivering DASH (Experimental)? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-dash), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-dash)) +* Usage: How can an RTMP stream be transcoded using FFMPEG? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-ffmpeg), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-ffmpeg)) +* Usage: What is the process for setting up an HTTP FLV Live Streaming Cluster? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http-flvCluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-http-flvCluster)) +* Usage: How can HLS be delivered using an NGINX Cluster? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls-cluster), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls-cluster)) +* Usage: What steps are to ingest a file, stream, or device to RTMP? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-ingest), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-ingest)) +* Usage: How can a stream be forwarded to other servers? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-forward), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-forward)) +* Usage: What are the strategies for improving edge performance on multiple CPUs? ([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/reuse-port)) +* Usage: How can bugs be reported or contact be made with us? ([CN](https://ossrs.net/lts/zh-cn/contact), [EN](https://ossrs.io/lts/en-us/contact)) ## AUTHORS -Thank you to all our contributors! 🙏 +We highly appreciate all our contributors for their significant contributions that have made a remarkable difference. +Thank you! 🙏 -You may provide financial support for this project by donating [via Open Collective](https://opencollective.com/srs-server/contribute/backer-34941/checkout?interval=month&amount=5). Thank you for your support! +If you wish to support this project financially, you can donate [through Open Collective](https://opencollective.com/srs-server). +We appreciate your contribution! [![](https://opencollective.com/srs-server/backers.svg?width=800&button=true)](https://opencollective.com/srs-server/contribute/backer-34941/checkout?interval=month&amount=5) The [TOC(Technical Oversight Committee)](trunk/AUTHORS.md#toc) and [contributors](trunk/AUTHORS.md#contributors): -* [Winlin](https://github.com/winlinvip): Focus on [ST](https://github.com/ossrs/state-threads) and [Issues/PR](https://github.com/ossrs/srs/issues). -* [ZhaoWenjie](https://github.com/wenjiegit): Focus on [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) and [Windows](https://github.com/ossrs/srs/issues/2532). -* [ShiWei](https://github.com/runner365): Focus on [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki) and [H.265](https://github.com/ossrs/srs/issues/465). -* [XiaoZhihong](https://github.com/xiaozhihong): Focus on [WebRTC/QUIC](https://github.com/ossrs/srs/issues/2091) and [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki). -* [WuPengqiang](https://github.com/Bepartofyou): Focus on [H.265](https://github.com/ossrs/srs/issues/465). -* [XiaLixin](https://github.com/xialixin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500). -* [LiPeng](https://github.com/lipeng19811218): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC). -* [ChenGuanghua](https://github.com/chen-guanghua): Focus on [WebRTC/QoS](https://github.com/ossrs/srs/issues/2051). -* [ChenHaibo](https://github.com/duiniuluantanqin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) and [API](https://github.com/ossrs/srs/issues/1657). +* [Winlin](https://github.com/winlinvip): Founder of the project, focusing on ST and Issues/PR. Responsible for architecture and maintenance. +* [ZhaoWenjie](https://github.com/wenjiegit): One of the earliest contributors, focusing on HDS and Windows. Has expertise in client technology. +* [ShiWei](https://github.com/runner365): Specializes in SRT and H.265, maintaining SRT and FLV patches for FFmpeg. An expert in codecs and FFmpeg. +* [XiaoZhihong](https://github.com/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](https://github.com/Bepartofyou): Focused on H.265, initially contributed to the FFmpeg module in SRS for transcoding AAC with OPUS for WebRTC. +* [XiaLixin](https://github.com/xialixin): Specializes in GB28181, with expertise in live streaming and WebRTC. +* [LiPeng](https://github.com/lipeng19811218): Concentrates on WebRTC and contributes to memory management and smart pointers. +* [ChenGuanghua](https://github.com/chen-guanghua): Focused on WebRTC/QoS and introduced the Asan toolchain to SRS. +* [ChenHaibo](https://github.com/duiniuluantanqin): Specializes in GB28181 and HTTP API, contributing to patches for FFmpeg with WHIP. A big `THANK YOU` also goes to: @@ -124,16 +134,16 @@ A big `THANK YOU` also goes to: ## Contributing -We are grateful to the community for contributing bugfix and improvements, please follow the -[guide](https://github.com/ossrs/srs/contribute). +We extend our heartfelt gratitude to the community for their contributions in identifying bugs and enhancing the project. +To stay connected with us and keep contributing to our community, please follow the [guide](https://github.com/ossrs/srs/contribute). ## LICENSE [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fossrs%2Fsrs.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Fossrs%2Fsrs?ref=badge_small) -SRS is licenced under [MIT](https://github.com/ossrs/srs/blob/develop/LICENSE) or [MulanPSL-2.0](https://spdx.org/licenses/MulanPSL-2.0.html), -and note that [MulanPSL-2.0 is compatible with Apache-2.0](https://www.apache.org/legal/resolved.html#category-a), -but some third-party libraries are distributed using their [own licenses](https://ossrs.net/lts/zh-cn/license). +SRS is licenced under [MIT](https://github.com/ossrs/srs/blob/develop/LICENSE) or [MulanPSL-2.0](https://spdx.org/licenses/MulanPSL-2.0.html). +Please note that while [MulanPSL-2.0 is compatible with Apache-2.0](https://www.apache.org/legal/resolved.html#category-a), +some third-party libraries are distributed under their [licenses](https://ossrs.io/lts/en-us/license). [![](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fossrs%2Fsrs.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fossrs%2Fsrs?ref=badge_large) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 716e5dfd1..d93fae966 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -121,6 +121,18 @@ unzip -v >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then fi exit $ret; fi +automake --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then + if [[ $OS_IS_CENTOS == YES ]]; then + echo "Please install automake by:" + echo " yum install -y automake" + elif [[ $OS_IS_UBUNTU == YES ]]; then + echo "Please install automake by:" + echo " apt install -y automake" + else + echo "Please install automake" + fi + exit $ret; +fi if [[ $SRS_VALGRIND == YES ]]; then valgrind --version >/dev/null 2>/dev/null; ret=$?; if [[ 0 -ne $ret ]]; then echo "Please install valgrind"; exit $ret; diff --git a/trunk/conf/srt2ts.conf b/trunk/conf/srt2ts.conf new file mode 100644 index 000000000..0f2ef1918 --- /dev/null +++ b/trunk/conf/srt2ts.conf @@ -0,0 +1,55 @@ + +listen 1935; +max_connections 1000; +daemon off; +srs_log_tank console; + +http_api { + enabled on; + listen 1985; +} + +http_server { + enabled on; + listen 8080; + dir ./objs/nginx/html; +} + +srt_server { + enabled on; + listen 10080; + maxbw 1000000000; + connect_timeout 4000; + peerlatency 0; + recvlatency 0; +} + +rtc_server { + enabled on; + # Listen at udp://8000 + listen 8000; + # + # The $CANDIDATE means fetch from env, if not configed, use * as default. + # + # The * means retrieving server IP automatically, from all network interfaces, + # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate + candidate $CANDIDATE; +} + +# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026 +vhost __defaultVhost__ { + srt { + enabled on; + } + rtc { + enabled on; + # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc + rtmp_to_rtc on; + # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp + rtc_to_rtmp on; + } + http_remux { + enabled on; + mount [vhost]/[app]/[stream].ts; + } +} diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 48adf7e67..26a2581ae 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 6.0 Changelog +* v6.0, 2023-05-12, Merge [#3539](https://github.com/ossrs/srs/pull/3539): WHIP: Improve HTTP DELETE for notifying server unpublish event. v6.0.43 (#3539) * v6.0, 2023-04-08, Merge [#3495](https://github.com/ossrs/srs/pull/3495): RTMP: Support enhanced RTMP specification for HEVC. v6.0.42 (#3495) * v6.0, 2023-04-01, Merge [#3392](https://github.com/ossrs/srs/pull/3392): Support composited bridges for 1:N protocols converting. v6.0.41 (#3392) * v6.0, 2023-04-01, Merge [#3458](https://github.com/ossrs/srs/pull/3450): API: Support HTTP basic authentication for API. v6.0.40 (#3458) @@ -56,7 +57,7 @@ The changelog for SRS. ## SRS 5.0 Changelog -* v5.0, 2023-04-01, Merge [#3458](https://github.com/ossrs/srs/pull/3450): API: Support HTTP basic authentication for API. v5.0.152 (#3458) +* v5.0, 2023-05-12, Merge [#3539](https://github.com/ossrs/srs/pull/3539): WHIP: Improve HTTP DELETE for notifying server unpublish event. v5.0.153 (#3539) * v5.0, 2023-03-27, Merge [#3450](https://github.com/ossrs/srs/pull/3450): WebRTC: Error message carries the SDP when failed. v5.0.151 (#3450) * v5.0, 2023-03-25, Merge [#3477](https://github.com/ossrs/srs/pull/3477): Remove unneccessary NULL check in srs_freep. v5.0.150 (#3477) * v5.0, 2023-03-25, Merge [#3455](https://github.com/ossrs/srs/pull/3455): RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149 (#3455) diff --git a/trunk/doc/PERFORMANCE.md b/trunk/doc/PERFORMANCE.md index f66c5a637..8fb81d220 100644 --- a/trunk/doc/PERFORMANCE.md +++ b/trunk/doc/PERFORMANCE.md @@ -1,46 +1,41 @@ # Performance -The performance benchmark data and corelative commits are listed here. - -* See also: [Performance for x86/x64 Test Guide][v4_CN_Performance]. -* See also: [Performance for RaspberryPi][v4_CN_RaspberryPi]. -* For multiple processes performance, read [#775: REUSEPORT][bug #775] or OriginCluster([CN][v4_EN_OriginCluster]/[EN][v4_EN_OriginCluster]). -* For RTC benchmark, please use [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage). - - -**Play RTMP benchmark** - -The data for playing RTMP was benchmarked by [SB][srs-bench]: - - -| Update | SRS | Clients | Type | CPU | Memory | Commit | -| ------------- | --------- | ------------- | ------------- | --------- | -------- | ------------ | -| 2014-12-07 | 2.0.67 | 10k(10000) | players | 95% | 656MB | [code][p12] | -| 2014-12-05 | 2.0.57 | 9.0k(9000) | players | 90% | 468MB | [code][p11] | -| 2014-12-05 | 2.0.55 | 8.0k(8000) | players | 89% | 360MB | [code][p10] | -| 2014-11-22 | 2.0.30 | 7.5k(7500) | players | 87% | 320MB | [code][p9] | -| 2014-11-13 | 2.0.15 | 6.0k(6000) | players | 82% | 203MB | [code][p8] | -| 2014-11-12 | 2.0.14 | 3.5k(3500) | players | 95% | 78MB | [code][p7] | -| 2014-11-12 | 2.0.14 | 2.7k(2700) | players | 69% | 59MB | - | -| 2014-11-11 | 2.0.12 | 2.7k(2700) | players | 85% | 66MB | - | -| 2014-11-11 | 1.0.5 | 2.7k(2700) | players | 85% | 66MB | - | -| 2014-07-12 | 0.9.156 | 2.7k(2700) | players | 89% | 61MB | [code][p6] | -| 2014-07-12 | 0.9.156 | 1.8k(1800) | players | 68% | 38MB | - | -| 2013-11-28 | 0.5.0 | 1.8k(1800) | players | 90% | 41M | - | +Here are the listed performance benchmark data with corresponding commits for your reference. + +* [Performance Guide for x86/x64 Tests.](https://ossrs.net/lts/zh-cn/docs/v4/doc/performance) +* [Performance Guide for RaspberryPi.](https://ossrs.net/lts/zh-cn/docs/v4/doc/raspberrypi) +* If you are interested in multiple processes performance, please refer to [#775](https://github.com/ossrs/srs/issues/775): REUSEPORT or OriginCluster([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/origin-cluster)/[EN](https://ossrs.io/lts/en-us/docs/v4/doc/origin-cluster)). +* For RTC benchmarking, you may use [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage). + +## Play RTMP benchmark + +The following data reflects the performance of RTMP playback, as tested using the [srs-bench](https://github.com/ossrs/srs-bench) tool: + +| Update | SRS | Clients | Type | CPU | Memory | Commit | +| ------------- | --------- | ------------- | ------------- | --------- | -------- |--------------------------------------------------------------------------------------| +| 2014-12-07 | 2.0.67 | 10k(10000) | players | 95% | 656MB | [code](https://github.com/ossrs/srs/commit/1311b6fe6576fd7b9c6d299b0f8f2e8d202f4bf8) | +| 2014-12-05 | 2.0.57 | 9.0k(9000) | players | 90% | 468MB | [code](https://github.com/ossrs/srs/commit/9ee138746f83adc26f0e236ec017f4d68a300004) | +| 2014-12-05 | 2.0.55 | 8.0k(8000) | players | 89% | 360MB | [code](https://github.com/ossrs/srs/commit/58136ec178e3d47db6c90a59875d7e40946936e5) | +| 2014-11-22 | 2.0.30 | 7.5k(7500) | players | 87% | 320MB | [code](https://github.com/ossrs/srs/commit/58136ec178e3d47db6c90a59875d7e40946936e5) | +| 2014-11-13 | 2.0.15 | 6.0k(6000) | players | 82% | 203MB | [code](https://github.com/ossrs/srs/commit/cc6aca9ad55342a06440ce7f3b38453776b2b2d1) | +| 2014-11-12 | 2.0.14 | 3.5k(3500) | players | 95% | 78MB | [code](https://github.com/ossrs/srs/commit/8acd143a7a152885b815999162660fd4e7a3f247) | +| 2014-11-12 | 2.0.14 | 2.7k(2700) | players | 69% | 59MB | - | +| 2014-11-11 | 2.0.12 | 2.7k(2700) | players | 85% | 66MB | - | +| 2014-11-11 | 1.0.5 | 2.7k(2700) | players | 85% | 66MB | - | +| 2014-07-12 | 0.9.156 | 2.7k(2700) | players | 89% | 61MB | [code](https://github.com/ossrs/srs/commit/1ae3e6c64cc5cee90e6050c26968ebc3c18281be) | +| 2014-07-12 | 0.9.156 | 1.8k(1800) | players | 68% | 38MB | - | +| 2013-11-28 | 0.5.0 | 1.8k(1800) | players | 90% | 41M | - | | Update | SFU | Clients | Type | CPU | Memory | Threads | VM | | ---------- | ---------------- | -------- | ------------- | --------- | -------- | ------- | ---- | | 2021-05-11 | SRS/v4.0.105 | 4000 | players | ~94% x1 | 419MB | 1 | G5 8CPU | | 2021-05-11 | NginxRTMP/v1.2.1 | 2400 | players | ~92% x1 | 173MB | 1 | G5 8CPU | -> Note: CentOS7, 600Kbps, [ECS/G5-2.5GHZ(SkyLake)](https://help.aliyun.com/document_detail/25378.html), -> [SRS/v4.0.105](https://github.com/ossrs/srs/commit/2ad24b2313e88a85801deaea370204f225555939), -> [NginxRTMP/v1.2.1](https://github.com/arut/nginx-rtmp-module/releases/tag/v1.2.1). +> Note: The test was conducted on CentOS7 with a video bitrate of 600Kbps and CPU of G5-2.5GHZ (SkyLake). - -**Publish RTMP benchmark** +## Publish RTMP benchmark -The data for publishing RTMP was benchmarked by [SB][srs-bench]: +The following data reflects RTMP publishing performance, as tested using the [srs-bench](https://github.com/ossrs/srs-bench) tool: | Update | SRS | Clients | Type | CPU | Memory | Commit | | ------------- | --------- | ------------- | ------------- | --------- | -------- | ------------ | @@ -59,15 +54,11 @@ The data for publishing RTMP was benchmarked by [SB][srs-bench]: | 2021-05-11 | SRS/v4.0.105 | 2300 | publishers | ~89% x1 | 1.1GB | 1 | G5 8CPU | | 2021-05-11 | NginxRTMP/v1.2.1 | 1300 | publishers | ~84% x1 | 198MB | 1 | G5 8CPU | -> Note: CentOS7, 600Kbps, [ECS/G5-2.5GHZ(SkyLake)](https://help.aliyun.com/document_detail/25378.html), -> [SRS/v4.0.105](https://github.com/ossrs/srs/commit/2ad24b2313e88a85801deaea370204f225555939), -> [NginxRTMP/v1.2.1](https://github.com/arut/nginx-rtmp-module/releases/tag/v1.2.1). +> Note: The test was conducted on CentOS7 with a video bitrate of 600Kbps and CPU of G5-2.5GHZ (SkyLake). - -**Play HTTP FLV benchmark** - -The data for playing HTTP FLV was benchmarked by [SB][srs-bench]: +##Play HTTP FLV benchmark +Here is the data for HTTP-FLV playback, as tested using the [srs-bench](https://github.com/ossrs/srs-bench) tool: | Update | SRS | Clients | Type | CPU | Memory | Commit | | ------------- | --------- | ------------- | ------------- | --------- | -------- | ------------ | @@ -77,10 +68,9 @@ The data for playing HTTP FLV was benchmarked by [SB][srs-bench]: | 2014-05-24 | 2.0.168 | 2.3k(2300) | players | 92% | 276MB | [code][p17] | | 2014-05-24 | 2.0.167 | 1.0k(1000) | players | 82% | 86MB | - | - -**RTC benchmark** +## RTC benchmark -The RTC benchmark data, by [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage): +The following data reflects WebRTC playback performance, as tested using the [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage) tool: | Update | SFU | Clients | Type | CPU | Memory | Threads | VM | | ---------- | ------------- | -------- | ------------- | --------- | -------- | ------- | ---- | @@ -93,15 +83,12 @@ The RTC benchmark data, by [srs-bench](https://github.com/ossrs/srs-bench/tree/f | 2021-03-31 | SRS/v4.0.87 | 550 | publishers | ~86% x1 | 1.3GB | 1 | G5 2CPU | | 2021-05-10 | Janus/v0.11.1 | 350 | publishers | ~93% x2 | 405MB | 23 | G5 2CPU | -> Note: CentOS7, 600Kbps, [ECS/G5-2.5GHZ(SkyLake)/G7-2.7GHZ(IceLake)](https://help.aliyun.com/document_detail/25378.html), -> [SRS/v4.0.87](https://github.com/ossrs/srs/commit/d6c16a7e236e03eba754c763e865464ec82d4516), -> [SRS/v4.0.105](https://github.com/ossrs/srs/commit/2ad24b2313e88a85801deaea370204f225555939), -> [Janus/v0.11.1](https://github.com/meetecho/janus-gateway/releases/tag/v0.11.1). +> Note: The test was conducted on CentOS7 with a video bitrate of 600Kbps and CPU of G5-2.5GHZ (SkyLake). - -**Latency benchmark** +## Latency benchmark -The latency between encoder and player with realtime config([CN][v4_CN_LowLatency], [EN][v4_EN_LowLatency]): +The following benchmark data shows end-to-end latency tested using the srs-bench tool with SRS running in real-time +configuration([CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/low-latency), [EN](https://ossrs.io/lts/en-us/docs/v4/doc/low-latency)): | Update | SRS | Protocol | VP6 | H.264 | VP6+MP3 | H.264+MP3 | | ------------- | --------- | --------- | --------- | --------- | --------- | -------- | @@ -112,275 +99,9 @@ The latency between encoder and player with realtime config([CN][v4_CN_LowLatenc > 2018-08-05, [c45f72e](https://github.com/ossrs/srs/commit/c45f72ef7bac9c7cf85b9125fc9e3aafd53f396f), Refine HTTP-FLV latency, support realtime mode. 2.0.252 -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]. +> Note: Multiple factors can impact end-to-end latency, such as the encoder, server, protocol, player, and network. -Winlin 2021 +> Note: VLC player is not recommended for low latency use scenarios due to its large buffer, resulting in significant latency. - -[p1]: https://github.com/ossrs/srs/commit/787ab674e38734ea8e0678101614fdcd84645dc8 -[p2]: https://github.com/ossrs/srs/commit/f35ec2155b1408d528a9f37da7904c9625186bcf -[p3]: https://github.com/ossrs/srs/commit/29324fab469e0f7cef9ad04ffdbce832ac7dd9ff -[p4]: https://github.com/ossrs/srs/commit/f57801eb46c16755b173984b915a4166922df6a6 -[p5]: https://github.com/ossrs/srs/commit/5589b13d2e216b91f97afb78ee0c011b2fccf7da -[p6]: https://github.com/ossrs/srs/commit/1ae3e6c64cc5cee90e6050c26968ebc3c18281be -[p7]: https://github.com/ossrs/srs/commit/8acd143a7a152885b815999162660fd4e7a3f247 -[p8]: https://github.com/ossrs/srs/commit/cc6aca9ad55342a06440ce7f3b38453776b2b2d1 -[p9]: https://github.com/ossrs/srs/commit/58136ec178e3d47db6c90a59875d7e40946936e5 -[p10]: https://github.com/ossrs/srs/commit/58136ec178e3d47db6c90a59875d7e40946936e5 -[p11]: https://github.com/ossrs/srs/commit/9ee138746f83adc26f0e236ec017f4d68a300004 -[p12]: https://github.com/ossrs/srs/commit/1311b6fe6576fd7b9c6d299b0f8f2e8d202f4bf8 -[p13]: https://github.com/ossrs/srs/commit/10297fab519811845b549a8af40a6bcbd23411e8 -[p14]: https://github.com/ossrs/srs/commit/10297fab519811845b549a8af40a6bcbd23411e8 -[p15]: https://github.com/ossrs/srs/commit/0d6b91039d408328caab31a1077d56a809b6bebc -[p16]: https://github.com/ossrs/srs/commit/0d6b91039d408328caab31a1077d56a809b6bebc -[p17]: https://github.com/ossrs/srs/commit/fc995473eb02c7cf64b5b212b456e11f34aa7984 -[p18]: https://github.com/ossrs/srs/commit/960341b9b2b9646270ccfd113b4dd784d9826c73 -[p19]: https://github.com/ossrs/srs/commit/4df19ba99a4e4d80cd89b304f9298d343497bec9 -[p20]: https://github.com/ossrs/srs/commit/d12fc7fcc5b2e9e3c8ee5c7da01d0e41c8f8ca4a -[p21]: https://github.com/ossrs/srs/commit/87519aaae835199e5adb60c0ae2c1cd24939448c -[p22]: https://github.com/ossrs/srs/commit/5a4373d4835758188b9a1f03005cea0b6ddc62aa -[p23]: https://github.com/ossrs/srs/pull/239 - -[authors]: https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.txt -[bigthanks]: https://ossrs.net/lts/zh-cn/product#release40 -[st]: https://github.com/ossrs/state-threads -[st2]: https://github.com/ossrs/state-threads/tree/srs -[state-threads]: https://github.com/ossrs/state-threads/tree/srs -[nginx]: http://nginx.org/ -[srs]: https://github.com/ossrs/srs -[gitee]: https://gitee.com/ossrs/srs -[srs-bench]: https://github.com/ossrs/srs-bench -[srs-ngb]: https://github.com/ossrs/srs-console -[srs-librtmp]: https://github.com/ossrs/srs-librtmp -[gitlab]: https://gitlab.com/winlinvip/srs-gitlab -[console]: http://ossrs.net:8080/console -[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 - -[v4_CN_Git]: https://ossrs.net/lts/zh-cn/docs/v4/doc/git -[v4_EN_Git]: https://ossrs.io/lts/en-us/docs/v4/doc/git -[v4_CN_SampleRTMP]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-rtmp -[v4_EN_SampleRTMP]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-rtmp -[v4_CN_SampleRTMPCluster]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-rtmp-cluster -[v4_EN_SampleRTMPCluster]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-rtmp-cluster -[v4_CN_SampleOriginCluster]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-origin-cluster -[v4_EN_SampleOriginCluster]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-origin-cluster -[v4_CN_SampleHLS]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls -[v4_EN_SampleHLS]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls -[v4_CN_SampleTranscode2HLS]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-transcode-to-hls -[v4_EN_SampleTranscode2HLS]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-transcode-to-hls -[v4_CN_SampleFFMPEG]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-ffmpeg -[v4_EN_SampleFFMPEG]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-ffmpeg -[v4_CN_SampleForward]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-forward -[v4_EN_SampleForward]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-forward -[v4_CN_SampleRealtime]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-realtime -[v4_EN_SampleRealtime]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-realtime -[v4_CN_WebRTC]: https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc -[v4_EN_WebRTC]: https://ossrs.io/lts/en-us/docs/v4/doc/webrtc -[v4_CN_WebRTC#config-candidate]: https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate -[v4_EN_WebRTC#config-candidate]: https://ossrs.io/lts/en-us/docs/v4/doc/webrtc#config-candidate -[v4_CN_SampleARM]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-arm -[v4_EN_SampleARM]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-arm -[v4_CN_SampleIngest]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-ingest -[v4_EN_SampleIngest]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-ingest -[v4_CN_SampleHTTP]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http -[v4_EN_SampleHTTP]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-http -[v4_CN_SampleDemo]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sampleDemo -[v4_EN_SampleDemo]: https://ossrs.io/lts/en-us/docs/v4/doc/sampleDemo -[v4_CN_OriginCluster]: https://ossrs.net/lts/zh-cn/docs/v4/doc/origin-cluster -[v4_EN_OriginCluster]: https://ossrs.io/lts/en-us/docs/v4/doc/origin-cluster -[v4_CN_REUSEPORT]: https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port -[v4_EN_REUSEPORT]: https://ossrs.io/lts/en-us/docs/v4/doc/reuse-port -[v4_CN_Sample]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample -[v4_EN_Sample]: https://ossrs.io/lts/en-us/docs/v4/doc/sample - -[v4_CN_Build]: https://ossrs.net/lts/zh-cn/docs/v4/doc/install -[v4_EN_Build]: https://ossrs.io/lts/en-us/docs/v4/doc/install -[v4_CN_Performance]: https://ossrs.net/lts/zh-cn/docs/v4/doc/performance -[v4_EN_Performance]: https://ossrs.io/lts/en-us/docs/v4/doc/performance -[v4_CN_DeliveryRTMP]: https://ossrs.net/lts/zh-cn/docs/v4/doc/delivery-rtmp -[v4_EN_DeliveryRTMP]: https://ossrs.io/lts/en-us/docs/v4/doc/delivery-rtmp -[v4_CN_Edge]: https://ossrs.net/lts/zh-cn/docs/v4/doc/edge -[v4_EN_Edge]: https://ossrs.io/lts/en-us/docs/v4/doc/edge -[v4_CN_RtmpUrlVhost]: https://ossrs.net/lts/zh-cn/docs/v4/doc/rtmp-url-vhost -[v4_EN_RtmpUrlVhost]: https://ossrs.io/lts/en-us/docs/v4/doc/rtmp-url-vhost -[v4_CN_RTMPHandshake]: https://ossrs.net/lts/zh-cn/docs/v4/doc/rtmp-handshake -[v4_EN_RTMPHandshake]: https://ossrs.io/lts/en-us/docs/v4/doc/rtmp-handshake -[v4_CN_HTTPServer]: https://ossrs.net/lts/zh-cn/docs/v4/doc/http-server -[v4_EN_HTTPServer]: https://ossrs.io/lts/en-us/docs/v4/doc/http-server -[v4_CN_DeliveryHLS]: https://ossrs.net/lts/zh-cn/docs/v4/doc/delivery-hls -[v4_EN_DeliveryHLS]: https://ossrs.io/lts/en-us/docs/v4/doc/delivery-hls -[v4_CN_DeliveryHLS2]: https://ossrs.net/lts/zh-cn/docs/v4/doc/delivery-hls#hlsaudioonly -[v4_EN_DeliveryHLS2]: https://ossrs.io/lts/en-us/docs/v4/doc/delivery-hls#hlsaudioonly -[v4_CN_Reload]: https://ossrs.net/lts/zh-cn/docs/v4/doc/reload -[v4_EN_Reload]: https://ossrs.io/lts/en-us/docs/v4/doc/reload -[v4_CN_LowLatency2]: https://ossrs.net/lts/zh-cn/docs/v4/doc/low-latency#gop-cache -[v4_EN_LowLatency2]: https://ossrs.io/lts/en-us/docs/v4/doc/low-latency#gop-cache -[v4_CN_Forward]: https://ossrs.net/lts/zh-cn/docs/v4/doc/forward -[v4_EN_Forward]: https://ossrs.io/lts/en-us/docs/v4/doc/forward -[v4_CN_FFMPEG]: https://ossrs.net/lts/zh-cn/docs/v4/doc/ffmpeg -[v4_EN_FFMPEG]: https://ossrs.io/lts/en-us/docs/v4/doc/ffmpeg -[v4_CN_HTTPCallback]: https://ossrs.net/lts/zh-cn/docs/v4/doc/http-callback -[v4_EN_HTTPCallback]: https://ossrs.io/lts/en-us/docs/v4/doc/http-callback -[v4_CN_SampleDemo]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sampleDemo -[v4_EN_SampleDemo]: https://ossrs.io/lts/en-us/docs/v4/doc/sampleDemo -[v4_CN_SrsLinuxArm]: https://ossrs.net/lts/zh-cn/docs/v4/doc/arm -[v4_EN_SrsLinuxArm]: https://ossrs.io/lts/en-us/docs/v4/doc/arm -[v4_CN_LinuxService]: https://ossrs.net/lts/zh-cn/docs/v4/doc/service -[v4_EN_LinuxService]: https://ossrs.io/lts/en-us/docs/v4/doc/service -[v4_CN_RTMP-ATC]: https://ossrs.net/lts/zh-cn/docs/v4/doc/rtmp-atc -[v4_EN_RTMP-ATC]: https://ossrs.io/lts/en-us/docs/v4/doc/rtmp-atc -[v4_CN_HTTPApi]: https://ossrs.net/lts/zh-cn/docs/v4/doc/http-api -[v4_EN_HTTPApi]: https://ossrs.io/lts/en-us/docs/v4/doc/http-api -[v4_CN_Ingest]: https://ossrs.net/lts/zh-cn/docs/v4/doc/ingest -[v4_EN_Ingest]: https://ossrs.io/lts/en-us/docs/v4/doc/ingest -[v4_CN_DVR]: https://ossrs.net/lts/zh-cn/docs/v4/doc/dvr -[v4_EN_DVR]: https://ossrs.io/lts/en-us/docs/v4/doc/dvr -[v4_CN_SrsLog]: https://ossrs.net/lts/zh-cn/docs/v4/doc/log -[v4_EN_SrsLog]: https://ossrs.io/lts/en-us/docs/v4/doc/log -[v4_CN_DRM2]: https://ossrs.net/lts/zh-cn/docs/v4/doc/drm#tokentraverse -[v4_EN_DRM2]: https://ossrs.io/lts/en-us/docs/v4/doc/drm#tokentraverse -[v4_CN_SampleHTTP]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http -[v4_EN_SampleHTTP]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-http -[v4_CN_FlvVodStream]: https://ossrs.net/lts/zh-cn/docs/v4/doc/flv-vod-stream -[v4_EN_FlvVodStream]: https://ossrs.io/lts/en-us/docs/v4/doc/flv-vod-stream -[v4_CN_Security]: https://ossrs.net/lts/zh-cn/docs/v4/doc/security -[v4_EN_Security]: https://ossrs.io/lts/en-us/docs/v4/doc/security -[v4_CN_DeliveryHttpStream]: https://ossrs.net/lts/zh-cn/docs/v4/doc/delivery-http-flv -[v4_EN_DeliveryHttpStream]: https://ossrs.io/lts/en-us/docs/v4/doc/delivery-http-flv -[v4_CN_DeliveryHDS]: https://ossrs.net/lts/zh-cn/docs/v4/doc/delivery-hds -[v4_EN_DeliveryHDS]: https://ossrs.io/lts/en-us/docs/v4/doc/delivery-hds -[v4_CN_Streamer]: https://ossrs.net/lts/zh-cn/docs/v4/doc/streamer -[v4_EN_Streamer]: https://ossrs.io/lts/en-us/docs/v4/doc/streamer -[v4_CN_Streamer2]: https://ossrs.net/lts/zh-cn/docs/v4/doc/streamer#push-http-flv-to-srs -[v4_EN_Streamer2]: https://ossrs.io/lts/en-us/docs/v4/doc/streamer#push-http-flv-to-srs -[v4_CN_SampleHttpFlv]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http-flv -[v4_EN_SampleHttpFlv]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-http-flv -[v4_CN_SampleHttpFlvCluster]: https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-http-flvCluster -[v4_EN_SampleHttpFlvCluster]: https://ossrs.io/lts/en-us/docs/v4/doc/sample-http-flvCluster -[v4_CN_LowLatency]: https://ossrs.net/lts/zh-cn/docs/v4/doc/low-latency -[v4_EN_LowLatency]: https://ossrs.io/lts/en-us/docs/v4/doc/low-latency -[v4_EN_LowLatency#merged-read]: https://ossrs.io/lts/en-us/docs/v4/doc/low-latency#merged-read -[v4_CN_Performance#performancereport4k]: https://ossrs.net/lts/zh-cn/docs/v4/doc/performance#performancereport4k -[v4_CN_DRM#tokentraverse]: https://ossrs.net/lts/zh-cn/docs/v4/doc/drm#tokentraverse -[v4_CN_RaspberryPi]: https://ossrs.net/lts/zh-cn/docs/v4/doc/raspberrypi -[v4_CN_Build]: https://ossrs.net/lts/zh-cn/docs/v4/doc/install -[v4_CN_LowLatency]: https://ossrs.net/lts/zh-cn/docs/v4/doc/low-latency -[v4_CN_Build]: https://ossrs.net/lts/zh-cn/docs/v4/doc/install -[v4_CN_Performance]: https://ossrs.net/lts/zh-cn/docs/v4/doc/performance -[v4_CN_RaspberryPi]: https://ossrs.net/lts/zh-cn/docs/v4/doc/raspberrypi -[v4_CN_LowLatency#merged-read]: https://ossrs.net/lts/zh-cn/docs/v4/doc/low-latency#merged-read -[v4_EN_LowLatency#merged-write]: https://ossrs.io/lts/en-us/docs/v4/doc/low-latency#merged-write -[v4_CN_LowLatency#merged-write]: https://ossrs.net/lts/zh-cn/docs/v4/doc/low-latency#merged-write -[v4_CN_NgExec]:https://ossrs.net/lts/zh-cn/docs/v4/doc/nginx-exec -[v4_EN_NgExec]:https://ossrs.io/lts/en-us/docs/v4/doc/nginx-exec -[v4_CN_SampleSRT]:https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-srt -[v4_EN_SampleSRT]:https://ossrs.io/lts/en-us/docs/v4/doc/sample-srt -[v4_CN_SampleDASH]:https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-dash -[v4_EN_SampleDASH]:https://ossrs.io/lts/en-us/docs/v4/doc/sample-dash - -[bug #547]: https://github.com/ossrs/srs/issues/547 -[bug #301]: https://github.com/ossrs/srs/issues/301 -[bug #459]: https://github.com/ossrs/srs/issues/459 -[bug #367]: https://github.com/ossrs/srs/issues/367 -[bug #257]: https://github.com/ossrs/srs/issues/257 -[bug #904]: https://github.com/ossrs/srs/issues/904 -[bug #913]: https://github.com/ossrs/srs/issues/913 -[bug #1059]: https://github.com/ossrs/srs/issues/1059 -[bug #92]: https://github.com/ossrs/srs/issues/92 -[bug #464]: https://github.com/ossrs/srs/issues/464 -[bug #460]: https://github.com/ossrs/srs/issues/460 -[bug #775]: https://github.com/ossrs/srs/issues/775 -[bug #307]: https://github.com/ossrs/srs/issues/307 -[bug #2324]: https://github.com/ossrs/srs/issues/2324 -[bug #1657]: https://github.com/ossrs/srs/issues/1657 -[bug #1500]: https://github.com/ossrs/srs/issues/1500 -[bug #738]: https://github.com/ossrs/srs/issues/738 -[bug #299]: https://github.com/ossrs/srs/issues/299 -[bug #250]: https://github.com/ossrs/srs/issues/250 -[bug #459]: https://github.com/ossrs/srs/issues/459 -[bug #470]: https://github.com/ossrs/srs/issues/470 -[bug #319]: https://github.com/ossrs/srs/issues/319 -[bug #1147]: https://github.com/ossrs/srs/issues/1147 -[bug #2304]: https://github.com/ossrs/srs/issues/2304 -[bug #1535]: https://github.com/ossrs/srs/issues/1535 -[bug #1342]: https://github.com/ossrs/srs/issues/1342 -[bug #1193]: https://github.com/ossrs/srs/issues/1193 -[bug #2093]: https://github.com/ossrs/srs/issues/2093 -[bug #465]: https://github.com/ossrs/srs/issues/465 -[bug #2091]: https://github.com/ossrs/srs/issues/2091 -[bug #2188]: https://github.com/ossrs/srs/issues/2188 -[bug #413]: https://github.com/ossrs/srs/issues/413 -[bug #1111]: https://github.com/ossrs/srs/issues/1111 -[bug #463]: https://github.com/ossrs/srs/issues/463 -[bug #775]: https://github.com/ossrs/srs/issues/775 -[bug #257-c0]: https://github.com/ossrs/srs/issues/257#issuecomment-66864413 - -[r3.0r5]: https://github.com/ossrs/srs/releases/tag/v3.0-r5 -[r3.0r4]: https://github.com/ossrs/srs/releases/tag/v3.0-r4 -[r3.0r3]: https://github.com/ossrs/srs/releases/tag/v3.0-r3 -[r3.0r2]: https://github.com/ossrs/srs/releases/tag/v3.0-r2 -[r3.0r1]: https://github.com/ossrs/srs/releases/tag/v3.0-r1 -[r3.0r0]: https://github.com/ossrs/srs/releases/tag/v3.0-r0 -[r3.0b4]: https://github.com/ossrs/srs/releases/tag/v3.0-b4 -[r3.0b3]: https://github.com/ossrs/srs/releases/tag/v3.0-b3 -[r3.0b2]: https://github.com/ossrs/srs/releases/tag/v3.0-b2 -[r3.0b1]: https://github.com/ossrs/srs/releases/tag/v3.0-b1 -[r3.0b0]: https://github.com/ossrs/srs/releases/tag/v3.0-b0 -[r3.0a9]: https://github.com/ossrs/srs/releases/tag/v3.0-a9 -[r3.0a8]: https://github.com/ossrs/srs/releases/tag/v3.0-a8 -[r3.0a7]: https://github.com/ossrs/srs/releases/tag/v3.0-a7 -[r3.0a6]: https://github.com/ossrs/srs/releases/tag/v3.0-a6 -[r3.0a5]: https://github.com/ossrs/srs/releases/tag/v3.0-a5 -[r3.0a4]: https://github.com/ossrs/srs/releases/tag/v3.0-a4 -[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.0r8]: https://github.com/ossrs/srs/releases/tag/v2.0-r8 -[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 -[r2.0r3]: https://github.com/ossrs/srs/releases/tag/v2.0-r3 -[r2.0r2]: https://github.com/ossrs/srs/releases/tag/v2.0-r2 -[r2.0r1]: https://github.com/ossrs/srs/releases/tag/v2.0-r1 -[r2.0r0]: https://github.com/ossrs/srs/releases/tag/v2.0-r0 -[r2.0b4]: https://github.com/ossrs/srs/releases/tag/v2.0-b4 -[r2.0b3]: https://github.com/ossrs/srs/releases/tag/v2.0-b3 -[r2.0b2]: https://github.com/ossrs/srs/releases/tag/v2.0-b2 -[r2.0b1]: https://github.com/ossrs/srs/releases/tag/v2.0-b1 -[r2.0b0]: https://github.com/ossrs/srs/releases/tag/v2.0-b0 -[r2.0a3]: https://github.com/ossrs/srs/releases/tag/v2.0-a3 -[r2.0a2]: https://github.com/ossrs/srs/releases/tag/v2.0-a2 -[r2.0a1]: https://github.com/ossrs/srs/releases/tag/v2.0-a1 -[r2.0a0]: https://github.com/ossrs/srs/releases/tag/v2.0-a0 -[r1.0r4]: https://github.com/ossrs/srs/releases/tag/v1.0-r4 -[r1.0r3]: https://github.com/ossrs/srs/releases/tag/v1.0-r3 -[r1.0r2]: https://github.com/ossrs/srs/releases/tag/v1.0-r2 -[r1.0r1]: https://github.com/ossrs/srs/releases/tag/v1.0-r1 -[r1.0r0]: https://github.com/ossrs/srs/releases/tag/v1.0-r0 -[r1.0b0]: https://github.com/ossrs/srs/releases/tag/v0.9.8 -[r1.0a7]: https://github.com/ossrs/srs/releases/tag/v0.9.7 -[r1.0a6]: https://github.com/ossrs/srs/releases/tag/v0.9.6 -[r1.0a5]: https://github.com/ossrs/srs/releases/tag/v0.9.5 -[r1.0a4]: https://github.com/ossrs/srs/releases/tag/v0.9.4 -[r1.0a3]: https://github.com/ossrs/srs/releases/tag/v0.9.3 -[r1.0a2]: https://github.com/ossrs/srs/releases/tag/v0.9.2 -[r1.0a0]: https://github.com/ossrs/srs/releases/tag/v0.9.1 -[r0.9]: https://github.com/ossrs/srs/releases/tag/v0.9.0 -[r0.8]: https://github.com/ossrs/srs/releases/tag/v0.8.0 -[r0.7]: https://github.com/ossrs/srs/releases/tag/v0.7.0 -[r0.6]: https://github.com/ossrs/srs/releases/tag/v0.6.0 -[r0.5]: https://github.com/ossrs/srs/releases/tag/v0.5.0 -[r0.4]: https://github.com/ossrs/srs/releases/tag/v0.4.0 -[r0.3]: https://github.com/ossrs/srs/releases/tag/v0.3.0 -[r0.2]: https://github.com/ossrs/srs/releases/tag/v0.2.0 -[r0.1]: https://github.com/ossrs/srs/releases/tag/v0.1.0 - -[LICENSE]: https://github.com/ossrs/srs/blob/4.0release/LICENSE -[LicenseMixing]: https://ossrs.net/lts/zh-cn/license +Winlin 2021 diff --git a/trunk/src/app/srs_app_rtc_api.cpp b/trunk/src/app/srs_app_rtc_api.cpp index 346592043..f552e10f5 100644 --- a/trunk/src/app/srs_app_rtc_api.cpp +++ b/trunk/src/app/srs_app_rtc_api.cpp @@ -685,15 +685,26 @@ srs_error_t SrsGoApiRtcWhip::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe ruc->req_->vhost = parsed_vhost->arg0(); } - srs_trace("RTC whip %s %s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, codec=%s, param=%s", + // For client to specifies whether encrypt by SRTP. + string srtp = r->query_get("encrypt"); + string dtls = r->query_get("dtls"); + + srs_trace("RTC whip %s %s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, codec=%s, srtp=%s, dtls=%s, param=%s", action.c_str(), ruc->req_->get_stream_url().c_str(), clientip.c_str(), ruc->req_->app.c_str(), ruc->req_->stream.c_str(), - remote_sdp_str.length(), eip.c_str(), codec.c_str(), ruc->req_->param.c_str() + remote_sdp_str.length(), eip.c_str(), codec.c_str(), srtp.c_str(), dtls.c_str(), ruc->req_->param.c_str() ); ruc->eip_ = eip; ruc->codec_ = codec; ruc->publish_ = (action == "publish"); - ruc->dtls_ = ruc->srtp_ = true; + + // For client to specifies whether encrypt by SRTP. + ruc->dtls_ = (dtls != "false"); + if (srtp.empty()) { + ruc->srtp_ = _srs_config->get_rtc_server_encrypt(); + } else { + ruc->srtp_ = (srtp != "false"); + } // TODO: FIXME: It seems remote_sdp doesn't represents the full SDP information. ruc->remote_sdp_str_ = remote_sdp_str; diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index 97bfe7db5..5fff03db0 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 152 +#define VERSION_REVISION 153 #endif diff --git a/trunk/src/core/srs_core_version6.hpp b/trunk/src/core/srs_core_version6.hpp index 5de6bf17f..490f2ded2 100644 --- a/trunk/src/core/srs_core_version6.hpp +++ b/trunk/src/core/srs_core_version6.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 6 #define VERSION_MINOR 0 -#define VERSION_REVISION 42 +#define VERSION_REVISION 43 #endif