About video transmission on existing broadband networks

zhaozj2021-02-11  178

Transmission of video on the existing broadband networks: bomb (wood frog) if found deficiencies in this article are welcome to send EMAIL bomb_hero@163.com correction. ============================================================================================================================================================================================================= =======================================================================================================================================================

First, the structure of the video stream

MPEG2 medium-view frequency flow flow flow streaming video data division, frame division three types I, P, B. I Frame: Describe all information of the current image, can be decoded separately. However, since the information is more, it is relatively large. P Frame: Describe the current image and the previous frame image, or a block area movement information, the image is decoded to decode the image after the previous frame decoding. This reduces the amount of data of the frame. Generally, the size is 1/5 ~ 1/10 of I frame. Of course, there are also exceptions, such as when the lens suddenly switches, since the current image information and the previous frame image information have little, the P frame will be large. B Frame: Describe the current image and the previous frame and the mobile information of the next frame image, such as some area, so when the lens is switched, refer to the information of the next frame, thereby reducing the size of the B frame. . This coding strategy is used in the MPEG4 Sample Profile. The current video stream currently encoded in the common network video stream encoder is the structure of the I frame P frame. The specific compression algorithm can write a book is not the scope discussed herein. Now let's take a look at the video flow structure ippppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp. If a P frame is lost during the transmission, all P-frame decodes will have an error before the next I frame, which is the origin of mosaic. Second, the transmission of the transmission method TCP has buffer and check mechanisms in the server and the client, and the server does not need to care if the client has passed the gateway during the transmission process. Direct transmission after the connection is established. The transmission process is transmitted using a flow mode, and generally does not appear the first reachable reach. The client is received in a stream, and then each frame is distinguished by decoding. However, since the TCP has a check retransmission mechanism, the data package is reloaded when a packet is transmitted after the error is transmitted. Thereby delay, there will be no big problems in a short time. But the time has long time will have a serious hysteresis, and if the client decoding speed is not enough to have a buffer overflow. UDP is transmitted by using packets, and there is no built-in retransmission mechanism, and retransmission will not be requested after data loss. Moreover, the UDP will split the packet into 2KB when the data package is greater than 2 kB. That is, the server sends a data packet greater than 2 kb, and the client will receive a number of packets less than or equal to 2kb, and the order of the front and rear is likely to be reversed. Based on the above reasons, each frame data should be divided into a packet of less than 2 kB and then send out the header information when transmitting video data using the UDP package. Head information generally includes frame numbers: used to illustrate those packets belong to the same frame. Packet number: Data combination for the same frame is sorted. Total package number: Used to explain how many packages are divided into this frame. This package size: Record the size of this package. Problems with UDP packet loss and client decoding speed issues. When UDP is packed, the frame is discarded, then continue to decode Mosaic on the screen, or discard the frame and later P frame until it receives an I frame and then decoding, this screen mutation will appear. The reason for non-retransmission is because if you want to retransmit it, you will be temporarily paused. If used in real-time video transmission, the meaning of retransmission is not large. Now there is a way of using RTCP transmission, I don't have this study, I don't know if the netizen can give this part to Patch. Third, the UDP mode client gets video data through the gateway When the client is in the gateway, the server is outside the gateway. The server is unable to actively use UDP to transfer video data to the client. To solve this problem, we must find solutions during the handshake of the client and the server. The server has an open TCP listening port and the public UDP listener port. When the client has a data request, use the TCP mode to connect the server, and then the server assigns a unique serial number to the client, serial number is used for identification.

转载请注明原文地址:https://www.9cbs.com/read-5976.html

New Post(0)