Analysis: live technical analysis program.

GitHub open source project Address: https://github.com/makewheels-zzq/ml-live

Principle live.

1. Air is generally used to push the device to capture audio and video services.
2. server doing a forward broadcast to the audience below.
3. After this complete their audio and video streaming video decoding apparatus is performed.

Processing live.

1.推流端:采集,美颜处理,编码,推流处理.
2.服务器端处理:转码,录制,截图,鉴黄.
3.播放器:拉流,解码,渲染.
4.互动系统:聊天室,礼物系统,点赞.

Live process.

Here Insert Picture Description

demand analysis.

PC end plug flow: share your desktop, audio and video
servers: transcoding, recording
PCWEB: video player, IM
mobile terminal applications: video player, IM
IM: public chat, kicking, gag.

Self streaming.

Here Insert Picture Description

case analysis:

Here Insert Picture Description

Chat system architecture.

Http long connection
Here Insert Picture Description

ps: WebSocket connections based on the length.

websocket:
Here Insert Picture Description

IM instant messaging

	方案选用Java+netty框架搭建聊天室.

RTMP

Here Insert Picture Description

The advantages of using RTMP.
Here Insert Picture Description

TCP three-way handshake

Here Insert Picture Description

FLV agreement

Here Insert Picture Description

Application in live in.
Here Insert Picture Description

advantage
Here Insert Picture Description

HLS protocol

Here Insert Picture Description

Chart #

Here Insert Picture Description
advantage

Here Insert Picture Description
Disadvantages:

Here Insert Picture Description

Various agreements comparison:

Here Insert Picture Description

Advantages and disadvantages of each protocol has. Depends on the specific application scenarios. For example, some mobile phone side browser, you may have to be written in hls agreement.

WebRTC

Here Insert Picture Description

Architecture:

Here Insert Picture Description

Scenarios

Here Insert Picture Description

RTP protocol:

Here Insert Picture Description
Protocol format:

Here Insert Picture Description
Belongs level:

Here Insert Picture Description

WebRTC open source program

Here Insert Picture Description

WebRTC and RTMP contrast

Here Insert Picture Description

  • Here what vibrato fighting fish eye teeth like pepper can support a lot of concurrency and CDN is a certain relationship.

Delay:

Here Insert Picture Description

SRS Introduction

SRS is positioned carrier-class Internet live server cluster, the concept of integrity and the pursuit of better simplest implementation of the code. SRS provides abundant access scheme to access SRS RTMP streams, including to push RTMP SRS, push RTSP / UDP / FLV to SRS, SRS pulling flows. SRS also supports access RTMP streams various changes, such as the flow RTMP code stream theme, forwarded to other servers, turn encapsulated in HTTP-FLV streams encapsulated into HLS turn, turn encapsulated into HDS, recorded as FLV. SRS includes key features such as support large clusters CDN services, such as RTMP multilevel clustering, the source station cluster, VHOST virtual servers, uninterrupted service Reload, HTTP-FLV cluster, Kafka docking. In addition, SRS also provides a rich application interfaces, including HTTP callback security policy Security, HTTP API interfaces, RTMP speed. SRS and the source station CDN clusters have been widely Applications.

SRS Architecture
System Architecture:

Here Insert Picture Description

Modular Architecture:

Here Insert Picture Description

SRS Streaming Architecture

Here Insert Picture Description

Reference
[. 1] https://github.com/ossrs/srs/wiki/v3_CN_Home
[2] [https://github.com/ossrs/srs/tree/2.0release#usage]

After a comparison of the respective protocols. My next article will be updated for a long time have come up with the SRS-based docker live server. In this article and in a step by step to build a good development environment.

Published 76 original articles · won praise 9 · views 6677

Guess you like

Origin blog.csdn.net/qq_37870369/article/details/105343739