Reprint: http://blog.csdn.net/liangxiaozhang/article/details/8473717
GOP plainly is the interval between two I frames. The comparison says GOP is 120, if it is 720p60, it is 2s i frame at a time.
In the video coding sequence, there are mainly three kinds of coded frames: I frame, p frame, b frame, as shown in the following figure.
I frame is intra-coded picture (frame coded image frame), do not refer to other image frames, only use this frame of information to encode
P-Frame is predictive-codedpicture (predictive coded image frame), using the previous I frame or p frame, and using motion prediction method to predict and encode between frames.
Frame B is the bidirectionallypredicted picture (bidirectional predictive coded image frame) that provides the highest compression ratio, and it requires both previous graphs
Image frame (I frame or P frame), also need later frame (P frame), using motion prediction method for bidirectional prediction coding between frames
In the video coding sequence, GOP is the group of picture (Image Group), which refers to the distance between two I frames, Reference (reference period) refers to the distance between two P frames (figure 3.1 below). An i frame occupies more bytes than a p frame, and a p frame occupies more than a B frame (shown in Figure 3.1 below).
I, P, b frame diagram
So in the case of the constant rate of GOP, the larger the value, p, B, the number of frames will be more, the average of each I, P, b frame to occupy more bytes, it is easier to obtain better image quality; the larger the reference, the greater the number of B frames, and the more easily the better image quality can be obtained.
What needs to be explained is that by increasing the GOP value to improve the image quality is limited, when the scene switching situation, the H.264 encoder will automatically force the insertion of an I frame, at this time the actual GOP value is shortened. On the other hand, in a GOP, p, b frame is by I frame prediction, when I frame image quality is poor, will affect a GOP in the subsequent P, b frame image quality, until the next GOP began to be able to recover, so the GOP value is not suitable to set too large.
At the same time, because the complexity of P and B frames is greater than I frame, excessive p and B frames can affect the coding efficiency and reduce the coding efficiency. In addition, too long GOP can also affect the response speed of the seek operation, since p and B frames are predicted by the previous I or P frames, the seek operation needs to be directly positioned, decoding a p or B frame, first decoding the I frame in the GOP and the previous N prediction frames, the longer the GOP value, The more prediction frames need to be decoded, the longer the seek response will be.