用于访问类似于 Quicktime 原子或 MPEG 盒的数据结构的 OSX API
Quicktime、MPEG 或 AIFF 文件似乎都将其数据元素组织成这样的块:
0x00 chunk 1 header (size as UInt32 + ID as 4-char-code)
0x08 chunk 1 data
...
0xA0 chunk 2 header
0xA8 chunk 2 data
...
and so on.
当读取这样的文件时,很容易跳到感兴趣的块,因为每个块都声明它自己的大小。当然,块也可以嵌套。
在 Quicktime 世界中,这些块被称为“原子”,在 MPEG 中,它们被称为“盒子”。
我的问题: Mac OSX 中是否有某种通用 API 来导航和访问这些块?我知道它很容易实现,但我宁愿使用正确的东西,也不愿自己将其组合在一起。
另外,我很好奇这种数据结构是否有一个除了“原子”或“盒子”之外的通用名称。对我来说,它看起来如此简单和有用,它一定存在于除了 Quicktime 或 MPEG 之外的许多其他领域。
谢谢, 塞巴斯蒂安
Quicktime-, MPEG- or AIFF-files all seem to organize their data elements in chunks like this:
0x00 chunk 1 header (size as UInt32 + ID as 4-char-code)
0x08 chunk 1 data
...
0xA0 chunk 2 header
0xA8 chunk 2 data
...
and so on.
When reading a file like that, it's easy to skip to the chunk of interest, because each chunk declares it's own size. Of course, chunks can also be nested.
In the Quicktime world these chunks are called 'Atoms', in MPEG they're called 'Boxes'.
My question:
Is there some kind of common API in Mac OSX to navigate and access these chunks? I know it's fairly easy to implement, but I'd rather use something proper than hacking it together myself.
Also, I'm curious if this kind of data structure has a common name other that 'Atoms' or 'Boxes'. To me it seems so simple and useful, it must exist in many other fields besides Quicktime or MPEG.
Thanks,
Sebastian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,Apple 提供的唯一 MPEG 解码服务是通过 QuickTime 提供的,因此 Atoms API 是常见的服务。
The only Apple-provided MPEG decoding services that I'm aware of are provided through QuickTime, so the Atoms API would be the common one.