AV Foundation Constants Reference
| Framework | AVFoundation/AVFoundation.h |
| Declared in | AVAnimation.h AVMediaFormat.h AVMetadataFormat.h AVVideoSettings.h |
Overview
This document describes constants defined in the AV Foundation framework not described in individual classes or in domain-specific constants references. See also:
Constants
Media Types
Constants to identify various media types.
NSString *const AVMediaTypeVideo; NSString *const AVMediaTypeAudio; NSString *const AVMediaTypeText; NSString *const AVMediaTypeClosedCaption; NSString *const AVMediaTypeSubtitle; NSString *const AVMediaTypeTimecode; NSString *const AVMediaTypeTimedMetadata; NSString *const AVMediaTypeMuxed;
Constants
AVMediaTypeVideoSpecifies video.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaTypeAudioSpecifies audio.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaTypeTextSpecifies text.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaTypeClosedCaptionSpecifies closed-caption content.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaTypeSubtitleSpecifies subtitles.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaTypeTimecodeSpecifies a time code.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaTypeTimedMetadataSpecifies timed metadata.
Available in OS X v10.7 through OS X v10.7.
Declared in
AVMediaFormat.h.AVMediaTypeMuxedSpecifies muxed media.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.
Video Gravity
These string constants define how the video is displayed within a layer’s bounds rectangle.
NSString * const AVLayerVideoGravityResize; NSString * const AVLayerVideoGravityResizeAspect; NSString * const AVLayerVideoGravityResizeAspectFill;
Constants
AVLayerVideoGravityResizeSpecifies that the video should be stretched to fill the layer’s bounds.
Available in OS X v10.7 and later.
Declared in
AVAnimation.h.AVLayerVideoGravityResizeAspectSpecifies that the player should preserve the video’s aspect ratio and fit the video within the layer’s bounds.
Available in OS X v10.7 and later.
Declared in
AVAnimation.h.AVLayerVideoGravityResizeAspectFillSpecifies that the player should preserve the video’s aspect ratio and fill the layer’s bounds.
Available in OS X v10.7 and later.
Declared in
AVAnimation.h.
Discussion
You use these constants when setting the videoGravity property of an AVPlayerLayer or AVCaptureVideoPreviewLayer instance.
Media Characteristics
Constants to specify the characteristics of media types.
NSString *const AVMediaCharacteristicVisual; NSString *const AVMediaCharacteristicAudible; NSString *const AVMediaCharacteristicLegible; NSString *const AVMediaCharacteristicFrameBased;
Constants
AVMediaCharacteristicVisualIndicates that the media is visual.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicAudibleIndicates that the media is audible.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicLegibleIndicates that the media is legible.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicFrameBasedIndicates that the media is frame-based.
Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.
Video Settings
These constants define dictionary keys for configuring video compression and compression settings for video assets.
NSString *const AVVideoCodecKey; NSString *const AVVideoCodecH264; NSString *const AVVideoCodecJPEG; NSString *const AVVideoCodecAppleProRes4444; NSString *const AVVideoCodecAppleProRes422; NSString *const AVVideoWidthKey; NSString *const AVVideoHeightKey; NSString *const AVVideoCompressionPropertiesKey; NSString *const AVVideoAverageBitRateKey; NSString *const AVVideoQualityKey; NSString *const AVVideoMaxKeyFrameIntervalKey; NSString *const AVVideoProfileLevelKey; NSString *const AVVideoProfileLevelH264Baseline30; NSString *const AVVideoProfileLevelH264Baseline31; NSString *const AVVideoProfileLevelH264Baseline41; NSString *const AVVideoProfileLevelH264Main30; NSString *const AVVideoProfileLevelH264Main31; NSString *const AVVideoProfileLevelH264Main32; NSString *const AVVideoProfileLevelH264Main41; NSString *const AVVideoPixelAspectRatioKey; NSString *const AVVideoPixelAspectRatioHorizontalSpacingKey; NSString *const AVVideoPixelAspectRatioVerticalSpacingKey; NSString *const AVVideoCleanApertureKey; NSString *const AVVideoCleanApertureWidthKey; NSString *const AVVideoCleanApertureHeightKey; NSString *const AVVideoCleanApertureHorizontalOffsetKey; NSString *const AVVideoCleanApertureVerticalOffsetKey;
Constants
AVVideoCodecKeySpecifies a key to access the name of the codec used to encode the video.
The corresponding value is an instance of
NSString; equivalent toCMVideoCodecType.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCodecH264Specifies that the video was encoded using H264.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCodecJPEGSpecifies that the video was encoded using the JPEG encoder.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCodecAppleProRes4444Specifies that the video was encoded using the Apple ProRes 4444 encoder.
Files are identified with the .ap4h extension.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCodecAppleProRes422Specifies that the video was encoded using the ProRes 422 Standard Definition encoder.
Files are identified with the .apcn extension.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoWidthKeySpecifies a key to access the width of the video in pixels.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoHeightKeySpecifies a key to access the height of the video in pixels.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCompressionPropertiesKeySpecifies a key to access the compression properties.
The corresponding value is an instance of
NSDictionary.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoAverageBitRateKeySpecifies a key to access the average bit rate (as bits per second) used in encoding.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoQualityKeySpecifies a key to access the JPEG coded quality.
The corresponding value is an instance of
NSNumber0.0-1.0.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoMaxKeyFrameIntervalKeySpecifies a key to access the maximum interval between key frames.
The corresponding value is an instance of
NSNumber.1means key frames only.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelKeySpecifies a key to access the video profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Baseline30Specifies a baseline level 3.0 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Baseline31Specifies a baseline level 3.1 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Baseline41Specifies a baseline level 4.1 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Main30Specifies a main level 3.0 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Main31Specifies a main level 3.1 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Main32Specifies a main level 3.2 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoProfileLevelH264Main41Specifies a main level 4.2 profile.
Available in OS X v10.8 and later.
Declared in
AVVideoSettings.h.AVVideoPixelAspectRatioKeySpecifies a key to access the pixel aspect ratio.
The corresponding value is an instance of
NSDictionary.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoPixelAspectRatioHorizontalSpacingKeySpecifies a key to access the pixel aspect ratio horizontal spacing.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoPixelAspectRatioVerticalSpacingKeySpecifies a key to access the pixel aspect ratio vertical spacing.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCleanApertureKeySpecifies a key to access the clean aperture.
The corresponding value is an instance of
NSDictionary.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCleanApertureWidthKeySpecifies a key to access the clean aperture width.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCleanApertureHeightKeySpecifies a key to access the clean aperture height.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCleanApertureHorizontalOffsetKeySpecifies a key to access the clean aperture horizontal offset.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoCleanApertureVerticalOffsetKeySpecifies a key to access the clean aperture vertical offset.
The corresponding value is an instance of
NSNumber.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.
File Format UTIs
These constants specify UTIs for various file formats.
NSString *const AVFileTypeAIFC; NSString *const AVFileTypeAIFF; NSString *const AVFileTypeAMR; NSString *const AVFileTypeCoreAudioFormat; NSString *const AVFileTypeAppleM4V; NSString *const AVFileTypeMPEG4; NSString *const AVFileTypeAppleM4A; NSString *const AVFileTypeQuickTimeMovie; NSString *const AVFileTypeWAVE;
Constants
AVFileTypeAIFCUTI for the AIFC audio file format.
The value of this UTI is
public.aifc-audio. Files are identified with the .aifc and .cdda extensions.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeAIFFUTI for the AIFF audio file format.
The value of this UTI is
public.aiff-audio. Files are identified with the .aif and .aiff extensions.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeCoreAudioFormatUTI for the CoreAudio file format.
The value of this UTI is
com.apple.coreaudio-format. Files are identified with the .caf extension.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeAppleM4VUTI for the iTunes video file format.
The value of this UTI is
com.apple.mpeg-4-video. Files are identified with the .m4v extension.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeMPEG4UTI for the MPEG-4 file format.
The value of this UTI is
public.mpeg-4. Files are identified with the .mp4 extension.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeAppleM4AUTI for the Apple m4a audio file format.
The value of this UTI is
com.apple.m4a-audio. Files are identified with the .m4a extension.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeQuickTimeMovieUTI for the QuickTime movie file format.
The value of this UTI is
com.apple.quicktime-movie. Files are identified with the .mov and .qt extensions.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeWAVEA UTI for the WAVE audio file format.
The value of this UTI is
com.microsoft.waveform-audio. Files are identified with the .wav, .wave, and .bwf extensions.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.AVFileTypeAMRUTI for the adaptive multi-rate audio file format.
The value of this UTI is
org.3gpp.adaptive-multi-rate-audio. Files are identified with the .amr extension.Available in OS X v10.7 and later.
Declared in
AVMediaFormat.h.
Core Animation
Support for integration with Core Animation.
const CFTimeInterval AVCoreAnimationBeginTimeAtZero
Constants
AVCoreAnimationBeginTimeAtZeroUse this constant to set the CoreAnimation's animation
beginTimeproperty to be time0.The constant is a small, non-zero, positive value which prevents CoreAnimation from replacing
0.0withCACurrentMediaTime.Available in OS X v10.7 and later.
Declared in
AVAnimation.h.
Video Color Properties
Key to specify video properties, and corresponding keys and values for the color primary, transfer function, and Y'CbCr matrix.
NSString *const AVVideoColorPropertiesKey; NSString *const AVVideoColorPrimariesKey; NSString *const AVVideoColorPrimaries_ITU_R_709_2; NSString *const AVVideoColorPrimaries_EBU_3213; NSString *const AVVideoColorPrimaries_SMPTE_C; NSString *const AVVideoTransferFunctionKey; NSString *const AVVideoTransferFunction_ITU_R_709_2; NSString *const AVVideoTransferFunction_SMPTE_240M_1995; NSString *const AVVideoYCbCrMatrixKey; NSString *const AVVideoYCbCrMatrix_ITU_R_709_2; NSString *const AVVideoYCbCrMatrix_ITU_R_601_4; NSString *const AVVideoYCbCrMatrix_SMPTE_240M_1995;
Constants
AVVideoColorPropertiesKeyThe key for a dictionary that contains properties specifying video color.
The dictionary must contain the keys
AVVideoColorPrimariesKey,AVVideoTransferFunctionKey, andAVVideoYCbCrMatrixKey.Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoColorPrimariesKeyThe key to identify color primaries in a color properties dictionary.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoColorPrimaries_ITU_R_709_2Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoColorPrimaries_EBU_3213Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoColorPrimaries_SMPTE_CAvailable in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoTransferFunctionKeyThe key to identify the transfer function in a color properties dictionary.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoTransferFunction_ITU_R_709_2Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoTransferFunction_SMPTE_240M_1995Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoYCbCrMatrixKeyThe key to identify the Y'CbCr matrix in a color properties dictionary.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoYCbCrMatrix_ITU_R_709_2Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoYCbCrMatrix_ITU_R_601_4Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoYCbCrMatrix_SMPTE_240M_1995Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.
Discussion
If you specify the AVVideoColorPropertiesKey, you must specify a color primary, transfer function, and Y'CbCr matrix. Typically you specify HD, which consists of AVVideoColorPrimaries_ITU_R_709_2 AVVideoTransferFunction_ITU_R_709_2, and AVVideoYCbCrMatrix_ITU_R_709_2.
If you require SD colorimetry use AVVideoColorPrimaries_SMPTE_C, AVVideoTransferFunction_ITU_R_709_2, and AVVideoYCbCrMatrix_ITU_R_601_4.
AVFoundation will color match if the source and destination color properties differ.
It is important that the source be tagged.
Video Scaling Mode
Constants to specify how video should be scaled to fit a given area.
NSString *const AVVideoScalingModeKey; NSString *const AVVideoScalingModeFit; NSString *const AVVideoScalingModeResize; NSString *const AVVideoScalingModeResizeAspect; NSString *const AVVideoScalingModeResizeAspectFill;
Constants
AVVideoScalingModeKeyA key to retrieve the video scaling mode from a dictionary.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoScalingModeFitCrop to remove edge processing region; preserve aspect ratio of cropped source by reducing specified width or height if necessary.
This mode does not scale a small source up to larger dimensions.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoScalingModeResizeCrop to remove edge processing region; scale remainder to destination area.
This mode does not preserve the aspect ratio.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoScalingModeResizeAspectPreserve aspect ratio of the source, and fill remaining areas with black to fit destination dimensions.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.AVVideoScalingModeResizeAspectFillPreserve aspect ratio of the source, and crop picture to fit destination dimensions.
Available in OS X v10.7 and later.
Declared in
AVVideoSettings.h.
Metadata Keys
Common metadata and common keys for metadata.
NSString *const AVMetadataKeySpaceCommon; NSString *const AVMetadataCommonKeyTitle; NSString *const AVMetadataCommonKeyCreator; NSString *const AVMetadataCommonKeySubject; NSString *const AVMetadataCommonKeyDescription; NSString *const AVMetadataCommonKeyPublisher; NSString *const AVMetadataCommonKeyContributor; NSString *const AVMetadataCommonKeyCreationDate; NSString *const AVMetadataCommonKeyLastModifiedDate; NSString *const AVMetadataCommonKeyType; NSString *const AVMetadataCommonKeyFormat; NSString *const AVMetadataCommonKeyIdentifier; NSString *const AVMetadataCommonKeySource; NSString *const AVMetadataCommonKeyLanguage; NSString *const AVMetadataCommonKeyRelation; NSString *const AVMetadataCommonKeyLocation; NSString *const AVMetadataCommonKeyCopyrights; NSString *const AVMetadataCommonKeyAlbumName; NSString *const AVMetadataCommonKeyAuthor; NSString *const AVMetadataCommonKeyArtist; NSString *const AVMetadataCommonKeyArtwork; NSString *const AVMetadataCommonKeyMake; NSString *const AVMetadataCommonKeyModel; NSString *const AVMetadataCommonKeySoftware;
Constants
AVMetadataKeySpaceCommonAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyTitleAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyCreatorAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeySubjectAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyDescriptionAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyPublisherAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyContributorAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyCreationDateAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyLastModifiedDateAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyTypeAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyFormatAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyIdentifierAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeySourceAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyLanguageAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyRelationAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyLocationAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyCopyrightsAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyAlbumNameAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyAuthorAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyArtistAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyArtworkAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyMakeAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeyModelAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.AVMetadataCommonKeySoftwareAvailable in OS X v10.7 and later.
Declared in
AVMetadataFormat.h.
AVMediaSelectionOption Constants
Media characteristic that may be present in an AVMediaSelectionOption object.
NSString *const AVMediaCharacteristicIsMainProgramContent; NSString *const AVMediaCharacteristicIsAuxiliaryContent; NSString *const AVMediaCharacteristicContainsOnlyForcedSubtitles; NSString *const AVMediaCharacteristicTranscribesSpokenDialogForAccessibility; NSString *const AVMediaCharacteristicDescribesMusicAndSoundForAccessibility; NSString *const AVMediaCharacteristicDescribesVideoForAccessibility;
Constants
AVMediaCharacteristicIsMainProgramContentIndicates that the option includes content that’s marked by the content author as intrinsic to the presentation of the asset.
Example: an option that presents the main program audio for the presentation, regardless of locale, would typically have this characteristic.
The value of this characteristic is
"public.main-program-content".The presence of this characteristic for a media option is inferred; any option that does not have the characteristic
AVMediaCharacteristicIsAuxiliaryContentis considered to have the characteristic.Available in OS X v10.8 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicIsAuxiliaryContentIndicates that the option includes content that’s marked by the content author as auxiliary to the presentation of the asset.
Example: an option that presents audio media containing commentary on the presentation would typically have this characteristic.
The value of this characteristic is
"public.auxiliary-content".For QuickTime movie and .m4v files, a media option is considered to have the characteristic
AVMediaCharacteristicIsAuxiliaryContentif it’s explicitly tagged with that characteristic or if, as a member of an alternate track group, its associated track is excluded from autoselection.Available in OS X v10.8 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicContainsOnlyForcedSubtitlesIndicates that the options presents only forced subtitles.
Media options with forced-only subtitles are typically selected when 1) the user has not selected a legible option with an accessibility characteristic or an auxiliary purpose and 2) its locale matches the locale of the selected audible media selection option.
The value of this characteristic is
"public.subtitles.forced-only".The presence of this characteristic for a legible media option is inferred from the format description of the associated track that presents the subtitle media.
Available in OS X v10.8 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicTranscribesSpokenDialogForAccessibilityIndicates that the option includes legible content in the language of its specified locale that transcribes spoken dialog.
It is possible for a legible media option to include both transcriptions of spoken dialog and descriptions of music and sound effects.
The value of this characteristic is
"public.accessibility.transcribes-spoken-dialog".For QuickTime movie and .m4v files, a media option is considered to have the characteristic
AVMediaCharacteristicTranscribesSpokenDialogForAccessibilityonly if it’s explicitly tagged with that characteristic.Available in OS X v10.8 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicDescribesMusicAndSoundForAccessibilityIndicates that the option includes legible content in the language of its specified locale that describes music and sound effects occurring in program audio.
It is possible for a legible media option to include both transcriptions of spoken dialog and descriptions of music and sound effects.
The value of this characteristic is
"public.accessibility.describes-music-and-sound".For QuickTime movie and .m4v files, a media option is considered to have the characteristic
AVMediaCharacteristicDescribesMusicAndSoundForAccessibilityonly if it’s explicitly tagged with that characteristic.Available in OS X v10.8 and later.
Declared in
AVMediaFormat.h.AVMediaCharacteristicDescribesVideoForAccessibilityIndicates that the option includes audible content that describes the visual portion of the presentation.
It is possible for a legible media option to include both transcriptions of spoken dialog and descriptions of music and sound effects.
The value of this characteristic is
"public.accessibility.describes-video".For QuickTime movie and .m4v files a media option is considered to have the characteristic
AVMediaCharacteristicDescribesVideoForAccessibilityonly if it’s explicitly tagged with that characteristic.Available in OS X v10.8 and later.
Declared in
AVMediaFormat.h.
Discussion
Each track of .mov files and .m4v files (that is, files of type AVFileTypeQuickTimeMovie and AVFileTypeAppleM4V) can optionally carry one or more tagged media characteristics, each of which declares a purpose, a trait, or some other distinguishing property of the track's media.
For example, a track containing audio that mixes original program content with additional narrative descriptions of visual action may be tagged with the media characteristic "public.accessibility.describes-video" in order to distinguish it from other audio tracks stored in the same file that do not contain additional narrative.
Each tagged media characteristic in .mov and .m4v files is stored in track userdata as a userdata item of type 'tagc' (represented as a FourCharCode) that consists of a standard atom header (size and type) followed by an array of US-ASCII characters (8-bit, high bit clear) comprising the value of the tag. The character array is not a C string; there is no terminating zero. The userdata item atom size is sum of the standard atom header size (8) and the size of the US-ASCII character array.
You can inspect the tagged media characteristics of a track as follows:
NSArray *trackUserDataItems = [myAVAssetTrack metadataForFormat:AVMetadataFormatQuickTimeUserData]; |
NSArray *trackTaggedMediaCharacteristics = [AVMetadataItem metadataItemsFromArray:trackUserDataItems |
withKey:AVMetadataQuickTimeUserDataKeyTaggedCharacteristic |
keySpace:AVMetadataKeySpaceQuickTimeUserData]; |
for (AVMetadataItem *metadataItem in trackTaggedMediaCharacteristics) { |
NSString *thisTrackMediaCharacteristic = [metadataItem stringValue]; |
} |
You can use hasMediaCharacteristic:] to determine whether a track has a particular media characteristic, whether the characteristic is inferred from its media type or format descriptions (such as AVMediaCharacteristicAudible or AVMediaCharacteristicContainsOnlyForcedSubtitles) or requires explicit tagging (such as AVMediaCharacteristicTranscribesSpokenDialogForAccessibility or AVMediaCharacteristicDescribesVideoForAccessibility). Note that explicit tagging can’t be used to override inferences from tracks' media types or format descriptions; for example:
[anAVAssetTrack hasMediaCharacteristic:AVMediaCharacteristicVisual] |
will return NO for any audio track, even if the track has been perversely tagged with the visual characteristic.
Tagged media characteristics can be written to the QuickTime userdata of an output track associated with an AVAssetWriterInput objectas follows, provided that the output file type of the asset writer is either AVFileTypeQuickTimeMovie or AVFileTypeAppleM4V:
AVMutableMetadataItem *myTaggedMediaCharacteristic = [[AVMutableMetadataItem alloc] init]; |
[myTaggedMediaCharacteristic setKey:AVMetadataQuickTimeUserDataKeyTaggedCharacteristic]; |
[myTaggedMediaCharacteristic setKeySpace:AVMetadataKeySpaceQuickTimeUserData]; |
[myTaggedMediaCharacteristic setValue:aMeaningfulCharacteristicAsNSString]; |
[myMutableArrayOfMetadata addObject:myTaggedMediaCharacteristic]; |
[myAssetWriterInput setMetadata:myMutableArrayOfMetadata]; |
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-06-06)