当前位置:网站首页>[book club issue 13] coding format of video files

[book club issue 13] coding format of video files

2022-07-04 15:28:00 Hua Weiyun

FFmpeg Video coding format

FFmpeg Support many video coding formats , such as MPEG4、H263、 H264、 H265、 VP8、 VI9 etc. .
What we focus on is H264 Video encoding format .

H263 Rate control

  1. VBR: Variable BitRate, Dynamic bit rate mode , The bit rate can vary with the complexity of the image , Therefore, its coding efficiency is relatively high .
  2. CBR: Constant Bi tRate, Constant bit rate mode , Because the code rate is constant , When there are dramatic changes in the picture ,QP The parameter will increase , The image quality will get worse , When the scene is still , And waste bandwidth . The overall image quality of this mode is unstable .
  3. ABR: Average BitRate, Average bit rate mode , yes VBR A derivative form of , Within the specified file size , Static or near static image parts use relatively low traffic , High traffic is used in the complex picture , It can be regarded as VBR and CBR A compromise of .

H264 Frame reference

First of all, I will put out the reference relations of the following three frames , For subsequent understanding .

H264 Of I The frame type

  1. One GOP The first image in the sequence is called IDR Images ( Refresh the image now ),IDR The images are all I Frame image , but I Not all frames are IDR frame , Only GOP The first of the sequence 1 individual I Frames are IDR frame .
  2. I frame , Also called intra reference frame , Keep a complete picture .
  3. Use only when decoding 1 Frame data can be reconstructed into a complete image .
  4. 1 Frame is generated without reference to other pictures .
  5. I Frames are P The frame and B Frame reference frame .
  6. I Frames don't need to consider motion vectors .
  7. I The frame occupies the largest amount of data .

H264 Of B The frame type

  1. B frame , Also called bidirectional reference frame , That is to say B A frame records the difference between this frame and the preceding and following frames , To decode B frame , Not only to get the previous cache screen , You have to decode the image , Through the superposition of the front and back pictures and the data of this frame, the final picture is obtained .
  2. B The compression rate of frames is the highest , But when decoding CPU The utilization rate will be relatively high .
  3. B The frame is from the front I or P The frame and the following P Frame to predict .
  4. B The frame transmits it with the preceding I or P The frame and the following P Prediction errors between frames and motion vectors .
  5. B Frame is not a reference frame , It doesn't cause the spread of decoding errors .

H264 Of P The frame type

  1. P frame , Also called forward reference frame , It means this - The frame is the same as the previous one Key frames ( or P frame ) The difference between , In decoding, the difference defined in this frame needs to be superimposed on the previous cached picture , Generate the final picture ,P Frame has no full picture data , Only with the previous one - Frame picture difference data .
  2. P Frames are 1 The frame is separated by 1^ 2 Frame encoding frame .
  3. P The frame is transmitted with motion compensation I or P Frame difference and motion vector ( Prediction error ).
  4. P The frame belongs to the inter frame coding of forward prediction . It only refers to the one closest to it in front of it 1 The frame or P frame .
  5. P The frame can be behind it P Frame reference frame , It can also be before and after B Frame reference frame .
  6. P Frames are reference frames , It may cause the spread of decoding errors .
  7. P The compression ratio of frames is between I The frame and B Between frames .

summary :

This period of study can let us know how to control the bit rate of video in common video coding formats , Especially common H264, adopt IBP Three frame types to complete the verification of video can be said to be very complete .

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041423556509.html