gpt4 book ai didi

iphone - 在 iOS 中检索 AVMetadataItem 上的 AVAsset 键名

转载 作者:可可西里 更新时间:2023-11-01 03:08:42 24 4
gpt4 key购买 nike

我正在尝试识别 iPad 上视频的不同元数据项。到目前为止,我已经能够成功地使用 AVAsset 库找到文件,并使用 metadataForFormat: 生成一个 AVMetadataItems 数组。在文件中仅找到 iTunes 和 Quicktime 用户数据格式。现在的问题是我有了这些信息,但我无法确定什么是什么。我打算用元数据键索引的信息加载字典,但是使用 AVMetadataItem 的 key 属性似乎无法正常工作,就好像返回一个数字(调试器说它是一个 NSCFNumber)。这是我正在做的一些示例代码:

ALAssetRepresentation *representation = [[valAsset defaultRepresentation] retain];
NSURL *url = [representation url];
AVURLAsset *aAsset = [[AVURLAsset URLAssetWithURL:url options:nil] retain];
metaDataDict = [[NSMutableDictionary dictionary] retain];
NSArray *fmtmetadata = [aAsset metadataForFormat:@"com.apple.itunes"];
for (AVMetadataItem* meta in fmtmetadata)
{
[metaDataDict setObject:[meta stringValue]
forKey:[meta key]];
NSLog(@"metadata: key = %@", [meta key]);
}

这会在调试器控制台中产生以下输出:

metadata: key = -1452383891
metadata: key = -1452841618
metadata: key = 1684370275
metadata: key = 1818518899
metadata: key = 1937009003
metadata: key = -1453101708

顺便说一下,将 NSLog 行更改为:

NSLog(@"metadata: %@", meta);

给我们这样的输出:

metadata: keySpace=itsk, key=desc, commonKey=(null), locale=(null), value=This is the Description of the Video, time={INVALID}, duration={INVALID}, extras={
dataType = 1;
}

非常感谢任何帮助!

最佳答案

看起来这些键是经过编码的 ID3 标签:

1684370275 = 0x64657363 = {'d', 'e', 's', 'c'}

1818518899 = 0x6C646573 = {'l', 'd', 'e', 's'}

1937009003 = 0x7374696B = {'s', 't', 'i', 'k'}

等等

关于iphone - 在 iOS 中检索 AVMetadataItem 上的 AVAsset 键名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5063581/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com