WebCamtexture low frame rate bug

Hi

Having a huge problem using the WebCamtexture Class trying to get decent video playback.

The problem is the I use just the default constructor

myWebcamtexture = new WebCamtexture();

performance is great!

However, I at the the very least need to supply the first argument, defining the webcam I want to use
ie

myWebcamtexture = new WebCamtexture(devices[0]);

When I do this, I get the desired webcam but the performance is NOT acceptable, as video frame rate drops to about 5 fps and there is huge latency.

Anyone have a solution?

Ok further research the issue is with the Logitech Webcam I am using. It defaults to 5fps. arghh!

Anyone else have same issue? How did you solve?

Hi there, I’m fighting exactly the same issue. Did you find a solution?

I was having huge issues with webcam texture, reverted my project to 2017.1.5 and it worked perfectly…

I’m also having this issue in 2019.2.2f1. Has anyone found a solution?

Same issue here : (
Any soulution yet?

Same issue(( (Four days i try to rewrite my code) I have Logitech C920 at desktop and USB 2.0 UVC HD at notebook. At notebook default constructor works great, at desktop - very slow.

You probably fixed it already, but if not try use:

myWebcamtexture.requestedFPS = 60;
7 Likes

Try setting a low resolution:

myWebcamTexture = new WebCamTexture(devices[0], 320, 240, 30);

Don’t know why, but some of my students with Macs get frame rates of 1 fps (yes, one), by taking the default settings when using the nullary constructor.

1 Like

Also seen this issue - can Unity not set the webcams to use a reasonable frame rate by default (i.e. 24-30 fps)?
Because it just looks like a bug when some devices show terrible stuttering cam views by default.
You can not even read the default fps can you?

I am unaware of any Unity support for doing this. You might try a native call, but that would be Platform Specific, which we don’t like, of course.

Using a constructor with explicit parameters avoids the problem on Macs, at least to the extent that it is caused by some Macs trying to use insanely high resolutions when you use the nullary constructor. Providing a LOT of light to the scene viewed by the camera helps too.

I had a similar issue, but only when using the webcam inside of unity. Once I built the project, it would interface fine with the webcam. So, it’s not so helpful if you’re helpful if you’re having this issue on a fully built project. Once I turned on Vsync for the Game tab in the display, the webcam responded as expected (Logitech C922 I believe, it’s been a while). I hope that helps out somebody in this thread. This is in Unity 2020.3.26f1.

1 Like

I had the same issue with the Logitech C920.
@1280x 720 resolution the frame rate was very low, @ 1920 x 1080 it was awful.
Finally I had to revert to my old-good Logitech B525, that is perfect (no jerky at all, @ every resolution).
So I think it’s an issue of this specific webcam

I Have the same probem with the Brio 4k at requested 1920x1080 30fps I only get 1 fps

Based on my tests, indicating “0” value for requested FPS in constructor
leads to the FPS Value by Default for target camera.

So, for example, it’s 24 FPS for Samsung Galaxy A71.

I also noticed that performance notably drops when you build with Development Mode (On).

1 Like