Slow frame rate with ofVideoGrabber and unicap


Using Linux Ubuntu 8.04 on a Thinkpad t61 with a built-in camera, OF 5, unicap… I am working on a project that uses ofVideoGrabber and tries to grab a frame every testApp::update(). I was getting a MUCH slower frame rate than my colleagues (my framerate was somewhere around 7 fps) on different platforms running the same code.

Zach helped me debug it at eyebeam/interactivos? and we discovered that it was related to unicap and the darkness of the room. Unicap was blocking the whole thing as it exposed the frame. When we shined a light at the camera, the framerate doubled and more. We ran ucview and were able to change some of the settings so that it didn’t block or wait to get the exposure. The resulting picture was dark, but so was the room, and the framerate stayed workably high.

Also Zach suggested using pre-recorded video footage instead of a live camera feed while coding so as to keep different points of failure compartmentalized or whatever (I was sure the framerate issue had to do w/ my graphics card drivers). Good advice.


Hi brian

It has to do with how the video grabbing module is programmed, I think the v4l one has the same issue. When you call grabFrame it blocks till a new frame is available, so your max framerate depend on the device one.

Some days ago I posted a change here:

that should solve this issue, if you can try it and tell if it works for you?

It also uses dma and at least a camera is reported to not work with that mod. If it’s problematic I’ll make a threaded version of the unicap module that solve this issue without using dma.