Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Iterate through frames of a QTMovie
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Iterate through frames of a QTMovie



On Feb 22, 2008, at 5:12 PM, Seth Willits wrote:


What is the best way to iterate through all the frames of a QTMovie object?

"Best"? Don't know. But you can definitely do it this way:


QTTime endOfMovie = [movie duration];

[movie gotoBeginning];
do {
... grab frame ...
[movie stepForward];
} while (QTTimeCompare([movie currentTime], endOfMovie) == NSOrderedAscending);


... grab last frame ...



I've been fiddling, and this method is actually reeeeally slow if you're using frameImageAtTime:withAttributes:error:. Even by specifying the image type as a pixel buffer or a GL texture, it's still really slow.

What I did find is that if you create and use a QTVisualContext for the movie, you can do the stepping above, but use the ImageAvailable callback to call QTVisualContextCopyImageForTime, and get a copy of the frame. I haven't actually *used* this used this yet, but it seems to work fine and it's much much faster.


-- Seth Willits




_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-API mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Iterate through frames of a QTMovie (From: Marcel Borsten <email@hidden>)
 >Re: Iterate through frames of a QTMovie (From: Seth Willits <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.