Saving default microscope settings?

Hi, I’m using Digital Viewer for a Plugable microscope and it’s working ok, but is it possible to save default settings? I saw a similar post back in 2016 but that’s 10 years ago now, I’m hoping something might have changed?

One thing I love about this microscope is that it has a long focal length so for soldering electronics I can have it positioned above the board, out of the way of my soldering iron and hands, but at default settings it compensates for the low light level by changing the exposure level, which reduces the frame rate and makes motion blur annoying. By turning off auto exposure, setting it to a predefined level and bumping the brightness up a heap I get a good image without motion blur and just adjust the LED brightness if I have to move closer. But every time I open the software, I need to go through the same changes. Being able to save these settings would make life much easier.

Alternatively, does anyone know of other software that allows this? I’d previously used the default Win10 camera software and ffmpeg, but that has the same issue that there doesn’t appear to be an ability to save default settings (if someone knows differently, please share! A command line would be amazing.)

Thanks, Brett

Hi Brett,

Thank you for reaching out, and welcome to the community.

Unfortunately, Digital Viewer still does not support persistent camera profiles between launches. Because it pulls the default hardware states upon initial boot, it will reset your manual exposure and brightness settings every single time it opens. Furthermore, the microscope itself is a standard UVC (USB Video Class) camera with no onboard, non-volatile memory, meaning that once unplugged, it completely forgets its configuration.

That being said, your question piqued my curiosity, and while I couldn’t get ffmpeg/ffplay to properly save the config without requiring you to run a command each time, I was able to get this somewhat working with OBS paired with an open-source community utility called WebCameraConfig.

Because OBS takes a few seconds to initialize its video pipeline, it creates a perfect small buffer window that allows a desktop script to automatically hijack the stream and inject custom user-adjusted camera settings right as the app opens…. well, technically a few seconds into it opening if the microscope has been disconnected and reconnected.

I will preface this by saying this method has only been tested by me, but if you are down to give it a shot, I have outlined the steps below. Please note that the only setting I adjusted during testing was disabling auto exposure.

Required software:

Step 1: Create the Configuration Folder
Windows restricts programs from writing configuration profiles inside protected system folders, so we need to create an unprotected home for our utility.

  1. Open File Explorer and navigate to your Documents folder.
  2. Create a new folder named exactly MicroscopeConfig.

Step 2: Download the WebCameraConfig Utility

  1. Go to the repository on GitHub: https://github.com/SuslikV/cfg-cam/releases
  2. Scroll down to the Assets section.
  3. Download WebCameraConfig.exe.
  4. Move the downloaded file out of your Downloads folder and paste it directly into your new Documents\MicroscopeConfig folder.

Step 3: Dial In and Save Your Camera Profile
Before we can automate everything, you will need to capture what your perfect soldering environment looks like.

  1. Open OBS Studio so your microscope light turns on and you see the live video feed. (If this does not occur, you will need to add the Digital Microscope as a Source Device)
  2. Open the camera properties page inside OBS (double-click the video capture source), and click Configure Video to open the Windows camera dialog box.
  3. Turn Auto Exposure OFF, then make any adjustments you normally make.
  4. Leave OBS open so the camera hardware holds onto these settings.
  5. Open the Windows Start Menu, type cmd, and launch Command Prompt.
  6. Copy and paste the following command exactly as written into the black window, then press Enter: “%USERPROFILE%\Documents\MicroscopeConfig\WebCameraConfig.exe” --savedev
  7. Look inside your MicroscopeConfig folder. You will see a new file named cam_sett.cfg. Your profile is now safely recorded. You can now close OBS and the Command Prompt.

Step 4: Create the One-Click Launch Script
The final step is to link the configuration injector and OBS into a single desktop shortcut.

  1. Right-click on your desktop and choose New > Text Document. Name it Launch Microscope.txt.
  2. Open the text file and paste the following code inside:
  3. @echo off
    title Plugable Microscope Custom Settings
    
    :: 1. Navigate to the OBS directory and start the software
    cd /d "C:\Program Files\obs-studio\bin\64bit\"
    start "" "obs64.exe"
    
    :: 2. Let OBS grab the camera stream before injecting settings
    timeout /t 5 /nobreak >nul
    
    :: 3. Dynamically switch to your custom config folder
    cd /d "%USERPROFILE%\Documents\MicroscopeConfig"
    
    :: 4. Run the utility to override Windows auto-exposure
    WebCameraConfig.exe
    
    timeout /t 2 >nul
    exit
    
  4. Save and close the file.
  5. Rename the file extension from .txt to .bat (so it becomes Launch Microscope.bat). Click Yes if Windows warns you about changing the extension. If Windows is causing issues creating the .bat file, open the text document, click File > Save As, type Launch Microscope.bat manually, and click Save.

You will need to launch the .bat file each time to ensure it re-injects the profile.

I hope this helps!

Please let me know if you have any questions.

Thank you,

Adi
Plugable Technologies

1 Like

Hi Adi,
Thank you so much for your effort and reply, that is amazing support and a credit to your company.
I’m not quite there yet I’m afraid. In step 3 part 6, if I paste exactly that it comes up with “The system cannot find the path specified.” Possibly relevant, my documents folder is at E:\My Documents. I’ve confirmed that the folder name created is MicrosopeConfig as instructed.
If I substitute %USERPROFILE%\Documents for E:\My Documents, it appears to work, showing: Device #1
\?\usb#vid_0c45&pid_6369&mi_00#8&328a6ce0&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
Digital Microscope
VideoProcAmp_BacklightCompensation=1 [Manual]
VideoProcAmp_Brightness=50 [Manual]
VideoProcAmp_Contrast=32 [Manual]
VideoProcAmp_Gain=0 [Manual]
VideoProcAmp_Gamma=100 [Manual]
VideoProcAmp_Hue=0 [Manual]
VideoProcAmp_Saturation=64 [Manual]
VideoProcAmp_Sharpness=3 [Manual]
VideoProcAmp_WhiteBalance=4600 [Auto]
CameraControl_Exposure=-5 [Manual]
—end of the device #1

Device #2
OBS Virtual Camera
—end of the device #2

Device #3
@device:sw:{860BB310-5D01-11D0-BD3B-00A0C911CE86}{VHSplitProc}_XSplitBroadcaster_1_staticsource_VIDEO
XSplitBroadcaster
—end of the device #3
… but then nothing appears in the MicroscopeConfig folder.
Any suggestions?
I won’t be at work over the weekend but hopefully you’ve able to see what I’m doing wrong? Everything up to this point appeared to work.
Thanks heaps, Brett

Hi Brett,

Thank you for the update! Great catch identifying folder mapping. It looks like there are two minor adjustments you need to make; otherwise, this should work.

In your note, you mentioned the folder was named MicrosopeConfig. Double-check the spelling on your E: drive and rename it to MicroscopeConfig (with the “c”) so that it perfectly matches the paths in our scripts.

Next, let’s make sure we generate the file while inside E:\My Documents\MicroscopeConfig folder. I suspect your file was generated on the C drive instead of the correct folder

Make sure OBS is open and that you dial in your settings before opening a fresh Command Prompt and running the following two lines sequentially.

cd /d "E:\My Documents\MicroscopeConfig"
WebCameraConfig.exe --savedev

Once you press enter on the second line, look back inside your E:\My Documents\MicroscopeConfig folder. Your cam_sett.cfg file should be in the folder along with WebCameraConfig.exe.

Next, just to ensure your batch file script is correct, please open it and confirm that it looks like so:

(If it looks off, delete everything and paste the exact text below. It should look exactly like this.)

@echo off
title Plugable Microscope Custom Settings

:: 1. Navigate to the OBS directory and start the software
cd /d "C:\Program Files\obs-studio\bin\64bit\"
start "" "obs64.exe"

:: 2. Let OBS grab the camera stream before injecting settings
timeout /t 5 /nobreak >nul

:: 3. Switch to your custom E: drive folder
cd /d "E:\My Documents\MicroscopeConfig"

:: 4. Run the utility to override Windows auto-exposure
WebCameraConfig.exe

timeout /t 2 >nul
exit

Save the file, close it, and you should be completely set.

Just to cover one more thing I didn’t mention earlier. Please ensure that you keep the microscope connected to the same USB port. As you can see in your terminal readout, Windows assigns a massive, unique path string to the device based on the port it uses: \?\usb#vid_0c45&pid_6369&mi_00#8&328a6ce0&0&0000...

If you change ports, that string will change, which could lead the script to fail. As long as you keep it in the same physical USB port on your workbench, this should continue to work.

I hope this helps!

Adi

Plugable Technologies

1 Like

Thank you so much Adi! With one slight tweak (I’d installed OBS at a different location) it works perfectly. The missing C was a mistake when I was writing the reply - the folder was correct - but after I got it working using your second set of instructions I realised that with the first version it saved the config file in the folder that was active in the command prompt (the %USERPROFILE% folder) - your second version was correct in changing the folder beforehand so both the command and the output end up in the same folder.

Noted about unplugging the microscope. Fortunately I’ve got everything fairly permanently plugged in so I don’t think it will be an issue but I’ll make a copy of these instructions in case I need to rewire things later.

Thank you so much for your effort, that is outstanding customer service and tell your boss I said you deserve a pay rise!! :slight_smile: I hope others in a similar situation are able to benefit from this as well.

Kind regards, Brett

Thank you for the kind words, Brett! It’s been my pleasure to help.

I am happy to hear you managed to get it working!