RTP protocol, RTCP protocol and RTP packaging method of H264

RTP protocol

RTP (Real-time Transport Protocol) protocol, the full name is Real-time Transport Protocol. It is mainly used for the transmission of audio and video data. So what is its function?

Generally, when we communicate in real time, we need to transmit audio and video data. We usually do this, first encode and compress the original data, and then transmit the encoded stream to the receiving end. During transmission, we usually do not directly transmit the encoded code stream, but pack the code stream into individual RTP packets before sending them.

So why do you need to package it into an RTP package? This is because our receiving end needs not only the original coded stream, but also some additional information to be able to use these audio and video coded data correctly. For example:

Which video coding standard is the current video code stream, is it H264, H265, VP8, VP9 or AV1? We know that each different encoding standard must have a different way of parsing the code stream. This needs to be notified to the receiving end through the RTP protocol.

When we know the encoding standard, we can correctly parse the code stream and decode the image. But we will encounter a new problem, that is, at what speed should the video be played? This also requires the RTP protocol to inform the receiving end.

This is an important role of the RTP protocol, which is to inform the receiving end of some necessary information. Of course, the role of the RTP protocol is more than that. In fact, it also plays a vital role in network bandwidth prediction and congestion control. We will continue to discuss it in the following courses, so I won’t talk about it here, you just have a general impression.

We know that RTP packets need to be accompanied by a lot of additional information, so how does this information exist in RTP packets? In fact, the RTP packet includes two parts: the first part is the RTP header; the other part is the RTP payload. Among them, the RTP header is mainly used to carry the additional information mentioned above. I will introduce the meaning of each field of the RTP header in detail later.

Here I will explain another part to you a little bit&

Guess you like

Origin blog.csdn.net/guofeidageda/article/details/128722710
RTP