<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/activeMaxExposureDuration",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(py)activeMaxExposureDuration"
  },
  "title" : "activeMaxExposureDuration"
}
-->

# activeMaxExposureDuration

The maximum exposure duration, in seconds, defined in the autoexposure algorithm.

```
var activeMaxExposureDuration: CMTime { get set }
```

## Discussion

When you set the exposureMode to [`AVCaptureDevice.ExposureMode.autoExpose`](/documentation/AVFoundation/AVCaptureDevice/ExposureMode-swift.enum/autoExpose) or [`AVCaptureDevice.ExposureMode.continuousAutoExposure`](/documentation/AVFoundation/AVCaptureDevice/ExposureMode-swift.enum/continuousAutoExposure), the autoexposure algorithm picks a default maximum exposure duration that’s tuned for the current configuration, balancing low light image quality with motion preservation. By querying or key-value observing this property, you can determine the current maximum exposure duration in use.

You may also override the default value by setting this property to a value between the format’s [`minExposureDuration`](/documentation/AVFoundation/AVCaptureDevice/Format/minExposureDuration) and [`maxExposureDuration`](/documentation/AVFoundation/AVCaptureDevice/Format/maxExposureDuration) values. The system throws an exception if you pass an out-of-bounds exposure value.

Setting the property to the special value of <doc://com.apple.documentation/documentation/CoreMedia/CMTime/invalid> resets the autoexposure maximum duration to the device’s default for your current configuration. When the device’s [`activeFormat`](/documentation/AVFoundation/AVCaptureDevice/activeFormat) or the capture session’s [`sessionPreset`](/documentation/AVFoundation/AVCaptureSession/sessionPreset) changes, this property resets to the default max exposure duration for the new format or session preset.

On some devices, the auto exposure algorithm picks a different maximum exposure duration for a given format depending on whether you used the [`sessionPreset`](/documentation/AVFoundation/AVCaptureSession/sessionPreset) or [`activeFormat`](/documentation/AVFoundation/AVCaptureDevice/activeFormat) APIs to set to set the format. To ensure uniform default handling of maximum exposure duration, set the value of a capture input’s [`unifiedAutoExposureDefaultsEnabled`](/documentation/AVFoundation/AVCaptureDeviceInput/unifiedAutoExposureDefaultsEnabled) property to <doc://com.apple.documentation/documentation/Swift/true>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)