Getting stable >=30fps out of webcam?


I have 2 questions:

  1. How do you lower the input resolution of the webcam with OfVideoGrabber? I have Logitech c920 running at 1080p and the fps are low (although there are supposed to be 30fps), I guess if I drop to 720p the fps will improve. I tried creating OfVideoGrabber with different resolutions, but I think it does not really change the input res of the camera, but please correct me if I am wrong.

  2. Which camera (USB/Firewire) will deliver stable 30fps at no lower then 720p resolution? Main consideration is size (the smaller the better), price - up to $1000.

Thank you!

I dont think you could get the c920 to give you 30fps at 1080p on any setup, the USB data bandwidth is your bottleneck there. Are there usb3 webcams yet? That would give you enough throughput to give you 30fps at 1080p. I think even at 720p, most usb2 webcams will top out around 15-20. I think you might be able to do 720p or close to it with a firewire HD cam. 720p is still difficult to come by over usb, but with 1000 you should be able to find something good.

If you use a canon t3i and kyle’s ofxEDSDK addon, you can bring in a canon dslr as a live camera input at a strange resolution (limited by USB bandwidth…) but it is like 1044x760 and looks really awesome.

I also had issues with the c910 (slightly older) changing resolution in OF, but eventually got it to stick…I think that issue was more in ofQTKITRecord.

yeah I realized the USB bottleneck issue and went the GoPro Hero2->Blackmagic route. Unfortunately Hero2 does not work with Blackmagic Intensity (there is a thread on that in “Advanced”).
Do you have any suggestions for firewire HD camera? Small size…

On a PC, the C920 will output at 1080p 30fps because it compresses the image using h264.

This works on a PC because of the driver support but on a mac it defaults to standard UVC drivers which dont support the decompression.

I figured logitech would try and work some driver magic on the pc. I only ever managed to get a kind of motion blur/slitscan 1080p/720p out of the C910 on a PC. Noticed that the C920 dropped mac support (or it had back in march or so) so it has kind of wonky support on the mac now.

I hear the new USB 3.0 Point Grey cameras get rid of the bandwith problem. The specs of the Flea3 8.8 MP Color USB 3.0 say 2080x1552 at 60 FPS, up to 4096x2160 at 21 FPS, in color.

–edit for price–>
it think they are about about $950 each.

How can I get a still picture from a C910/920 without videograbber?
I’m getting a still pic from a C910 using videograbber. When I push a button I copy the vector of the video to an image, but I would like something more quick and efficient as I’m thinking to get pics from 8 cameras at the same time.

img.setFromPixels(vidGrabber.getPixels(), 1280, 720, OF_IMAGE_COLOR, true) ;  


I just bought a c922 camera which is heavily advertised that can do 30fps at 1080p or even 60fps at 720p. But I can only get around 5fps when I use the videoGrabberExample.
I’ve read somewhere that the camera does a hardware encoding of the video with h264, which allows high framerates over usb2.
Has anyone managed to get that framerate in openframeworks? Or is there a fundamental limitation with how OF deals with the data that gets from the camera?

I am on windows by the way.

I’ve also tried a small windows app that allows you to preview the webcam, but this also gives me similar framerates. Am I missing a driver or something, other than what windows installed automatically and the software I downloaded from logitech’s support page?

You could try gstreamer to capture instead of using the built in videograbber. I’m pretty sure that it can do H264 decoding.

Does it work with the camera app on windows?

Oh that’s interesting. So do you mean that a different library may be able to acquire the compressed stream, where the OF videoGrabber just gets raw frames?

Which windows app do you mean?
I tried a random basic app I found online without any luck.

I also tried touchDesigner which is usually very good with getting inputs from various devices in the best possible way. It has a selection of drivers (see 1st image), but only the top two work, with similar results and low framerate. When I chose DirectShow, I can also bring up the camera’s default settings windows. One for the exposure/color properties, the second for the Device Output Properties (see 2nd image). Interestingly, the compression options are disabled, which makes me think that I may be missing a driver.

Do you think it may be related to graphics card?

@SBA The go pro will work with the black magic card. The blackmagic requires you set the exact incoming refresh rate and frame size, but go pro cameras do not really tell you what they are outputting (it is not the same format as they are recording).

There are some threads on the blackmagic forum that explain how to get it going

Apparently setting the go pro to 120fps will make it output a 30p signal

Hey, I played around with the c920 and it’s not easy to get high FPS from the camera. You should be able to get at least 30fps at 1920p.
If I remember correctly, it’s a combination of:

Good luck :slight_smile:

I still haven’t had time to try gstreamer or other libraries, but almost by accident I came across a differect solution, even if it’s not perfect.
My camera came with XSplit broadcaster (I believe the free version can do that as well) which allows you to combine various inputs (cameras/screengrabs/streaming) and output them as a virtual camera. Somehow this program pulls the full 30fps HD video from the c920, so all I have to do it to have this program running in the background and set the ofVideoGrabber id to point to its virtual camera.