当前位置:网站首页>UE pixel stream, come to a "diet pill"!
UE pixel stream, come to a "diet pill"!
2022-07-05 08:22:00 【xosg】
Part1 Preface
Pixel streams are illusory engines UE5 The front and rear end separation frames provided : Server running UE5, Front end rendering UI, Intermediate transmission video stream . such , Even low-end computers or mobile phones without graphics cards can access and run UE5 Server for .
however UE The official pixel stream code base is very bloated , Lack of documentation , Difficult to use directly , We transformed it into a lightweight version , Out of the box pixel stream front-end library and signaling server , Address :
https://github.com/inveta/peer-stream.
besides , We have also developed a tool chain matching it , Automatically monitor the life cycle of pixel streams , Even if the server is unattended, it can work normally .

Part2UE5 Self starting : Fast startup speed
Worship UE5 Of HLOD technology (Nanite as well as WorldPartition) Bestowed ,UE5 The start time of the packaging program is basically 5s within ( Even oversized models ), therefore UE5 There is no need to drive on the server all the time to consume resources , When you visit the web page, you can temporarily start , Anyway, it won't take a few seconds . In our open source library ,UE5 The self starting program is written in the signaling server : When WebSocket When there is a new connection from the front end , It starts UE5, When there is no access, it will automatically close after a period of time UE5.
Part3 The singleton pattern : Thread safe file lock
UE5 Thread safety should be considered in self startup : If the front end has high concurrency connections , It is likely to start multiple UE5 process , That will bring great pressure to the server . besides , If the operation and maintenance personnel do not operate in a standard way , You may also accidentally open multiple UE5, Causing the system to crash . In order to avoid this problem at its root , We're open source UE5 Singleton mode plug-in : It strictly limits that at most one computer can be turned on at the same time UE5 example , Realize atomic operation through file lock , Very stable .
Plug-in address :https://github.com/inveta/SingleTon.

Part4UE5 Automatically quit : Save system resources
When no one is looking ,UE5 Automatic shutdown is natural , But the timeout of idle shutdown needs to be set within a reasonable range , The time setting cannot be too short or too long : If the time is too short, it is prone to frequent startup and shutdown , Increase the risk of crash ; If it takes too long, it will be useless , Waste system resources . Therefore, within a reasonable range , After many attempts , Our pixel stream plug-in passes the following 3 Time out to control UE5 Life cycle of ,
● After the signaling server is disconnected 10s To withdraw from UE5: Even the signaling server is down ,UE5 There is no need to exist , But to prevent short interruptions ,10s Internal reconnection can be done without exiting .
● After the front end is disconnected ,30 Exit in minutes UE5: After the user closes the web page , leave 30 Minute observation period , During this period, if there is a new web page connected , Then stop the timer .
● UE5 Start over 24 Hours later, , sign out UE5: Sometimes people are not in front of the computer , But the browser remains connected , Lead to UE5 Continuous operation for too long , It will also consume a lot of power , So set UE5 The maximum running time is 24 Hours .

Part5 Throttle and prevent shaking : Prevent collapse to the greatest extent
Time control is the most important detail in the pixel flow ecological chain , Because the whole system needs various timers to maintain the life cycle , Handling exception States , The time units of different timers range from milliseconds to seconds to minutes to hours , Except as mentioned in the previous section 3 Kind of UE5 Automatically exit timing , For throttling and anti shake , The following settings are also set in the whole system 8 A timer to deal with possible network attacks .
● WebSocket After disconnection 3s Internal automatic reconnection : No need to reconnect manually , Don't reconnect immediately .
● initialization DataChannel Request delay 500ms: Prevent web pages from being refreshed crazily .
● Dom After the element is disconnected 1s Internal continuous opening : Prevent front end JS Nonstandard code leads to high-frequency cutover of elements .
● Signaling server 500ms At most 1 Time WS Connect : prevent WebSocket collapse .● Every time 50s Launch once WS heartbeat connection : Avoid proxy server downtime .
● Signaling server and UE5 Send each other every minute ping-pong Keep alive request .
● UE5 Pass per second WebRTC Forward send QP Parameters , Monitor network status and video quality .
● On initialization ,UE5 Send to signaling server every second 10 Time WebSocket Connection request .
边栏推荐
- 实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
- Some thoughts on extracting perspectives from ealfa and Ebeta
- Compilation warning solution sorting in Quartus II
- Tailq of linked list
- FIO测试硬盘性能参数和实例详细总结(附源码)
- Circleq of linked list
- Various types of questions judged by prime numbers within 100 (C language)
- 【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
- QEMU STM32 vscode debugging environment configuration
- STM32 --- NVIC interrupt
猜你喜欢

Some thoughts on extracting perspectives from ealfa and Ebeta

Summary -st2.0 Hall angle estimation

Example 003: a complete square is an integer. It is a complete square after adding 100, and it is a complete square after adding 168. What is the number?

Simple design description of MIC circuit of ECM mobile phone

Charge pump boost principle - this article will give you a simple understanding

Summary of SIM card circuit knowledge

Tailq of linked list

Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase

Circleq of linked list

Let's briefly talk about the chips commonly used in mobile phones - OVP chips
随机推荐
Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
Circleq of linked list
Google sitemap files for rails Projects - Google sitemap files for rails projects
Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]
Soem EtherCAT source code analysis II (list of known configuration information)
H264 (I) i/p/b frame gop/idr/ and other parameters
QEMU STM32 vscode debugging environment configuration
[trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture
MySQL之MHA高可用集群
Relationship between line voltage and phase voltage, line current and phase current
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
Summary -st2.0 Hall angle estimation
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Detailed summary of FIO test hard disk performance parameters and examples (with source code)
Negative pressure generation of buck-boost circuit
[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)
Soem EtherCAT source code analysis I (data type definition)
实例007:copy 将一个列表的数据复制到另一个列表中。
Basic information commands and functions of kernel development
Working principle and type selection of common mode inductor