<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice"
  },
  "title" : "AVCaptureDevice"
}
-->

# AVCaptureDevice

An object that represents a hardware or virtual capture device like a camera or microphone.

```
class AVCaptureDevice
```

## Overview

Capture devices provide media data to capture session inputs that you connect to an [`AVCaptureSession`](/documentation/AVFoundation/AVCaptureSession). An individual device can provide one or more streams of media of a particular type.

You don’t create capture device instances directly. Instead, retrieve them using an instance of [`AVCaptureDevice.DiscoverySession`](/documentation/AVFoundation/AVCaptureDevice/DiscoverySession), or by calling the [`default(_:for:position:)`](/documentation/AVFoundation/AVCaptureDevice/default(_:for:position:)) method.

A capture device provides several configuration options. Before attempting to configure device properties, such as its focus mode, exposure mode, and so on, you must first acquire a lock on the device by calling the [`lockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/lockForConfiguration()) method. You should also query the device’s capabilities to ensure that the new modes you intend to set are valid for the device. You can then set the properties and release the lock using the [`unlockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/unlockForConfiguration()) method. You may hold the lock if you want all settable device properties to remain unchanged. However, holding the device lock unnecessarily may degrade capture quality in other apps sharing the device and isn’t recommended.

## Topics

### Finding and monitoring devices

[`AVCaptureDevice.DiscoverySession`](/documentation/AVFoundation/AVCaptureDevice/DiscoverySession)

An object that finds capture devices that match specific search criteria.

[`default(_:for:position:)`](/documentation/AVFoundation/AVCaptureDevice/default(_:for:position:))

Returns the default device for the specified device type, media type, and position.

[`default(for:)`](/documentation/AVFoundation/AVCaptureDevice/default(for:))

Returns the default device that captures the specified media type.

[`init(uniqueID:)`](/documentation/AVFoundation/AVCaptureDevice/init(uniqueID:))

Creates an object that represents a device with the specified identifier.

[`wasConnectedNotification`](/documentation/AVFoundation/AVCaptureDevice/wasConnectedNotification)

A notification the system posts when a new capture device becomes available.

[`wasDisconnectedNotification`](/documentation/AVFoundation/AVCaptureDevice/wasDisconnectedNotification)

A notification the system posts when an existing device becomes unavailable.

[`devices(for:)`](/documentation/AVFoundation/AVCaptureDevice/devices(for:))

Returns devices capable of capturing media of the specified type.

[`devices()`](/documentation/AVFoundation/AVCaptureDevice/devices())

Returns all available capture devices on the system.

### Authorizing device access

[`requestAccess(for:completionHandler:)`](/documentation/AVFoundation/AVCaptureDevice/requestAccess(for:completionHandler:))

Requests the user’s permission to allow the app to capture media of a particular type.

[`authorizationStatus(for:)`](/documentation/AVFoundation/AVCaptureDevice/authorizationStatus(for:))

Returns an authorization status that indicates whether the user grants the app permission to capture media of a particular type.

[`AVAuthorizationStatus`](/documentation/AVFoundation/AVAuthorizationStatus)

Constants that indicate the status of an app’s authorization to capture media.

### Identifying a device

[`uniqueID`](/documentation/AVFoundation/AVCaptureDevice/uniqueID)

An identifier that uniquely identifies the device.

[`modelID`](/documentation/AVFoundation/AVCaptureDevice/modelID)

A model identifier for the device.

[`localizedName`](/documentation/AVFoundation/AVCaptureDevice/localizedName)

A localized device name for display in the user interface.

[`manufacturer`](/documentation/AVFoundation/AVCaptureDevice/manufacturer)

A human-readable string for the manufacturer of the device.

[`deviceType`](/documentation/AVFoundation/AVCaptureDevice/deviceType-swift.property)

The type of device, such as a built-in microphone or wide-angle camera.

[`AVCaptureDevice.DeviceType`](/documentation/AVFoundation/AVCaptureDevice/DeviceType-swift.struct)

A structure that defines the device types the framework supports.

[`position`](/documentation/AVFoundation/AVCaptureDevice/position-swift.property)

The physical position of the capture device hardware.

[`AVCaptureDevice.Position`](/documentation/AVFoundation/AVCaptureDevice/Position-swift.enum)

Constants that indicate the physical position of a capture device.

### Accessing device state

[`isConnected`](/documentation/AVFoundation/AVCaptureDevice/isConnected)

A Boolean value that indicates whether a device is currently connected to the system and available for use.

[`isSuspended`](/documentation/AVFoundation/AVCaptureDevice/isSuspended)

A Boolean value that indicates whether the device is in a suspended state.

[`isInUseByAnotherApplication`](/documentation/AVFoundation/AVCaptureDevice/isInUseByAnotherApplication)

A Boolean value that indicates whether another app is using the device.

### Inspecting device characteristics

[`isVirtualDevice`](/documentation/AVFoundation/AVCaptureDevice/isVirtualDevice)

A Boolean value that indicates whether the device consists of two or more physical devices.

[`constituentDevices`](/documentation/AVFoundation/AVCaptureDevice/constituentDevices)

An array of physical devices that make up a virtual device.

[`hasMediaType(_:)`](/documentation/AVFoundation/AVCaptureDevice/hasMediaType(_:))

Returns a Boolean value that indicates whether the device captures media of a particular type.

[`transportType`](/documentation/AVFoundation/AVCaptureDevice/transportType)

The transport type of the device.

[`supportsSessionPreset(_:)`](/documentation/AVFoundation/AVCaptureDevice/supportsSessionPreset(_:))

Returns a Boolean value that indicates whether you can use the device with capture session configured with the specified preset.

### Monitoring device rotation

[`AVCaptureDevice.RotationCoordinator`](/documentation/AVFoundation/AVCaptureDevice/RotationCoordinator)

A class that monitors the physical orientation of a capture device and provides adjustment angles to keep images level, relative to gravity.

### Configuring camera hardware

[`lockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/lockForConfiguration())

Requests exclusive access to configure device hardware properties.

[`unlockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/unlockForConfiguration())

Releases exclusive control over device hardware properties.

[`isSubjectAreaChangeMonitoringEnabled`](/documentation/AVFoundation/AVCaptureDevice/isSubjectAreaChangeMonitoringEnabled)

A Boolean value that indicates whether the device monitors the subject area for changes.

[`subjectAreaDidChangeNotification`](/documentation/AVFoundation/AVCaptureDevice/subjectAreaDidChangeNotification)

A notification the system posts when a capture device detects a substantial change to the video subject area.

[Formats](/documentation/AVFoundation/capture-device-formats)

Configure capture formats and camera frame rates.

[Focus](/documentation/AVFoundation/capture-device-focus)

Configure the automatic focus behavior of a camera, or manually set its lens position.

[Exposure](/documentation/AVFoundation/capture-device-exposure)

Configure the automatic exposure behavior of a camera, or manually control its exposure settings.

[White balance](/documentation/AVFoundation/capture-device-white-balance)

Configure the automatic white balance behavior of a camera, or manually control white balance settings.

[Lighting](/documentation/AVFoundation/capture-device-lighting)

Configure the device flash, torch, and low light settings.

[Color](/documentation/AVFoundation/capture-device-color)

Manage HDR and color space settings for a device.

[Zoom](/documentation/AVFoundation/capture-device-zoom)

Configure device zooming behavior and inspect hardware capabilities.

### Configuring Cinematic video

[`setCinematicVideoFixedFocus(at:focusMode:)`](/documentation/AVFoundation/AVCaptureDevice/setCinematicVideoFixedFocus(at:focusMode:))

Fix focus at a distance.

[`setCinematicVideoTrackingFocus(at:focusMode:)`](/documentation/AVFoundation/AVCaptureDevice/setCinematicVideoTrackingFocus(at:focusMode:))

Focus on and start tracking an object if it can be detected at the region specified by the point.

[`setCinematicVideoTrackingFocus(detectedObjectID:focusMode:)`](/documentation/AVFoundation/AVCaptureDevice/setCinematicVideoTrackingFocus(detectedObjectID:focusMode:))

Focus on and start tracking a detected object.

[`AVCaptureDevice.CinematicVideoFocusMode`](/documentation/AVFoundation/AVCaptureDevice/CinematicVideoFocusMode)

Constants indicating the focus behavior when recording a Cinematic Video.

[`AVCaptureSceneMonitoringStatus`](/documentation/AVFoundation/AVCaptureSceneMonitoringStatus)

An informative status about the scene observed by the device.

[`notEnoughLight`](/documentation/AVFoundation/AVCaptureSceneMonitoringStatus/notEnoughLight)

The light level of the current scene is insufficient for the current set of features to function optimally.

[`cinematicVideoCaptureSceneMonitoringStatuses`](/documentation/AVFoundation/AVCaptureDevice/cinematicVideoCaptureSceneMonitoringStatuses)

The current scene monitoring statuses related to Cinematic Video capture.

### Configuring smart framing

[`smartFramingMonitor`](/documentation/AVFoundation/AVCaptureDevice/smartFramingMonitor)

A monitor owned by the device that recommends an optimal framing based on the content in the scene.

[`AVCaptureSmartFramingMonitor`](/documentation/AVFoundation/AVCaptureSmartFramingMonitor)

An object associated with a capture device that monitors the scene and suggests an optimal framing.

[`AVCaptureFraming`](/documentation/AVFoundation/AVCaptureFraming)

A framing, consisting of an aspect ratio and a zoom factor.

### Configuring dynamic aspect ratio

[`setDynamicAspectRatio(_:completionHandler:)`](/documentation/AVFoundation/AVCaptureDevice/setDynamicAspectRatio(_:completionHandler:))

Updates the dynamic aspect ratio of the device.

[`AVCaptureDevice.AspectRatio`](/documentation/AVFoundation/AVCaptureDevice/AspectRatio)

String constants describing the different video aspect ratios you can configure for a particular device.

[`dynamicAspectRatio`](/documentation/AVFoundation/AVCaptureDevice/dynamicAspectRatio)

A key-value observable property indicating the current aspect ratio for a device.

[`dynamicDimensions`](/documentation/AVFoundation/AVCaptureDevice/dynamicDimensions)

A key-value observable property describing the output dimensions of the video buffer based on the device’s dynamic aspect ratio.

### Enabling automatic frame rate

[`isAutoVideoFrameRateEnabled`](/documentation/AVFoundation/AVCaptureDevice/isAutoVideoFrameRateEnabled)

A Boolean value that indicates whether the capture device performs automatic video frame rate adjustments.

### Supporting spatial capture

[`spatialCaptureDiscomfortReasons`](/documentation/AVFoundation/AVCaptureDevice/spatialCaptureDiscomfortReasons)

Reasons why current environmental conditions aren’t suitable to capturing spatial videos that are comfortable to view.

[`AVSpatialCaptureDiscomfortReason`](/documentation/AVFoundation/AVSpatialCaptureDiscomfortReason)

Constants that indicate the suitability of the current scene to create a comfortable viewing experience.

### Supporting Continuity Camera

[`systemPreferredCamera`](/documentation/AVFoundation/AVCaptureDevice/systemPreferredCamera)

A camera the system prefers to use for video and photo capture.

[`userPreferredCamera`](/documentation/AVFoundation/AVCaptureDevice/userPreferredCamera)

A camera the user prefers to use for video and photo capture.

[`isContinuityCamera`](/documentation/AVFoundation/AVCaptureDevice/isContinuityCamera)

A Boolean value that indicates whether the device is a Continuity Camera.

[`companionDeskViewCamera`](/documentation/AVFoundation/AVCaptureDevice/companionDeskViewCamera)

A Desk View camera associated with a device.

### Supporting system features

[System video effects and microphone modes](/documentation/AVFoundation/system-video-effects-and-microphone-modes)

Configure the state of system video effects like Center Stage, and inspect enhancements the system applies to microphone audio.

### Monitoring system pressure

[`systemPressureState`](/documentation/AVFoundation/AVCaptureDevice/systemPressureState-swift.property)

A value that indicates the capture device’s current system pressure state.

[`AVCaptureDevice.SystemPressureState`](/documentation/AVFoundation/AVCaptureDevice/SystemPressureState-swift.class)

An object that provides information about OS and hardware status affecting capture system performance and availability.

[`AVCaptureSessionInterruptionSystemPressureStateKey`](/documentation/AVFoundation/AVCaptureSessionInterruptionSystemPressureStateKey)

A key to retrieve a state value that indicates the system pressure level and contributing factors that caused the interruption.

### Restricting camera switching

[`setPrimaryConstituentDeviceSwitchingBehavior(_:restrictedSwitchingBehaviorConditions:)`](/documentation/AVFoundation/AVCaptureDevice/setPrimaryConstituentDeviceSwitchingBehavior(_:restrictedSwitchingBehaviorConditions:))

Sets the switching behavior of the primary constituent device.

[`primaryConstituentDeviceSwitchingBehavior`](/documentation/AVFoundation/AVCaptureDevice/primaryConstituentDeviceSwitchingBehavior-swift.property)

The switching behavior for the primary constituent device.

[`primaryConstituentDeviceRestrictedSwitchingBehaviorConditions`](/documentation/AVFoundation/AVCaptureDevice/primaryConstituentDeviceRestrictedSwitchingBehaviorConditions-swift.property)

The conditions that restrict the primary constituent device’s switching behavior.

[`activePrimaryConstituentDeviceSwitchingBehavior`](/documentation/AVFoundation/AVCaptureDevice/activePrimaryConstituentDeviceSwitchingBehavior)

The switching behavior of the active constituent device.

[`activePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions`](/documentation/AVFoundation/AVCaptureDevice/activePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions)

The conditions that restrict camera switching behavior for the active primary constituent device.

[`activePrimaryConstituent`](/documentation/AVFoundation/AVCaptureDevice/activePrimaryConstituent)

A virtual device’s active primary constituent device.

[`AVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior`](/documentation/AVFoundation/AVCaptureDevice/PrimaryConstituentDeviceSwitchingBehavior-swift.enum)

Constants that control when to allow a virtual device to switch its active primary constituent device.

[`AVCaptureDevice.PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions`](/documentation/AVFoundation/AVCaptureDevice/PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions-swift.struct)

A structure that defines the conditions in which to restrict camera switching.

[`supportedFallbackPrimaryConstituentDevices`](/documentation/AVFoundation/AVCaptureDevice/supportedFallbackPrimaryConstituentDevices)

The constituent devices available to select as a fallback for a longer focal length primary constituent device.

[`fallbackPrimaryConstituentDevices`](/documentation/AVFoundation/AVCaptureDevice/fallbackPrimaryConstituentDevices)

The fallback devices to use when a constituent device with a longer focal length becomes limited by its light sensitivity or minimum focus distance.

### Configuring macOS features

[macOS capture features](/documentation/AVFoundation/macos-capture-features)

Control the transport behavior and input sources of capture hardware in macOS.

### Accessing camera extrinsics

[`extrinsicMatrix(from:to:)`](/documentation/AVFoundation/AVCaptureDevice/extrinsicMatrix(from:to:))

Returns the relative extrinsic matrix from one capture device to another.

### Accessing the focal length

[`nominalFocalLengthIn35mmFilm`](/documentation/AVFoundation/AVCaptureDevice/nominalFocalLengthIn35mmFilm)

The nominal 35mm equivalent focal length of the capture device’s lens.

### Determining lens stabilization

[`AVCaptureDevice.LensStabilizationStatus`](/documentation/AVFoundation/AVCaptureDevice/LensStabilizationStatus)

Constants that indicate the status of optical image stabilization hardware during a bracketed photo capture.

### Configuring lens smudge detection

[`isCameraLensSmudgeDetectionEnabled`](/documentation/AVFoundation/AVCaptureDevice/isCameraLensSmudgeDetectionEnabled)

Whether camera lens smudge detection is enabled.

[`setCameraLensSmudgeDetectionEnabled(_:detectionInterval:)`](/documentation/AVFoundation/AVCaptureDevice/setCameraLensSmudgeDetectionEnabled(_:detectionInterval:))

Specify whether to enable camera lens smudge detection, and the interval time between each run of detections.

[`cameraLensSmudgeDetectionInterval`](/documentation/AVFoundation/AVCaptureDevice/cameraLensSmudgeDetectionInterval)

The camera lens smudge detection interval.

[`cameraLensSmudgeDetectionStatus`](/documentation/AVFoundation/AVCaptureDevice/cameraLensSmudgeDetectionStatus)

A value specifying the status of camera lens smudge detection.

[`AVCaptureCameraLensSmudgeDetectionStatus`](/documentation/AVFoundation/AVCaptureCameraLensSmudgeDetectionStatus)

Constants indicating the current camera lens smudge detection status.

### Synchronizing with external devices

[`isFollowingExternalSyncDevice`](/documentation/AVFoundation/AVCaptureDevice/isFollowingExternalSyncDevice)

Whether the device is following an external sync device.

[`minSupportedExternalSyncFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/minSupportedExternalSyncFrameDuration)

The minimum frame duration that can be passed as the `videoFrameDuration` when directing your device input to follow an external sync device.

[`isVideoFrameDurationLocked`](/documentation/AVFoundation/AVCaptureDevice/isVideoFrameDurationLocked)

Whether the device’s video frame rate (expressed as a duration) is currently locked.

[`minSupportedLockedVideoFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/minSupportedLockedVideoFrameDuration)

The maximum frame rate (expressed as a minimum duration) that can be set on an input associated with this device.



---

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)