Enumeration

AVError.Code

An enumeration of possible error codes encountered in AVCapture.

Declaration

enum AVError.Code : Int, _ErrorCodeProtocol

Topics

Error Codes

case airPlayControllerRequiresInternet

The AirPlay controller requires internet to function.

case airPlayReceiverRequiresInternet

The AirPlay receiver requires internet to function.

case applicationIsNotAuthorized

The application is not authorized to play media.

case applicationIsNotAuthorizedToUseDevice

The user has denied this application permission for media capture.

case compositionTrackSegmentsNotContiguous

The source media can’t be added because it contains gaps.

case contentIsNotAuthorized

The user is not authorized to play the media.

case contentIsProtected

The application is not authorized to open the media.

case contentIsUnavailable

Captured content is unavailable.

case contentNotUpdated

Captured content couldn’t be updated.

case createContentKeyRequestFailed

The app couldn’t create a content key request.

case decodeFailed

The decoding of the source media failed.

case decoderNotFound

The decoder for the given media was not found.

case decoderTemporarilyUnavailable

The appropriate decoder is currently not available.

case deviceAlreadyUsedByAnotherSession

The device is already in use by another session.

case deviceInUseByAnotherApplication

The device could not be opened because it is in use by another application.

case deviceIsNotAvailableInBackground

You attempted to start a capture session in the background, which is not allowed on iOS.

Deprecated
case deviceLockedForConfigurationByAnotherProcess

You cannot change the settings for the device because another app process is controlling the device.

case deviceNotConnected

The device could not be opened because it is not connected or turned on.

case deviceWasDisconnected

Recording stopped because the device was turned off or disconnected.

case diskFull

Recording stopped because the disk is getting full.

case displayWasDisabled

Screen capture failed because the display was inactive.

case encoderNotFound

The requested encoder was not found.

case encoderTemporarilyUnavailable

The appropriate encoder is currently not available.

case exportFailed

The export was unable to finish successfully.

case externalPlaybackNotSupportedForAsset

The current asset doesn’t support playback.

case failedToLoadMediaData

The media resource does not contain all of the data required and cannot be loaded.

case failedToParse

AVFoundation couldn’t parse the media.

case fileAlreadyExists

The file could not be created because a file with the same name already exists in the same location.

case fileFailedToParse

The media could not be opened because the file is damaged or not in a recognized format.

case fileFormatNotRecognized

The media could not be opened because it is not in a recognized format.

case fileTypeDoesNotSupportSampleReferences

The file type doesn’t support sample references.

case formatUnsupported

The current asset format isn’t supported.

case incompatibleAsset

You cannot display the media because the iOS device is not capable of playing the content.

case invalidCompositionTrackSegmentDuration

You cannot add the source media because its duration in the destination is invalid.

case invalidCompositionTrackSegmentSourceDuration

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

case invalidCompositionTrackSegmentSourceStartTime

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

case invalidOutputURLPathExtension

The path extension of the URL was invalid.

case invalidSourceMedia

The operation could not complete because some source media could not be read.

case invalidVideoComposition

You attempted to perform a video composition operation that is not supported.

case malformedDepth

The depth data wasn’t properly structured.

case maximumDurationReached

Recording stopped because the maximum duration for the file was reached.

case maximumFileSizeReached

Recording stopped because the maximum size for the file was reached.

case maximumNumberOfSamplesForFileFormatReached

Recording stopped because the maximum number of samples for the file was reached.

case maximumStillImageCaptureRequestsExceeded

The photo could not be taken because there are too many photo requests that haven’t completed yet.

case mediaChanged

Recording stopped because the format of the source media changed.

case mediaDiscontinuity

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

case mediaServicesWereReset

The operation could not be completed because media services became unavailable.

case noCompatibleAlternatesForExternalDisplay

No compatible external displays were found.

case noDataCaptured

Recording failed because no data was received.

case noImageAtTime

There is no image at that time in the media.

case noLongerPlayable

The asset is no longer playable.

case noSourceTrack

The asset has no source track.

case operationInterrupted

An interruption occurred while an AVAssetWriter, AVAssetReader or AVAssetExportSession was executing.

case operationNotAllowed

The user requested an unsupported operation.

case operationNotSupportedForAsset

You attempted to perform an operation with the asset that is not supported.

case operationNotSupportedForPreset

You attempted to perform an operation that’s not supported for the current preset.

Beta
case outOfMemory

The operation could not be completed because there is not enough memory to process all of the media.

case recordingAlreadyInProgress

Movie file output on iOS supports only one recording at a time.

case referenceForbiddenByReferencePolicy

You attempted to perform an operation with the asset that attempted to follow a reference that was not allowed.

case screenCaptureFailed

There was an unexpected problem that prevented screen capture.

case serverIncorrectlyConfigured

The HTTP server sending the media resource is not configured as expected.

case sessionConfigurationChanged

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

case sessionHardwareCostOverage

You requested too many camera hardware resources.

Beta
case sessionNotRunning

Recording could not start because the session isn’t running.

case sessionWasInterrupted

Recording stopped because it was interrupted.

case torchLevelUnavailable

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

case undecodableMediaData

The media data could not be decoded.

case unknown

Reason for the error is unknown.

case unsupportedDeviceActiveFormat

The device’s active format is not supported for the requested action.

Beta
case unsupportedOutputSettings

The user requested unsupported output settings.

case videoCompositorFailed

The video compositor couldn’t composite frames.

See Also

Error Constants

static var airPlayControllerRequiresInternet: AVError.Code

The AirPlay controller requires internet to function.

static var airPlayReceiverRequiresInternet: AVError.Code

The AirPlay receiver requires internet to function.

static var applicationIsNotAuthorized: AVError.Code

The application is not authorized to play media.

static var applicationIsNotAuthorizedToUseDevice: AVError.Code

The user has denied this application permission for media capture.

static var compositionTrackSegmentsNotContiguous: AVError.Code

The source media can’t be added because it contains gaps.

static var contentIsNotAuthorized: AVError.Code

The user is not authorized to play the media.

static var contentIsProtected: AVError.Code

The application is not authorized to open the media.

static var contentIsUnavailable: AVError.Code

Captured content is unavailable.

static var contentNotUpdated: AVError.Code

Captured content couldn’t be updated.

static var createContentKeyRequestFailed: AVError.Code

The app couldn't create a content key request.

static var decodeFailed: AVError.Code

The operation could not be completed because some source media could not be decoded.

static var decoderNotFound: AVError.Code

The decoder for the given media was not found.

static var decoderTemporarilyUnavailable: AVError.Code

The appropriate decoder is currently not available.

static var deviceAlreadyUsedByAnotherSession: AVError.Code

Media could not be captured from the device because it is already in use elsewhere in this application.

static var deviceInUseByAnotherApplication: AVError.Code

The device could not be opened because it is in use by another application.

static var deviceIsNotAvailableInBackground: AVError.Code

You attempted to start a capture session in the background, which is not allowed on iOS.

Deprecated
static var deviceLockedForConfigurationByAnotherProcess: AVError.Code

You cannot change the settings for the device because another app process is controlling the device.

static var deviceNotConnected: AVError.Code

The device could not be opened because it is not connected or turned on.

static var deviceWasDisconnected: AVError.Code

Recording stopped because the device was turned off or disconnected.

static var diskFull: AVError.Code

Recording stopped because the disk is getting full.

static var displayWasDisabled: AVError.Code

Screen capture failed because the display was inactive.

static var encoderNotFound: AVError.Code

The requested encoder was not found.

static var encoderTemporarilyUnavailable: AVError.Code

The appropriate encoder is currently not available.

static var exportFailed: AVError.Code

The export could not be completed.

static var externalPlaybackNotSupportedForAsset: AVError.Code

The current asset doesn’t support playback.

static var failedToLoadMediaData: AVError.Code

The media resource does not contain all of the data required and cannot be loaded.

static var failedToParse: AVError.Code

The media resource couldn’t be parsed and cannot be loaded.

static var fileAlreadyExists: AVError.Code

The file couldn’t be created because a file with the same name already exists in the same location.

static var fileFailedToParse: AVError.Code

The media couldn't be parsed.

static var fileFormatNotRecognized: AVError.Code

The media could not be opened because it is not in a recognized format.

static var fileTypeDoesNotSupportSampleReferences: AVError.Code

The file type doesn’t support sample references.

static var formatUnsupported: AVError.Code

The current asset format isn’t supported.

static var incompatibleAsset: AVError.Code

The media could not be displayed because the iOS device is not capable of playing the content.

static var invalidCompositionTrackSegmentDuration: AVError.Code

The source media can’t be added because its duration in the destination is invalid.

static var invalidCompositionTrackSegmentSourceDuration: AVError.Code

The source media can’t be added because it has no duration.

static var invalidCompositionTrackSegmentSourceStartTime: AVError.Code

The source media can’t be added because its start time in the destination is invalid.

static var invalidOutputURLPathExtension: AVError.Code

The path extension of the URL was invalid.

static var invalidSourceMedia: AVError.Code

The operation could not be completed because some source media could not be read.

static var invalidVideoComposition: AVError.Code

You attempted to perform a video composition operation that is not supported.

static var malformedDepth: AVError.Code

The depth data wasn’t properly structured.

static var maximumDurationReached: AVError.Code

Recording stopped because the maximum duration for the file was reached.

static var maximumFileSizeReached: AVError.Code

Recording stopped because the maximum size for the file was reached.

static var maximumNumberOfSamplesForFileFormatReached: AVError.Code

Recording stopped because the maximum number of samples for the file was reached.

static var maximumStillImageCaptureRequestsExceeded: AVError.Code

The photo could not be taken because there are too many photo requests that haven’t completed yet.

static var mediaChanged: AVError.Code

Recording stopped because the format of the source media changed.

static var mediaDiscontinuity: AVError.Code

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

static var mediaServicesWereReset: AVError.Code

The operation could not be completed because media services became unavailable.

static var noDataCaptured: AVError.Code

Recording failed because no data was received.

static var noImageAtTime: AVError.Code

There is no image at that time in the media.

static var noLongerPlayable: AVError.Code

The asset is no longer playable.

static var noSourceTrack: AVError.Code

The asset has no source track.

static var operationNotAllowed: AVError.Code

The user requested an unsupported operation.

static var operationNotSupportedForAsset: AVError.Code

You attempted to perform an operation with the asset that is not supported.

static var operationNotSupportedForPreset: AVError.Code

You attempted to perform an operation that’s not supported for the current preset.

Beta
static var outOfMemory: AVError.Code

The operation could not be completed because there is not enough memory to process all of the media.

static var recordingAlreadyInProgress: AVError.Code

Movie file output on iOS supports only one recording at a time.

static var referenceForbiddenByReferencePolicy: AVError.Code

The asset attempted to follow a reference that was not allowed.

static var screenCaptureFailed: AVError.Code

There was an unexpected problem that prevented screen capture.

static var serverIncorrectlyConfigured: AVError.Code

The HTTP server sending the media resource is not configured as expected.

static var sessionConfigurationChanged: AVError.Code

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

static var sessionHardwareCostOverage: AVError.Code

You requested too many camera hardware resources.

Beta
static var sessionNotRunning: AVError.Code

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

static var sessionWasInterrupted: AVError.Code

Recording stopped because it was interrupted.

static var torchLevelUnavailable: AVError.Code

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

static var undecodableMediaData: AVError.Code

The media data could not be decoded.

static var unknown: AVError.Code

Reason for the error is unknown.

static var unsupportedOutputSettings: AVError.Code

The user requested unsupported output settings.

static var videoCompositorFailed: AVError.Code

The video compositor couldn’t composite frames.

static func != (AVError, AVError) -> Bool

Returns a Boolean value indicating whether two values are not equal.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software