当前位置:网站首页>【读书会第十三期】视频文件的封装格式
【读书会第十三期】视频文件的封装格式
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视频文件格式详细的讲述了格式具体的标准,可以说是将这个在生活中见得最常见的格式重新的理解了一遍,原来是这样进行封装的。
边栏推荐
- Pytest multi process / multi thread execution test case
- 2022-07-03:数组里有0和1,一定要翻转一个区间,翻转:0变1,1变0。 请问翻转后可以使得1的个数最多是多少? 来自小红书。3.13笔试。
- New year's first race, submit bug reward more!
- Katalon framework tests web (XXI) to obtain element attribute assertions
- 智慧地铁| 云计算为城市地铁交通注入智慧
- MySQL backup notes
- 新型数据中心,助力加快构建以数据为关键要素的数字经济
- 函数计算异步任务能力介绍 - 任务触发去重
- ctf-pikachu-CSRF
- Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
猜你喜欢
随机推荐
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Calculate the odd sum of 1~n (1~100 as an example)
Simple dialogue system -- text classification using transformer
[PaddleSeg 源码阅读] PaddleSeg计算 mIoU
[paddleseg source code reading] paddleseg calculation dice
Support the first triggered go ticker
Leetcode51.n queen
Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches
Want to do something in production? Then try these redis commands
Katalon框架测试web(二十六)自动发邮件
Apple submitted the new MAC model to the regulatory database before the spring conference
Future源碼一觀-JUC系列
Code Execution Vulnerability - no alphanumeric rce create_ function()
logistic regression
[paddleseg source code reading] paddleseg custom data class
基于PHP的轻量企业销售管理系统
SQL statement strengthening exercise (MySQL 8.0 as an example)
Zlmediakit compilation and webrtc push-pull flow testing
Database SQL statement summary, continuous update
Easy to win insert sort










