Quicktime 元数据 API 和 iTunes

发布于 2024-12-05 16:17:07 字数 1131 浏览 0 评论 0原文

我正在尝试使用 Quicktime 元数据 API 在 .mov 文件中设置一些元数据,并将其显示在 iTunes 中。我已经让它适用于大多数属性,但我无法填充描述字段。这是我正在使用的代码(缩短为仅显示我认为相关的部分)。

const char* cString = ([@"HELLO WORLD" cStringUsingEncoding:NSMacOSRomanStringEncoding]);

QTMovie* qtMovie = [[QTMovie alloc] initWithFile:filename error:&error];
Movie movie = [qtMovie quickTimeMovie];

QTMetaDataRef metaDataRef = NULL;
OSStatus err = noErr;
err = QTCopyMovieMetaData(movie, &metaDataRef);

QTMetaDataItem outItem;
QTMetaDataAddItem(metaDataRef,
                  kQTMetaDataStorageFormatiTunes, 
                  kQTMetaDataKeyFormatCommon,
                  (const UInt8 *)&key,
                  sizeof(key),
                  (const UInt8 *)cString,
                  strlen(cString),
                  kQTMetaDataTypeUTF8,
                  &outItem);

我找到了以下链接,指出对于信息和描述属性,我应该使用 kQTMetaDataStorageFormatQuicktime,但这似乎没有任何区别。在将元数据导入 iTunes 视频时,是否有其他人成功地填充了描述列?

http://lists.apple.com/archives/quicktime-api /2006/May/msg00115.html

I'm trying to set some metadata in a .mov file with the quicktime metadata APIs and have it show up in iTunes. I've got it working for most of the properties, but I can't get the description field to populate. Here is the code I'm using (shortened to only show what I think is the relevant portion).

const char* cString = ([@"HELLO WORLD" cStringUsingEncoding:NSMacOSRomanStringEncoding]);

QTMovie* qtMovie = [[QTMovie alloc] initWithFile:filename error:&error];
Movie movie = [qtMovie quickTimeMovie];

QTMetaDataRef metaDataRef = NULL;
OSStatus err = noErr;
err = QTCopyMovieMetaData(movie, &metaDataRef);

QTMetaDataItem outItem;
QTMetaDataAddItem(metaDataRef,
                  kQTMetaDataStorageFormatiTunes, 
                  kQTMetaDataKeyFormatCommon,
                  (const UInt8 *)&key,
                  sizeof(key),
                  (const UInt8 *)cString,
                  strlen(cString),
                  kQTMetaDataTypeUTF8,
                  &outItem);

I found the following link, stating that for the information and description properties, I should be using kQTMetaDataStorageFormatQuicktime, but that doesn't seem to make any difference. Has anyone else had any success getting the description column to populate when importing metadata into iTunes videos?

http://lists.apple.com/archives/quicktime-api/2006/May/msg00115.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不醒的梦 2024-12-12 16:17:07

我最终使用 AtomicParsley http://atomicparsley.sourceforge.net/ 没有任何问题,这还有一个好处它支持 mp4 和 m4v 文件,而不仅仅是 mov 文件,这也是我需要的。这样,描述就显示得很好了。它也比 QTMetaData api 更容易使用。

编辑: 啊..刚刚发现这个应用程序不适用于 mov 文件。这适用于 mp4 和 m4v 文件,但我想原来的问题仍然存在,因为我也想支持 mov 文件。

I ended up using AtomicParsley http://atomicparsley.sourceforge.net/ without any issues which also has the benefit that it supports mp4 and m4v files and not just mov files which is also something I needed. With that the descriptions showed up fine. It was also much easier to use than the QTMetaData api.

Edit: Argh.. Just found out that this app doesn't work with mov files. This will work with mp4 and m4v files, but I guess the original question still stands because I would like to support mov files as well.

浅暮の光 2024-12-12 16:17:07

在这篇文章的帮助下,并对我的标记媒体内容进行深入调试后,终于弄清楚了。

检索 AVMetadataItem 中 AVAsset 的密钥名称iOS

我将数据格式设置为 kQTMetaDataStorageFormatiTunes,将密钥格式设置为 kQTMetaDataKeyFormatiTunesShortForm。然后我使用的标签是编码的 id3 标签,如上面的帖子中所示。如果您的目标是查看 iTunes 中的数据,则常用键(kQTMetaDataCommonKeyArtist、kQTMetaDataCommonKeyComment)通常不起作用。其中一些似乎仍然可以工作,但总的来说,它们没有正确映射到 id3 对应项。

Figured it out finally with the help of this post and some deep debugging into the contents of my tagged media.

Retrieving the key name on AVMetadataItem for an AVAsset in iOS

I set the data format to kQTMetaDataStorageFormatiTunes and the key format to kQTMetaDataKeyFormatiTunesShortForm. And then the tags I use are the encoded id3 tags like in the post above. The common keys (kQTMetaDataCommonKeyArtist, kQTMetaDataCommonKeyComment) will generally not work if your goal is to view the data in iTunes. It seems a couple of them still do work, but in general they don't map over properly to their id3 counterparts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文