Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Multiplying by the frame rate is not frame accurate because many of the file containers and codecs that Quicktime uses make use of <a href="http://en.wikipedia.org/wiki/Variable_frame_rate" rel="nofollow noreferrer">variable frame rates</a> to get better compression. You'll notice this in any kind of movie that has freezes frame for any length of time. See macbreak's <a href="http://media.libsyn.com/media/macbreak/macbreak20060216-001a-mp4.mov" rel="nofollow noreferrer">The Road to 1080p, part1</a> as an example.</p> <p>You can do frame accurate ranges with the QTMovie methods <a href="http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTKitFramework/Classes/QTMovie_Class/Reference/Reference.html#//apple_ref/doc/uid/20002391-DontLinkElementID_18" rel="nofollow noreferrer">frameStartTime:atTime</a> and <a href="http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTKitFramework/Classes/QTMovie_Class/Reference/Reference.html#//apple_ref/doc/uid/20002391-DontLinkElementID_19" rel="nofollow noreferrer">frameEndTime:atTime</a> introduced in OSX 10.6. These will give you the start and end of a frame respectively without doing frame decoding. </p> <p>For example to count all the frames in a movie:</p> <pre><code>// Initialize QTMovie object called 'movie', disable looping, etc [movie gotoEnd]; QTTime endTime = [movie currentTime]; [movie gotoBeginning]; QTTime curTime = [movie currentTime]; unsigned long numFrames = 0; while (true) { % get the end time of the current frame [movie frameEndTime:&amp;curTime]; numFrames++; % If we get to the last frame, stop counting if (QTTimeCompare(curTime, endTime) == NSOrderedSame) { break; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload