Surveillance camera RTSP low-latency no plug-in live broadcast solution

Surveillance camera RTSP low-latency no plug-in live broadcast solution

Chapter 1 Application Introduction

At present, there are more and more video surveillance application scenarios. The solutions provided by traditional video surveillance manufacturers need to install the manufacturer's own mobile phone APP or PC client software, which is very inconvenient to integrate and dock with third-party application platforms in the Internet environment. Such as smart city system, electronic map system based on H5, etc.
At present, some companies convert it to the HLS protocol to realize the video playback function of H5, but the delay is very large (ranging from a few seconds to tens of seconds), which cannot meet the application requirements of real-time monitoring, which hinders the large-scale application of monitoring video main obstacle.

Based on this situation, we launched a low-latency live monitoring solution compatible with H5 technology on the basis of years of streaming media platform development. The network cameras of the manufacturers are managed and released in a unified manner, supporting the network cameras and NVR equipment of almost all major monitoring manufacturers, supporting the direct access of the client through the built-in browser of the PC and mobile phone, and the direct access of third-party applications such as WeChat, which greatly improves the It improves the user experience and expands the application scope of surveillance video.

At the same time, the solution supports the HTML5 standard on the terminal, and users can directly watch it based on the H5 browser. It is compatible with PC, Android terminals, iOS terminals, WeChat public accounts and WeChat applets, and is convenient for integration with various application systems, such as smart cities, Map navigation, etc., while ensuring that the end-to-end delay is less than 1 second, and can reach a delay of less than 500ms in a high-quality network environment.

Chapter 2 Implementation of the plan

2.1 Technical Architecture of the Solution

First, the solution is implemented based on H.264 video coding technology and low-latency live streaming technology. The architecture of the whole solution is as follows:
insert image description here

2.2 Functional module composition

First of all, the solution is implemented based on H.264 video coding technology and low-latency live streaming technology. The architecture of the whole solution is as follows: The solution is mainly
composed of four parts:
1. The front-end monitoring equipment
is based on the existing equipment of the user. Including network cameras, NVR and other equipment of major surveillance manufacturers;
2. Video transcoding workstation
Realize real-time transcoding of surveillance video streams, and the transcoded programs are directly pushed to the streaming media content distribution platform.
The workstation is divided into versions with different configurations according to different application needs. A single workstation can transcode 20~100 surveillance videos at the same time.
3. Low-latency streaming media content distribution platform
It is used to receive the video and audio signals pushed up by the video transcoding workstation, and then publish them in the form of streaming media.
The platform is realized by general-purpose hardware server + streaming media platform software, which can effectively save investment for users.

The streaming media content publishing platform can realize the following functions:
1) Support concurrent access of thousands of network cameras;
2) Support PC, smart phone, set-top box and other multi-terminal devices to play directly through the browser;
3) A single server supports more than 2000 Users watch concurrently;
4) Support multi-server load balancing technology and server disaster recovery backup;
5) Support synchronous recording function of live programs, and automatically generate on-demand content after recording;
6) Support server performance and status monitoring, including CPU And memory usage, number of real-time connections, network bandwidth usage, etc.
7) Multi-terminal automatic adaptation technology.
For the current mainstream client devices, we have developed a terminal adaptive playback function, which can automatically adapt to mainstream browsers on the PC side (Fifrfox, Chrome, Safari), HTML5 browsers on the Android side, HTML5 browsers on the iOS side, WeChat applets, etc. .

Screenshots of streaming software functions:
insert image description here
insert image description here
4. Terminal content release
monitoring After the program is released through streaming media, the released network stream needs to be published in the form of a webpage on the content management platform, so that end users can access and watch.
The release method and effect of the program are as follows:
Terminal playback effect
Backstage program released
This is a key link to control the delay of the live broadcast, because even if the delay is controlled very low in the previous links, once a large data cache is generated in this link, it will seriously affect the efficiency of the entire system . Therefore, in this terminal playback link, we developed a self-implemented video player to effectively control the decoding delay of the terminal.
Here, the core technologies we use include:
1) Ultra-low data buffer technology
After the player receives the data stream, it only buffers a few key frames before sending the audio and video data to the decoder;
2) Real-time decoding technology
decoder After receiving the audio and video data, start the decoding function immediately to decode the audio and video;
3) Multi-terminal adaptation technology
For the current mainstream client devices, we have developed a terminal adaptive playback plug-in, which is compatible with mainstream browsers on the PC side (Fifrfox , Chrome, Safari), HTML5 browsers on Android, HTML5 browsers on iOS, and WeChat applets.

Chapter 3 Platform Installation and Deployment

The platform is based on a modular design concept, which allows users to install and use it easily while ensuring the overall stability of the platform.

3.1 Construction of Video Transcoding Workstation

Step 1: Prepare IP monitoring signal source
The system supports IP cameras, NVR and other network monitoring equipment;
Step 2: Device connection
Connect the monitoring signal source and video transcoding workstation to the same local area network;
Step 3: Configure transcoding server

  1. Log in to the transcoding server through a browser, as shown in the following figure:
    insert image description here
  2. Enter "Channel Settings" and configure the transcoding information of each channel, as shown in the figure below:
    insert image description here
    According to the actual situation of the project, configure the front-end monitoring signal source to each channel of the transcoding workstation as shown in the figure above.
    Video source address : Enter the program streaming address of the IP camera or NVR;
    RTMP streaming address : Obtain the program streaming address of the streaming media server through the video surveillance management platform;
    after the parameters are set, click the "Settings" button at the bottom of the page. Can be configured.

The management interface of the streaming media server is as follows:
insert image description here
In the "Performance Monitoring" panel, we see that the number of publishers shows 1, indicating that the live stream has been pushed to the server.

3.2 Streaming server construction

Deploy the streaming media server in the Internet IDC computer room or the central computer room of the unit LAN to ensure the interconnection between the server and the front-end network monitoring equipment.
The server can be a server of a general brand, such as DELL, HP, IBM, Lenovo, Inspur, etc.,
or you can rent a network server or cloud server, such as renting a cloud server from Amazon, Alibaba Cloud, or Tencent Cloud.

Streaming media distribution server configuration requirements:
CPU: Intel EXON E5-2650
Memory: >32GB
Hard disk: >1TB
Operating system: CentOS 7.2 x64 or above or Windows Server 2016 x64 or above Network
card: Gigabit Ethernet
Application software: Shunjing Technology streaming media service system

[Concurrent hosting plan of streaming media server]
Usually, streaming media server is designed to support 200 signal sources/1000 concurrent users to watch.

The main reasons are as follows:
First, the resolution of the main stream of HD cameras is usually 1920x1080, and the average bit rate is set at about 4Mb/s when the H.264 encoding format is adopted. The total bandwidth required by 200 HD cameras is about 800Mb/s.
Considering that the backbone bandwidth of most networks is Gigabit, and the bandwidth utilization rate is usually about 85%, the actual available bandwidth of Gigabit networks is about 850Mb/s, so servers connected to Gigabit backbone networks can stably carry 200 HD camera signal input.

[Multi-server load balancing]
When more front-end signal sources need to be connected, multiple streaming media servers need to be deployed to carry them. At this time, multi-server load balancing technology is required to achieve.
The schematic diagram of multi-server load balancing is as follows:
insert image description here
[Streaming Media Service System Deployment]:
First download and install Shunjing Technology Streaming Media Server System, as shown in the figure below:
Streaming Media Server Download Address (click here to download) :

insert image description here
The first step is to click "Online Registration Software" in the lower right corner .
The second step is to enter the necessary registration information in the opened webpage and click "Start Registration" .
start registration
The third step is to contact technical support to open the test authorization

The fourth step is to refresh the license certificate
insert image description here

The fifth step is to configure the relevant parameters of the server, among which the following information needs to be paid attention to:

  1. The default TCP port numbers of each protocol should not be occupied by other applications, mainly including:
    HTTP service port: 8080
    RTMP service port: 1935, 8935
    VOD service port: 8088
  2. Ensure that the save path of the HLS fragment file exists and is accessible
    D:\iAVCastMedias\hls
  3. Make sure that the DASH segment file save path exists and is accessible
    D:\iAVCastMedias\dash
    Step 6 : Start the service
    insert image description here

3.3 WEB publishing of video programs

After the streaming media platform is built, it is necessary to publish the monitoring content through the website in the form of HTML5, so that the client can browse and watch through a variety of terminals. This function mainly depends on the "digital new media resource management platform " . As shown in the figure below:
Step 1 , log in to the management background, open " Network Live Management→Manage Live Channel " in the left menu , as shown in the figure below;
insert image description here
step 2 , click "Add Live Channel", and click "Play Address" at the bottom Enter the 4 program addresses obtained in Chapter 3.4, and then submit.
insert image description here

3.4 Terminal viewing

Open the front desk of the website after the release, click on the program information to watch it, as shown in the figure below:
insert image description here
Watch on mobile phone: click the " watch on mobile phone
" button on the PC page , and you can watch with your mobile phone after scanning the code.
insert image description here
insert image description here

Chapter 4 Implementation Effect of the Platform

4.1 Live broadcast delay index

In a private network environment, the end-to-end live broadcast delay is usually within 500ms;
in the Internet environment of the same telecom operator, the end-to-end live broadcast delay is usually within 800ms;

4.2 Supported Terminal Types

Existing solutions can support the following device terminals:
insert image description here

4.3 Concurrency performance indicators

After actual testing, the concurrency performance indicators of our low-latency live server software system are as follows:
Server hardware configuration environment:
CPU: Intel E5-2650
Memory: 16GB
hard disk: 120GB solid-state disk
Network card: Intel Gigabit network card x 4-port
server operating system :
CentOS x64 7.4/Windows Server 2016
Live stream: 2Mb/s
Image resolution: 1280x720
Video encoding format: H.264 Main Profile
Concurrent performance index: 2000 concurrent live reception
Peak CPU usage: 42%
Average CPU usage: 35 %
Average memory usage: 56%

4.3 Terminal rendering effect

Effect on PC:
insert image description here
Effect on mobile phone:
insert image description here

Chapter 5 Platform Equipment List

According to the project situation, the system integrator can refer to the following equipment specifications for solution configuration.
The following is a list of software and hardware products for the required equipment :
insert image description here
Friends who are destined can communicate more, WeChat: liufeihong668

Guess you like

Origin blog.csdn.net/zhiboshequ/article/details/117879492