A command-line utility for managing webcam configuration on Windows
Ever moved to a country with 50Hz powerline frequency and noticed your webcam footage looking like a disco strobe light? Windows defaults to 60Hz anti-flicker settings, which causes annoying flickering when your local power grid runs at 50Hz. While you can fix this manually in camera settings... doing it for multiple cameras or at scale is a pain.
That's where wincamcfg comes in.
wincamcfg lets you read and write webcam properties from the command line. The original use case was fixing powerline-frequency flicker on cameras moved between 50Hz and 60Hz countries, but the same approach works for brightness, contrast, white balance, and the rest of the DirectShow property set.
It can set the same things as the native DirectShow camera-properties dialog:
git clone https://github.com/andrewj-t/wincamcfg.git
cd wincamcfg
cargo build --releaseThe compiled binary will be in target/release/wincamcfg.exe.
See what cameras are connected to your system:
wincamcfg listExample output:
[0] Integrated Webcam
[1] Logitech HD Pro C920
Check current property values for a specific camera:
# Get all properties for camera 0
wincamcfg get --camera 0
# Get all properties for all cameras
wincamcfg get --camera all
# Output as JSON for scripting
wincamcfg get --camera 0 --output jsonThe main reason this tool exists! Set your cameras to match your local power grid:
# Set camera 0 to 50Hz (for most of Europe, Asia, Africa, Australia)
wincamcfg set --camera 0 --property PowerlineFrequency --value 50Hz
# Set camera 0 to 60Hz (for Americas, parts of Asia)
wincamcfg set --camera 0 --property PowerlineFrequency --value 60Hz
# Set ALL cameras to 50Hz
wincamcfg set --camera all --property PowerlineFrequency --value 50HzOther settings you can change:
# Adjust brightness
wincamcfg set --camera 0 --property Brightness --value 128
# Adjust contrast
wincamcfg set --camera 0 --property Contrast --value 150
# Enable auto white balance
wincamcfg set --camera 0 --property WhiteBalance --value Auto
# Disable backlight compensation
wincamcfg set --camera 0 --property BacklightCompensation --value OffProperties like Exposure, Focus, and WhiteBalance can run in either Auto or Manual mode. Pass --value Auto to switch the property into auto mode, or pass any numeric value to switch it into manual mode at that value.
# Turn auto exposure ON
wincamcfg set --camera 0 --property Exposure --value Auto
# Turn auto exposure OFF by setting an explicit manual value
# (use `get` to see the supported range and current value, e.g. -11..-1 on a C920)
wincamcfg set --camera 0 --property Exposure --value -5
# Same idea for autofocus
wincamcfg set --camera 0 --property Focus --value Auto # autofocus on
wincamcfg set --camera 0 --property Focus --value 0 # autofocus off, fixed focusThe current mode is shown in square brackets by get, e.g. Exposure: -5 [Manual] or Exposure: -6 [Auto]. Only properties that advertise Auto support will show a mode tag.
Restore factory settings:
# Reset a specific property to default
wincamcfg set --camera 0 --property Brightness --default
# Reset ALL properties on a camera to defaults
wincamcfg set --camera 0 --property all --default
# Reset ALL cameras to factory defaults
wincamcfg set --camera all --property all --defaultPowerlineFrequency- Fix flickering (Disabled, 50Hz, 60Hz, Auto)Brightness- Adjust brightness levelsContrast- Adjust contrast levelsHue- Adjust colour hueSaturation- Adjust colour saturationSharpness- Adjust image sharpnessGamma- Adjust gamma correctionWhiteBalance- White balance (Auto or manual value)BacklightCompensation- Backlight compensation (On/Off)Gain- Gain/ISO controlcolourEnable- Enable/disable colour (On/Off)
Use wincamcfg get --camera 0 to see which properties your specific camera supports.
Use --output json for machine-readable output:
# PowerShell example: Configure all cameras on startup
wincamcfg set --camera all --property PowerlineFrequency --value 50Hz --output jsonDrop this into a startup script or GPO if you need every machine on a fleet to land on the same camera config.
- Windows (uses DirectShow APIs)
- Rust 2024 edition or later (for building from source)
Every release ships with build-provenance attestations for wincamcfg.exe and the SPDX/CycloneDX SBOMs, generated by GitHub Actions. They prove the artifact was built from the tagged commit and not swapped out afterwards.
Verify with the GitHub CLI:
gh attestation verify wincamcfg.exe --repo andrewj-t/wincamcfg
gh attestation verify sbom.spdx.json --repo andrewj-t/wincamcfg
gh attestation verify sbom.cyclonedx.json --repo andrewj-t/wincamcfgA successful verification ties the binary to the GitHub Actions run that produced it, the git tag that triggered the run, and the workflow file as it existed at that commit.
See the GitHub attestations documentation for details.
The release binary is not code-signed. Code-signing certificates aren't free and this is a side project. If your organization requires signed binaries, you can sign with signtool using your internal CA's certificate.
Having issues? Check out the Troubleshooting Guide for debug logging instructions and common solutions.
MIT. See LICENSE.
Bug reports and PRs welcome. For bugs, please include a reproduction case: camera model, the exact command you ran, and a trace log if you can get one. TROUBLESHOOTING.md covers how to capture the log.
