Webcam in high resolution lags

#1

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!

#2

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

#3

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.

#4

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

#5

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?

#6

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

#7

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

#8

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!

ofVideoGrabber issue
#9

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.

#10

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