---
title: activeFormat
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcapturedevice/activeformat
---

# activeFormat

The capture format in use by the device.

## Declaration

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

## Mentioned in

Adopting smart framing in your camera app

## Discussion

Discussion In iOS, a device’s active format and a capture session’s sessionPreset are mutually exclusive. If you set a device’s active format, the session to which it’s attached changes its preset to 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 AVAudioSession and its related APIs instead. Set the activeFormat, activeVideoMinFrameDuration, and activeVideoMaxFrameDuration properties simultaneously by performing the configuration between calls to the session’s beginConfiguration() and commitConfiguration() methods. // 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, the system may not meet the target framerate. This property is key-value observable.

## See Also

### Configuring capture formats

- [formats](avfoundation/avcapturedevice/formats.md)
- [activeDepthDataFormat](avfoundation/avcapturedevice/activedepthdataformat.md)
- [AVCaptureDevice.Format](avfoundation/avcapturedevice/format.md)
