37

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.

7 Answers7

37

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 gyan.dev or BtbN) 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"
    
Mr n
  • 3
stevek_mcc
  • 1,229
  • 1
  • 12
  • 12
18

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!

JeePee
  • 196
10

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...

somebadhat
  • 1,240
Falty
  • 121
3

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

Toto
  • 19,304
Falty
  • 31
  • 1
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

Fishcake
  • 352
2

Looking for this answer as well and not finding any Open Source implementation I went on a wrote one:

https://github.com/PatBQc/SeriousWebcamSettings

Serious Webcam Settings Window example available on GitHub Open source repository:
Serious Webcam Settings Window exemple available on Github Open source repository

Luuklag
  • 133
1

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