当前位置:网站首页>[book club issue 13] Chapter 2 notes on the packaging format and coding format of video files
[book club issue 13] Chapter 2 notes on the packaging format and coding format of video files
2022-07-28 08:05:00 【Hua Weiyun】
Note reference sources :https://education.huaweicloud.com/courses/course-v1:HuaweiX+CBUCNXLO005+Self-paced/courseware/96d922bf013841c39aabcb94f210e197/6b6d22c4ae644bc4b8b39c27c9ecd491/
FFmpeg Video packaging format
FFmpeg Supports many encapsulation formats , Include MP4、FLV、MKV、TS And other video packaging formats 、MP3、AAC And other audio packaging formats RTMP、RTSP、HLS And so on network protocol encapsulation format .
# ./configure --list-muxersa64 framehash mpeg1vcd rmac3 framemd5 mpeg1video roqadts g722 mpeg2dvd rsoadx g723_1 mpeg2svcd rtpaiff g726 mpeg2video rtp_mpegtsamr g726le mpeg2vob rtspapng gif mpegts sapaptx gsm mpjpeg sbcaptx_hd gxf mxf sccasf h261 mxf_d10 segafilmasf_stream h263 mxf_opatom segmentass h264 null singlejpegast hash nut smjpegau hds oga smoothstreamingavi hevc ogg soxavm2 hls ogv spdifavs2 ico oma spxbit ilbc opus srtcaf image2 pcm_alaw stream_segmentcavsvideo image2pipe pcm_f32be supchromaprint ipod pcm_f32le swfcodec2 ircam pcm_f64be teecodec2raw ismv pcm_f64le tg2crc ivf pcm_mulaw tgpdash jacosub pcm_s16be truehddata latm pcm_s16le ttadaud lrc pcm_s24be uncodedframecrcdirac m4v pcm_s24le vc1dnxhd matroska pcm_s32be vc1tdts matroska_audio pcm_s32le vocdv md5 pcm_s8 w64eac3 microdvd pcm_u16be wavf4v mjpeg pcm_u16le webmffmetadata mkvtimestamp_v2 pcm_u24be webm_chunkfifo mlp pcm_u24le webm_dash_manifestfifo_test mmf pcm_u32be webpfilmstrip mov pcm_u32le webvttfits mp2 pcm_u8 wtvflac mp3 pcm_vidc wvflv mp4 psp yuv4mpegpipeframecrc mpeg1system rawvideoMP4 Package format
MP4 Basically, the encapsulation format can be considered as the most common video file format in daily life and work , Mainly because of its wide applicability , Not only in PC End (windows、mac、linux) Very good support , And on the mobile side (Android、iOS) It can also be played smoothly .
MP4 Format standard
MP4 Format standard is ISO-14496 Part 12 and ISO-14496 Part 14, The specific features are as follows :
- MP4 The document consists of many Box and FullBox.
- FullBox yes Box An extension of , stay Header Added in 8 position version Information and 24 Bit flags Information .3. Every Box from Header and Data Two parts .
- Header It contains the whole Box The length of the size of (size) And type (type).
- Data It contains actual data , It could be pure data , It can also be a son Box. When Box Medium Data Is a series of sub Box when , This Box Also known as Container( Containers ).
MP4 ftyp Box
ftyp Box, It is usually located at the beginning of the file , Which includes MP4 Types of video files 、 edition 、 Compatible protocols and other information .
MP4 moov Containers
moov The container contains MP4 Media data information of video file , There are two sub containers inside : mvhd and trak, The former defines the file header information , The latter defines... In the media file track Information .
moov Containers are generally generated in by default MP4 End of file , When playing online, you need to load a complete file to open it normally , In order to quickly open the video , Need to put moov Put the container in MP4 In front of the file .
MP4 mdat Box
mdat Box, Used to store the actual data content of media files .
FFmpeg Video coding format
FFmpeg Support many video coding formats , such as MPEG4、H263、H264、H265、VP8、VP9 etc. . Next , Emphasis on the H264 Video encoding format .
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 .
- 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 .
- 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 Of I The frame type
Frames are encoded within frames , Frames represent keyframes , You can understand it as a complete preservation of this frame ;
- One GOP The first image in the sequence is called IDR Images ( Refresh the image now ),IDR The images are all Ⅰ 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 I Frame data can be reconstructed into a complete image .
4.I Frame is generated without reference to other pictures .
5.I Frames are P The frame and B Frame reference frame ( Its quality directly affects the quality of subsequent frames in the same group ). - 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
Bidirectional predictive interpolation coding frames .B Frames are two-way differential frames , That is to say B A frame records the difference between this frame and the preceding and following frames
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
Forward prediction coding frame .P The frame represents this frame and the previous keyframe ( or P frame ) The difference between , In decoding, the difference defined in this frame is superimposed on the previously cached picture , Generate the final picture .
1.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 ,Р Frame has no full picture data , Only data different from the picture of the previous frame .
2.P Frames are I 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 I 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 .
边栏推荐
- 任务管理器中,显示的CPU速度大于它的最大速度【主频】
- Method of hiding scroll bar in wechat applet
- 03 | 项目部署:如何快速部署一个基于laravel框架开发的网站
- Plantuml Usage Summary
- SWM32系列教程5-ADC应用
- Collector原理解析
- And is two numbers of S - two questions per day
- Protobuf basic grammar summary
- In QT multithreading, in which thread does the slot function perform analysis
- How to analyze the taxi business problem of didi SQL interview question
猜你喜欢
![Redis of non relational database [detailed setup of redis cluster]](/img/0b/bd05fb91d17f6e0dc9f657a4047ccb.png)
Redis of non relational database [detailed setup of redis cluster]

Synthesis of dna-ag2sqds DNA modified silver sulfide Ag2S quantum dots

聊一聊数据库的行存与列存

数据化管理洞悉零售及电子商务运营——数据化管理介绍

Find out whether the number exists from the matrix

Merge two sorted linked lists - two questions per day

解决CNN固有缺陷!通用 CNN 架构CCNN来了| ICML2022

记录一次mycat连接Communications link failure问题解决

Parse tree structure JS

使用FFmpeg来批量生成单图+单音频的一图流视频
随机推荐
Qt多线程中槽函数在哪个线程里执行分析
EMC's "don't come back until you rectify"
What if you are prompted that your connection to this website is not a private connection?
Fxksmdb.exe process description
Using identity framework to realize JWT identity authentication and authorization in.Net 6.0
Merge two sorted linked lists - two questions per day
DNA-CuInSeQDs近红外CuInSe量子点包裹脱氧核糖核酸DNA
How do we run batch mode in MySQL?
华为高级工程师---BGP路由过滤及社团属性
Forward propagation of deep learning neural networks (1)
MPLS --- 多协议标签交换技术
@Documented 的作用
Talk about row storage and column storage of database
Find out whether the number exists from the matrix
ArcGIS JS customizes the accessor and uses the watchutils related method to view the attribute
The core packages and middleware required for golang development cover all areas of the project and are worth collecting
The first common node of two linked lists -- two questions per day
mysql:LIKE和REGEXP操作有什么区别?
How to analyze the taxi business problem of didi SQL interview question
The even number of an integer queue is placed in the front, the odd number is placed in the back, and the relative position of the even and odd numbers remains unchanged