“This is the 29th day of my participation in the First Challenge 2022. For details: First Challenge 2022.”

Project introduction

Project official website: SRS (OSSRs.net)

Making: the SRS – making

Gitee: SRS is a simple and efficient real-time video server

SRS is one of the Top1 open source video servers in the world. As a simple and efficient real-time video server, SRS supports RTMP, WebRTC, HLS, http-flv, SRT, and GB28181, meeting audio and video service requirements in different scenarios.

For most beginners, the technical threshold of audio and video technology is difficult. SRS can lower the threshold of using audio and video technology, and it can also meet the following application scenarios:

(1) Full platform broadcast: only Encoders(FFmpeg/OBS) in the figure above push RTMP to SRS; An SRS Origin(without Cluster) is encapsulated as HTTP-FLV stream and HLS stream. Players can play http-FLV or HLS streams depending on the platform player.

(2) WebRTC call service: SRS can be used for one-to-one call, multi-party call, conference room and other applications. WebRTC is a key and core capability introduced by SRS4 that effectively reduces SRS latency.

(3) Monitoring and broadcasting cloud: In addition to using FFmpeg to actively pull the stream to SRS, the stream can also be pushed by SRT protocol in the broadcasting industry or GB28181 protocol in the monitoring industry, and THE SRS can be converted to the Internet protocol for viewing.

(4) Live interaction: RTMP to WebRTC playback to reduce the playback delay, can also do live link, or use WebRTC streaming and so on.

Most audio and video application scenarios can be satisfied with SRS+ Tencent Cloud Lighthouse. Tencent Cloud Lighthouse also provides many system and application images for developers and users to use. SRS application image is also updated recently. This article will briefly introduce the relevant experience.

A key deployment

Audio and video streaming requires high bandwidth resources for servers, and the prices of network and bandwidth resources are relatively high in China. As a result, the prices of high-bandwidth servers of Lighthouse and CVM in China are also relatively high. In order to reduce costs, Lighthouse in Hong Kong is recommended here. The minimum configuration of Lighthouse is a 2C2G server with 30M bandwidth at 32 yuan per month, which is relatively cost-effective. At the same time, the physical distance between Hong Kong and mainland China is relatively close, with low network delay and high cost performance. Therefore, it is most recommended to use Hong Kong.

System image We select the official SRS application image, which is based on CentOS 7.9 64-bit.

Compared with manual deployment and installation, the installation time of an application image using Lighthouse is shorter, which avoids errors and reduces the time cost of deployment.

After the SRS image is installed, you can view basic information about the SRS server, such as the access address and installation address, in the background management information of the lightweight application server to facilitate application management. Follow the prompts to check the password information provided by the SRS server, which we will need in the subsequent experience.

After installing the app, we need to open up some ports on the server for live streaming. We do not recommend opening all ports. Opening all ports greatly reduces server security. You can open some ports based on official documents and service requirements. This time we have opened the port for application management tips.

Live on flow

In this demonstration, OBS is selected to live push stream. After logging in to the access address of OBS and entering the password, you can enter the dashboard of SRS, view the push stream address and key required by OBS push stream, and click Copy.

In the OBS Settings – Push Stream interface, select custom service, copy server address information and stream key correctly and save.

Add the video source in OBS. Select window collection as the video source for this demonstration. Click Push stream to view the video push stream effect on the Web interface.

In THE SRS video stream, we can also see the relevant video stream is normally pushed, and the overall difficulty of the user experience is quite friendly. For small white user or quite friendly.

Conclusion:

SRS provides us with additional choices of audio and video servers. In some application scenarios that require audio and video technology, besides using audio and video applications such as online conferences and live broadcast platforms, it is also a good choice to use cloud server +SRS to build audio and video platforms. The advantages of lower difficulty, lower cost and complete control are also easy to attract some customers such as video live broadcasting and cross-border e-commerce live broadcasting.

Lighthouse, the lightweight application server of Tencent Cloud, also provides many application images for you. In order to conveniently solve the problems that arise when you communicate with the SRS cloud server, you are welcome to scan the QR code and enter the wechat group for communication. Welcome to add group to discuss the use of experience, for help, please watch the video tutorial first. For SRS and audio/video related questions, please visit the relevant open source community.