Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > QuickTime > Movie Creation >

Sequence Grabber - How often should I call SGIdle?


Q: How often should I call SGIdle in my application? The Traditional Mac OS Sequence Grabber documentation says you should call SGIdle "as often as possible". Is this still recommended?

A: "As often as possible" is not really a good idea on Mac OS X. You should call SGIdle as often as needed to not drop any frames.

Generally, you should call SGIdle frequently enough for the type of content you are trying to capture. There's no single answer which will work optimally for every format. For example, if you are capturing DV at 29.97 fps, at a minimum you should be calling SGIdle at least as frequently as the frame rate. If you are capturing audio simultaneously, you should take this into account and increase the frequency as well.

With the above suggestions in mind, when capturing 29.97 fps DV A/V calling SGIdle 40 to 50 times a second is a good starting point. Depending on other tasks being performed by your application during capture, the exact frequency may vary. Using a timer (such as an NSTimer or a Carbon event loop timer) and calling SGIdle at regular intervals is the best approach to take.

IMPORTANT:
A single call to SGIdle does NOT equal one frame in the resulting QuickTime Movie. Setting your SGIdle frequency to 50 times per second will NOT give you a 50 fps Movie.

You should use the Video Settings Panel to select a desired framerate by calling SGSettingsDialog or set it programatically using the SGSetFrameRate API.

References:


[Apr 06, 2004]