Skip to content

WebRTC: Support WebRTC, for video meeting, SFU server, video converence. #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
winlinvip opened this issue May 16, 2015 · 37 comments · Fixed by #2303
Closed

WebRTC: Support WebRTC, for video meeting, SFU server, video converence. #307

winlinvip opened this issue May 16, 2015 · 37 comments · Fixed by #2303
Assignees
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented May 16, 2015

WebRTC is now quite mature, with stable playback and the protocol already being an RFC. There are also quite a few corresponding open-source projects. However, I believe that WebRTC still lacks a high-performance, simple and easy-to-use server. I have analyzed the existing servers before and found various issues. SRS has a great opportunity to solve these problems.

See English or Chinese

@winlinvip winlinvip added the Feature It's a new feature. label May 16, 2015
@winlinvip winlinvip added this to the srs 3.0 release milestone May 16, 2015
@Jianru-Lin

This comment has been minimized.

@PengZheng

This comment has been minimized.

@823639792

This comment has been minimized.

@winlinvip winlinvip changed the title 支持WebRTC Support WebRTC Dec 7, 2019
@winlinvip

This comment has been minimized.

@winlinvip

This comment has been minimized.

@winlinvip
Copy link
Member Author

winlinvip commented Mar 14, 2020

candidate is the address that RTC provides services to the outside. In certain deployment scenarios, we need to configure it in multiple ways.

This is also the only item that RTC must confirm the configuration for, while others can be left at their default settings.

For detailed configuration instructions, please refer to: https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate

TRANS_BY_GPT3

@winlinvip

This comment has been minimized.

@winlinvip

This comment has been minimized.

@winlinvip

This comment has been minimized.

@winlinvip
Copy link
Member Author

winlinvip commented Apr 4, 2020

MacPro information:

  • macOS Mojave
  • Version 10.14.6 (18G3020)
  • MacBook Pro (Retina, 15-inch, Mid 2015)
  • Processor: 2.2 GHz Intel Core i7
  • Memory: 16 GB 1600 MHz DDR3

Docker information:

  • Docker Desktop 2.2.0.3(42716)
  • Engine: 19.03.5
  • Resources: CPUs 4, Memory 2GB, Swap 1GB

Note: SRS is bound to CPU0, Benchmark is bound to CPU2-3.

Note: The test video is still ./doc/source.200kbps.768x320.flv.

Note: The following tests are all Streams=1, meaning pushing one stream for multiple playback scenarios.

Baseline

Baseline without any optimization, the data is as follows:

Stage SRS Players CPU us sys si Docker
Baseline 4.0.20 200 51% 35% 19% 15% 233%

image

SRTP-NASM

SRTP enabled openssl, and openssl enabled assembly, which means that SRTP encryption and decryption are optimized with assembly. Refer to 5e06a256. The data is as follows:

Stage SRS Players CPU us sys si Docker
SRTP-NASM 4.0.20 200 38% 28% 22% 14% 198%
Baseline 4.0.20 200 51% 35% 19% 15% 233%

image

UDP sendmmsg + mw_latency

After enabling sendmmsg, multiple UDP packets can be sent at once. The data is as follows:

Remark: By default, RTC is configured for low latency, which means min_latency on; and play.mw_latency 0;, so the number of messages that can be written with each sendmmsg is not much. We will increase the latency to observe changes in performance.

Note: The queue (ms) below refers to mw_sleep, which is also known as mw_latency, which represents how many milliseconds the server actively queues (delays) before writing multiple packets at once.

Stage SRS Players Queue CPU us sys si Docker
--- --- --- --- --- --- --- --- ---
UDP sendmmsg 4.0.20 200 350ms 20% 22% 12% 4% 130%
UDP sendmmsg 4.0.20 200 200ms 18% 11% 7% 3% 132%
UDP sendmmsg 4.0.20 200 100ms 21% 18% 12% 5% 134%
UDP sendmmsg 4.0.20 200 0ms 38% 29% 20% 12% 200%
SRTP-NASM 4.0.20 200 0ms 38% 28% 22% 14% 198%
Baseline 4.0.20 200 0ms 51% 35% 19% 15% 233%

image

image

image

image

Although the optimization of queues over 100ms may not be significant, I think there may be other bottlenecks. From the data above, it can be seen that sendmmsg is very useful for optimizing system performance.

Currently, the server queue is set by increasing the delay, also known as mw_latency. This allows the server to send more data at once, which is useful for TCP optimization. However, for UDP, especially in low-latency RTC scenarios, it is not advisable to increase the delay to improve performance. In fact, sendmmsg allows for sending data to multiple clients at once, and future optimization will be aimed in this direction.

TRANS_BY_GPT3

@wmatrix

This comment has been minimized.

@lwg82

This comment has been minimized.

@includeamin

This comment has been minimized.

@xiaozhihong

This comment has been minimized.

@includeamin

This comment has been minimized.

@includeamin

This comment has been minimized.

@zengdick

This comment has been minimized.

@johnlanz

This comment has been minimized.

@LAW-lc

This comment has been minimized.

@yf-hk

This comment has been minimized.

@emnvn

This comment has been minimized.

@bigben0123

This comment has been minimized.

@mud0107

This comment has been minimized.

@Isaac-1010

This comment has been minimized.

@mud0107

This comment has been minimized.

@matishsiao

This comment has been minimized.

@winlinvip winlinvip linked a pull request Apr 27, 2021 that will close this issue
@ossrs ossrs locked as too heated and limited conversation to collaborators Apr 28, 2021
@winlinvip winlinvip pinned this issue May 16, 2021
@winlinvip winlinvip changed the title Support WebRTC Support WebRTC,一对一通话,多人通话,SFU,直播连麦,会议录制等 May 16, 2021
@winlinvip winlinvip changed the title Support WebRTC,一对一通话,多人通话,SFU,直播连麦,会议录制等 WebRTC: Support WebRTC, for video meeting, SFU server, video converence. 一对一通话,多人通话,SFU,直播连麦,会议录制等 Nov 25, 2022
@winlinvip winlinvip changed the title WebRTC: Support WebRTC, for video meeting, SFU server, video converence. 一对一通话,多人通话,SFU,直播连麦,会议录制等 WebRTC: Support WebRTC, for video meeting, SFU server, video converence. Jul 25, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

Member Author winlinvip commented • edited MacPro information: macOS Mojave Version 10.14.6 (18G3020) MacBook Pro (Retina, 15-inch, Mid 2015) Processor: 2.2 GHz Intel Core i7 Memory: 16 GB 1600 MHz DDR3 Docker information: Docker Desktop 2.2.0.3(42716) Engine: 19.03.5 Resources: CPUs 4, Memory 2GB, Swap 1GB Note: SRS is bound to CPU0, Benchmark is bound to CPU2-3. Note: The test video is still ./doc/source.200kbps.768x320.flv. Note: The following tests are all Streams=1, meaning pushing one stream for multiple playback scenarios. Baseline Baseline without any optimization, the data is as follows: Stage SRS Players CPU us sys si Docker Baseline 4.0.20 200 51% 35% 19% 15% 233% SRTP-NASM SRTP enabled openssl, and openssl enabled assembly, which means that SRTP encryption and decryption are optimized with assembly. Refer to 5e06a256. The data is as follows: Stage SRS Players CPU us sys si Docker SRTP-NASM 4.0.20 200 38% 28% 22% 14% 198% Baseline 4.0.20 200 51% 35% 19% 15% 233% UDP sendmmsg + mw_latency After enabling sendmmsg, multiple UDP packets can be sent at once. The data is as follows: Remark: By default, RTC is configured for low latency, which means min_latency on; and play.mw_latency 0;, so the number of messages that can be written with each sendmmsg is not much. We will increase the latency to observe changes in performance. Note: The queue (ms) below refers to mw_sleep, which is also known as mw_latency, which represents how many milliseconds the server actively queues (delays) before writing multiple packets at once. Stage SRS Players Queue CPU us sys si Docker --- --- --- --- --- --- --- --- --- UDP sendmmsg 4.0.20 200 350ms 20% 22% 12% 4% 130% UDP sendmmsg 4.0.20 200 200ms 18% 11% 7% 3% 132% UDP sendmmsg 4.0.20 200 100ms 21% 18% 12% 5% 134% UDP sendmmsg 4.0.20 200 0ms 38% 29% 20% 12% 200% SRTP-NASM 4.0.20 200 0ms 38% 28% 22% 14% 198% Baseline 4.0.20 200 0ms 51% 35% 19% 15% 233% Although the optimization of queues over 100ms may not be significant, I think there may be other bottlenecks. From the data above, it can be seen that sendmmsg is very useful for optimizing system performance. Currently, the server queue is set by increasing the delay, also known as mw_latency. This allows the server to send more data at once, which is useful for TCP optimization. However, for UDP, especially in low-latency RTC scenarios, it is not advisable to increase the delay to improve performance. In fact, sendmmsg allows for sending data to multiple clients at once, and future optimization will be aimed in this direction. TRANS_BY_GPT3