---
title: "CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/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.

## Declaration

```swift
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

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:  |   |   |  important: You need to provide at least one sequence parameter set and one picture parameter set.

## 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)
- [CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)](coremedia/cmvideoformatdescriptionmatchesimagebuffer(_:imagebuffer:).md)
- [CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:formatDescriptionOut:)](coremedia/cmvideoformatdescriptioncreatefromh264parametersets(allocator:parametersetcount:parametersetpointers:parametersetsizes:nalunitheaderlength: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)
