<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMVideoFormatDescriptionMatchesImageBuffer"
  },
  "title" : "CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)"
}
-->

# CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)

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

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

## Parameters

`desc`

CMVideoFormatDescription to validate.

`imageBuffer`

image buffer to validate against.

## Return Value

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

## 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.

---

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)