===========================ATOM介 绍============================

FTYP:
4Byte:size = 0x1C                                                    (0x00--0x03)
4Byte:type = 0x66 74 79 70                                    (0x04--0x07)
4Byte:MajorBrand = 0x6D 70 34 32                      (0x08--0x0B)
4Byte:MinorVersion                                                  (0x0C--0x0F)
size -= 16;
while(size)
{
4Byte:compatible_brand
size -= 4;
}

MOOV(Movie Atom)(容器)

4Byte:size = 0x00 00 0F 6C                                           (0x1C--0x1F)
4Byte:type = 0x66 74 79 70                                           (0x20--0x23)

MVHD(Movie header atom)

字段          长度(字节)         描述       
尺寸----------4--------------------这个movie header atom的字节数       
类型----------4--------------------Mvhd       
版本----------1--------------------这个movie header atom的版本       
标志----------3--------------------扩展的movie header标志,这里为0       
生成时间----4--------------------Movie atom的起始时间。基准时间是1904-1-1 0:00 AM       
修订时间----4--------------------Movie atom的修订时间。基准时间是1904-1-1 0:00 AM       
Timescale-- 4--------------------A time value that indicates the time scale for this movie—that is, the number of time units that pass per second in its time coordinate system. A time coordinate system that measures time in sixtieths of a second, for example, has a time scale of 60.    
相当于定义了标准的1秒在这部电影里面的刻度是多少.
Duration--4--A time value that indicates the duration of the movie in time scale units.Note that this property is derived from the movie’s tracks. The value of this field corresponds to the duration of the longest track in the movie.

播放速度----4--------------------播放此movie的速度。1.0为正常播放速度       
播放音量----2--------------------播放此movie的音量。1.0为最大音量       保留--10    这里为0       
矩阵结构----36------------------该矩阵定义了此movie中两个坐标空间的映射关系       
预览时间----4--------------------开始预览此movie的时间       
预览duration--4-----------------以movie的time scale为单位,预览的duration       
Poster time--4 ------------------The time value of the time of the movie poster.       
Selection time--4----------------The time value for the start time of the current selection.       
Selection duration--4 ----------The duration of the current selection in movie time scale units.       
当前时间----4--------------------当前时间       
下一个track ID--4--------------下一个待添加track的ID值。0不是一个有效的ID值。

4Byte:size = 0x00 00 00 6C                                           (0x24--0x27)
4Byte:type = 1836476516                                              (0x28--0x2B)
1Byte:Version = 0x00
3Byte:Flags = 0x00 00 00 
if(Version == 0) //默认
{
4Byte:CreationTime = 0xC6 D3 A0 F9                          (0x30--0x33)
4Byte:ModificationTime = 0xC6 D3 A0 F9    
4Byte:TimeScale = 0x00 00 02 58(600)                       (0x38--0x3B)
4Byte:Duration = 0x00 00 14 28(5160)                         (0x3C--0x3F)
}
else if(Version == 1)
{
8Byte:CreationTime = 
8Byte:ModificationTime = 
4Byte:TimeScale = 
8Byte:Duration =
}
else
{
//todo
}
4Byte:Rate = 0x00 01 00 00                                    (0x40--0x43)      
2Byte:Volume= 0x01 00                                           (0x44--0x45)
10Byte:Reserved =                                                   (0x46--0x4F)

for (int i=0; i<9; i++)                                                  (0x50--0x73)
{
4Byte:Matrix[i]     
}

4Byte:Preview time = 0                                              (0x74--0x77)
4Byte:Preview duration = 0                                      (0x78--0x7B)
4Byte:Poster time = 0                                               (0x7C--0x7F)
4Byte:Selection time = 0                                           (0x80--0x83)
4Byte:Selection duration = 0                                    (0x84--0x87)
4Byte:Current time = 0                                              (0x88--0x8B)
4Byte:Next Track Id = 5                                             (0x8C--0x8F)

计算电影长度 = Duration/TimeScale= 5160/600 = 8.6 = 8秒 600ms 

TimeScale: 是指衡量影片时间的单位尺度,以毫秒为单位;
Duration: 是指某段影片的播放时间,以TimeScale所指示的时间尺度为单位。
譬如 TimeScale = 1000, 某个AU(Access Unit)的Duration = 23, 则表示该AU的播放时间为23毫秒。
再譬如某部影片以30 fps的速率播放,若TimeScale = 1000, 则各AU的duration为33或34(交替出现以使误差最小)。
一般情况下一个AU可以理解成为一个Frame,常见的TimeScale设置为1000以获取直观和计算方便,音频也常将TimeScale的值设置为采样率。在压缩影片时,一定要注意声音和视频的这两组值设置正确,否则会引起音视频不正确。


MPEG4 笔记(FTYP,MOOV,MVHD)相关推荐

  1. MPEG4 笔记2(FTYP,MOOV,MVHD)

    http://hi.baidu.com/gongjun0371/blog/item/2bfef51200c659095aaf539c.html

  2. 软编码Flv 到Mp4 容器(五) fmp4 ftyp box 和moovmvhd box详解

    https://github.com/332065255/flv2fmp4 代码库 软编码Flv 到Mp4 容器(一) 软编码Flv 到Mp4 容器(二) flv tag拆解 软编码Flv 到Mp4 ...

  3. 软编码Flv 到Mp4 容器(十三) fmp4 生成ftyp和moov所必要的 flv数据

    https://github.com/332065255/flv2fmp4 代码库 软编码Flv 到Mp4 容器(一) 软编码Flv 到Mp4 容器(二) flv tag拆解 软编码Flv 到Mp4 ...

  4. Moov itom not found 详解及修复。

    moov atom 是什么? understanding the mpeg4 movie atom (moov atom) 怎么修复? Untrunc(better than recover_mp4_ ...

  5. mp4(H264容器)的详细文件格式分析

    十六进制码流分析: ftyp Box       00 00 00 1C:  size ,28,表示此BOX有28个字节,表示长度的四个字节也计算在内.以下同       66 74 79 70:  ...

  6. mp4v2再学习 -- Linux 下安装说明

    一.MP4v2 简介 参看:嵌入式Linux下MP4视频录制库MP4V2移植和简介 了解:mp4(3) - Linux man page 了解:MP4文件格式的解析,以及MP4文件的分割算法 首先官网 ...

  7. 3gp文件格式研究 (转windcao的专栏)

    序言 06我开始做3gp文件的播放器,但是关于3gp的文档太少了也很难找,在网友luxh的帮助下, 我终于有了第一份关于3gp文件格式的文档<ISO/IEC 14496-12,ISO媒体文件格式 ...

  8. symbian流媒体入门之--《3gp文件格式研究》

    原文地址:http://blog.csdn.net/windcao/archive/2006/05/12/725722.aspx 序言 06我开始做3gp文件的播放器,但是关于3gp的文档太少了也很难 ...

  9. 手机音视频流媒体开发一些有用资料(2009.6.17更新)

    <script type="text/javascript"> document.body.oncopy = function() { if (window.clipb ...

最新文章

  1. redis和mysql内存数据库性能_Redis高性能内存数据库
  2. linux无人值守安装
  3. 《LeetCode力扣练习》剑指 Offer 24. 反转链表 Java
  4. Django模型 Q对象实现复杂查找
  5. c++实现全局优化的了望算法
  6. 基于某网站的信息爬取与保存_指定跳转页
  7. UI自动化之元素定位(xpath、css)
  8. Canvas-图片旋转
  9. 通过可视化来了解你的Spark应用程序
  10. matlab数据导出excel,求教怎么将matlab的数据导出到excel
  11. sklearn搭建线性模型的总结
  12. linux c 文件映射,linuxc-共享内存
  13. Dapper:The member of type SeoTKD cannot be used as a parameter Value
  14. Spring框架中的核心思想包括什么
  15. AWS AI网络研讨会 webinar - Case 分享
  16. 访问图像元素(imagedata widthstep)
  17. [phaser3入门探坑]使用phaser3制作山寨马里奥
  18. 大数据和云计算技术的就业前景
  19. boost电路输出电流公式_Boost电路的参数计算及仿真
  20. 三维动画在计算机上的应用,计算机图技术在三维动画中的应用.doc

热门文章

  1. 重磅:小程序将可分享到朋友圈啦!
  2. 高速缓存DNS解析详解
  3. 手机开机接入网络的过程
  4. 腾讯未来交通白皮书 附下载地址
  5. 【CTF】java反序列-2020-网鼎杯-朱雀组-Web-think_java
  6. 通过Python对的大理石接触分析
  7. 三级分销软件开发技术分销系统模式
  8. PY爬取2020年电影票房排行
  9. Redis:本地客户端连接远程服务器方法
  10. Just Waiting for You!个性化推荐带你领略不一样的算法之美