SMPTE从快速时间的时间码 [英] SMPTE TimeCode from Quick Time
本文介绍了SMPTE从快速时间的时间码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获得QT电影的时间码开始和持续时间?我发现我必须使用QTKIt或者QTStringFromSMPTETime,但是我在网上找不到任何例子。
How do I get the timecode start and the duration of a QT movie? I've figured out that I have to use QTKIt and maybe QTStringFromSMPTETime but I couldn't find any example on the web.
推荐答案
下面是使用QTKit和QuickTime API的示例:
Here is an example using QTKit and the QuickTime API:
QTTrack * tcTrack = [[self.movie tracksOfMediaType:QTMediaTypeTimeCode] objectAtIndex:0];
if (tcTrack != nil) {
QTMedia * media = [tcTrack media];
if (media != nil) {
NSLog(@"sample : %@", [media attributeForKey:QTMediaSampleCountAttribute]);
Media qtMedia = [media quickTimeMedia];
MediaHandler mh = GetMediaHandler(qtMedia);
long frameNum;
TimeCodeDef tcDef;
TimeCodeRecord tcData;
UserData srcRefH;
TCGetTimeCodeAtTime(mh, 0, &frameNum, &tcDef, &tcData, &srcRefH);
// frameNum holds the frame number since 00:00:00:00
// tcData holds the HH:MM:SS:FF data
}
}
这篇关于SMPTE从快速时间的时间码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文