开发者

SMPTE TimeCode from Quick Time

开发者 https://www.devze.com 2023-04-03 06:59 出处:网络
How do I get th开发者_运维百科e 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.He

How do I get th开发者_运维百科e 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.


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号