AV Foundation Error Constants

Framework
AVFoundation/AVFoundation.h
Declared in
AVError.h

Overview

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

Constants

Error Domain

Constant to identify the AVFoundation error domain.

const NSString *AVFoundationErrorDomain;
Constants
AVFoundationErrorDomain

Domain for AVFoundation errors.

Available in iOS 4.0 and later.

Declared in AVError.h.

Error User Info Keys

Keys in the user info dictionary in errors AVFoundation creates.

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

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorTimeKey

The corresponding value is an NSValue object containing a CMTime.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorFileSizeKey

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorPIDKey

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorRecordingSuccessfullyFinishedKey

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

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

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.

Declared in AVError.h.

Error Codes

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

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
AVErrorUnknown

Reason for the error is unknown.

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorSessionNotRunning

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

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorNoDataCaptured

Recording failed because no data was received.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorSessionConfigurationChanged

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorDiskFull

Recording stopped because the disk is getting full.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorDeviceWasDisconnected

Recording stopped because the device was turned off or disconnected.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorMediaChanged

Recording stopped because the format of the source media changed.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorMaximumDurationReached

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorMaximumFileSizeReached

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorMediaDiscontinuity

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorMaximumNumberOfSamplesForFileFormatReached

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorDeviceNotConnected

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorDeviceInUseByAnotherApplication

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

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorSessionWasInterrupted

Recording stopped because it was interrupted.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorMediaServicesWereReset

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorExportFailed

The export could not be completed.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorDecodeFailed

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorInvalidSourceMedia

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

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorCompositionTrackSegmentsNotContiguous

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorInvalidCompositionTrackSegmentDuration

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorInvalidCompositionTrackSegmentSourceStartTime

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorInvalidCompositionTrackSegmentSourceDuration

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

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorFileFormatNotRecognized

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

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorContentIsProtected

The application is not authorized to open the media.

Available in iOS 4.0 and later.

Declared in AVError.h.

AVErrorNoImageAtTime

There is no image at that time in the media.

Available in iOS 4.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorContentIsNotAuthorized

The user is not authorized to play the media.

Available in iOS 4.3 and later.

Declared in AVError.h.

AVErrorApplicationIsNotAuthorized

The application is not authorized to play media.

Available in iOS 4.3 and later.

Declared in AVError.h.

AVErrorDeviceIsNotAvailableInBackground

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

Available in iOS 4.3 and later.

Declared in AVError.h.

AVErrorOperationNotSupportedForAsset

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

Available in iOS 5.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorInvalidVideoComposition

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

Available in iOS 5.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorInvalidOutputURLPathExtension

The path extension of the URL was invalid.

Available in iOS 5.1 and later.

Declared in AVError.h.

AVErrorScreenCaptureFailed

Screen capture failed.

Available in iOS 6.0 and later.

Declared in AVError.h.

AVErrorDisplayWasDisabled

Screen capture failed because the display was inactive.

Available in iOS 6.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

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.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorFailedToLoadMediaData

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

Available in iOS 6.0 and later.

Declared in AVError.h.

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.

Declared in AVError.h.

AVErrorApplicationIsNotAuthorizedToUseDevice

The user has denied this application permission for media capture.

Available in iOS 7.0 and later.

Declared in AVError.h.