---
title: "CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmvideoformatdescriptionmatchesimagebuffer(_:imagebuffer:)"
---

# CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)

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

## Declaration

```swift
func CMVideoFormatDescriptionMatchesImageBuffer(_ desc: CMVideoFormatDescription, imageBuffer: CVImageBuffer) -> Bool
```

## Parameters

- `desc`: CMVideoFormatDescription to validate.
- `imageBuffer`: Image buffer to validate against.

## Return Value

Return Value A Boolean indicating whether the format description matches the image buffer.

## Discussion

Discussion This function uses the keys returned by CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers to compare the extensions of the given format description to the attachments of the given image buffer (if an attachment is absent in either it must be absent in both). It also checks kCMFormatDescriptionExtension_BytesPerRow against CVPixelBufferGetBytesPerRow, if applicable.

## See Also

### Working with Video Descriptions

- [CMImageDescriptionFlavor](coremedia/cmimagedescriptionflavor.md)
- [CMVideoFormatDescriptionCreate(allocator:codecType:width:height:extensions:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreate(allocator:codectype:width:height:extensions:formatdescriptionout:).md)
- [CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreateforimagebuffer(allocator:imagebuffer:formatdescriptionout:).md)
- [CMVideoFormatDescriptionGetCleanAperture(_:originIsAtTopLeft:)](coremedia/cmvideoformatdescriptiongetcleanaperture(_:originisattopleft:).md)
- [CMVideoFormatDescriptionGetDimensions(_:)](coremedia/cmvideoformatdescriptiongetdimensions(_:).md)
- [CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers()](coremedia/cmvideoformatdescriptiongetextensionkeyscommonwithimagebuffers().md)
- [CMVideoFormatDescriptionGetPresentationDimensions(_:usePixelAspectRatio:useCleanAperture:)](coremedia/cmvideoformatdescriptiongetpresentationdimensions(_:usepixelaspectratio:usecleanaperture:).md)
- [CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreatefromh264parametersets(allocator:parametersetcount:parametersetpointers:parametersetsizes:nalunitheaderlength:formatdescriptionout:).md)
- [CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreatefromhevcparametersets(allocator:parametersetcount:parametersetpointers:parametersetsizes:nalunitheaderlength:extensions:formatdescriptionout:).md)
- [CMVideoFormatDescriptionGetH264ParameterSetAtIndex(_:parameterSetIndex:parameterSetPointerOut:parameterSetSizeOut:parameterSetCountOut:nalUnitHeaderLengthOut:)](coremedia/cmvideoformatdescriptiongeth264parametersetatindex(_:parametersetindex:parametersetpointerout:parametersetsizeout:parametersetcountout:nalunitheaderlengthout:).md)
- [CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer(allocator:videoFormatDescription:stringEncoding:flavor:blockBufferOut:)](coremedia/cmvideoformatdescriptioncopyasbigendianimagedescriptionblockbuffer(allocator:videoformatdescription:stringencoding:flavor:blockbufferout:).md)
- [CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer(allocator:bigEndianImageDescriptionBlockBuffer:stringEncoding:flavor:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreatefrombigendianimagedescriptionblockbuffer(allocator:bigendianimagedescriptionblockbuffer:stringencoding:flavor:formatdescriptionout:).md)
- [CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData(allocator:bigEndianImageDescriptionData:size:stringEncoding:flavor:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreatefrombigendianimagedescriptiondata(allocator:bigendianimagedescriptiondata:size:stringencoding:flavor:formatdescriptionout:).md)
- [CMSwapBigEndianImageDescriptionToHost(_:_:)](coremedia/cmswapbigendianimagedescriptiontohost(_:_:).md)
- [CMSwapHostEndianImageDescriptionToBig(_:_:)](coremedia/cmswaphostendianimagedescriptiontobig(_:_:).md)
