-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
SRT: Support publish by SRT for live streaming, new generation protocol for broadcasting. #1147
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Build From SourceSRT requires the use of Havision's library: https://github.com/Haivision/srt Compile SRS and start it.
Stream SRT, use ffmpeg to convert the file to SRT stream.
Play RTMP stream: http://ossrs.net/srs.release/trunk/research/players/srs_player.html?app=live&stream=livestream&server=127.0.0.1&port=1935&autostart=true&vhost=127.0.0.1
|
Moved to #1147 (comment) |
Moved to #1147 (comment) |
Build From Dockersrs-docker has already supported the compilation environment for SRT. This image includes openssl, libsrt, and ffmpeg, which can be used as a base to compile SRS with SRT support.
Compile and start SRS:
Push SRT stream, convert file to SRT stream using ffmpeg:
Play RTMP stream: http://ossrs.net/srs.release/trunk/research/players/srs_player.html?app=live&stream=livestream&server=127.0.0.1&port=1935&autostart=true&vhost=127.0.0.1
|
This comment has been minimized.
This comment has been minimized.
Moved to #1147 (comment) |
This comment has been minimized.
This comment has been minimized.
SRT in SRS4.0 has recently been tested and has made good progress:
Welcome everyone to assist in testing the last-mile SRT streaming to SRS4.0 in various environments:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Happy New Year. Low Latency SRTThis article describes how to reduce the delay of SRT, which is related to each link. The summary is as follows:
Recommended solution for ultra-high definition, ultra-low latency SRT live streaming:
Delay involves every link, below are the detailed configurations for each link. The directory is as follows:
CPUFor streaming and playback, it is important to monitor the CPU usage. On Windows, you can open the Task Manager. CPU usage can have an impact on delay.
Sometimes, it's not the encoder or player causing high CPU usage. It's possible that other programs or network activities are causing the CPU to spike. PingPing can display the network conditions, and the network is constantly changing. If the RTT is 100ms, then the latency is at least 100ms, considering the worst-case scenario. Suggestions for optimization: '.
As shown in the following figure, if the maximum is 112ms, then the latency may be even greater than this: And the network in the following figure is very stable, it is the WiFi at home to the BGP server, basically around 10ms, at worst it is also 20ms, such a network is very stable: If the ping shows high latency, you can use the WiFi Explorer tool to check the signal and noise of the WiFi. Based on actual testing, even if the Huawei WiFi has a strong signal and low noise, the RTT occasionally becomes large, reaching 100ms or even 200ms. It seems that the 5G channel is slightly better than the 2G channel. In conclusion, it is necessary to rely on ping data. If the RTT exceeds 60ms, it may cause latency. EncoderThe encoder has a significant impact on latency. It is important to choose the Baseline profile and select CBR (Constant Bit Rate). If there are options for fine-tuning (TUNE), you can choose zerolatency. Optimization suggestions:
Using Sinsam Live, configure as shown in the following diagram: Using vMix for live streaming, configure as follows: OBS configuration is shown in the following figure: ServerSpecial configuration must also be done on the server, as SRT is a UDP protocol and the default UDP buffer is very small. It needs optimization. You can refer to SRS Optimization for reference and adjust the following parameters: # Modify the buffer length to 16MB
sysctl net.core.rmem_max=16777216
sysctl net.core.rmem_default=16777216
sysctl net.core.wmem_max=16777216
sysctl net.core.wmem_default=16777216 You can check if the server is dropping packets, which often indicates network congestion or the inability to handle them in time. Pay particular attention to the [root@VM-24-2-centos ~]# netstat -suna
Udp:
0 packet receive errors
0 receive buffer errors
0 send buffer errors During high bitrate, due to the high number of UDP packets, you can check for congestion. The
In addition, the CPU indicator of the server must also be monitored. For SRS, if the CPU exceeds 80%, it indicates a problem, regardless of the number of CPU cores. To prevent high latency caused by the CPU running at a high percentage, you can use the
It is also necessary to monitor the server's bandwidth to prevent it from running over. You can use the
SRTThe configuration of SRS and SRT also needs to be adjusted in order to obtain lower latency.
PlayerSRT streaming address, Xinxiang Live, OBS, vmix, streaming address:
You can directly play SRT streams using
You can also directly play the SRT source on the production platform, or use the production platform to pull the SRT and then transmit it to other display devices through NDI, and so on. Configuration of xinxiang live preview stream: Configuration of vmix preview stream:
BenchmarkDelay measurement can be done using a stopwatch. We recommend using stopwatch online stopwatch. You can open it directly using OBS's Window Capture or Browser. Refer to #2742 for more information. BitrateWe conducted separate tests for delay with different bitrates, and found that it had minimal impact. Here are the results:
Network JitterWhen there is network jitter, it can impact the latency. We recommend using the tool clumsy, whose interface is shown below:
Drop: Testing data is as follows, testing at a rate of 6Mbps, as the maximum bandwidth is 8Mbps, some retransmission bandwidth needs to be reserved:
RTT latency, the test data is as follows, testing with a bitrate of 6Mbps because the maximum bandwidth is 8Mbps, and some bandwidth needs to be reserved for retransmissions:
As can be seen, at a bitrate of 6Mbps and a 10% packet loss, with an RTT of 60ms, the SRT push-pull stream can maintain a stable latency of 230ms without compromising the quality. ReportPublic network LightHouse SRS server, Xinxiong live streaming pushes SRT stream, vmix pulls SRT stream, with a latency of 260ms. Xinxiong streaming, ffplay playback, with a latency of 190ms. vMix streaming, ffplay playback, with a latency of 200ms. Local device cores like live streaming and pulling SRT streams, with a 300ms latency. Local device diagram of pushing and pulling SRT streams using Vmix, with a 300ms latency. Local device diagram of pushing and pulling streams using OBS, with a latency of around 300ms. Local device core like pushing and pulling streams, playing with ffplay, minimum latency of 230ms. Local VMix pushing and pulling streams, playing with ffplay, minimum latency of 200ms.
|
About the support of SRS for the SRT protocol.
See English or Chinese
The text was updated successfully, but these errors were encountered: