<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:@E@AVError"
  },
  "title" : "AVError.Code"
}
-->

# AVError.Code

An enumeration that defines the errors that framework operations can generate.

```
enum Code
```

## Topics

### Error codes

[`AVErrorAirPlayControllerRequiresInternet`](/documentation/AVFoundation/AVError-swift.struct/Code/airPlayControllerRequiresInternet)

The AirPlay controller requires an internet connection to function.

[`AVErrorAirPlayReceiverRequiresInternet`](/documentation/AVFoundation/AVError-swift.struct/Code/airPlayReceiverRequiresInternet)

The AirPlay receiver requires an internet connection to function.

[`AVErrorAirPlayReceiverTemporarilyUnavailable`](/documentation/AVFoundation/AVError-swift.struct/Code/airPlayReceiverTemporarilyUnavailable)

An AirPlay receiver is temporarily unavailable.

[`AVErrorApplicationIsNotAuthorized`](/documentation/AVFoundation/AVError-swift.struct/Code/applicationIsNotAuthorized)

The app isn’t authorized to play media.

[`AVErrorApplicationIsNotAuthorizedToUseDevice`](/documentation/AVFoundation/AVError-swift.struct/Code/applicationIsNotAuthorizedToUseDevice)

The user denied this app permission to capture media.

[`AVErrorAutoWhiteBalanceNotLocked`](/documentation/AVFoundation/AVError-swift.struct/Code/autoWhiteBalanceNotLocked)

[`AVErrorContentKeyInvalid`](/documentation/AVFoundation/AVError-c.enum/AVErrorContentKeyInvalid)

[`AVErrorContentKeyRequestPlaybackDestinationDoesNotSupportDeviceIdentifierRandomization`](/documentation/AVFoundation/AVError-c.enum/AVErrorContentKeyRequestPlaybackDestinationDoesNotSupportDeviceIdentifierRandomization)

[`AVErrorCompositionTrackSegmentsNotContiguous`](/documentation/AVFoundation/AVError-swift.struct/Code/compositionTrackSegmentsNotContiguous)

The composition can’t add the source media because it contains gaps.

[`AVErrorContentIsNotAuthorized`](/documentation/AVFoundation/AVError-swift.struct/Code/contentIsNotAuthorized)

The user isn’t authorized to play the media.

[`AVErrorContentIsProtected`](/documentation/AVFoundation/AVError-swift.struct/Code/contentIsProtected)

The app isn’t authorized to open the media.

[`AVErrorContentIsUnavailable`](/documentation/AVFoundation/AVError-swift.struct/Code/contentIsUnavailable)

The captured content is unavailable.

[`AVErrorContentKeyRequestCancelled`](/documentation/AVFoundation/AVError-swift.struct/Code/contentKeyRequestCancelled)

The app canceled a request to retrieve a content key.

[`AVErrorContentNotUpdated`](/documentation/AVFoundation/AVError-swift.struct/Code/contentNotUpdated)

The system couldn’t update the captured content.

[`AVErrorCreateContentKeyRequestFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/createContentKeyRequestFailed)

The app couldn’t create a content key request.

[`AVErrorDecodeFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/decodeFailed)

The system failed to decode the media.

[`AVErrorDecoderNotFound`](/documentation/AVFoundation/AVError-swift.struct/Code/decoderNotFound)

The system can’t find a suitable decoder for the media.

[`AVErrorDecoderTemporarilyUnavailable`](/documentation/AVFoundation/AVError-swift.struct/Code/decoderTemporarilyUnavailable)

A suitable decoder for the media is temporarily available.

[`AVErrorDeviceAlreadyUsedByAnotherSession`](/documentation/AVFoundation/AVError-swift.struct/Code/deviceAlreadyUsedByAnotherSession)

Your app can’t access the device because another session is currently using it.

[`AVErrorDeviceInUseByAnotherApplication`](/documentation/AVFoundation/AVError-swift.struct/Code/deviceInUseByAnotherApplication)

Your app can’t access the device because another app is currently using it.

[`AVErrorDeviceIsNotAvailableInBackground`](/documentation/AVFoundation/AVError-swift.struct/Code/deviceIsNotAvailableInBackground)

You attempted to start a capture session in the background, which isn’t allowed in iOS.

[`AVErrorDeviceLockedForConfigurationByAnotherProcess`](/documentation/AVFoundation/AVError-swift.struct/Code/deviceLockedForConfigurationByAnotherProcess)

Your app can’t change device settings because another process currently controls the device.

[`AVErrorDeviceNotConnected`](/documentation/AVFoundation/AVError-swift.struct/Code/deviceNotConnected)

You app can’t access the device because it isn’t connected.

[`AVErrorDeviceWasDisconnected`](/documentation/AVFoundation/AVError-swift.struct/Code/deviceWasDisconnected)

A previously connected device is no longer accessible.

[`AVErrorDiskFull`](/documentation/AVFoundation/AVError-swift.struct/Code/diskFull)

Recording stopped because the disk is full.

[`AVErrorDisplayWasDisabled`](/documentation/AVFoundation/AVError-swift.struct/Code/displayWasDisabled)

Screen capture failed because the display was inactive.

[`AVErrorEncodeFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/encodeFailed)

The system couldn’t encode the media data.

[`AVErrorEncoderNotFound`](/documentation/AVFoundation/AVError-swift.struct/Code/encoderNotFound)

The requested encoder isn’t found.

[`AVErrorEncoderTemporarilyUnavailable`](/documentation/AVFoundation/AVError-swift.struct/Code/encoderTemporarilyUnavailable)

An appropriate encoder isn’t currently available.

[`AVErrorExportFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/exportFailed)

The requested export operation failed.

[`AVErrorExternalPlaybackNotSupportedForAsset`](/documentation/AVFoundation/AVError-swift.struct/Code/externalPlaybackNotSupportedForAsset)

The current asset doesn’t support playback.

[`AVErrorFailedToLoadMediaData`](/documentation/AVFoundation/AVError-swift.struct/Code/failedToLoadMediaData)

The system can’t load the requested media data.

[`AVErrorFailedToLoadSampleData`](/documentation/AVFoundation/AVError-swift.struct/Code/failedToLoadSampleData)

The system can’t load the requested sample data.

[`AVErrorFailedToParse`](/documentation/AVFoundation/AVError-swift.struct/Code/failedToParse)

The system can’t parse the media.

[`AVErrorFileAlreadyExists`](/documentation/AVFoundation/AVError-swift.struct/Code/fileAlreadyExists)

A file with the same name exists at the location and you can’t overwrite it.

[`AVErrorFileFailedToParse`](/documentation/AVFoundation/AVError-swift.struct/Code/fileFailedToParse)

The file is corrupt or in an unrecognized format.

[`AVErrorFileFormatNotRecognized`](/documentation/AVFoundation/AVError-swift.struct/Code/fileFormatNotRecognized)

The system can’t open the file because it’s in an unrecognized format.

[`AVErrorFileTypeDoesNotSupportSampleReferences`](/documentation/AVFoundation/AVError-swift.struct/Code/fileTypeDoesNotSupportSampleReferences)

The file type doesn’t support sample references.

[`AVErrorFollowExternalSyncDeviceTimedOut`](/documentation/AVFoundation/AVError-swift.struct/Code/followExternalSyncDeviceTimedOut)

[`AVErrorFormatUnsupported`](/documentation/AVFoundation/AVError-swift.struct/Code/formatUnsupported)

The current asset format isn’t supported.

[`AVErrorIncompatibleAsset`](/documentation/AVFoundation/AVError-swift.struct/Code/incompatibleAsset)

You can’t display the media because the device isn’t capable of playing the content.

[`AVErrorIncorrectlyConfigured`](/documentation/AVFoundation/AVError-swift.struct/Code/incorrectlyConfigured)

The system is incorrectly configured for the requested operation.

[`AVErrorInvalidCompositionTrackSegmentDuration`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidCompositionTrackSegmentDuration)

You can’t add the source media because its duration in the destination is invalid.

[`AVErrorInvalidCompositionTrackSegmentSourceDuration`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidCompositionTrackSegmentSourceDuration)

You can’t add the source media because it has no duration.

[`AVErrorInvalidCompositionTrackSegmentSourceStartTime`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidCompositionTrackSegmentSourceStartTime)

You can’t add the source media because its start time in the destination is invalid.

[`AVErrorInvalidOutputURLPathExtension`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidOutputURLPathExtension)

The path extension of the output URL is invalid.

[`AVErrorInvalidSampleCursor`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidSampleCursor)

An invalid sample cursor produced an error.

[`AVErrorInvalidSourceMedia`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidSourceMedia)

The system couldn’t read the source media.

[`AVErrorInvalidVideoComposition`](/documentation/AVFoundation/AVError-swift.struct/Code/invalidVideoComposition)

You attempted to present an unsupported video composition.

[`AVErrorMalformedDepth`](/documentation/AVFoundation/AVError-swift.struct/Code/malformedDepth)

The depth data isn’t properly structured.

[`AVErrorMaximumDurationReached`](/documentation/AVFoundation/AVError-swift.struct/Code/maximumDurationReached)

The recording stopped because it reached the file’s maximum duration.

[`AVErrorMaximumFileSizeReached`](/documentation/AVFoundation/AVError-swift.struct/Code/maximumFileSizeReached)

The recording stopped because it reached the file’s maximum size.

[`AVErrorMaximumNumberOfSamplesForFileFormatReached`](/documentation/AVFoundation/AVError-swift.struct/Code/maximumNumberOfSamplesForFileFormatReached)

The recording stopped because it reached the file’s maximum number of samples.

[`AVErrorMaximumStillImageCaptureRequestsExceeded`](/documentation/AVFoundation/AVError-swift.struct/Code/maximumStillImageCaptureRequestsExceeded)

Your app can’t take a photo because there are too many unfinished photo capture requests.

[`AVErrorMediaChanged`](/documentation/AVFoundation/AVError-swift.struct/Code/mediaChanged)

Recording stopped because the format of the source media changed.

[`AVErrorMediaDiscontinuity`](/documentation/AVFoundation/AVError-swift.struct/Code/mediaDiscontinuity)

Recording stopped because there was an interruption in the input media.

[`AVErrorMediaExtensionConflict`](/documentation/AVFoundation/AVError-swift.struct/Code/mediaExtensionConflict)

[`AVErrorMediaExtensionDisabled`](/documentation/AVFoundation/AVError-swift.struct/Code/mediaExtensionDisabled)

[`AVErrorMediaServicesWereReset`](/documentation/AVFoundation/AVError-swift.struct/Code/mediaServicesWereReset)

The system couldn’t perform the operation because media services were unavailable.

[`AVErrorNoCompatibleAlternatesForExternalDisplay`](/documentation/AVFoundation/AVError-swift.struct/Code/noCompatibleAlternatesForExternalDisplay)

The system found no compatible external displays.

[`AVErrorNoDataCaptured`](/documentation/AVFoundation/AVError-swift.struct/Code/noDataCaptured)

The recording failed because the system received no data.

[`AVErrorNoImageAtTime`](/documentation/AVFoundation/AVError-swift.struct/Code/noImageAtTime)

No image is available in the media at the indicated time.

[`AVErrorNoLongerPlayable`](/documentation/AVFoundation/AVError-swift.struct/Code/noLongerPlayable)

The asset is no longer playable.

[`AVErrorNoSmartFramingsEnabled`](/documentation/AVFoundation/AVError-swift.struct/Code/noSmartFramingsEnabled)

[`AVErrorNoSourceTrack`](/documentation/AVFoundation/AVError-swift.struct/Code/noSourceTrack)

The asset doesn’t contain a source track.

[`AVErrorOperationCancelled`](/documentation/AVFoundation/AVError-swift.struct/Code/operationCancelled)

The asset handled a request to cancel loading a property value asynchronously.

[`AVErrorOperationInterrupted`](/documentation/AVFoundation/AVError-swift.struct/Code/operationInterrupted)

An interruption occurred while performing a reading or writing operation.

[`AVErrorOperationNotAllowed`](/documentation/AVFoundation/AVError-swift.struct/Code/operationNotAllowed)

The requested operation isn’t allowed.

[`AVErrorOperationNotSupportedForAsset`](/documentation/AVFoundation/AVError-swift.struct/Code/operationNotSupportedForAsset)

Your app attempted to perform an unsupported operation with the asset.

[`AVErrorOperationNotSupportedForPreset`](/documentation/AVFoundation/AVError-swift.struct/Code/operationNotSupportedForPreset)

Your app attempted to perform an unsupported operation for the current preset.

[`AVErrorOutOfMemory`](/documentation/AVFoundation/AVError-swift.struct/Code/outOfMemory)

The operation couldn’t finish because there isn’t enough memory available to process the media.

[`AVErrorRecordingAlreadyInProgress`](/documentation/AVFoundation/AVError-swift.struct/Code/recordingAlreadyInProgress)

Your app attempted to start recording a movie file while an existing recording is underway.

[`AVErrorReferenceForbiddenByReferencePolicy`](/documentation/AVFoundation/AVError-swift.struct/Code/referenceForbiddenByReferencePolicy)

The current reference restrictions prevent the system from loading referenced media.

[`AVErrorRosettaNotInstalled`](/documentation/AVFoundation/AVError-swift.struct/Code/rosettaNotInstalled)

The system doesn’t have Rosetta installed and can’t perform the requested operation.

[`AVErrorSandboxExtensionDenied`](/documentation/AVFoundation/AVError-swift.struct/Code/sandboxExtensionDenied)

The system denied issuing the sandbox extension.

[`AVErrorScreenCaptureFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/screenCaptureFailed)

An unexpected problem occurred that prevented screen capture.

[`AVErrorSegmentStartedWithNonSyncSample`](/documentation/AVFoundation/AVError-swift.struct/Code/segmentStartedWithNonSyncSample)

The operation attempted to write a new MPEG-4 segment that didn’t start with a sync sample.

[`AVErrorServerIncorrectlyConfigured`](/documentation/AVFoundation/AVError-swift.struct/Code/serverIncorrectlyConfigured)

The configuration of the HTTP server that streams the media resource isn’t correct.

[`AVErrorSessionConfigurationChanged`](/documentation/AVFoundation/AVError-swift.struct/Code/sessionConfigurationChanged)

Recording stopped because the configuration of media sources and destinations changed.

[`AVErrorSessionHardwareCostOverage`](/documentation/AVFoundation/AVError-swift.struct/Code/sessionHardwareCostOverage)

Your app requested too many camera hardware resources.

[`AVErrorSessionNotRunning`](/documentation/AVFoundation/AVError-swift.struct/Code/sessionNotRunning)

The recording couldn’t start because the session isn’t running.

[`AVErrorSessionWasInterrupted`](/documentation/AVFoundation/AVError-swift.struct/Code/sessionWasInterrupted)

The recording stopped because the system interrupted the audio session.

[`AVErrorToneMappingFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/toneMappingFailed)

The requested tone mapping failed.

[`AVErrorTorchLevelUnavailable`](/documentation/AVFoundation/AVError-swift.struct/Code/torchLevelUnavailable)

The specified torch level is valid but currently unavailable, possibly due to overheating.

[`AVErrorUndecodableMediaData`](/documentation/AVFoundation/AVError-swift.struct/Code/undecodableMediaData)

The system couldn’t decode the media data.

[`AVErrorUnknown`](/documentation/AVFoundation/AVError-swift.struct/Code/unknown)

An unknown error occurred.

[`AVErrorUnsupportedDeviceActiveFormat`](/documentation/AVFoundation/AVError-swift.struct/Code/unsupportedDeviceActiveFormat)

The capture session doesn’t support the camera device’s active format.

[`AVErrorUnsupportedOutputSettings`](/documentation/AVFoundation/AVError-swift.struct/Code/unsupportedOutputSettings)

Your app requested unsupported output settings.

[`AVErrorVideoCompositorFailed`](/documentation/AVFoundation/AVError-swift.struct/Code/videoCompositorFailed)

The compositor couldn’t composite video frames.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)