gpt4 book ai didi

objective-c - 确定视频文件是 NDF 还是 DF(丢帧或非丢帧)

转载 作者:行者123 更新时间:2023-12-03 17:56:46 26 4
gpt4 key购买 nike

我需要确定电影是丢帧还是非丢帧。

我试图在 xcode 视频框架之一(QTMovie 或 AVFoundation 中的其他框架)中的视频文件的属性中找到它。运气不太好。

我这样做是为了在 FCP-X XML 文件中填写必要的信息。

有人有这方面的经验吗?

重要提示,我正在 64 位环境中工作,并且必须保持该环境。

最佳答案

您可以使用CMTimeCodeFormatDescriptionGetTimeCodeFlags()获取给定时间码格式描述引用的时间码标志。您可以通过询问 AVAssetTrack 来获取格式描述引用。其formatDescriptions

我认为它看起来像这样:

BOOL isDropFrame (AVAssetTrack* track)
{
BOOL result = NO;
NSArray* descriptions = [track formatDescriptions];
NSEnumerator* descriptionEnum = [descriptions objectEnumerator];
CMFormatDescriptionRef nextDescription;
while ((!result) && ((nextDescription = (CMFormatDescriptionRef)[descriptionEnum nextObject]) != nil))
{
if (CMFormatDescriptionGetMediaType(nextDescription) == kCMMediaType_TimeCode)
{
uint32_t timeCodeFlags = CMTimeCodeFormatDescriptionGetTimeCodeFlags ((CMTimeCodeFormatDescriptionRef)nextDescription);
result = ((timeCodeFlags & kCMTimeCodeFlag_DropFrame) != 0);
}
}
return result;
}

关于objective-c - 确定视频文件是 NDF 还是 DF(丢帧或非丢帧),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12135167/

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