You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通用视频类(UVC):如何关闭自动增益控制(AGC)

Disable AGC (Automatic Gain Control) for Manual Brightness Control in UVC Camera

Hey there! Awesome that you've got your UVC camera up and running with manual brightness and contrast adjustments using those TrySetValue calls. To disable the AGC feature so your manual brightness settings stay locked in, you can absolutely use built-in properties from the VideoDeviceController—here's how to do it:

Key Control to Target: AutomaticGainControl

The VideoDeviceController includes an AutomaticGainControl property (a MediaDeviceControl instance) that lets you toggle the camera's auto-gain functionality. When disabled, the camera won't automatically adjust gain (and thus brightness) based on ambient light, leaving your manual brightness adjustments fully in charge.

Here's the code snippet to implement this:

// Access the Automatic Gain Control (AGC) from your MediaCapture instance
var agcControl = MedCap.VideoDeviceController.AutomaticGainControl;

// Always check if the camera supports this control before modifying it
if (agcControl != null && agcControl.Capabilities.Supported)
{
    // Disable AGC by setting its value to false
    agcControl.TrySetValue(false);
}

Bonus: Disable Automatic Brightness (If Your Camera Supports It)

Some cameras also have a separate AutomaticBrightness control that works alongside AGC. To ensure complete manual control over brightness, you might want to disable this too:

var autoBrightnessControl = MedCap.VideoDeviceController.AutomaticBrightness;
if (autoBrightnessControl != null && autoBrightnessControl.Capabilities.Supported)
{
    autoBrightnessControl.TrySetValue(false);
}

Quick Notes

  • Different UVC cameras have varying feature sets, so always verify if a control is supported (Capabilities.Supported) before trying to modify it—this avoids null reference errors or unrecognized commands.
  • Once AGC is disabled, you'll be responsible for adjusting brightness manually across different lighting conditions, so you may want to test your manual settings in various environments to get the desired output.

内容的提问来源于stack exchange,提问作者Ianb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 06:41:28