I recently needed a webcam, bought a one and it was so bad I returned it thinking it had to be defective, then got another one which was "4K HD" that was also horrible, and after wasting a lot of time looking at unrelated and wrong things (trying each usb port, tracking down the manufacturer to see if there was a driver, etc) I finally realized this really was just how bad modern webcams are. But, not for everyone! Because several people posting reviews of this webcam their image was smooth and didn't look like blurry low-res claymation stop-motion. I had tried every resolution setting (yes I tried highest settings which were not 4k but were above 1080 as well as all the way down to 240 and it made no difference!) and indeed every setting available to me. Finally I caught a break where in a youtube video someone mentioned the LOW LIGHT COMPENSATION and it was only reachable in a dialog in OBS studio. I installed OBS, clicked around, turned compensation off, and it completely fixed the webcam immediately. !!! It is unconscionable that this setting be the default and I can only guess the percentage of folks that suffer along with it on. As you all know, changing webcam settings wasn't permanent, and as someone who doesn't even use OBS right now it was a hassle to go in and reset this each time I needed to use the webcam.
I usually try to solve things the easy way and so wasted hours looking to find a solution from someone else - but there was none. I was excited about finding cam-cfg, and tried it, but had the same experience that others described above. Later in more technical parts of my quest I saw in the cam-cfg github open issues that other people had mentioned this (or very similar things) and the author hadn't gotten around to those parts of the settings. After lots of searching and brow-beating perplexity, gpt4, etc, without any progress, I gave up and decided I had to do it myself.
I checked the OBS source code and saw there was no occurance of "low light compensation" (or partial match etc) though in debugging on my system I saw that the dialog in OBS that had this option was actually a thread that was win-dshow.dll from the plugins directory. I thought that might be related to DirectShow. There was nothing in the code related to this setting though :/ I figure there must have been a call asking directshow for a dialog of settings, just en-masse like "give me a dialog", and the OBS plugin doesn't seem to micromanage nor know what the settings are. Anyway I then looked at the windows drivers and didn't get very far there either! But in searching the entire c:\windows\ file structure I did see Kswdmcap.ax (which is a dll file with an ".ax" extention for some reason?) that did have the "low light compensation" string in it! It was "WDM Streaming Video Capture" (by Microsoft) .. I had hoped maybe I'd get lucky and see a section of code that referenced the compensation string and be able to toggle it to default to an off setting, something like that. Instead I dove back into Microsoft's documentation of Directshow (as it relates to video capture) (it's all considered deprecated, too) and saw some things that might have worked but then realized I hadn't even used the search function at github. Crazy. So I stopped my uphill journey (I had plans to look into usb sniffing and try to send commands directly to the camera etc all sorts of things).. and found this:
Solution to the low light compensation webcam bug
https://github.com/Oliphan/WebcamFixer
(I found Oliphan's real name but not sure it was intentionally leaked so omitting it here, but this is the person we can thank.)
Even if I wanted to compile the source myself there are the AForge libraries and you need DotNetCore 3.x so I decided to use the binaries. But, I'm not a trusting sort, and ran each exe or dll through virustotal. The Aforge dll was flagged by some user as malware but I tracked down the code and it was binary same as official
https://www.aforgenet.com/ and
https://code.google.com/archive/p/aforge/, and after wasting a bunch more time there I just ran it. I went to OBS and set the compensation on (thus slowing my cam to a crawl), then ran the WebcamFixer.exe and it cleared the setting ! and my webcam was instantly clear and fast. So, a person could just add a reference to this exe in startup somewhere, and that's that.
I dug around pretty good in the AForge docs and this is just using the Directshow API part but it's still undocumented - I don't see a property 19 in the list.
https://www.aforgenet.com/framework/docs/html/97ed6ba7-6bc7-14cf-80b5-25738fcf126f/ (the enumeration of that property has only 7 settings listed)
C#:
using System;
using AForge.Video.DirectShow;
namespace WebcamFixer
{
class WebcamFixer
{
static void Main(string[] args)
{
FilterInfoCollection filterCol = new FilterInfoCollection(FilterCategory.VideoInputDevice);
foreach (FilterInfo filterInfo in filterCol)
{
VideoCaptureDevice tmp = new VideoCaptureDevice(filterInfo.MonikerString);
try
{
tmp.SetCameraProperty((CameraControlProperty)(19), 0, CameraControlFlags.None);
}
catch { }
}
}
}
}
There is a release binary here
https://github.com/Oliphan/WebcamFixer/releases/download/1.0.0/WebcamFixer.zip
What a way to punish computer users for not buying Logitech huh? What cretin made this settings default everywhere? Someone either wasn't thinking or was downright evil. Anyway this is solved!