<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMVideoFormatDescriptionCreateFromHEVCParameterSets"
  },
  "title" : "CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)"
}
-->

# 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 CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator: CFAllocator?, parameterSetCount: Int, parameterSetPointers: UnsafePointer<UnsafePointer<UInt8>>, parameterSetSizes: UnsafePointer<Int>, nalUnitHeaderLength NALUnitHeaderLength: Int32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatus
```

## Parameters

`allocator`

The `CFAllocator` for creating the format description, or pass `nil` to use the default allocator.

`parameterSetCount`

The number of parameter sets to include in the format description, which needs to be at least `2`.

`parameterSetPointers`

Points to a C array containing `parameterSetCount` pointers to parameter sets.

`parameterSetSizes`

Points to a C array containing the size, in bytes, of each of the parameter sets.

`NALUnitHeaderLength`

The size, in bytes, of the `NALUnitLength` field in an AVC video sample or an AVC parameter set sample. Pass `1`, `2`, or `4`.

`extensions`

An optional dictionary of extension key-value pairs. Keys are <doc://com.apple.documentation/documentation/CoreFoundation/CFString> and values are property list objects, such as <doc://com.apple.documentation/documentation/CoreFoundation/CFData>, <doc://com.apple.documentation/documentation/CoreFoundation/CFBoolean>, <doc://com.apple.documentation/documentation/CoreFoundation/CFNumber>, <doc://com.apple.documentation/documentation/CoreFoundation/CFString>, <doc://com.apple.documentation/documentation/CoreFoundation/CFDate>, <doc://com.apple.documentation/documentation/CoreFoundation/CFArray>, and <doc://com.apple.documentation/documentation/CoreFoundation/CFDictionary>.

`formatDescriptionOut`

The newly created video format description.

## Discussion

This method parses the dimensions from the parameter sets and creates a format description suitable for an HEVC (H.265) stream. The parameter sets’ data can come from raw NAL units and needs to include emulation prevention bytes as necessary.

The supported NAL unit types to include in the format description are:

|7 |Sequence parameter set          |
|--|--------------------------------|
|8 |Picture parameter set           |
|13|Sequence parameter set extension|

> Important:
> You need to provide at least one sequence parameter set and one picture parameter set.

---

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)