<!--
{
  "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

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

The AirPlay controller requires an internet connection to function.

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

The AirPlay receiver requires an internet connection to function.

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

An AirPlay receiver is temporarily unavailable.

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

The app isn’t authorized to play media.

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

The user denied this app permission to capture media.

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

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

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

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

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

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

The user isn’t authorized to play the media.

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

The app isn’t authorized to open the media.

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

The captured content is unavailable.

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

The app canceled a request to retrieve a content key.

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

The system couldn’t update the captured content.

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

The app couldn’t create a content key request.

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

The system failed to decode the media.

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

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

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

A suitable decoder for the media is temporarily available.

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

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

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

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

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

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

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

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

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

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

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

A previously connected device is no longer accessible.

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

Recording stopped because the disk is full.

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

Screen capture failed because the display was inactive.

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

The system couldn’t encode the media data.

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

The requested encoder isn’t found.

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

An appropriate encoder isn’t currently available.

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

The requested export operation failed.

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

The current asset doesn’t support playback.

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

The system can’t load the requested media data.

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

The system can’t load the requested sample data.

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

The system can’t parse the media.

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

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

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

The file is corrupt or in an unrecognized format.

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

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

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

The file type doesn’t support sample references.

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

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

The current asset format isn’t supported.

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

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

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

The system is incorrectly configured for the requested operation.

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

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

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

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

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

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

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

The path extension of the output URL is invalid.

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

An invalid sample cursor produced an error.

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

The system couldn’t read the source media.

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

You attempted to present an unsupported video composition.

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

The depth data isn’t properly structured.

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

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

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

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

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

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

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

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

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

Recording stopped because the format of the source media changed.

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

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

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

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

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

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

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

The system found no compatible external displays.

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

The recording failed because the system received no data.

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

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

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

The asset is no longer playable.

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

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

The asset doesn’t contain a source track.

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

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

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

An interruption occurred while performing a reading or writing operation.

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

The requested operation isn’t allowed.

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

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

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

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

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

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

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

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

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

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

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

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

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

The system denied issuing the sandbox extension.

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

An unexpected problem occurred that prevented screen capture.

[`AVError.Code.segmentStartedWithNonSyncSample`](/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.

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

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

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

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

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

Your app requested too many camera hardware resources.

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

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

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

The recording stopped because the system interrupted the audio session.

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

The requested tone mapping failed.

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

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

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

The system couldn’t decode the media data.

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

An unknown error occurred.

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

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

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

Your app requested unsupported output settings.

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

The compositor couldn’t composite video frames.



---

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)