Question / Help How can I permanently set the properties of my webcam on windows?

pinkfreud

New Member
Every time I'm going to use my camera I need to set it up manually using the webcam properties window that I access through OBS-studio. I have included screenshots to show what I'm talking about.

I'm trying to find a way to make these changes permanent in my system, so I've been searching for keys in the windows registry or some configuration files somewhere, either in Windows or in OBS. Any clues?
If I could at least write a script that I could double click or auto-run, that would also be nice.

I'm basically changing the values of white balance, focus and exposure. I would play with the others too, but those are the most important ones to change every time I used it, because they are set to auto by default, which makes the camera perform poorly.

By the way, it's a "HP Webcam HD-4110"
 

Attachments

  • webcam_props2.png
    webcam_props2.png
    7.4 KB · Views: 2,509
  • wemcam_props1.png
    wemcam_props1.png
    9.5 KB · Views: 2,407

Banyarola

Active Member
I use two c-920's
Ha! I do the same thing every day...I turn off the auto focus and the 'low light' setting. It seems they like to start of default settings...
 

pinkfreud

New Member
I use two c-920's
Ha! I do the same thing every day...I turn off the auto focus and the 'low light' setting. It seems they like to start of default settings...
Yeah, but that's the thing, where are those default values stored? If they are in a config file or in the windows registry, it would be perfect, but we need to find those.
If those default values are stored in a driver's binary, then a solution would have to be a script that we would have to double click or add to our system startup programs. Wouldn't be perfect, but would make life much easier.
And I'm assuming that there might exist such global webcam config thing, and it's not a different one for each webcam

But I'm losing hope, I've been searching the web for hours for this, which leads me to believe the default values are stored in the driver's binaries :/
 

Banyarola

Active Member
Sorry, I have no idea where they are stored. They could be in the driver but I don't know..
It's not that much trouble for me..I use my cams on two different computers and at different times for different purposes.
I just put up with it...It's not that big a deal to me...
I'm sure others here may be able to help you out if there is a solution..
 

Toastfalter

Member
For the Logitech i use G-Hub and Logitech Gaming Software.
You have to set a Perm profile in G-Hub Settings!
My Perm Profile is Standard. You can set your settings and have to lock it on the top!

I have to install both programs. Otherwise it wont work for me.
Logitech Gaming Software is installed but wont start at the windows start.
I did all my settings in the G-Hub and lock it with the profile as permanent profile in the settings.
Without the Gaming Software it wont work and reset my settings after every reboot.
 

pinkfreud

New Member
For the Logitech i use G-Hub and Logitech Gaming Software.
You have to set a Perm profile in G-Hub Settings!
My Perm Profile is Standard. You can set your settings and have to lock it on the top!

I have to install both programs. Otherwise it wont work for me.
Logitech Gaming Software is installed but wont start at the windows start.
I did all my settings in the G-Hub and lock it with the profile as permanent profile in the settings.
Without the Gaming Software it wont work and reset my settings after every reboot.
Would this work for any webcam or just Logitech webcams?
 

Toastfalter

Member
I Think its only for Logitech. U can try it.
Its becouse Banyarola had the same problem with his logitech webcams.

Maybe there is an option in windows device manager, where you can disable windows to set settings
 

Watung

New Member
You might want to look at the following as workaround.

I use a small program cam-cfg to save my camera settings in OBS. Here's how:

1. Run OBS, select your camera, and go to Properties -> Configure Video, then apply settings as you want
2. Run cam-cfg from command line with option --savedev, this will create a cam_sett.cfg file that stores settings you've made in Step 1
3. Create a shell script (e.g. BAT file) to run cam-cfg at first (without any options, as this will load the cam_sett.cfg by default), then OBS at next.
4. The next time you run OBS, just run the script instead. This will open the OBS, with the stored camera-settings.

Hope it helps.
 
  • Like
Reactions: Oni

Steikjepanne

New Member
You might want to look at the following as workaround.

I use a small program cam-cfg to save my camera settings in OBS. Here's how:

1. Run OBS, select your camera, and go to Properties -> Configure Video, then apply settings as you want
2. Run cam-cfg from command line with option --savedev, this will create a cam_sett.cfg file that stores settings you've made in Step 1
3. Create a shell script (e.g. BAT file) to run cam-cfg at first (without any options, as this will load the cam_sett.cfg by default), then OBS at next.
4. The next time you run OBS, just run the script instead. This will open the OBS, with the stored camera-settings.

Hope it helps.
Can you please explain more simple for me how to make the cam_sett.cfg file
 

Oni

New Member
You might want to look at the following as workaround.

I use a small program cam-cfg to save my camera settings in OBS. Here's how:

1. Run OBS, select your camera, and go to Properties -> Configure Video, then apply settings as you want
2. Run cam-cfg from command line with option --savedev, this will create a cam_sett.cfg file that stores settings you've made in Step 1
3. Create a shell script (e.g. BAT file) to run cam-cfg at first (without any options, as this will load the cam_sett.cfg by default), then OBS at next.
4. The next time you run OBS, just run the script instead. This will open the OBS, with the stored camera-settings.

Hope it helps.
You saved my life <3
 

kevinwcm

New Member
Can you please explain more simple for me how to make the cam_sett.cfg file
Thank you so much for this, really does work.
So for those who are not sure how to do it, I've attached my current bat file for your reference, so you can edit it for your PC.

What I did
1. I placed the WebCameraConfig.exe in my Documents folder (for easier access. Don't place in obs folder, as it is in program files, it will need permission to write the cfg file. To be safe, just place it other than protected folders, like Documents/Downloads)
2. Open your OBS and adjust your webcam's settings.
3. After you've done adjusting the webcam's setting, open cmd and go to the file location of the WebCameraConfig.exe location. In my case, I'll type cd C:\Users\kevin\Documents
4. Once there, you just type "WebCameraConfig.exe --savedev" (without "")
5. You will see a file called "cam_sett.cfg" created next to WebCameraConfig.exe. This means it's successful.
6.To test it out, you can simply adjust any settings in OBS webcam settings. Then you double click on WebCameraConfig.exe, it should immediately change the settings to the one you save when you do step 3.

Now to make it automated, so that when you open OBS, this file will be applied...
1. right click and edit the .bat file I attached.
2. Change the path to the place where you place the WebCameraConfig.exe. In my case is "C:\Users\kevin\Documents"
3. add your OBS path. in my case is "C:\Program Files\obs-studio\bin\64bit"
4. Once you do that and save, double clicking on this .bat file should automatically change the webcam setting and opens OBS.

Hope this helps and many thanks to the developer who did this
 

Attachments

  • OBS Studio with Webcam Settings.zip
    278 bytes · Views: 1,168

johndenewtown

New Member
Thank you Kevin for the more detailed explanation. I've just implemented it and it seems to be working fine - a great time saver! Many thanks to you and others for this.
 

genxha

New Member
Thank you so much for this, really does work.
So for those who are not sure how to do it, I've attached my current bat file for your reference, so you can edit it for your PC.

What I did
1. I placed the WebCameraConfig.exe in my Documents folder (for easier access. Don't place in obs folder, as it is in program files, it will need permission to write the cfg file. To be safe, just place it other than protected folders, like Documents/Downloads)
2. Open your OBS and adjust your webcam's settings.
3. After you've done adjusting the webcam's setting, open cmd and go to the file location of the WebCameraConfig.exe location. In my case, I'll type cd C:\Users\kevin\Documents
4. Once there, you just type "WebCameraConfig.exe --savedev" (without "")
5. You will see a file called "cam_sett.cfg" created next to WebCameraConfig.exe. This means it's successful.
6.To test it out, you can simply adjust any settings in OBS webcam settings. Then you double click on WebCameraConfig.exe, it should immediately change the settings to the one you save when you do step 3.

Now to make it automated, so that when you open OBS, this file will be applied...
1. right click and edit the .bat file I attached.
2. Change the path to the place where you place the WebCameraConfig.exe. In my case is "C:\Users\kevin\Documents"
3. add your OBS path. in my case is "C:\Program Files\obs-studio\bin\64bit"
4. Once you do that and save, double clicking on this .bat file should automatically change the webcam setting and opens OBS.

Hope this helps and many thanks to the developer who did this
Sadly it does not apply "low light compensaion" settings...
 

maxv

New Member
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!
 
Top