---
title: AVCaptureDevice
framework: avfoundation
role: symbol
role_heading: Class
path: avfoundation/avcapturedevice
---

# AVCaptureDevice

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

## Declaration

```swift
class AVCaptureDevice
```

## Mentioned in

Choosing a capture device Enhancing your app experience with the Camera Control Requesting authorization to capture and save media Setting up a capture session

## Overview

Overview Capture devices provide media data to capture session inputs that you connect to an 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, or by calling the 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() 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() 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](avfoundation/avcapturedevice/discoverysession.md)
- [default(_:for:position:)](avfoundation/avcapturedevice/default(_:for:position:).md)
- [default(for:)](avfoundation/avcapturedevice/default(for:).md)
- [init(uniqueID:)](avfoundation/avcapturedevice/init(uniqueid:).md)
- [wasConnectedNotification](avfoundation/avcapturedevice/wasconnectednotification.md)
- [wasDisconnectedNotification](avfoundation/avcapturedevice/wasdisconnectednotification.md)
- [devices(for:)](avfoundation/avcapturedevice/devices(for:).md)
- [devices()](avfoundation/avcapturedevice/devices().md)

### Authorizing device access

- [requestAccess(for:completionHandler:)](avfoundation/avcapturedevice/requestaccess(for:completionhandler:).md)
- [authorizationStatus(for:)](avfoundation/avcapturedevice/authorizationstatus(for:).md)
- [AVAuthorizationStatus](avfoundation/avauthorizationstatus.md)

### Identifying a device

- [uniqueID](avfoundation/avcapturedevice/uniqueid.md)
- [modelID](avfoundation/avcapturedevice/modelid.md)
- [localizedName](avfoundation/avcapturedevice/localizedname.md)
- [manufacturer](avfoundation/avcapturedevice/manufacturer.md)
- [deviceType](avfoundation/avcapturedevice/devicetype-swift.property.md)
- [AVCaptureDevice.DeviceType](avfoundation/avcapturedevice/devicetype-swift.struct.md)
- [position](avfoundation/avcapturedevice/position-swift.property.md)
- [AVCaptureDevice.Position](avfoundation/avcapturedevice/position-swift.enum.md)

### Accessing device state

- [isConnected](avfoundation/avcapturedevice/isconnected.md)
- [isSuspended](avfoundation/avcapturedevice/issuspended.md)
- [isInUseByAnotherApplication](avfoundation/avcapturedevice/isinusebyanotherapplication.md)

### Inspecting device characteristics

- [isVirtualDevice](avfoundation/avcapturedevice/isvirtualdevice.md)
- [constituentDevices](avfoundation/avcapturedevice/constituentdevices.md)
- [hasMediaType(_:)](avfoundation/avcapturedevice/hasmediatype(_:).md)
- [transportType](avfoundation/avcapturedevice/transporttype.md)
- [supportsSessionPreset(_:)](avfoundation/avcapturedevice/supportssessionpreset(_:).md)

### Monitoring device rotation

- [AVCaptureDevice.RotationCoordinator](avfoundation/avcapturedevice/rotationcoordinator.md)

### Configuring camera hardware

- [lockForConfiguration()](avfoundation/avcapturedevice/lockforconfiguration().md)
- [unlockForConfiguration()](avfoundation/avcapturedevice/unlockforconfiguration().md)
- [isSubjectAreaChangeMonitoringEnabled](avfoundation/avcapturedevice/issubjectareachangemonitoringenabled.md)
- [subjectAreaDidChangeNotification](avfoundation/avcapturedevice/subjectareadidchangenotification.md)
- [Formats](avfoundation/capture-device-formats.md)
- [Focus](avfoundation/capture-device-focus.md)
- [Exposure](avfoundation/capture-device-exposure.md)
- [White balance](avfoundation/capture-device-white-balance.md)
- [Lighting](avfoundation/capture-device-lighting.md)
- [Color](avfoundation/capture-device-color.md)
- [Zoom](avfoundation/capture-device-zoom.md)

### Configuring Cinematic video

- [setCinematicVideoFixedFocus(at:focusMode:)](avfoundation/avcapturedevice/setcinematicvideofixedfocus(at:focusmode:).md)
- [setCinematicVideoTrackingFocus(at:focusMode:)](avfoundation/avcapturedevice/setcinematicvideotrackingfocus(at:focusmode:).md)
- [setCinematicVideoTrackingFocus(detectedObjectID:focusMode:)](avfoundation/avcapturedevice/setcinematicvideotrackingfocus(detectedobjectid:focusmode:).md)
- [AVCaptureDevice.CinematicVideoFocusMode](avfoundation/avcapturedevice/cinematicvideofocusmode.md)
- [AVCaptureSceneMonitoringStatus](avfoundation/avcapturescenemonitoringstatus.md)
- [notEnoughLight](avfoundation/avcapturescenemonitoringstatus/notenoughlight.md)
- [cinematicVideoCaptureSceneMonitoringStatuses](avfoundation/avcapturedevice/cinematicvideocapturescenemonitoringstatuses.md)

### Configuring smart framing

- [smartFramingMonitor](avfoundation/avcapturedevice/smartframingmonitor.md)
- [AVCaptureSmartFramingMonitor](avfoundation/avcapturesmartframingmonitor.md)
- [AVCaptureFraming](avfoundation/avcaptureframing.md)

### Configuring dynamic aspect ratio

- [setDynamicAspectRatio(_:completionHandler:)](avfoundation/avcapturedevice/setdynamicaspectratio(_:completionhandler:).md)
- [AVCaptureDevice.AspectRatio](avfoundation/avcapturedevice/aspectratio.md)
- [dynamicAspectRatio](avfoundation/avcapturedevice/dynamicaspectratio.md)
- [dynamicDimensions](avfoundation/avcapturedevice/dynamicdimensions.md)

### Enabling automatic frame rate

- [isAutoVideoFrameRateEnabled](avfoundation/avcapturedevice/isautovideoframerateenabled.md)

### Supporting spatial capture

- [spatialCaptureDiscomfortReasons](avfoundation/avcapturedevice/spatialcapturediscomfortreasons.md)
- [AVSpatialCaptureDiscomfortReason](avfoundation/avspatialcapturediscomfortreason.md)

### Supporting Continuity Camera

- [systemPreferredCamera](avfoundation/avcapturedevice/systempreferredcamera.md)
- [userPreferredCamera](avfoundation/avcapturedevice/userpreferredcamera.md)
- [isContinuityCamera](avfoundation/avcapturedevice/iscontinuitycamera.md)
- [companionDeskViewCamera](avfoundation/avcapturedevice/companiondeskviewcamera.md)

### Supporting system features

- [System video effects and microphone modes](avfoundation/system-video-effects-and-microphone-modes.md)

### Monitoring system pressure

- [systemPressureState](avfoundation/avcapturedevice/systempressurestate-swift.property.md)
- [AVCaptureDevice.SystemPressureState](avfoundation/avcapturedevice/systempressurestate-swift.class.md)
- [AVCaptureSessionInterruptionSystemPressureStateKey](avfoundation/avcapturesessioninterruptionsystempressurestatekey.md)

### Restricting camera switching

- [setPrimaryConstituentDeviceSwitchingBehavior(_:restrictedSwitchingBehaviorConditions:)](avfoundation/avcapturedevice/setprimaryconstituentdeviceswitchingbehavior(_:restrictedswitchingbehaviorconditions:).md)
- [primaryConstituentDeviceSwitchingBehavior](avfoundation/avcapturedevice/primaryconstituentdeviceswitchingbehavior-swift.property.md)
- [primaryConstituentDeviceRestrictedSwitchingBehaviorConditions](avfoundation/avcapturedevice/primaryconstituentdevicerestrictedswitchingbehaviorconditions-swift.property.md)
- [activePrimaryConstituentDeviceSwitchingBehavior](avfoundation/avcapturedevice/activeprimaryconstituentdeviceswitchingbehavior.md)
- [activePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions](avfoundation/avcapturedevice/activeprimaryconstituentdevicerestrictedswitchingbehaviorconditions.md)
- [activePrimaryConstituent](avfoundation/avcapturedevice/activeprimaryconstituent.md)
- [AVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior](avfoundation/avcapturedevice/primaryconstituentdeviceswitchingbehavior-swift.enum.md)
- [AVCaptureDevice.PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions](avfoundation/avcapturedevice/primaryconstituentdevicerestrictedswitchingbehaviorconditions-swift.struct.md)
- [supportedFallbackPrimaryConstituentDevices](avfoundation/avcapturedevice/supportedfallbackprimaryconstituentdevices.md)
- [fallbackPrimaryConstituentDevices](avfoundation/avcapturedevice/fallbackprimaryconstituentdevices.md)

### Configuring macOS features

- [macOS capture features](avfoundation/macos-capture-features.md)

### Accessing camera extrinsics

- [extrinsicMatrix(from:to:)](avfoundation/avcapturedevice/extrinsicmatrix(from:to:).md)

### Accessing the focal length

- [nominalFocalLengthIn35mmFilm](avfoundation/avcapturedevice/nominalfocallengthin35mmfilm.md)

### Determining lens stabilization

- [AVCaptureDevice.LensStabilizationStatus](avfoundation/avcapturedevice/lensstabilizationstatus.md)

### Configuring lens smudge detection

- [isCameraLensSmudgeDetectionEnabled](avfoundation/avcapturedevice/iscameralenssmudgedetectionenabled.md)
- [setCameraLensSmudgeDetectionEnabled(_:detectionInterval:)](avfoundation/avcapturedevice/setcameralenssmudgedetectionenabled(_:detectioninterval:).md)
- [cameraLensSmudgeDetectionInterval](avfoundation/avcapturedevice/cameralenssmudgedetectioninterval.md)
- [cameraLensSmudgeDetectionStatus](avfoundation/avcapturedevice/cameralenssmudgedetectionstatus.md)
- [AVCaptureCameraLensSmudgeDetectionStatus](avfoundation/avcapturecameralenssmudgedetectionstatus.md)

### Synchronizing with external devices

- [isFollowingExternalSyncDevice](avfoundation/avcapturedevice/isfollowingexternalsyncdevice.md)
- [minSupportedExternalSyncFrameDuration](avfoundation/avcapturedevice/minsupportedexternalsyncframeduration.md)
- [isVideoFrameDurationLocked](avfoundation/avcapturedevice/isvideoframedurationlocked.md)
- [minSupportedLockedVideoFrameDuration](avfoundation/avcapturedevice/minsupportedlockedvideoframeduration.md)

### Type Properties

- [isEdgeLightActive](avfoundation/avcapturedevice/isedgelightactive.md)
- [isEdgeLightEnabled](avfoundation/avcapturedevice/isedgelightenabled.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Capture devices

- [Choosing a capture device](avfoundation/choosing-a-capture-device.md)
- [Adopting smart framing in your camera app](avfoundation/adopting-smart-framing-in-your-camera-app.md)
- [AVCaptureDeviceInput](avfoundation/avcapturedeviceinput.md)
- [AVContinuityDevice](avfoundation/avcontinuitydevice.md)
- [AVExternalStorageDevice](avfoundation/avexternalstoragedevice.md)
- [AVExternalStorageDeviceDiscoverySession](avfoundation/avexternalstoragedevicediscoverysession.md)
