<!--
{
  "documentType" : "article",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/cmformatdescription-api",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CMFormatDescription"
}
-->

# CMFormatDescription

A media format descriptor that describes the samples in a sample buffer.

## Discussion

`CMFormatDescriptions` are immutable Core Foundation objects that describe media data of various types, including audio, video, and muxed media data. There are two types of API: media-type-agnostic APIs (supported by all CMFormatDescriptions) and media-type-specific APIs. The media-type-agnostic APIs are prefixed with `CMFormatDescription`, and the media-type-specific APIs are prefixed with `CMAudioFormatDescription`, `CMVideoFormatDescription`, and so on.

## Topics

### Creating Format Descriptions

[`func CMFormatDescriptionCreate(allocator: CFAllocator?, mediaType: CMMediaType, mediaSubType: FourCharCode, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMFormatDescriptionCreate(allocator:mediaType:mediaSubType:extensions:formatDescriptionOut:))

Creates a format description for general use.

### Comparing Format Descriptions

[`func CMFormatDescriptionEqual(CMFormatDescription?, otherFormatDescription: CMFormatDescription?) -> Bool`](/documentation/CoreMedia/CMFormatDescriptionEqual(_:otherFormatDescription:))

Returns a Boolean value that indicates whether two format descriptions are equal.

[`func CMFormatDescriptionEqualIgnoringExtensionKeys(CMFormatDescription?, otherFormatDescription: CMFormatDescription?, extensionKeysToIgnore: CFTypeRef?, sampleDescriptionExtensionAtomKeysToIgnore: CFTypeRef?) -> Bool`](/documentation/CoreMedia/CMFormatDescriptionEqualIgnoringExtensionKeys(_:otherFormatDescription:extensionKeysToIgnore:sampleDescriptionExtensionAtomKeysToIgnore:))

Returns a Boolean value that indicates whether two format descriptions are equal, ignoring differences in the extension keys you specify.

### Inspecting Format Descriptions

[`func CMFormatDescriptionGetMediaType(CMFormatDescription) -> CMMediaType`](/documentation/CoreMedia/CMFormatDescriptionGetMediaType(_:))

Returns the media type of a format description.

[`func CMFormatDescriptionGetMediaSubType(CMFormatDescription) -> FourCharCode`](/documentation/CoreMedia/CMFormatDescriptionGetMediaSubType(_:))

Returns the media subtype of a format description.

[`func CMFormatDescriptionGetExtension(CMFormatDescription, extensionKey: CFString) -> CFPropertyList?`](/documentation/CoreMedia/CMFormatDescriptionGetExtension(_:extensionKey:))

Returns an extension from the format description by using an extension key.

[`func CMFormatDescriptionGetExtensions(CMFormatDescription) -> CFDictionary?`](/documentation/CoreMedia/CMFormatDescriptionGetExtensions(_:))

Returns all of the extensions for a format description.

[`func CMFormatDescriptionGetTypeID() -> CFTypeID`](/documentation/CoreMedia/CMFormatDescriptionGetTypeID())

Returns the Core Foundation type identifier that identifies format description objects.

### Working with Audio Descriptions

[`struct CMSoundDescriptionFlavor`](/documentation/CoreMedia/CMSoundDescriptionFlavor)

Types that represent sound format descriptions.

[`func CMAudioFormatDescriptionCreateSummary(allocator: CFAllocator?, formatDescriptionArray: CFArray, flags: UInt32, formatDescriptionOut: UnsafeMutablePointer<CMAudioFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMAudioFormatDescriptionCreateSummary(allocator:formatDescriptionArray:flags:formatDescriptionOut:))

Creates a summary audio format description from an array of descriptions.

[`func CMAudioFormatDescriptionCreate(allocator: CFAllocator?, asbd: UnsafePointer<AudioStreamBasicDescription>, layoutSize: Int, layout: UnsafePointer<AudioChannelLayout>?, magicCookieSize: Int, magicCookie: UnsafeRawPointer?, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMAudioFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMAudioFormatDescriptionCreate(allocator:asbd:layoutSize:layout:magicCookieSize:magicCookie:extensions:formatDescriptionOut:))

Creates a format description for an audio media stream.

[`func CMAudioFormatDescriptionEqual(CMAudioFormatDescription, otherFormatDescription: CMAudioFormatDescription, equalityMask: CMAudioFormatDescriptionMask, equalityMaskOut: UnsafeMutablePointer<CMAudioFormatDescriptionMask>?) -> Bool`](/documentation/CoreMedia/CMAudioFormatDescriptionEqual(_:otherFormatDescription:equalityMask:equalityMaskOut:))

Returns a Boolean value that indicates whether the two audio format descriptions are equal.

[`func CMAudioFormatDescriptionGetChannelLayout(CMAudioFormatDescription, sizeOut: UnsafeMutablePointer<Int>?) -> UnsafePointer<AudioChannelLayout>?`](/documentation/CoreMedia/CMAudioFormatDescriptionGetChannelLayout(_:sizeOut:))

Returns a read-only pointer to, and the size of, the audio channel layout inside an audio format description.

[`func CMAudioFormatDescriptionGetFormatList(CMAudioFormatDescription, sizeOut: UnsafeMutablePointer<Int>?) -> UnsafePointer<AudioFormatListItem>?`](/documentation/CoreMedia/CMAudioFormatDescriptionGetFormatList(_:sizeOut:))

Returns a read-only pointer to, and size of, the array of audio format list item structures in an audio format description.

[`func CMAudioFormatDescriptionGetMagicCookie(CMAudioFormatDescription, sizeOut: UnsafeMutablePointer<Int>?) -> UnsafeRawPointer?`](/documentation/CoreMedia/CMAudioFormatDescriptionGetMagicCookie(_:sizeOut:))

Returns a read-only pointer to, and size of, the magic cookie in an audio format description.

[`func CMAudioFormatDescriptionGetMostCompatibleFormat(CMAudioFormatDescription) -> UnsafePointer<AudioFormatListItem>?`](/documentation/CoreMedia/CMAudioFormatDescriptionGetMostCompatibleFormat(_:))

Returns a read-only pointer to the appropriate audio format list item in an audio format description.

[`func CMAudioFormatDescriptionGetRichestDecodableFormat(CMAudioFormatDescription) -> UnsafePointer<AudioFormatListItem>?`](/documentation/CoreMedia/CMAudioFormatDescriptionGetRichestDecodableFormat(_:))

Returns a read-only pointer to the appropriate audio format list item in an audio format description.

[`func CMAudioFormatDescriptionGetStreamBasicDescription(CMAudioFormatDescription) -> UnsafePointer<AudioStreamBasicDescription>?`](/documentation/CoreMedia/CMAudioFormatDescriptionGetStreamBasicDescription(_:))

Returns a read-only pointer to the audio stream description in an audio format description.

[`func CMDoesBigEndianSoundDescriptionRequireLegacyCBRSampleTableLayout(CMBlockBuffer, flavor: CMSoundDescriptionFlavor?) -> Bool`](/documentation/CoreMedia/CMDoesBigEndianSoundDescriptionRequireLegacyCBRSampleTableLayout(_:flavor:))

Returns a Boolean value that indicates whether the sample tables need to use the legacy constant bit-rate encoding layout.

[`func CMSwapBigEndianSoundDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapBigEndianSoundDescriptionToHost(_:_:))

Converts a sound description data structure from big-endian to host-endian, in place.

[`func CMSwapHostEndianSoundDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapHostEndianSoundDescriptionToBig(_:_:))

Converts a sound description data structure from host-endian to big-endian, in place.

[`func CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionData(allocator: CFAllocator?, bigEndianSoundDescriptionData: UnsafePointer<UInt8>, size: Int, flavor: CMSoundDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMAudioFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionData(allocator:bigEndianSoundDescriptionData:size:flavor:formatDescriptionOut:))

Creates an audio format description from a big-endian sound description data structure.

[`func CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionBlockBuffer(allocator: CFAllocator?, bigEndianSoundDescriptionBlockBuffer: CMBlockBuffer, flavor: CMSoundDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMAudioFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionBlockBuffer(allocator:bigEndianSoundDescriptionBlockBuffer:flavor:formatDescriptionOut:))

Creates an audio format description from a big-endian sound description data structure in a buffer.

[`func CMAudioFormatDescriptionCopyAsBigEndianSoundDescriptionBlockBuffer(allocator: CFAllocator?, audioFormatDescription: CMAudioFormatDescription, flavor: CMSoundDescriptionFlavor?, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus`](/documentation/CoreMedia/CMAudioFormatDescriptionCopyAsBigEndianSoundDescriptionBlockBuffer(allocator:audioFormatDescription:flavor:blockBufferOut:))

Copies the contents of an audio format description to a buffer in big-endian byte ordering.

### Working with Video Descriptions

[`struct CMImageDescriptionFlavor`](/documentation/CoreMedia/CMImageDescriptionFlavor)

Types that represent image format descriptions.

[`func CMVideoFormatDescriptionCreate(allocator: CFAllocator?, codecType: CMVideoCodecType, width: Int32, height: Int32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCreate(allocator:codecType:width:height:extensions:formatDescriptionOut:))

Creates a format description for a video media stream.

[`func CMVideoFormatDescriptionCreateForImageBuffer(allocator: CFAllocator?, imageBuffer: CVImageBuffer, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:))

Creates a format description for a video media stream by using an image buffer.

[`func CMVideoFormatDescriptionGetCleanAperture(CMVideoFormatDescription, originIsAtTopLeft: Bool) -> CGRect`](/documentation/CoreMedia/CMVideoFormatDescriptionGetCleanAperture(_:originIsAtTopLeft:))

Returns a rectangle that defines the portion of the encoded pixel dimensions that represent the image data that’s valid for displaying.

[`func CMVideoFormatDescriptionGetDimensions(CMVideoFormatDescription) -> CMVideoDimensions`](/documentation/CoreMedia/CMVideoFormatDescriptionGetDimensions(_:))

Returns the video dimensions, in encoded pixels.

[`func CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers() -> CFArray`](/documentation/CoreMedia/CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers())

Returns an array of keys that you use for video format description extensions, image buffer attachments, and attributes.

[`func CMVideoFormatDescriptionGetPresentationDimensions(CMVideoFormatDescription, usePixelAspectRatio: Bool, useCleanAperture: Bool) -> CGSize`](/documentation/CoreMedia/CMVideoFormatDescriptionGetPresentationDimensions(_:usePixelAspectRatio:useCleanAperture:))

Returns the dimensions after taking the pixel aspect ratio and clean aperture into account.

[`func CMVideoFormatDescriptionMatchesImageBuffer(CMVideoFormatDescription, imageBuffer: CVImageBuffer) -> Bool`](/documentation/CoreMedia/CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:))

Returns a Boolean value that indicates whether a format description matches an image buffer.

[`func CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator: CFAllocator?, parameterSetCount: Int, parameterSetPointers: UnsafePointer<UnsafePointer<UInt8>>, parameterSetSizes: UnsafePointer<Int>, nalUnitHeaderLength: Int32, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:formatDescriptionOut:))

Creates a format description for a video media stream that the parameter set describes.

[`func CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator: CFAllocator?, parameterSetCount: Int, parameterSetPointers: UnsafePointer<UnsafePointer<UInt8>>, parameterSetSizes: UnsafePointer<Int>, nalUnitHeaderLength: Int32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:))

Creates a format description for a video media stream using HEVC (H.265) parameter set NAL units.

[`func CMVideoFormatDescriptionGetH264ParameterSetAtIndex(CMFormatDescription, parameterSetIndex: Int, parameterSetPointerOut: UnsafeMutablePointer<UnsafePointer<UInt8>?>?, parameterSetSizeOut: UnsafeMutablePointer<Int>?, parameterSetCountOut: UnsafeMutablePointer<Int>?, nalUnitHeaderLengthOut: UnsafeMutablePointer<Int32>?) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionGetH264ParameterSetAtIndex(_:parameterSetIndex:parameterSetPointerOut:parameterSetSizeOut:parameterSetCountOut:nalUnitHeaderLengthOut:))

Returns a parameter set that an H.264 format description contains.

[`extern OSStatus CMVideoFormatDescriptionCopyTagCollectionArray(CMVideoFormatDescriptionRef formatDescription, CFArrayRef*tagCollectionsOut);`](/documentation/CoreMedia/CMVideoFormatDescriptionCopyTagCollectionArray)

Copies the multi-image encoding properties as an array of CMTagCollections.

[`func CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer(allocator: CFAllocator?, videoFormatDescription: CMVideoFormatDescription, stringEncoding: CFStringEncoding, flavor: CMImageDescriptionFlavor?, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer(allocator:videoFormatDescription:stringEncoding:flavor:blockBufferOut:))

Copies the contents of a video format description to a buffer in big-endian byte ordering.

[`func CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer(allocator: CFAllocator?, bigEndianImageDescriptionBlockBuffer: CMBlockBuffer, stringEncoding: CFStringEncoding, flavor: CMImageDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer(allocator:bigEndianImageDescriptionBlockBuffer:stringEncoding:flavor:formatDescriptionOut:))

Creates a video format description from a big-endian image description inside a buffer.

[`func CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData(allocator: CFAllocator?, bigEndianImageDescriptionData: UnsafePointer<UInt8>, size: Int, stringEncoding: CFStringEncoding, flavor: CMImageDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData(allocator:bigEndianImageDescriptionData:size:stringEncoding:flavor:formatDescriptionOut:))

Creates a video format description from a big-endian image description structure.

[`func CMSwapBigEndianImageDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapBigEndianImageDescriptionToHost(_:_:))

Converts an image description data structure from big-endian to host-endian, in place.

[`func CMSwapHostEndianImageDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapHostEndianImageDescriptionToBig(_:_:))

Converts an image description data structure from host-endian to big-endian, in place.

### Working with Muxed Descriptions

[`func CMMuxedFormatDescriptionCreate(allocator: CFAllocator?, muxType: CMMuxedStreamType, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMMuxedFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMuxedFormatDescriptionCreate(allocator:muxType:extensions:formatDescriptionOut:))

Creates a format description for a muxed media stream.

### Working with Metadata Descriptions

[`struct CMMetadataDescriptionFlavor`](/documentation/CoreMedia/CMMetadataDescriptionFlavor)

Types that represent metadata format descriptions.

[`func CMMetadataFormatDescriptionCreateWithKeys(allocator: CFAllocator?, metadataType: CMMetadataFormatType, keys: CFArray?, formatDescriptionOut: UnsafeMutablePointer<CMMetadataFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCreateWithKeys(allocator:metadataType:keys:formatDescriptionOut:))

Creates a metadata format description with the metadata keys you specify.

[`func CMMetadataFormatDescriptionGetKeyWithLocalID(CMMetadataFormatDescription, localKeyID: OSType) -> CFDictionary?`](/documentation/CoreMedia/CMMetadataFormatDescriptionGetKeyWithLocalID(_:localKeyID:))

Returns the key for the local identifier.

[`func CMMetadataFormatDescriptionCopyAsBigEndianMetadataDescriptionBlockBuffer(allocator: CFAllocator?, metadataFormatDescription: CMMetadataFormatDescription, flavor: CMMetadataDescriptionFlavor?, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCopyAsBigEndianMetadataDescriptionBlockBuffer(allocator:metadataFormatDescription:flavor:blockBufferOut:))

Copies the contents of a metadata format description to a buffer in big-endian byte order.

[`func CMMetadataFormatDescriptionCreateByMergingMetadataFormatDescriptions(allocator: CFAllocator?, sourceDescription: CMMetadataFormatDescription, otherSourceDescription: CMMetadataFormatDescription, formatDescriptionOut: UnsafeMutablePointer<CMMetadataFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCreateByMergingMetadataFormatDescriptions(allocator:sourceDescription:otherSourceDescription:formatDescriptionOut:))

Creates a metadata format description object by merging with another description.

[`func CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionBlockBuffer(allocator: CFAllocator?, bigEndianMetadataDescriptionBlockBuffer: CMBlockBuffer, flavor: CMMetadataDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMMetadataFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionBlockBuffer(allocator:bigEndianMetadataDescriptionBlockBuffer:flavor:formatDescriptionOut:))

Creates a metadata format description from a big-endian metadata description structure inside a buffer.

[`func CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionData(allocator: CFAllocator?, bigEndianMetadataDescriptionData: UnsafePointer<UInt8>, size: Int, flavor: CMMetadataDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMMetadataFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionData(allocator:bigEndianMetadataDescriptionData:size:flavor:formatDescriptionOut:))

Creates a metadata format description from a big-endian metadata description structure.

[`func CMMetadataFormatDescriptionCreateWithMetadataFormatDescriptionAndMetadataSpecifications(allocator: CFAllocator?, sourceDescription: CMMetadataFormatDescription, metadataSpecifications: CFArray, formatDescriptionOut: UnsafeMutablePointer<CMMetadataFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCreateWithMetadataFormatDescriptionAndMetadataSpecifications(allocator:sourceDescription:metadataSpecifications:formatDescriptionOut:))

Creates a metadata format description by extending an existing description with the values you specify.

[`func CMMetadataFormatDescriptionCreateWithMetadataSpecifications(allocator: CFAllocator?, metadataType: CMMetadataFormatType, metadataSpecifications: CFArray, formatDescriptionOut: UnsafeMutablePointer<CMMetadataFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMMetadataFormatDescriptionCreateWithMetadataSpecifications(allocator:metadataType:metadataSpecifications:formatDescriptionOut:))

Creates a metadata format description with the specifications you specify.

[`func CMSwapBigEndianMetadataDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapBigEndianMetadataDescriptionToHost(_:_:))

Converts a metadata description data structure from big-endian to host-endian, in place.

[`func CMSwapHostEndianMetadataDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapHostEndianMetadataDescriptionToBig(_:_:))

Converts a metadata description data structure from host-endian to big-endian, in place.

[`func CMMetadataFormatDescriptionGetIdentifiers(CMMetadataFormatDescription) -> CFArray?`](/documentation/CoreMedia/CMMetadataFormatDescriptionGetIdentifiers(_:))

Returns an array of metadata identifiers from a metadata format description.

### Working with Text Descriptions

[`struct CMTextDescriptionFlavor`](/documentation/CoreMedia/CMTextDescriptionFlavor)

Types that represent text format descriptions.

[`func CMTextFormatDescriptionGetDefaultStyle(CMFormatDescription, localFontIDOut: UnsafeMutablePointer<UInt16>?, boldOut: UnsafeMutablePointer<DarwinBoolean>?, italicOut: UnsafeMutablePointer<DarwinBoolean>?, underlineOut: UnsafeMutablePointer<DarwinBoolean>?, fontSizeOut: UnsafeMutablePointer<CGFloat>?, colorComponentsOut: UnsafeMutablePointer<CGFloat>?) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionGetDefaultStyle(_:localFontIDOut:boldOut:italicOut:underlineOut:fontSizeOut:colorComponentsOut:))

Returns the default text style.

[`func CMTextFormatDescriptionGetDefaultTextBox(CMFormatDescription, originIsAtTopLeft: Bool, heightOfTextTrack: CGFloat, defaultTextBoxOut: UnsafeMutablePointer<CGRect>) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionGetDefaultTextBox(_:originIsAtTopLeft:heightOfTextTrack:defaultTextBoxOut:))

Returns the default text box.

[`func CMTextFormatDescriptionGetDisplayFlags(CMFormatDescription, displayFlagsOut: UnsafeMutablePointer<CMTextDisplayFlags>) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionGetDisplayFlags(_:displayFlagsOut:))

Returns the display flags.

[`func CMTextFormatDescriptionGetFontName(CMFormatDescription, localFontID: UInt16, fontNameOut: AutoreleasingUnsafeMutablePointer<CFString?>) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionGetFontName(_:localFontID:fontNameOut:))

Returns a font name for a local font identifier.

[`func CMTextFormatDescriptionGetJustification(CMFormatDescription, horizontalOut: UnsafeMutablePointer<CMTextJustificationValue>?, verticalOut: UnsafeMutablePointer<CMTextJustificationValue>?) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionGetJustification(_:horizontalOut:verticalOut:))

Returns the horizontal and vertical justification.

[`func CMTextFormatDescriptionCopyAsBigEndianTextDescriptionBlockBuffer(allocator: CFAllocator?, textFormatDescription: CMTextFormatDescription, flavor: CMTextDescriptionFlavor?, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionCopyAsBigEndianTextDescriptionBlockBuffer(allocator:textFormatDescription:flavor:blockBufferOut:))

Copies the contents of a text format description to a buffer in big-endian byte order.

[`func CMTextFormatDescriptionCreateFromBigEndianTextDescriptionBlockBuffer(allocator: CFAllocator?, bigEndianTextDescriptionBlockBuffer: CMBlockBuffer, flavor: CMTextDescriptionFlavor?, mediaType: CMMediaType, formatDescriptionOut: UnsafeMutablePointer<CMTextFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionCreateFromBigEndianTextDescriptionBlockBuffer(allocator:bigEndianTextDescriptionBlockBuffer:flavor:mediaType:formatDescriptionOut:))

Creates a text format description from a big-endian text description structure inside a buffer.

[`func CMTextFormatDescriptionCreateFromBigEndianTextDescriptionData(allocator: CFAllocator?, bigEndianTextDescriptionData: UnsafePointer<UInt8>, size: Int, flavor: CMTextDescriptionFlavor?, mediaType: CMMediaType, formatDescriptionOut: UnsafeMutablePointer<CMTextFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMTextFormatDescriptionCreateFromBigEndianTextDescriptionData(allocator:bigEndianTextDescriptionData:size:flavor:mediaType:formatDescriptionOut:))

Creates a text format description from a big-endian text description structure.

[`func CMSwapBigEndianTextDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapBigEndianTextDescriptionToHost(_:_:))

Converts a text description structure from big-endian to host-endian, in place.

[`func CMSwapHostEndianTextDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapHostEndianTextDescriptionToBig(_:_:))

Converts a text description structure from host-endian to big-endian, in place.

### Working with Time Code Descriptions

[`struct CMTimeCodeDescriptionFlavor`](/documentation/CoreMedia/CMTimeCodeDescriptionFlavor)

Types that represent time code format descriptions.

[`func CMTimeCodeFormatDescriptionCreate(allocator: CFAllocator?, timeCodeFormatType: CMTimeCodeFormatType, frameDuration: CMTime, frameQuanta: UInt32, flags: UInt32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMTimeCodeFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionCreate(allocator:timeCodeFormatType:frameDuration:frameQuanta:flags:extensions:formatDescriptionOut:))

Creates a format description for time code media.

[`func CMTimeCodeFormatDescriptionGetFrameDuration(CMTimeCodeFormatDescription) -> CMTime`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionGetFrameDuration(_:))

Returns the duration of each frame.

[`func CMTimeCodeFormatDescriptionGetFrameQuanta(CMTimeCodeFormatDescription) -> UInt32`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionGetFrameQuanta(_:))

Returns the frames per second for a time code, or frames per tick in counter mode.

[`func CMTimeCodeFormatDescriptionGetTimeCodeFlags(CMTimeCodeFormatDescription) -> UInt32`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionGetTimeCodeFlags(_:))

Returns time code flags.

[`func CMTimeCodeFormatDescriptionCopyAsBigEndianTimeCodeDescriptionBlockBuffer(allocator: CFAllocator?, timeCodeFormatDescription: CMTimeCodeFormatDescription, flavor: CMTimeCodeDescriptionFlavor?, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionCopyAsBigEndianTimeCodeDescriptionBlockBuffer(allocator:timeCodeFormatDescription:flavor:blockBufferOut:))

Copies the contents of a time code format description to a buffer in big-endian byte order.

[`func CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionBlockBuffer(allocator: CFAllocator?, bigEndianTimeCodeDescriptionBlockBuffer: CMBlockBuffer, flavor: CMTimeCodeDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMTimeCodeFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionBlockBuffer(allocator:bigEndianTimeCodeDescriptionBlockBuffer:flavor:formatDescriptionOut:))

Creates a time code format description from a big-endian time code description data structure in a buffer.

[`func CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionData(allocator: CFAllocator?, bigEndianTimeCodeDescriptionData: UnsafePointer<UInt8>, size: Int, flavor: CMTimeCodeDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMTimeCodeFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionData(allocator:bigEndianTimeCodeDescriptionData:size:flavor:formatDescriptionOut:))

Creates a time code format description from a big-endian time code description structure.

[`func CMSwapBigEndianTimeCodeDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapBigEndianTimeCodeDescriptionToHost(_:_:))

Converts a time code description data structure from big-endian to host-endian, in place.

[`func CMSwapHostEndianTimeCodeDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapHostEndianTimeCodeDescriptionToBig(_:_:))

Converts a time code description data structure from host-endian to big-endian, in place.

### Working with Closed Captioning Descriptions

[`struct CMClosedCaptionDescriptionFlavor`](/documentation/CoreMedia/CMClosedCaptionDescriptionFlavor)

Types that represent closed caption format descriptions.

[`func CMClosedCaptionFormatDescriptionCopyAsBigEndianClosedCaptionDescriptionBlockBuffer(allocator: CFAllocator?, closedCaptionFormatDescription: CMClosedCaptionFormatDescription, flavor: CMClosedCaptionDescriptionFlavor?, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus`](/documentation/CoreMedia/CMClosedCaptionFormatDescriptionCopyAsBigEndianClosedCaptionDescriptionBlockBuffer(allocator:closedCaptionFormatDescription:flavor:blockBufferOut:))

Copies the contents of a closed caption format description to a buffer in big-endian byte order.

[`func CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionBlockBuffer(allocator: CFAllocator?, bigEndianClosedCaptionDescriptionBlockBuffer: CMBlockBuffer, flavor: CMClosedCaptionDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMClosedCaptionFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionBlockBuffer(allocator:bigEndianClosedCaptionDescriptionBlockBuffer:flavor:formatDescriptionOut:))

Creates a closed caption format description from a big-endian closed caption description structure in a buffer.

[`func CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionData(allocator: CFAllocator?, bigEndianClosedCaptionDescriptionData: UnsafePointer<UInt8>, size: Int, flavor: CMClosedCaptionDescriptionFlavor?, formatDescriptionOut: UnsafeMutablePointer<CMClosedCaptionFormatDescription?>) -> OSStatus`](/documentation/CoreMedia/CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionData(allocator:bigEndianClosedCaptionDescriptionData:size:flavor:formatDescriptionOut:))

Creates a closed caption format description from a big-endian closed caption description structure.

[`func CMSwapHostEndianClosedCaptionDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapHostEndianClosedCaptionDescriptionToBig(_:_:))

Converts a closed caption description structure from host-endian to big-endian, in place.

[`func CMSwapBigEndianClosedCaptionDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus`](/documentation/CoreMedia/CMSwapBigEndianClosedCaptionDescriptionToHost(_:_:))

Converts a closed caption description structure from big-endian to host-endian, in place.

### Format Description Types

[`class CMFormatDescription`](/documentation/CoreMedia/CMFormatDescription)

An object that describes a media format descriptor.

[`typealias CMAudioFormatDescription`](/documentation/CoreMedia/CMAudioFormatDescription)

A type you use to interact with audio format descriptions.

[`typealias CMClosedCaptionFormatDescription`](/documentation/CoreMedia/CMClosedCaptionFormatDescription)

A type you use to interact with closed caption format descriptions.

[`typealias CMMetadataFormatDescription`](/documentation/CoreMedia/CMMetadataFormatDescription)

A type you use to interact with metadata format descriptions.

[`typealias CMMuxedFormatDescription`](/documentation/CoreMedia/CMMuxedFormatDescription)

A type you use to interact with muxed format descriptions.

[`typealias CMTextFormatDescription`](/documentation/CoreMedia/CMTextFormatDescription)

A type you use to interact with text format descriptions.

[`typealias CMTimeCodeFormatDescription`](/documentation/CoreMedia/CMTimeCodeFormatDescription)

A type you use to interact with time code format descriptions.

[`typealias CMVideoFormatDescription`](/documentation/CoreMedia/CMVideoFormatDescription)

A type you use to interact with video format descriptions.

### Format Description Extension Keys

[`let kCMFormatDescriptionExtension_ContentColorVolume: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_ContentColorVolume)

[`let kCMFormatDescriptionExtension_HasAdditionalViews: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_HasAdditionalViews)

[`let kCMFormatDescriptionExtension_HasLeftStereoEyeView: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_HasLeftStereoEyeView)

[`let kCMFormatDescriptionExtension_HasRightStereoEyeView: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_HasRightStereoEyeView)

[`let kCMFormatDescriptionExtension_HeroEye: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_HeroEye)

[`let kCMFormatDescriptionExtension_HorizontalDisparityAdjustment: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_HorizontalDisparityAdjustment)

[`let kCMFormatDescriptionExtension_LogTransferFunction: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_LogTransferFunction)

[`let kCMFormatDescriptionExtension_StereoCameraBaseline: CFString`](/documentation/CoreMedia/kCMFormatDescriptionExtension_StereoCameraBaseline)

[`let kCMFormatDescriptionHeroEye_Left: CFString`](/documentation/CoreMedia/kCMFormatDescriptionHeroEye_Left)

[`let kCMFormatDescriptionHeroEye_Right: CFString`](/documentation/CoreMedia/kCMFormatDescriptionHeroEye_Right)

### Format Types

[`typealias CMClosedCaptionFormatType`](/documentation/CoreMedia/CMClosedCaptionFormatType)

A closed caption format type.

[`typealias CMMetadataFormatType`](/documentation/CoreMedia/CMMetadataFormatType)

A metadata format type.

[Metadata Format Types](/documentation/CoreMedia/metadata-format-types)

Constants that represent media format types.

[`typealias CMSubtitleFormatType`](/documentation/CoreMedia/CMSubtitleFormatType)

A type that represents a text subtitle format.

[Subtitle Format Types](/documentation/CoreMedia/subtitle-format-types)

Constants that represent subtitle format types.

[`typealias CMTimeCodeFormatType`](/documentation/CoreMedia/CMTimeCodeFormatType)

A time code format type.

[Time Code Formats](/documentation/CoreMedia/time-code-formats)

Constants that represent time code format types.

[`typealias CMTextFormatType`](/documentation/CoreMedia/CMTextFormatType)

A text format type.

[`typealias CMPixelFormatType`](/documentation/CoreMedia/CMPixelFormatType)

A pixel format type.

[Tagged Buffer Group Format Types](/documentation/CoreMedia/tagged-buffergroup-format-types)

### Data Types

[`struct CMVideoDimensions`](/documentation/CoreMedia/CMVideoDimensions)

A structure that represents video dimensions.

[`typealias CMAudioFormatDescriptionMask`](/documentation/CoreMedia/CMAudioFormatDescriptionMask)

A type for mask bits that represent parts of an audio format description.

[`typealias CMMediaType`](/documentation/CoreMedia/CMMediaType)

Constants that represent media types.

[`typealias CMAudioCodecType`](/documentation/CoreMedia/CMAudioCodecType)

An audio codec type.

[`typealias CMVideoCodecType`](/documentation/CoreMedia/CMVideoCodecType)

A video codec type.

[`typealias CMTextDisplayFlags`](/documentation/CoreMedia/CMTextDisplayFlags)

An integer value that describes the display mode flags for text media.

[`typealias CMTextJustificationValue`](/documentation/CoreMedia/CMTextJustificationValue)

An integer value that describes the justification modes for text media.

[Media Type Constants](/documentation/CoreMedia/media-type-constants)

Constants that represent media types.

[Muxed Stream Types](/documentation/CoreMedia/muxed-stream-types)

Constants that represent muxed stream types.

[Audio Codec Types](/documentation/CoreMedia/audio-codec-types)

Constants that represent audio codec types.

### Constants

[Audio Format Description Mask Codes](/documentation/CoreMedia/audio-format-desc-codes)

Mask codes that identify audio formats.

[Chroma Location Extension Constants](/documentation/CoreMedia/chroma-location-extension-constants)

Constants that identify chroma location extensions.

[Clean Aperture Extension Constants](/documentation/CoreMedia/clean-aperture-extension-constants)

Constants that identify clean aperture extensions.

[Closed Caption Format Type Constants](/documentation/CoreMedia/closed-caption-formats)

Types that identify closed caption formats.

[Color Primary Extension Constants](/documentation/CoreMedia/color-primary-extension-constants)

Constants that identify color primary extensions.

[Field Detail Extension Constants](/documentation/CoreMedia/field-detail-extension-constants)

Constants that identify field detail extensions.

[Format Description Bridge Error Codes](/documentation/CoreMedia/format-description-bridge-errors)

Bridge errors the system returns from format description calls.

[Format Description Constants](/documentation/CoreMedia/format-description-constants)

Constants that identify format descriptions.

[Format Description Error Codes](/documentation/CoreMedia/format-description-errors)

Errors the system returns from format description calls.

[HEVC Temporal Level Info Constants](/documentation/CoreMedia/hevc-temporal-level-info-constants)

Constants that identify HEVC temporal level information.

[Metadata Format Description Constants](/documentation/CoreMedia/metadata-format-description-constants)

Constants that identify metadata format descriptions.

[MPEG-2-conformant Formats](/documentation/CoreMedia/mpeg-2-conformant-formats)

Constants that identify MPEG-2 formats.

[Pixel Aspect Ratio Extension Constants](/documentation/CoreMedia/pixel-aspect-ratio-extension-constants)

Constants that identify pixel aspect ratio extensions.

[Text Display Flags](/documentation/CoreMedia/text-display-flags)

Flags that identify text display methods.

[Text Format Constants](/documentation/CoreMedia/text-format-constants)

Types that identify text formats.

[Text Format Description Constants](/documentation/CoreMedia/text-format-description-constants)

Constants that identify text format descriptions.

[Text Justification Constants](/documentation/CoreMedia/text-justification-constants)

Types that identify text justifications.

[Time Code Flags](/documentation/CoreMedia/time-code-flags)

Flags that identify time codes.

[Time Code Format Description Constants](/documentation/CoreMedia/time-code-format-description-constants)

Constants that identify time code format descriptions.

[Transfer Function Extension Constants](/documentation/CoreMedia/transfer-function-extension-constants)

Constants that identify transfer function extensions.

[Video Codec Constants](/documentation/CoreMedia/video-codec-constants)

Types that identify video codecs.

[Video Pixel Formats](/documentation/CoreMedia/video-pixel-formats)

Constants that identify video pixel formats.

[Video Profile Constants](/documentation/CoreMedia/video-profile-constants)

Constants that identify video profiles.

[YCbCrMatrix Extension Constants](/documentation/CoreMedia/ycbcrmatrix-extension-constants)

Constants that identify YCbCrMatrix extensions.



---

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)