当前位置:网站首页>[book club issue 13] + Chapter III coding format of video files
[book club issue 13] + Chapter III coding format of video files
2022-07-22 06:05:00 【Hua Weiyun】
Today's main learning content knowledge points Review :
- FFmpeg Support many video coding formats , such as MPEG4、H263、H264、H265、VP8、VP9 etc. .
- Today's focus H264 Video encoding format (H264 Rate control 、H264 Of I The frame type 、H264 Of P The frame type 、H264 Of B The frame type 、H264 Frame reference )
- Video compression , Each frame represents a still image . In actual compression , Various algorithms will be adopted to reduce the capacity of data , among IPB(I>P>B ) Is the most common .
- I Frames are keyframes , It belongs to intra compression . That's right. AVI The compression is the same . P It's a forward search It means .B It's a two-way search . They are all based on I Frame to compress data .
- H264 The core algorithm is intra frame compression and inter frame compression , Intra compression is the generation of I Frame algorithm , Inter frame compression is the generation of B The frame and P Frame algorithm .
1.H264 Rate control
- 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 . The quality is guaranteed , And bandwidth constraints . This algorithm gives priority to image quality
- CBR:Constant BitRate, 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 . This algorithm gives priority to bit rate ( bandwidth ), Count the average bit rate over a period of time , It would be more reasonable .
- 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 . It can be understood as Reach the set bit rate within a certain time range , But the local bit rate peak can exceed the set bit rate , Constant average bit rate .
2.H264 Of I The frame type
- 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 (I Frames are frame groups GOP The base frame of ( First frame ), Only one in a group I frame .).
- I frame , Also called intra reference frame , Keep a complete picture .
- Use only when decoding I Frame data can be reconstructed into a complete image .
- I Frame is generated without reference to other pictures .
- I Frames are P The frame and B Frame reference frame .
- I Frames don't need to consider motion vectors .
- I The frame occupies the largest amount of data .
- It's a full frame compressed encoded frame . It takes the whole frame of image information JPEG Compression coding and transmission .
- I Frames represent keyframes , You can understand it as a complete preservation of this frame ; Decoding only needs the frame data to complete ( Because it contains the whole picture ).
3.H264 Of P The frame type
- P frame , Also called forward reference frame , It represents this frame and the previous key frame ( 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 data different from the picture of the previous frame .
- P Frames are I The frame is separated by 1~2 Frame encoding frame .
- P The frame is transmitted with motion compensation I or P Frame difference and motion vector ( Prediction error ).
- 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 I The frame or P frame .
- P The frame can be behind it P Frame reference frame , It can also be before and after B Frame reference frame .
- P Frames are reference frames , It may cause the spread of decoding errors .
- P The compression ratio of frames is between I The frame and B Between frames .
- P The frame represents this frame and the previous keyframe ( 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 .( That's the difference frame ,P Frame has no full picture data , Only data different from the previous frame ).
- P Frame prediction and reconstruction :P The frame is based on I Frames are reference frames , stay I Find... In the frame P frame “ A point ” The predicted values and motion vectors of , Take the prediction difference and transmit it with the motion vector . At the receiving end, according to the motion vector from I Find... In the frame P frame “ A point ” And add the predicted value to the difference value P frame “ A point ” Sample value , So we can get complete P frame .
4.H264 Of B The frame type
- 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 .
- B The compression rate of frames is the highest , But when decoding CPU The utilization rate will be relatively high .
- B The frame is from the front I or P The frame and the following P Frame to predict .
- B The frame transmits it with the preceding I or P The frame and the following P Prediction errors between frames and motion vectors .
- B Frame is not a reference frame , It doesn't cause the spread of decoding errors .
- B Frames are two-way differential frames ,B High frame compression rate , But when decoding CPU I will be tired .
- B Frame prediction and reconstruction :B Frame before I or P The frame and the following P Frames are reference frames ,“ find ”B frame “ A point ” And two motion vectors , And take the prediction difference and the motion vector transmission . According to the motion vector in two frames “ find ( Work out )” Predict the value and sum it with the difference , obtain B frame “ A point ” Sample value , So we can get complete B frame .
5.H264 Frame reference
I、B、P Each frame is based on the needs of the compression algorithm , It's artificially defined , They are real physical frames . Generally speaking ,I The frame compression rate is 7( Follow JPG almost ),P Frames are 20,B Frames can reach 50. Visible use B Frames can save a lot of space , The space saved can be used to save more I frame , So at the same bit rate , Can provide better picture quality .
边栏推荐
- RavenDB完全事务性的 NoSQL 文档数据库
- Discussion on passing the d-shield PHP webshell without killing horses
- Function anti chattering and function throttling
- 如何高效地实现基础设备可视化
- Zabbix3.0版报警设置
- C语言解题——Number Sequence
- 过D盾php webshell免杀马探讨
- The difference between w3school and w3school
- 牛客网刷题——第三天
- Early details about visual studio 2019
猜你喜欢
2022亚洲国际物联网展会
A device from black to white (with front desk 0day)
今天面了个腾讯拿 38K 出来的,让我见识到了基础的天花板
Postman - post request application / x-www-from-urlencoded
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷
Analysis on the characteristics of two-layer industrial switch
国家互联网信息办公室有关负责人就对滴滴全球股份有限公司依法作出网络安全审查相关行政处罚的决定答记者问
RavenDB完全事务性的 NoSQL 文档数据库
基于通用单片机(久齐) 半导体制冷制热的控制 手机散热器按摩仪器中冷热头的控制
idea报错Port 8080 is already in use
随机推荐
How to map the SSM framework file upload to the database
The difference between w3school and w3school
EF Core 数据过滤
牛客网刷题——第三天
TypeScript学习
NETCORE - Middleware (1)
免杀exe技术探讨
NISP-2之信息安全技术系列博文目录
机房可视化管理标签自动生成
D3.js + canvas drawing organization chart
Niuke online question brushing - day 3
关于Visual Studio 2019的前期详情
前两天面了个腾讯拿 38K 出来的,让我见识到了基础的天花板,今天share给大家~
C#. Net sqlserver login function
D3.js + Canvas 绘制组织结构图
C语言解题——Number Sequence
写了几段小代码,把系统给搞崩了,被老板爆怼一顿
The wonderful problem encountered in FPGA design - "chip also depends on origin" (III)
QT 之事件的相关使用用例
MySQL:MySQL客户端和服务端之间是如何连接的呢?