27

There is a webcam settings dialog in Windows which can be accessed inside Skype and some other apps, but I want to be able to open it directly. How can I open it directly? I have attached screenshot of dialog for reference.

6
  • Try Windows Key + R, and enter ms-settings:privacy-webcam
    – DavidPostill
    Jan 20 '18 at 17:27
  • @DavidPostill It shows different dialog
    – user398328
    Jan 20 '18 at 20:25
  • Anybody?.......
    – user398328
    Jan 27 '18 at 2:40
  • 2
    This is really driving me crazy, I can access it Skype, I can write my own program to open it but I just want to open it within Windows...
    – Fishcake
    Feb 14 '18 at 16:46
  • @Fishcake How can you open it from your program. What's the API for it?
    – user398328
    May 28 '18 at 15:16
12

I know this thread is old but inspired from stevek_mcc's answer, I made a small script to launch the webcam settings dialog directly from Windows.

Github: webcam-settings-dialog-windows

Hope this could help someone!

26

Thanks to Fishcake's answer, I was able to find a program that offers command-line access to the same ISpecifyPropertyPages interface as AForge's DisplayPropertyPage, and thus allows us to open the dialog: ffmpeg.

  1. Download an ffmpeg Windows executable (e.g. from zeranoe) and expand bin\ffmpeg.exe into a directory, e.g. c:\utils
  2. Start a cmd prompt and change to that directory: cd \utils
  3. Find the exact name of your device, either from Control Panel | Devices and Printers or by running ffmpeg:

    C:\utils>ffmpeg -list_devices true -f dshow -i dummy -hide_banner
    [dshow @ 0000022fd7ac8440] DirectShow video devices (some may be both video and audio devices)
    [dshow @ 0000022fd7ac8440]  "USB 2.0 CAMERA"
    
  4. Run ffmpeg to show the dialog:

    ffmpeg -f dshow -show_video_device_dialog true -i video="USB 2.0 CAMERA"
    
2
  • 3
    This should be the accepted answer. Sep 14 '20 at 8:02
  • wish there was a way to feed it a set of sane defaults for gain/exposure etc.
    – AMG
    Mar 25 at 3:06
8

I have written a little program to do this and also to allow saving camera settings in different profiles.

http://faltinek.de/freestuff/CamooZ.zip

CamooZ at work...

6
  • It is never recommended to download software from a non-HTTPS connection, nor should a software link point to a downloadable file, but the software's webpage. It would be ill-advised for any user to click on the link in this answer
    – JW0914
    Apr 25 '20 at 12:25
  • 2
    Thanks for the answer. And sorry about the downvotes. This site is not very friendly towards new users.
    – user398328
    Apr 26 '20 at 0:43
  • This would be really useful, and most would indeed just want to download the exe. But without a webpage, a digital signature and/or open source, many won't take the risk. I found the ffmpeg solution above only because it was open source: I could search the net for the function call. Maybe you could make the source available?
    – stevek_mcc
    Apr 27 '20 at 12:54
  • @VarunAgw Downvotes have nothing to do with being a new user, but the quality of the answer, and without some means of security verification for the suggested software, the software should never have been placed in an answer, which is why I down-voted. IMHO, answers should never contain a link to a direct download, as it's a blatant, massive security risk and is therefore unacceptable, whether on Stack Exchange or any other forum.
    – JW0914
    Apr 30 '20 at 12:54
  • @VarunAgw That's just common sense... any software developer should know to (1) Not post a non-HTTPS link to their software, and (2) not link directly to a direct download, but to the software's webpage. There are trusted software development sites folks can host closed-source software on, GitHub being one of them.
    – JW0914
    May 1 '20 at 0:33
2

The only way I've managed to launch it without using an external program (e.g. Skype) was to use AForge.Net

Using AForge.Net, you can launch the property window by simply calling DisplayPropertyPage on a VideoCaptureDevice

videoCaptureDevice.DisplayPropertyPage(IntPtr.Zero);

Using AForge.Net might be overkill for just displaying the property page (I was using it already for some image manipulation) but you can view the source to see what it is doing under the hood. The DisplayPropertyPage method is in the class VideoCaptureDevice.cs

0

I just wrote my own simple script to quickly let me access the webcam settings for both my cameras, as the option to access the settings in most other applications are missing, except in Lync/Skype for Business (which hopefully nobody uses anymore.)

Anyway, I thought it'd be nice to share what I learnt.

Mixed Winbatch and PowerShell script

Its a mixed Winbatch and PowerShell script that enumerates all cameras and opens the Camera Property dialog for each of them using ffmpeg. Its mixed because I didn't want to modify my ExecutionPolicy-settings, where a regular .ps1-script would otherwise halt on confirming a ExecutionPolicy Change.

OpenCameraSettings.cmd

for /f "Usebackq Tokens=* Delims=" %%a in (`powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -Command "(Get-PnpDevice).where{$_.Class -eq 'Camera'}.FriendlyName"`) do (
    ffmpeg.exe -f dshow -show_video_device_dialog true -i video="%%a"
)

Description

The script basically consists of a Winbatch For-loop that enumerates Cameras using PowerShell and opens its properties using ffmpeg.

The PowerShell-part of the script also hides the terminal window that ffmpeg otherwise generates:

powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -Command "..."

The same PowerShell part of the script also enumerates all Camera devices:

(Get-PnpDevice).where{$_.Class -eq 'Camera'}.FriendlyName

WinBatch Alternative (without any usage of PowerShell)

Uses PnPUtil to query for Camera devices.
PnPUtil comes built into newer versions of Windows and replaces Windows Device Console (Devcon.exe) that only comes with WDK, Visual Studio, and the Windows SDK for desktop apps.

@echo off
setlocal enabledelayedexpansion
for /f "Usebackq Tokens=2 Delims=:" %%i in (`pnputil /enum-devices /Class Camera ^| find /i "Device Description"`) do (
    set cam=%%i
    rem trim double spaces
    set cam=!cam:  =!
    rem remove a space from the beginning of the string
    set cam=!cam:~1!
    ffmpeg.exe -f dshow -show_video_device_dialog true -i video="!cam!"
)

PowerShell alternative

(will complain about ExecutionPolicy change depending on your configuration)

Uses Get-PnpDevice from the PowerShell module PnpDevice to query for Camera devices.
The PowerShell module PnpDevice comes with at least Windows Server 2012-2019 and Windows 10.

((Get-PnpDevice).Where{$_.Class -eq 'Camera'}.FriendlyName).ForEach{
    powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". $PSScriptRoot\ffmpeg.exe -f dshow -show_video_device_dialog true -i video='$PSItem'"
}

Oh and I used ffmpeg-git-essentials (version: 2021-09-30-git-3ee4502753) from gyan.dev.

And yes, you can list the camera devices using ffmpeg too, but you'll have to do some string manipulation in order to use its values in a loop.

ffmpeg -list_devices true -f dshow -i dummy -hide_banner
0

News from CamooZ

this time properly posted in the OBS forum's tools section:

https://obsproject.com/forum/resources/camooz-tool-to-manage-and-save-and-restore-camera-settings.1271/

enter image description here

New contributor
Falty is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • 1
    Links will change over time. It is not ok. You should post the full answer here and reference the source.
    – ZygD
    Oct 17 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy