如何读取 mp4 视频的 Mdat 原子?
我正在尝试解析 mp4 并能够解析 moov
但不确定如何使用 moov
信息来解析 mdat
。
我的目标是从 mdat
获取元数据等轨道信息(如果可能的话),因为它包含视频和音频数据。
目前正在关注 QuickTime 文件格式规范
尝试过 Sample-to-Chunk Atoms
但我所有的 stsc (20 字节)如下所示:
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0]
[0 0 0 1]
[0 0 0 1 0 0 0 1]
[0 0 0 1]
fmt.Println(binary.BigEndian.Uint32(buf[0:4])) //4
fmt.Println(binary.BigEndian.Uint32(buf[4:8])) //4
fmt.Println(binary.BigEndian.Uint32(buf[8:16])) //8
fmt.Println(binary.BigEndian.Uint32(buf[16:20])) //4
目前不知道如何处理和解析 mdat
原子。
任何帮助将不胜感激!
I am trying to parse a mp4 and able to do parse moov
but not sure how to use moov
information to parse mdat
.
My goal is to get the track info like metadata and if possible frames from mdat
as it contains the video and audio data.
currently following QuickTime File Format Specification
Tried with Sample-to-Chunk Atoms
but all my stsc (20 bytes) looks like this:
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0]
[0 0 0 1]
[0 0 0 1 0 0 0 1]
[0 0 0 1]
fmt.Println(binary.BigEndian.Uint32(buf[0:4])) //4
fmt.Println(binary.BigEndian.Uint32(buf[4:8])) //4
fmt.Println(binary.BigEndian.Uint32(buf[8:16])) //8
fmt.Println(binary.BigEndian.Uint32(buf[16:20])) //4
Don't know currently how to approach and parse mdat
atoms.
Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
mp4 规范是 ISO/IEC 14496-12,它比 qt 规范更明确。
如果您想了解示例表如何引用各个框架,您可以在此处查看我的项目 https://github.com /essential61/mp4analysisr
the mp4 specification is ISO/IEC 14496-12 which is more definitive than the qt one.
If you want to understand how the sample tables reference individual frames you could look at my project here https://github.com/essential61/mp4analyser