ofVideoGrabber and Non Native resolution - performance

Hi,

Im using ofVideoGrabber to grab a stream from a standard webcam and then scaling this up when drawing the texture from the camera to the screen using draw (x,y w,h)l. Im experiencing a big difference in rendering performance if I dont use the native resolution of the camera.

The camera’s native res is 320x240;

ie.

  
  
int w = 720;  
int h = 576;  
vidGrabber.initGrabber(cWidth,cHeight);  
  
// later in draw()  
  
  
videoGrabber.draw(0,0,ofGetScreenWidth(), ofGetScreenHeight());  
  

this results in poor FPS.
However

  
  
int w = 320;  
int h = 240;  
vidGrabber.initGrabber(cWidth,cHeight);  
  
// later in draw()  
  
videoGrabber.draw(0,0,ofGetScreenWidth(), ofGetScreenHeight());  
  
  

This results in a significant gain in performance. ie ~25 FPS faster.

The console output on the first test shows that a range of resolutions and color depths have been tried before it is successful.

Im trying to understand why there is a difference in performance and if i can build something into my app to make sure that the optimum/ native resolution is used.

Any help is much appreciated.

The cam is a Creative Webcam Live, im running winxp

cheers

when you don’t pass the right resolution, oF does an auto resize so your app works no matter if the resolution is not supported. this resizing though, is done in the cpu / computer memory, while the one that happens on draw(x,y,w,h) is done in the gpu/graphics card memory so the first is way slower.

thanks arturo,

is there any way to find out the native via OF, so that this can be coded into the app and the performance maintained?