videoGrabber resolution problem

I encountered an issue when grabbing video at 640x480 on a MacBook Pro with various cameras. 320x240 works fine but when I double the resolution I get a video feed of 320x240 stuffed into the top left corner. When I call the videoGrabber.settings() _do not_ change anything, simply press ok the capturing is fine again.

I can reproduce this with movieGrabberExample.



hmmm - could be a bug in the settings loader (specific to mac / osx / quicktime video capture) or something else. did you have this issue with 0.02?

today I get a mac mini :slight_smile: so will be able to test better mac issues. theo is looking into it too so we should be able to report back on this issue (as well as cameron’s issue) with mac / qt / ofvg.

take care!

hey thanks for that - I think I know what this is.
should have a fix soon.

Does this fix it for you?

Swap out the loadSettings function in ofVideoGrabber with:

bool ofVideoGrabber::loadSettings(){  
	if (bGrabberInited != true) return false;  
	ComponentResult	err;  
	UserData mySGVideoSettings = NULL;  
	// get the settings using the key "ofVideoSettings-the name of the device"  
	string pref = "ofVideoSettings-"+deviceName;  
	CFStringRef cameraString = CFStringCreateWithCString(kCFAllocatorDefault,pref.c_str(),kCFStringEncodingMacRoman);  
	GetSettingsPreference(cameraString, &mySGVideoSettings);  
	if (mySGVideoSettings) {  
		Rect	curBounds, curVideoRect;  
		ComponentResult	err;  
		//we need to make sure the dimensions don't get effected  
		//by our preferences  
		// Get our current state  
		err = SGGetChannelBounds (gVideoChannel, &curBounds);  
		if (err != noErr){  
			printf("Error in SGGetChannelBounds \n");  
		err = SGGetVideoRect (gVideoChannel, &curVideoRect);  
		if (err != noErr){  
			printf("Error in SGGetVideoRect \n");  
		// use the saved settings preference to configure the SGChannel  
		err = SGSetChannelSettings(gSeqGrabber, gVideoChannel, mySGVideoSettings, 0);  
		if ( err != noErr ) {  
			printf("Error applying stored settings %i \n", err);  
			return false;  
		// Pause  
		err = SGPause (gSeqGrabber, true);  
		if (err != noErr){  
			printf("Error in SGPause\n");  
		SGSetChannelBounds(gVideoChannel, &videoRect);  
		SGPause (gSeqGrabber, false);  
		printf("No camera settings to load \n");  
		return false;  
	return true;  

Looks like auto generated settings file was overriding the requested size.

yes, thanks theo,
this seems to do the trick.

cheers stefan!

I’ll add it in and re upload the 0.03 release with the other small changes.