当前位置:网站首页>【读书会第十三期】视频文件的封装格式
【读书会第十三期】视频文件的封装格式
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视频文件格式详细的讲述了格式具体的标准,可以说是将这个在生活中见得最常见的格式重新的理解了一遍,原来是这样进行封装的。
边栏推荐
- @Scheduled scheduled tasks
- CSP drawing
- New year's first race, submit bug reward more!
- system information
- Leecode 122. Zuijia timing of buying and selling stocks ②
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Consul of distributed service registration discovery and unified configuration management
- Zlmediakit compilation and webrtc push-pull flow testing
- Database SQL statement summary, continuous update
- JDBC 进阶
猜你喜欢

Go 语言入门很简单:Go 实现凯撒密码

'2'>' 10'==true? How does JS perform implicit type conversion?

如何有效远程办公之我见 | 社区征文

Defensive programming skills

Audio and video technology development weekly | 232

Recursive structure

Select sorting and bubble sorting template

JVM family -- heap analysis

Wechat official account web page authorization

PID of sunflower classic
随机推荐
函数计算异步任务能力介绍 - 任务触发去重
用于TCP协议交互的TCPClientDemo
Audio and video technology development weekly | 232
Add token validation in swagger
Nbear introduction and use diagram
Command Execution Vulnerability - command execution - vulnerability sites - code injection - vulnerability exploitation - joint execution - bypass (spaces, keyword filtering, variable bypass) - two ex
Monitoring - Prometheus introduction
[paddleseg source code reading] paddleseg calculation dice
How to pipe several commands in Go?
Zigzag scan
[PaddleSeg 源码阅读] PaddleSeg 自定义数据类
Typical applications of minimum spanning tree
Objective-C string class, array class
三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量
The new data center helps speed up the construction of a digital economy with data as a key element
logistic regression
1289_FreeRTOS中vTaskSuspend()接口实现分析
Want to do something in production? Then try these redis commands
SQL injection (1) -- determine whether there are SQL injection vulnerabilities
JVM family -- heap analysis
