How to fix webcam lag and the lag reasons

slow webcam

As a developer of one of the webcam programs, we get questions like why a webcam is slow or why the webcam lags. So first, we will describe the common causes and methods of eliminating the "slowness", and then we will give some advice related to our AlterCam program.

What causes the webcam to slow down?

The camera can slow down either because of the low number of frames per second on the camera itself or because of the high system load when the program does not have enough resources to take all available frames from the camera. Here are some common causes of webcam lags and how to get rid of them.

Low FPS camera mode selected

Programs can connect to webcams in various modes and resolutions. For example, the Logitech C922 Pro Stream camera has several dozen different connection modes with frames per second (FPS) from 2 to 60. If you connect to the camera in 2 FPS mode, the camera will refresh the picture only twice a second, and it will feel like the camera lag. However, it does not slow down at all. It is a selected frame rate mode!

How to fix it? Select a connection mode with a higher number of frames per second (FPS). The program that connects to the webcam must have such a setting.

Resolution and frame rate list for a webcam

 

Insufficient lighting

Remember, if marketers write 30 FPS or 60 FPS in the tech specs of a webcam, these values are achieved only in perfect lighting conditions! The number of frames per second depends directly on the shutter speed (the time it takes the camera to read one frame from the matrix). By default, the shutter speed changes automatically depending on the lighting. The more light there is, the faster the camera sensor can get a picture of acceptable brightness.

Most Chinese cameras, which declare 30 FPS, give up to 20 frames per second in standard lighting. If you try to shoot in a dark room, the FPS will drop below ten because the sensor needs to increase the time the shutter is open to collect more data on the sensor for a good picture in terms of brightness.

What to do? There are two ways to solve the problem. The first is to deal with lighting. Do not shoot in dark rooms, put an extra lamp, and so on. The second way is to turn off the automatic exposure of the webcam in the settings. In this case, you can manually reduce the shutter speed, which will raise the number of frames per second, but reduce the picture's brightness. Perhaps this option will suit you. You need to open the webcam settings window, go to the "Camera Control" tab, uncheck the box next to the "Exposure" parameter and move the exposure slider to the left. It may also be necessary to disable the "Low Light Compensation" option.

turning off the auto exposure for a webcam

 

System overloaded

This reason for camera lag seems the most likely for most users, but it is one of the rarest. It's easy to check - start the Windows Task Manager and see the CPU load. If it is close to 100%, then this can affect the performance of the webcam. In this case, you need to close unnecessary programs, especially those that load the CPU more.

If the camera lags in AlterCam

First, you need to check the connection mode in the webcam settings, especially FPS (frames per second). To open the webcam settings in AlterCam, click on the button with the gear picture to the right of the long video source selection button. Ensure the mode selected is FPS 20 or higher:

Webcam resolution and FPS in AlterCam

 

Secondly, make sure the area to be captured is well lit.

Third, close unnecessary programs that may load the processor.

Suppose you want to turn off automatic exposure and reduce it manually, as described above. In that case, you need to open the camera settings in AlterCam (click on the small gear) and in that settings window, click the "Properties" button.

We hope the tips will help you get rid of the lags.