确定视频文件是NDF还是DF(丢帧或非丢帧) [英] Determine if a video file is NDF or DF (Drop Frame or Non-Drop Frame)

查看:231
本文介绍了确定视频文件是NDF还是DF(丢帧或非丢帧)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确定电影是Drop Frame还是Non-Drop Frame.

I need to find whether a movie is Drop Frame or Non-Drop Frame.

我试图在一个xcode视频框架(QTMovie或AVFoundation的东西)的视频文件的属性中找到它.运气不好.

I'm trying to find it in the attributes for a video file in one of the xcode video frameworks (either QTMovie or something from AVFoundation). Not having much luck.

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

I'm doing this to fill in necessary information in an FCP-X XML file.

有人对此有任何经验吗?

Does anyone have any experience with this?

重要说明,我在64位环境中工作,必须留在那里.

Important note, I am working in a 64 bit environment, and must stay there.

推荐答案

您可以使用我认为它看起来像这样:

I think it would look something like this:

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;
}

这篇关于确定视频文件是NDF还是DF(丢帧或非丢帧)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆