openframeworks/openFrameworks — Issue #769: ofVideoGrabber, setDesiredFrameRate ignored
Author: timscaffidi
Created: 2011-10-10 05:17:54+00:00
State: open

I noticed that in linux (not sure about other platforms) calling setDesiredFrameRate(); before calling initGrabber() has no effect, even when the desired framerate is available by the camera driver, and shows up in the log from ofVideoPlayer.

I've tracked down the source of the problem, and it appears to be that initially the internal grabber object is NULL, and is only created when initGrabber is called, thus any prior attempts to set the framerate will not work.

By moving the lines:

if( grabber == NULL ){
setGrabber( ofPtr(new OF_VID_GRABBER_TYPE) );
}

from initGrabber() to the ofVideoGrabber constructor, the issue is solved. I'm not sure if this would have any undesirable effects, however.