Summary of live broadcast system source code and social app construction process

We all know that the live broadcast industry is ushering in a new revolution. The self-media era is already a globalized market. How can we better understand the live broadcast system? Let us first understand its construction process knowledge.

1. Understand the popular live broadcast products Yingke, Douyu, Panda, Huya, Huajiao, etc.
1. A complete live broadcast app function (shared by Luoying loyallin) 1. Chat, private chat, chat room, light up, push, Blacklist, etc.;
2. Gifts • Ordinary gifts, luxury gifts, red envelopes, rankings, third-party recharge, in-app purchases, gift dynamic updates, cash withdrawals, etc.;
3. Live broadcast list • Follow, popular, latest, classified live broadcast user list, etc.;
4. Live broadcast by yourself • Recording, streaming, decoding, playback, beauty, heartbeat, background switching, host to administrator operations, administrator to users, etc.;
5. Room logic • Create a room, enter a room, exit a room, close a room , switch rooms, room administrator settings, room user list, etc.;
6. User logic • Ordinary login, third-party login, registration, search, modify personal information, watch list, fan list, forget password, view personal information, income list, Follow and cancel, search, etc.;
7. Watch live broadcasts, chat information, scrolling bullet screens, gift display, loading interface, etc.;
8. Statistics, APP business statistics, third-party statistics, etc.;
9. Supervise, hide, review, etc.;
2. The principle of a complete live broadcast app The principle of live broadcast:
push the video recorded by the anchor to the server, and then distribute it to the audience for viewing by the server. Live broadcast: Streaming end (collection, beauty processing, encoding, streaming), server-side processing (transcoding, recording, screenshots, pornography), player (pulling, decoding, rendering), interactive system (chat room) , gift system, like) a complete live app implementation process
1. Collection, 2. Filter processing, 3. Encoding, 4. Pushing, 5. CDN distribution, 6. Pulling, 7. Decoding, 8. Playing, 9 .Chat interactive live broadcast process.
2.
A complete live broadcast app architecture Live broadcast architecture 2. Understand streaming media (live streaming needs to use streaming media) Streaming media development: The network layer (socket or st) is responsible for transmission, the protocol layer (rtmp or hls) is responsible for network packaging, and the encapsulation layer (flv , ts) is responsible for the encapsulation of codec data, and the encoding layer (h.264 and aac) is responsible for image and audio compression. • Frame: Each frame represents a still image • GOP: (Group of Pictures) picture group, a GOP is a group of continuous pictures, each picture is a frame, a GOP is a collection of many frames • Live data , is actually a group of pictures, including I frame, P frame, and B frame. When the user watches it for the first time, it will look for the I frame, and the player will go to the server to find the latest I frame and feed it back to the user.

Therefore, GOP Cache increases the end-to-end delay, because it must get the latest I frame. The longer the length of the GOP Cache, the better the picture quality. Bit rate: The amount of data displayed per second after the picture is compressed. • Frame rate: The number of pictures displayed per second. It affects the smoothness of the picture, which is proportional to the fluency of the picture: the larger the frame rate, the smoother the picture; the smaller the frame rate, the more pulsating the picture is. •Due to the special physiological structure of human eyes, if the frame rate of the viewed picture is higher than 16, it will be considered to be coherent. This phenomenon is called persistence of vision. And when the frame rate reaches a certain value, if it increases again, it is not easy for the human eye to notice that there is a significant improvement in fluency.
Summary of live broadcast system source code and social app construction process
Resolution: The length and width of the (rectangular) picture, that is, the size of the picture. The amount of data per second before compression: frame rate X resolution (the unit should be several bytes) Compression ratio: the amount of data per second before compression /Bit rate (For the same video source and the same video encoding algorithm, the higher the compression ratio, the worse the picture quality.) • Video file format: file suffix, such as .wmv,.mov,.mp4,. mp3, .avi, • Main use, according to the file format, the system will automatically determine what software to use to open it. Note: Modify the file format at will, it will not have much impact on the file itself. For example, if you change avi to mp4, the file will still be avi.•Video encapsulation format: a container for storing video information. Streaming encapsulation can include TS, FLV, etc., and indexed encapsulation can include MP4, MOV, AVI, etc. •

Main role: A video file often contains images and audio, as well as some configuration information (such as the association between images and audio, how to decode them, etc.): These contents need to be organized and packaged according to certain rules. Note: You will find packaged The format is the same as the file format, because the suffix name of the general video file format adopts the name of the corresponding video encapsulation format, so the video file format is the video encapsulation format. • Video encapsulation format and video compression coding standard: Just like project engineering and programming language, the encapsulation format is the engineering of a project, and the video encoding method is the programming language. A project project can be developed in different languages.

Only a part of the analysis has been done above. Since there are too many content, we will continue to break it down next time. Interested friends can contact the editor.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325210409&siteId=291194637