Webcam in high resolution lags

Hi all, I am using ofVideoGrabber to get access to a webcam. I set the grabber in 1080p resolution, but the fps drops to around 10 when drawing it on canvas.

I wanna ask if there is any method to play webcam video in 1080p at 30fps.
Should I use another addon for webcam or use other format or codec or etc. stuff to play it smoothly? and how?

The webcam I am using is Logitech HD 920.

Anyone has idea? Thanks in advance!

what platform are you using? is the fps that of the application of the camera?

I do the test in win10.
Sorry for the wrong number above. The fps is around 5. It is the fps of the camera.
I used grimus’ method to get the fps of the camera.

Try running the application in release instead of debug in case it’s a performance problem. Also cameras might lower the fps to get a brighter image if there’s not much light, try also adding more light to see if that makes any differece

I was running it in release : ( I also tried put more lights around the camera. It still lags.

I used to try doing this in unity and the result was the same. Then I found an asset which could make the logitech webcam turn to use mjpg format instead of YUY2. And the performance is better, around 30 fps. I am thinking if I can use mjpg format in OF to solve this problem.

Do you have any idea of doing that in OF?

Not in windows unfortunately, I think only in linux you can choose the format at the moment

That’s sad. :frowning:
Thanks for your big help! I may try lower the resolution to improve the performance.

Hi @arturo, I still need 1080p webcam to run at high fps. I wonder if it is possible to do it in windows by using some other libraries instead of videoGrabber. Do you have any advice? Thanks in advance!

you could try ofxGStreamer but i’m not sure that the video grabber works well in windows. other than that the only solution i can think of is modifying the ofDirectShowGrabber class to add support for compressed formats.

Thanks so much for your quick response! I will have a try on these two. Thanks again!

Hi @MataKurara did you find any solution??
I’m having the exactly same problem …

1 Like