Introduction to RTSP/GB28181 protocol video platform docking RTMP stream camera encoding

Video is based on the principle of persistence of human vision, by playing a series of pictures, making the human eyes feel moving. Simply transmitting video images, the video volume is very large, which is unacceptable for the existing network and storage. In order to make the video easy to transmit and store, people find that the video has a lot of repeated information. If the repeated information is removed at the sending end and restored at the receiving end, the video data files are greatly reduced, so H.264 video Compression standard.

In the H.264 compression standard, I frame, P frame, and B frame are used to represent the transmitted video picture.

1. I

I frame, also known as intra-frame coded frame, is an independent frame with all its own information. It can be decoded independently without referring to other images. It can be simply understood as a static picture. The first frame in a video sequence is always an I frame because it is a key frame.

2.P frame

P-frames are also called inter-frame predictive coding frames, and need to refer to the previous I-frames for coding. It represents the difference between the current frame and the previous frame (the previous frame may be an I frame or a P frame). When decoding, it is necessary to superimpose the difference defined in this frame with the previously buffered picture to generate the final picture. Compared with I frames, P frames usually take up fewer data bits, but the disadvantage is that because P frames have a complex dependency on the previous P and I reference frames, they are very sensitive to transmission errors.

3. B frame

B frame is also called bidirectional predictive coding frame, that is, B frame records the difference between this frame and the previous and next frames. That is to say, to decode B-frames, not only the previous buffered picture must be obtained, but also the decoded picture, and the final picture is obtained by superimposing the front and back pictures and the data of the current frame. The B frame has a high compression rate, but has a higher requirement for decoding performance.

to sum up

I frame only needs to consider this frame; P frame records the difference from the previous frame; B frame records the difference between the previous frame and the next frame, which can save more space. The video file is smaller, but relatively It is more troublesome when it comes to decoding. Because when decoding, it is necessary to use not only the previously buffered picture, but also to know the next I or P picture, which is easy to freeze for players that do not support B-frame decoding.

The video picture previewed in the video surveillance system is real-time, which requires a high level of smoothness of the picture. The use of I-frames and P-frames for video transmission can improve the adaptability of the network and reduce the decoding cost. Therefore, video decoding at this stage only uses I-frames and P-frames for transmission. Hikvision camera encoding, the I frame interval is 50, including 49 P frames.

It can be known from the above camera parameters that the push-stream camera produces 25 frames per second, and there is a key frame in every 50 frames, so it is a key frame every two seconds. Such a setting can ensure the normal and smooth live broadcast of the device.

TSINGSEE Qingxi Video's full line of products currently support H265 encoded video playback. The RTMP protocol video platform EasyDSS, RTSP protocol video platform EasyNVR, GB28181 protocol video platform EasyGBS, and video fusion platform EasyCVR have integrated H265 player EasyPlayer. If you are interested in H265, you can read it: h264 encoded video or h265 encoded video which is clearer .

  • EasyPlayer.js in EasyNVR edge gateway service:

  • EasyPlayer.js in the EasyGBS GB/T28181 streaming service:

  • EasyPlayer.js in EasyDSS streaming video live/on-demand service:

  • EasyPlayer.js in EasyCVR security video cloud service platform:

 

Guess you like

Origin blog.csdn.net/u010460625/article/details/108894185