Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Camera board • Re: Camera Module 3 – How to Fix Shutter Speed and Gain (Disable AEC/AGC) in Custom rpicam C++ Application

$
0
0
Thank you, that solved the issue.

A short summary:

To completely disable automatic exposure (AEC) and automatic gain (AGC) for the Camera Module 3 in your custom C++ code using rpicam, you must:
  • Use a recent version of rpicam_app.cpp that includes explicit control over ExposureTimeMode and AnalogueGainMode.
  • Include the following logic in your camera pipeline setup:

Code:

if (!controls_.get(controls::ExposureTime) && options_->Get().shutter){    controls_.set(controls::ExposureTimeMode, controls::ExposureTimeModeManual);    controls_.set(controls::ExposureTime, options_->Get().shutter.get<std::chrono::microseconds>());}if (!controls_.get(controls::AnalogueGain) && options_->Get().gain){    controls_.set(controls::AnalogueGainMode, controls::AnalogueGainModeManual);    controls_.set(controls::AnalogueGain, options_->Get().gain);}
Without setting these two *Mode values to manual, the shutter and gain values you provide will not take effect, as AEC/AGC will override them.

Also note:

Minimum gain for the IMX708 is typically 1.12x, not 1.0x.

Exposure time may behave differently depending on the selected resolution mode (e.g. 2×2 binning vs full resolution).

Once the ExposureTimeMode and AnalogueGainMode are manually set, your shutter and gain values will be respected, and automatic exposure will be fully disabled.

Thanks to @therealdavidp for the clarification.

Statistics: Posted by gftrobots — Mon Jul 14, 2025 9:24 am



Viewing all articles
Browse latest Browse all 8374

Trending Articles