QuickTime 的“dref”结构原子“alis”元素
我需要重写 QuickTime 参考影片,使其指向另一组文件。 我在 Windows 环境中工作,因此无法访问 QuickTime API,并且由于引用的文件无法访问,我也无法使用 COM 接口加载电影,因为它无法解析引用的路径。
“QuickTime 文件格式规范”中的文档指出,“dref”原子可以具有“alis”、“url”和“rsrc”数据引用的列表。在这种情况下,我需要解析“alis”元素。根据参考资料,“数据引用是 Macintosh 别名”。
这么久以来,我一直没能看到该结构体的声明或任何相关信息。您知道别名记录的结构吗?在哪里可以找到有关其结构的详细信息?
非常感谢您的帮助!
I need to rewrite a QuickTime reference movie, making it point to another set of files.
I'm working in Windows environment, so I don't have acces to the QuickTime API, and being the referenced files unaccesible, I can't also use the COM interface to load the movie because it can't resolve the referenced paths.
The documentation in the "QuickTime File Format Specification" says that the 'dref' atom can have a list of 'alis', 'url ' and 'rsrc' data references. In this case I need to parse the 'alis' elements. According to the reference, "Data reference is a Macintosh alias".
So long, I have not been able to see a declaration of the structure or any related information. Do you know the structure of an alias record? Where can I find detailed information about it's structure?
Thank you a lot for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该格式与您可以通过右键单击某个项目并为其创建别名在 Finder 中生成的别名非常相似。
旁白:当最初指定 QuickTime 格式时,Apple 明智地选择合并许多其他标准和范例,这些标准和范例已经在操作系统的其他地方广泛使用。这就是 QT 能够(或曾经)能够做参考电影等非常聪明的事情的原因之一。不幸的是,现在还有很多不再相关的操作系统功能遗留下来的东西(即AppleShare)。回到鼎盛时期,QuickTime 非常出色,尤其是与竞争对手相比;如今,由于 Windows 移植存在缺陷以及当时桌面系统的处理能力相对较低,它的价值被大大低估了。
回到主题,不幸的是,别名文件的格式不是开放/发布的标准,并且网上关于该主题的文档很少。有一个真正的旧文档,它解构了 Mac OS Classic 中使用的别名格式。尽管 OS X 中使用的结构非常相似,但别名文件本身往往要大得多,因为它们在文件末尾包含许多额外的数据字符串,这些字符串未在上面链接的文档中记录。
另外,在 finder 中创建的别名do看起来与 dref 原子中包含的别名有点不同,尽管我从未逐位运行它们来推断出实际的差异。如果您想查看这些文件的内容,并且安装了 OS X 开发人员工具,您可以运行
Finder 生成的别名来去除文件的别名,以便您可以以十六进制形式查看其内容编辑器(否则,操作系统只会将您重定向到链接文件 - 哦!)。您可以重新设置文件的别名属性,或者通过运行任意指定任何文件作为别名
不幸的是,在我的实验中,转储了 QT 电影的
dref
原子的alis
部分似乎从未生成 Mac OS 能够解释的别名。幸运的是(或者不是,就像我的情况一样),Mac OS 据称用来创建/处理别名的函数是名为 别名管理器,它是非常低级别的 CoreServices 框架的一部分。如果您有时间进一步深入研究,您可以编写一些代码来试验 Mac OS 的内置别名生成和解释功能。
不幸的是,如果您正在处理旧的/有缺陷的文件,您无法知道该文件是否实际上是由 CoreServices 的别名管理器生成的,或者该框架从那时起是否已更改/演变/回归。由于它是一种封闭格式,因此选择不使用别名管理器的第三方开发人员只能猜测该格式的“合法”结构。
The format is very similar to the sort of alias that you could generate in the Finder by right-clicking an item, and creating an alias to it.
Aside: When the QuickTime format was originally specified, Apple intelligently chose to incorporate a number of other standards and paradigms that were extensively already being used elsewhere in the OS. This is one of the reasons why QT is (or was) able to do really clever things like reference movies. Unfortunately, there's also now a lot of cruft leftover from OS features that are no longer relevant (ie. AppleShare). Back in its heyday, QuickTime was slick, especially compared to its competitors; today, it's vastly underappreciated due to the buggy Windows port, and the relatively low processing power of the desktop systems of its time.
Back ontopic, unfortunately, the format for alias files is not an open/published standard, and there is precious little documentation on the topic on the 'net. There's one really old doc that deconstructs the alias format used in Mac OS Classic. Although the structure used in OS X is very similar, the alias files themselves tend to be much larger, as they contain numerous extra data strings at the end of the file that are not documented in the above-linked documentation.
Also, aliases created in the finder do look a bit different from the ones contained within the dref atom, although I've never run through them bit-by-bit to deduce the actual differences. If you want to take a peek at what those files, and have the OS X Developer Tools installed, you can run
on a Finder-generated alias to strip the file of its alias-ness so that you can look at its contents in a hex editor (otherwise, the OS will just redirect you to the linked file - doh!). You can re-set the file's alias attribute, or arbitrarily designate any file as an alias by running
Unfortunately, during my experiments, dumping the
alis
portion of a QT movie'sdref
atom has never seemed to generate an alias that Mac OS was able to interpret.Fortunately (or not, as it was in my case), the functions that Mac OS allegedly uses to create/handle aliases are part of a public API called the Alias Manager, which is part of the very-low-level CoreServices framework. If you've got time to delve into this further, you can write some code to experiment with Mac OS's built-in alias-generating and interpreting capabilities.
Unfortunately, if you're dealing with an old/buggy file, you have no way of knowing if the file was actually generated by CoreServices' Alias Manager, or if that framework has changed/evolved/regressed since then. Because it's a closed format, 3rd-party developers who opt to not use the Alias Manager can only take guesses as to the format's "legal" structure.
您可以使用这个Java程序来查看标头中的内容,并且提取数据(它有点旧,但可能仍然有效)。不过,更有用的是作者对 Quicktime 标头的深入讨论。
但我认为你可能只是在寻找苹果文档, 当前在这里找到。
You can use this Java program to see what is in the header, and extract data (it's a bit old, but may still work). What is more useful, though, is the thorough discussion by the author about the Quicktime header.
But I think you may just be looking for the Apple documentation, currently found here.