<!--
{
  "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/CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMVideoFormatDescriptionCreateForImageBuffer"
  },
  "title" : "CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)"
}
-->

# CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)

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

```
func CMVideoFormatDescriptionCreateForImageBuffer(allocator: CFAllocator?, imageBuffer: CVImageBuffer, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatus
```

## Parameters

`allocator`

`CFAllocator` to be used when creating the `CMFormatDescription`. Pass `NULL` to use the default allocator.

`imageBuffer`

Image buffer for which we are creating the format description.

`formatDescriptionOut`

On output, returns newly created video `CMFormatDescription`.

## Return Value

A result code. Returns `noErr` if successful.

## Discussion

This convenience function is equivalent to:

```objc
CMVideoFormatDescriptionCreate ( allocator, ( CVPixelBufferGetTypeID() == CFGetTypeID( imageBuffer ) ? CVPixelBufferGetPixelFormatType( imageBuffer ) : 0,  width of image,  height of image, extensions );
                                                
```

`extensions` is a `CFDictionary` of attachments to image buffer with keys specified by `CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers`, and also `kCMFormatDescriptionExtension_BytesPerRow` 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)