当前位置:网站首页>【读书会第十三期】视频文件的封装格式
【读书会第十三期】视频文件的封装格式
2022-07-04 03:46:00 【华为云】
FFmpeg的视频封装格式
FFmpeg支持很多封装格式,包括MP4、FL.V、 MKV、 TS等视频封装格式、MP3、 MC等音频封装格式以及RTMP、 RTSP、 HILS 等网络协议封装格式。
而我们重点学习MP4视频封装格式。
MP4封装格式
MP4封装格式基本上可以认为是日常生活和工作中最常见的视频文件格式,主要是由于其广泛的适用性,不仅在PC端(windows、 mac、 linux) 支持的非常好,而且在移动端(Android、 i0S) 也能流畅播放。
MP4格式标准
MP4格式标准为ISO- 14496 Part 12 和ISO- 14496 Part 14, 具体特征如下:
- MP4文件由许多Box和FullBox。
- FullBox 是Box的扩展,在lleader 中增加了8位version信息和24位的flags信息。
- 每个Box由Header和Data两部分组成。
- Header 中包含了整个Box 的长度大小(size) 和类型(type) 。
- Data 中包含了实际的数据,可以是纯数据,也可以是子Box。 当Box中的Data 是一系列子Box时,这个Box又被称为Container (容器)。
MP4 ftyp Box
ftyp Box, -般位于文件开始位置,其中包含了MP4视频文件的类型、版本、兼容协
议等信息。
MP4 moov容器
moov容器中包含了MP4视频文件的媒体数据信息,内部又包含两个子容器: mvhd和
trak,前者定义了文件头信息,后者定义了媒体文件中的track信息。
Moov容器一般默认会生成在MP4 文件结尾,在线播放时需要加载完整个文件才能正常打开,为了能够快速打开视频,需要把moov容器放在MP4文件的前面。
MP4 mdat Box
mdat Box,用来存放媒体文件的实际数据内容。
总结:
第二天的学习主要讲解了视频文件的封装格式,以最常见的MP4视频文件格式详细的讲述了格式具体的标准,可以说是将这个在生活中见得最常见的格式重新的理解了一遍,原来是这样进行封装的。
边栏推荐
猜你喜欢
Stm32bug [stlink forced update prompt appears in keilmdk, but it cannot be updated]
Session learning diary 1
MySQL query
Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches
SQL statement strengthening exercise (MySQL 8.0 as an example)
mysql数据库的存储
Audio and video technology development weekly | 232
[paddleseg source code reading] paddleseg custom data class
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
渗透实战-SQLServer提权
随机推荐
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
JDBC 进阶
Leecode 122. Zuijia timing of buying and selling stocks ②
毕业总结
Simple dialogue system -- text classification using transformer
1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
super_ Subclass object memory structure_ Inheritance tree traceability
How to pipe several commands in Go?
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
Is it safe to buy insurance for your children online? Do you want to buy a million dollar medical insurance for your children?
ctf-pikachu-CSRF
Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
Handler source code analysis
Objective-C string class, array class
The property of judging odd or even numbers about XOR.
Recent learning fragmentation (14)
XSS prevention
用于TCP协议交互的TCPClientDemo
Formulaire day05
图解网络:什么是热备份路由器协议HSRP?