iOS Developer Library

Developer

AVFoundation Framework Reference AV Foundation Error Constants

Options
Deployment Target:

On This Page
Language:

AV Foundation Error Constants

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

This document describes the error constants defined in the AV Foundation framework that are not described in individual classes.

Constants

  • Constant to identify the AVFoundation error domain.

    Declaration

    Swift

    let AVFoundationErrorDomain: String

    Objective-C

    const NSString *AVFoundationErrorDomain;

    Constants

    • AVFoundationErrorDomain

      AVFoundationErrorDomain

      Domain for AVFoundation errors.

      Available in iOS 4.0 and later.

  • Keys in the user info dictionary in errors AVFoundation creates.

    Declaration

    Swift

    let AVErrorDeviceKey: String let AVErrorTimeKey: String let AVErrorFileSizeKey: String let AVErrorPIDKey: String let AVErrorRecordingSuccessfullyFinishedKey: String let AVErrorMediaTypeKey: String let AVErrorMediaSubTypeKey: String

    Objective-C

    NSString *const AVErrorDeviceKey; NSString *const AVErrorTimeKey; NSString *const AVErrorFileSizeKey; NSString *const AVErrorPIDKey; NSString *const AVErrorRecordingSuccessfullyFinishedKey; NSString *const AVErrorMediaTypeKey; NSString *const AVErrorMediaSubTypeKey;

    Constants

    • AVErrorDeviceKey

      AVErrorDeviceKey

      The corresponding value is an NSString object with the name of the device.

      Available in iOS 4.0 and later.

    • AVErrorTimeKey

      AVErrorTimeKey

      The corresponding value is an NSValue object containing a CMTime.

      Available in iOS 4.0 and later.

    • AVErrorFileSizeKey

      AVErrorFileSizeKey

      The corresponding value is an NSNumber object containing the size of the file in bytes.

      Available in iOS 4.0 and later.

    • AVErrorPIDKey

      AVErrorPIDKey

      The corresponding value is an NSNumber object containing a process ID number.

      Available in iOS 4.0 and later.

    • AVErrorRecordingSuccessfullyFinishedKey

      AVErrorRecordingSuccessfullyFinishedKey

      The corresponding value is an NSNumber object with a Boolean value indicating whether recording finished successfully.

      Available in iOS 4.0 and later.

    • AVErrorMediaTypeKey

      AVErrorMediaTypeKey

      The corresponding value is an NSString object that specifies a media type such as video, audio, or metadata. For a list of possible values, see AV Foundation Constants Reference.

      Available in iOS 4.3 and later.

    • AVErrorMediaSubTypeKey

      AVErrorMediaSubTypeKey

      The corresponding value is an array of NSNumber objects that specify media subtypes. The types are represented by four character codes (4ccs), as defined in CoreAudioTypes.h for audio media and in CMFormatDescription.h for video media.

      Available in iOS 4.3 and later.

  • Codes that specify an error. These may appear in NSError objects returned by various AVFoundation methods.

    Declaration

    Swift

    enum AVError : Int { case Unknown case OutOfMemory case SessionNotRunning case DeviceAlreadyUsedByAnotherSession case NoDataCaptured case SessionConfigurationChanged case DiskFull case DeviceWasDisconnected case MediaChanged case MaximumDurationReached case MaximumFileSizeReached case MediaDiscontinuity case MaximumNumberOfSamplesForFileFormatReached case DeviceNotConnected case DeviceInUseByAnotherApplication case DeviceLockedForConfigurationByAnotherProcess case SessionWasInterrupted case MediaServicesWereReset case ExportFailed case DecodeFailed case InvalidSourceMedia case FileAlreadyExists case CompositionTrackSegmentsNotContiguous case InvalidCompositionTrackSegmentDuration case InvalidCompositionTrackSegmentSourceStartTime case InvalidCompositionTrackSegmentSourceDuration case FileFormatNotRecognized case FileFailedToParse case MaximumStillImageCaptureRequestsExceeded case ContentIsProtected case NoImageAtTime case DecoderNotFound case EncoderNotFound case ContentIsNotAuthorized case ApplicationIsNotAuthorized case DeviceIsNotAvailableInBackground case OperationNotSupportedForAsset case DecoderTemporarilyUnavailable case EncoderTemporarilyUnavailable case InvalidVideoComposition case ReferenceForbiddenByReferencePolicy case InvalidOutputURLPathExtension case ScreenCaptureFailed case DisplayWasDisabled case TorchLevelUnavailable case OperationInterrupted case IncompatibleAsset case FailedToLoadMediaData case ServerIncorrectlyConfigured case ApplicationIsNotAuthorizedToUseDevice case FailedToParse case FileTypeDoesNotSupportSampleReferences case UndecodableMediaData case AirPlayControllerRequiresInternet case AirPlayReceiverRequiresInternet }

    Objective-C

    enum { AVErrorUnknown = -11800, AVErrorOutOfMemory = -11801, AVErrorSessionNotRunning = -11803, AVErrorDeviceAlreadyUsedByAnotherSession = -11804, AVErrorNoDataCaptured = -11805, AVErrorSessionConfigurationChanged = -11806, AVErrorDiskFull = -11807, AVErrorDeviceWasDisconnected = -11808, AVErrorMediaChanged = -11809, AVErrorMaximumDurationReached = -11810, AVErrorMaximumFileSizeReached = -11811, AVErrorMediaDiscontinuity = -11812, AVErrorMaximumNumberOfSamplesForFileFormatReached = -11813, AVErrorDeviceNotConnected = -11814, AVErrorDeviceInUseByAnotherApplication = -11815, AVErrorDeviceLockedForConfigurationByAnotherProcess = -11817, AVErrorSessionWasInterrupted = -11818, AVErrorMediaServicesWereReset = -11819, AVErrorExportFailed = -11820, AVErrorDecodeFailed = -11821, AVErrorInvalidSourceMedia = -11822, AVErrorFileAlreadyExists = -11823, AVErrorCompositionTrackSegmentsNotContiguous = -11824, AVErrorInvalidCompositionTrackSegmentDuration = -11825, AVErrorInvalidCompositionTrackSegmentSourceStartTime = -11826, AVErrorInvalidCompositionTrackSegmentSourceDuration = -11827, AVErrorFileFormatNotRecognized = -11828, AVErrorFileFailedToParse = -11829, AVErrorMaximumStillImageCaptureRequestsExceeded = -11830, AVErrorContentIsProtected = -11831, AVErrorNoImageAtTime = -11832, AVErrorDecoderNotFound = -11833, AVErrorEncoderNotFound = -11834, AVErrorContentIsNotAuthorized = -11835, AVErrorApplicationIsNotAuthorized = -11836, AVErrorDeviceIsNotAvailableInBackground = -11837, AVErrorOperationNotSupportedForAsset = -11838, AVErrorDecoderTemporarilyUnavailable = -11839, AVErrorEncoderTemporarilyUnavailable = -11840, AVErrorInvalidVideoComposition = -11841, AVErrorReferenceForbiddenByReferencePolicy = -11842, AVErrorInvalidOutputURLPathExtension = -11843, AVErrorScreenCaptureFailed = -11844, AVErrorDisplayWasDisabled = -11845, AVErrorTorchLevelUnavailable = -11846, AVErrorOperationInterrupted = -11847, AVErrorIncompatibleAsset = -11848, AVErrorFailedToLoadMediaData = -11849, AVErrorServerIncorrectlyConfigured = -11850, AVErrorApplicationIsNotAuthorizedToUseDevice = -11852, };

    Constants

    • Unknown

      AVErrorUnknown

      Reason for the error is unknown.

      Available in iOS 4.0 and later.

    • OutOfMemory

      AVErrorOutOfMemory

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

      Available in iOS 4.0 and later.

    • SessionNotRunning

      AVErrorSessionNotRunning

      Recording could not be started because no data is being captured.

      Available in iOS 4.0 and later.

    • DeviceAlreadyUsedByAnotherSession

      AVErrorDeviceAlreadyUsedByAnotherSession

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

      Available in iOS 4.0 and later.

    • NoDataCaptured

      AVErrorNoDataCaptured

      Recording failed because no data was received.

      Available in iOS 4.0 and later.

    • SessionConfigurationChanged

      AVErrorSessionConfigurationChanged

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

      Available in iOS 4.0 and later.

    • DiskFull

      AVErrorDiskFull

      Recording stopped because the disk is getting full.

      Available in iOS 4.0 and later.

    • DeviceWasDisconnected

      AVErrorDeviceWasDisconnected

      Recording stopped because the device was turned off or disconnected.

      Available in iOS 4.0 and later.

    • MediaChanged

      AVErrorMediaChanged

      Recording stopped because the format of the source media changed.

      Available in iOS 4.0 and later.

    • MaximumDurationReached

      AVErrorMaximumDurationReached

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

      Available in iOS 4.0 and later.

    • MaximumFileSizeReached

      AVErrorMaximumFileSizeReached

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

      Available in iOS 4.0 and later.

    • MediaDiscontinuity

      AVErrorMediaDiscontinuity

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

      Available in iOS 4.0 and later.

    • MaximumNumberOfSamplesForFileFormatReached

      AVErrorMaximumNumberOfSamplesForFileFormatReached

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

      Available in iOS 4.0 and later.

    • DeviceNotConnected

      AVErrorDeviceNotConnected

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

      Available in iOS 4.0 and later.

    • DeviceInUseByAnotherApplication

      AVErrorDeviceInUseByAnotherApplication

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

      Available in iOS 4.0 and later.

    • DeviceLockedForConfigurationByAnotherProcess

      AVErrorDeviceLockedForConfigurationByAnotherProcess

      Settings for the device could not be changed because the device is being controlled by another application.

      Available in iOS 4.0 and later.

    • SessionWasInterrupted

      AVErrorSessionWasInterrupted

      Recording stopped because it was interrupted.

      Available in iOS 4.0 and later.

    • MediaServicesWereReset

      AVErrorMediaServicesWereReset

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

      Available in iOS 4.0 and later.

    • ExportFailed

      AVErrorExportFailed

      The export could not be completed.

      Available in iOS 4.0 and later.

    • DecodeFailed

      AVErrorDecodeFailed

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

      Available in iOS 4.0 and later.

    • InvalidSourceMedia

      AVErrorInvalidSourceMedia

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

      Available in iOS 4.0 and later.

    • FileAlreadyExists

      AVErrorFileAlreadyExists

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

      Available in iOS 4.0 and later.

    • CompositionTrackSegmentsNotContiguous

      AVErrorCompositionTrackSegmentsNotContiguous

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

      Available in iOS 4.0 and later.

    • InvalidCompositionTrackSegmentDuration

      AVErrorInvalidCompositionTrackSegmentDuration

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

      Available in iOS 4.0 and later.

    • InvalidCompositionTrackSegmentSourceStartTime

      AVErrorInvalidCompositionTrackSegmentSourceStartTime

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

      Available in iOS 4.0 and later.

    • InvalidCompositionTrackSegmentSourceDuration

      AVErrorInvalidCompositionTrackSegmentSourceDuration

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

      Available in iOS 4.0 and later.

    • FileFormatNotRecognized

      AVErrorFileFormatNotRecognized

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

      Available in iOS 4.0 and later.

    • FileFailedToParse

      AVErrorFileFailedToParse

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

      Available in iOS 4.0 and later.

    • MaximumStillImageCaptureRequestsExceeded

      AVErrorMaximumStillImageCaptureRequestsExceeded

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

      Available in iOS 4.0 and later.

    • ContentIsProtected

      AVErrorContentIsProtected

      The application is not authorized to open the media.

      Available in iOS 4.0 and later.

    • NoImageAtTime

      AVErrorNoImageAtTime

      There is no image at that time in the media.

      Available in iOS 4.0 and later.

    • DecoderNotFound

      AVErrorDecoderNotFound

      The decoder for the given media was not found

      The error’s userInfo may contain values for the keys AVErrorMediaTypeKey and AVErrorMediaSubTypeKey, if they are available.

      Available in iOS 4.3 and later.

    • EncoderNotFound

      AVErrorEncoderNotFound

      The requested encoder was not found.

      The error’s userInfo may contain values for the keys AVErrorMediaTypeKey and AVErrorMediaSubTypeKey, if they are available.

      Available in iOS 4.3 and later.

    • ContentIsNotAuthorized

      AVErrorContentIsNotAuthorized

      The user is not authorized to play the media.

      Available in iOS 4.3 and later.

    • ApplicationIsNotAuthorized

      AVErrorApplicationIsNotAuthorized

      The application is not authorized to play media.

      Available in iOS 4.3 and later.

    • DeviceIsNotAvailableInBackground

      AVErrorDeviceIsNotAvailableInBackground

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

      Available in iOS 4.3 and later.

    • OperationNotSupportedForAsset

      AVErrorOperationNotSupportedForAsset

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

      Available in iOS 5.0 and later.

    • DecoderTemporarilyUnavailable

      AVErrorDecoderTemporarilyUnavailable

      The appropriate decoder is currently not available.

      The error’s userInfo may contain AVErrorMediaTypeKey and AVErrorMediaSubTypeKey, if they are available.

      Available in iOS 5.0 and later.

    • EncoderTemporarilyUnavailable

      AVErrorEncoderTemporarilyUnavailable

      The appropriate encoder is currently not available.

      The error’s userInfo may contain AVErrorMediaTypeKey and AVErrorMediaSubTypeKey, if they are available.

      Available in iOS 5.0 and later.

    • InvalidVideoComposition

      AVErrorInvalidVideoComposition

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

      Available in iOS 5.0 and later.

    • ReferenceForbiddenByReferencePolicy

      AVErrorReferenceForbiddenByReferencePolicy

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

      Available in iOS 5.0 and later.

    • InvalidOutputURLPathExtension

      AVErrorInvalidOutputURLPathExtension

      The path extension of the URL was invalid.

      Available in iOS 5.1 and later.

    • ScreenCaptureFailed

      AVErrorScreenCaptureFailed

      Screen capture failed.

      Available in iOS 6.0 and later.

    • DisplayWasDisabled

      AVErrorDisplayWasDisabled

      Screen capture failed because the display was inactive.

      Available in iOS 6.0 and later.

    • TorchLevelUnavailable

      AVErrorTorchLevelUnavailable

      The specified torch level is valid but currently unavailable. This might be due to the device being overheated currently.

      Available in iOS 6.0 and later.

    • OperationInterrupted

      AVErrorOperationInterrupted

      An interruption occurred while an AVAssetWriter, AVAssetReader or AVAssetExportSession was executing. One such interruption is when an app runs a reader, writer or export and then transitions to the background before execution finishes.

      Available in iOS 6.0 and later.

    • IncompatibleAsset

      AVErrorIncompatibleAsset

      The media could not be displayed because the iOS device is not capable of playing the content. This might occur if the device does not support playing a particular video profile level.

      Available in iOS 6.0 and later.

    • FailedToLoadMediaData

      AVErrorFailedToLoadMediaData

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

      Available in iOS 6.0 and later.

    • ServerIncorrectlyConfigured

      AVErrorServerIncorrectlyConfigured

      The HTTP server sending the media resource is not configured as expected. This might mean that the server does not support byte range requests.

      Available in iOS 6.0 and later.

    • ApplicationIsNotAuthorizedToUseDevice

      AVErrorApplicationIsNotAuthorizedToUseDevice

      The user has denied this application permission for media capture.

      Available in iOS 7.0 and later.