Nowadays, live streaming applications are very popular. They convey the most real on-site information to users in a vivid and intuitive way, which is widely welcomed by the majority of users. As a technician, XIAobian often develops various live broadcasting platforms (entertainment live broadcasting, games live broadcasting, education live broadcasting, financial live broadcasting, etc.). Below, I would like to share some of my accumulated experience with you, hoping to communicate and learn with you and make progress together.
First of all, we have similar experience in the video and audio collection coding technology of mobile terminals. Considering the processing power of mobile phones, our technical route is to make use of the video coding ability of mobile phones’ core processors. The Android end calls Mediacodec development interface, iOS end calls Core Video framework provided by Apple to achieve, we use H.264 Video coding and AAC audio coding format, through hardware coding greatly reduce the CPU load and power consumption of mobile terminals. In the choice of protocol, we use the current mainstream RTMP protocol to push data from the client to the server. RTMP is a stream transfer protocol developed by Adobe. The structure is relatively simple, and you can do your own research. Moreover, this protocol is widely used in the industry, which is easy to integrate with different products. In the second step, the content release and transcoding front-end equipment will collect and process the video and audio content of live broadcast and first push it to the source server of the platform. The source server is deployed in the backbone node machine room of the local operator in Beijing (close to it for easy maintenance). The source server adopts the multi-cluster hot backup mechanism to prevent the stable running of the entire platform after the breakdown of one source server. The source server is connected to a professional disk array storage device. After receiving the data, the source server copies N copies and forwards them to the following N level 2 CDN nodes, and copies one copy to the transcoding server. Transcoding server will receive real-time transcoding, each flow is mainly to convert the hd streaming a standard definition stream for small screen mobile terminals, mobile terminal receives the small stream not only conform to their own small screen resolution is needed, at the same time can reduce to move the decoding ability request, also can effectively save bandwidth costs. Step 3: Streaming media release Streaming media release is also crucial for the entire platform, because the final service for end users is provided by streaming media servers distributed throughout the network. The stability and performance of streaming media servers determine the experience effect of end users and the operating cost of the platform. According to our previous experience in IPTV, the technical route we chose in this project is still self-development, of course, based on the previous IPTV streaming media server, and the core technologies have been improved as follows:
- The streaming media server still adopts C language to ensure the highest operating efficiency.
- Change the previous multi-process model into asynchronous IO model to improve the concurrent processing performance of the server;
- Add support for RTMP and HLS protocols on the protocol layer. 4. Hadoop is introduced as a distributed architecture to facilitate large-scale distributed deployment, scheduling and fault tolerance; Through these improvements, the overall performance of streaming media server will have a qualitative leap. The fourth step is CDN content distribution, which is my specialty. It is the same with the technical route OF IPTV platform I did before, which is to distribute streaming media data quickly among multiple nodes in the whole network, so as to improve the experience effect of end users. In terms of protocol selection, we support RTMP protocol, HTTP protocol and UDP protocol according to the characteristics of live broadcast and on-demand applications. The construction aspect of node server, we according to the overall layout of domestic Internet, the center node – > – > municipal provincial node three-level architecture model, the main user traffic first guide to the third level of nodes, then the second-level nodes, so design, mainly because of the small and medium-sized cities, the lower the price of bandwidth, This can greatly save the later operating costs. In the decoding and playback part of the terminal, we consider to independently develop players for PC, Android and iOS terminals. Since the three terminals adopt different operating system platforms, we set up three development groups to complete them respectively. The technical route is as follows: PC: Adopt the mainstream technology route in the industry, based on Adobe Flash Player to do application layer development, which is the most mature technology route at present. In order to shorten the development cycle, we do it based on Adobe OSMF player framework, and it is feasible to control the development cycle within 2 months. The Android side: In the development of Android player, the first consideration is the decoding performance of the terminal, because the decoding framework has many options, such as FFMPEG, VLC, MediaPlayer API, Exoplayer, etc. From the perspective of our own familiarity and controllability of the project, Finally, we decided to adopt Google’s Exoplayer for secondary development, and the development cycle could be controlled within 2 months. IOS: The player on iOS is also based on the same consideration. We choose the VideoToolbox development interface provided by Apple, through which we can directly call the hardware decoding function of Apple processor, which can greatly reduce the power consumption of the device and extend the battery life. The above is a small series of how to create a broadcast platform experience and a little bit of experience, record is not only a summary of their own, but also want to share with entrepreneurs and peers, I hope to help you. If you have different views, welcome to consult communication!