当前位置:网站首页>RTMP streaming exception fast recovery scheme
RTMP streaming exception fast recovery scheme
2022-06-23 07:33:00 【Video cloud live broadcast helper】
1、 Problem analysis
We take an actual network case To introduce the problem ,3 month 9 Japan , Anchor in Brazil , flow id:stream-2990700835946365032
stay 20:50-21:50 During this period, the overall streaming frame rate is very low , Frame loss is very serious , But the number of users is very large , Yes 5w+ People online , Down close 100G Playback bandwidth
from cdn From the perspective of playback quality , Corresponding time period , The Caton rate is very high , The viewing quality is very poor .
In an emergency , Cut off the flow and force the flow pushing end to push the flow again , The stability of the push stream is quickly restored .
As shown in the figure above , stay 21 spot 47 about , After re streaming , The streaming frame rate is stable at 30 frame , The Caton rate also returned to normal .
After analysis , The anchor is in Brazil , The upstream connection is also in Brazil , There are a lot of slow logs on the server :
In fact, due to the single tcp Slow connection problem , It often occurs in the complex overseas streaming environment . Overseas links are complicated , And the link is very long , Sometimes at the beginning, the flow quality is very stable , After a long time , After the network jitters , There will be the deterioration of the above network , Cause unstable data transmission .
Developed countries such as Europe and the United States have good network quality , The bandwidth is sufficient , Can meet the normal live streaming . In some developing countries , Like the Middle East , Southeast Asia , The telecommunications infrastructure is poor , Insufficient network bandwidth , Local operators have various bandwidth limitations . It is easy to push streams after a period of time , The network is unstable , After the cut-off is pushed back, it can return to normal . To avoid scheduling to the same node , Usually through configuration host The way , Specify the access node , To avoid scheduling to the same node , To resume normal streaming .
The above abnormal conditions , Generally, it is pushed again by cutting off the flow or switching the flow nodes , It can often solve most problems . There is a high risk of the server actively disconnecting the anchor , If the streaming end is not handled well , There will also be an exception of the anchor streaming , This leads to streaming failure , It is easy to cause complaints , Therefore, it usually needs to be handled manually . The disadvantages of manual processing are obvious , The high cost , The problem was not dealt with in time , It takes a long time to deal with problems .
In order to solve the above problems , utilize rtmp302 characteristic , Made an improvement plan . If the server detects that the streaming is slow , adopt amf Control the way messages are sent , Push the new streaming address , Send to the streaming end , The streaming end combines the local network conditions , To make a comprehensive decision whether to cut off the flow and push again .
The highlight of this scheme is that the server only provides suggestions , Don't make decisions , The client can combine the information provided by the terminal and the background , Conduct a comprehensive assessment , Compare unilateral decisions , It can greatly improve the accuracy of decision-making .
2、RTMP 302 Redirect the specific scheme
In order to solve the problem of , Network anomaly , Adopted RTMP 302 Redirection scheme , The specific implementation logic is shown in the figure below :
Step one , In the process of streaming ,rtmp server The client supports continuous weak network detection , Support domain name + Configuration weak network detection of publishing point dimension .
Step two , When this condition is detected , It is necessary to report to the dispatching system , According to client IP, Request a legal 、 High quality streaming access node IP, Splicing complete redirection streaming addresses , adopt amf data To the streaming client .
Step three , The streaming client identifies the corresponding amf data,
The streaming terminal gets redirect After the redirection address in , Integrated local information , Determine whether it is necessary to cut off the flow and push again , if necessary , Use the address provided by the server to push the stream again , Solve the slow problem .
For details, please check the specific RFC file :
1.https://tools.ietf.org/html/rfc7016#section-3.5.1.6
AMS Say it's built-in support :
Server redirection
Automatically provide video players with new or alternate locations if content is missing using built-in redirection in RTMP similar to HTTP 302 redirection.
The above solutions , In the process of streaming , adopt RTMP 302 To get the slow information of the server , According to the client-side and server-side slow information , To cut off the flow and push again , Quickly resume live broadcast , Improve the success rate of streaming .
Extend the above scheme , When starting streaming , utilize 302 Load balancing on the server . When the server just receives the client data , Send... To the client RTMP 302 Information , For high load 302 Dispatch , Improve the success rate of streaming . It can also be done through 302 Quickly propose abnormal streaming access points .
3、 Conclusion
in summary :
1、 In the process of streaming , Send... To the client RTMP 302 Control messages , The client uses the redirection address provided by the server , Conduct cut-off and re push , You can quickly recover streaming exceptions , Improve the quality of upstream streaming ;
2、 At the beginning of streaming , The server can integrate the background machine load and bandwidth resources , Load balancing scheduling for streaming , Provide high-quality access points for clients , Improve streaming quality , Improve the availability of platform access .
3、 Compatibility is good. , Compatible with new and old clients , Whether the inspection RTMP 302 amf Information , Completely controlled by the client . The client can , For selective use .
4、 Higher success rate of decision-making , Compared with the traditional client cut-off and re push strategy , This scheme can integrate the information of client and server , To formulate a better retry strategy for disconnection .
边栏推荐
- MySQL (II) - MySQL data type
- Spock constraint - call frequency / target / method parameters
- Technical article writing guide
- SSTable详解
- 【PyQt5系列】修改计数器实现控制
- Feelm joined the Carbon Disclosure Project as an initiative of Smallville to deal with climate change emergencies
- 306. Addenda
- 901. stock price span
- 【云计算赛项】职业技能竞赛--容器开发部分例题Pig快速开发框架
- Spock约束-调用频率/目标/方法参数
猜你喜欢

【PyQt5系列】修改计数器实现控制

论文写作之WPS安装Mathtype插件编写数学公式

Product axure9 (English version), prototype design and production pull-down secondary menu

How to tag and label naming before the project release

链游飞船开发 农民世界链游开发 土地链游开发

SSTable详解

启发式的搜索策略

JS to determine the added and decreased elements of two arrays

Quartz调度框架的学习使用

C WPF additional attribute implementation interface defines decorator
随机推荐
MySQL(四) — MySQL存储引擎
leetcode210. Schedule II 207 Curriculum topology sorting DFS BFS
Heuristic search strategy
C WPF additional attribute implementation interface defines decorator
在线文本过滤小于指定长度工具
[AI practice] xgb Xgbregression multioutputregressor parameter 1
MySQL(五) — 锁及事务
codeforce 158B Taxi
Here comes the dry goods | PAAS collection to see first ~
20bn Jester complete dataset Download
[2022 graduation season] from graduation to transition to the workplace
Arthas-thread命令定位线程死锁
Simpledateformat thread safety issues
The List
Spock约束-调用频率/目标/方法参数
TensorFlow中的数据类型
Difference between char and varchar
Solutions to abnormal network connection of Xiaoai speakers
控制台程序
Realization of rolling broadcast effect