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

# activeFormat

The capture format in use by the device.

```
var activeFormat: AVCaptureDevice.Format { get set }
```

## Discussion

In iOS, a device’s active format and a capture session’s [`sessionPreset`](/documentation/AVFoundation/AVCaptureSession/sessionPreset) are mutually exclusive. If you set a device’s active format, the session to which it’s attached changes its preset to [`inputPriority`](/documentation/AVFoundation/AVCaptureSession/Preset/inputPriority). Likewise if you set a preset on a capture session, the session assumes control of its input devices, and configures their active format appropriately.

> Note:
> Audio devices don’t expose any user-configurable formats in iOS. To configure audio input on iOS, use <doc://com.apple.documentation/documentation/AVFAudio/AVAudioSession> and its related APIs instead.

Set the [`activeFormat`](/documentation/AVFoundation/AVCaptureDevice/activeFormat), [`activeVideoMinFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/activeVideoMinFrameDuration), and [`activeVideoMaxFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/activeVideoMaxFrameDuration) properties simultaneously by performing the configuration between calls to the session’s [`beginConfiguration()`](/documentation/AVFoundation/AVCaptureSession/beginConfiguration()) and [`commitConfiguration()`](/documentation/AVFoundation/AVCaptureSession/commitConfiguration()) methods.

```swift
// Configure capture session.
captureSession.beginConfiguration()

do {
    try device.lockForConfiguration()
    
    // Set the device's active format.
    device.activeFormat = // a supported format.
    
    // Set the device's min/max frame duration.
    device.activeVideoMinFrameDuration = // a supported minimum duration.
    device.activeVideoMaxFrameDuration = // a supported maximum duration.
    
    device.unlockForConfiguration()
} catch {
    // Handle error.
}

// Apply the changes to the session.
captureSession.commitConfiguration()
```

If you configure a session to use an active format intended for high resolution still photography, and you apply zoom, orientation, or format changes to an [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput), the system may not meet the target framerate.

This property is key-value observable.

---

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)