Creates a format description for a video media stream described by H.264 parameter set NAL units.


func CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator: CFAllocator?, parameterSetCount: Int, parameterSetPointers: UnsafePointer<UnsafePointer<UInt8>>, parameterSetSizes: UnsafePointer<Int>, nalUnitHeaderLength NALUnitHeaderLength: Int32, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatus



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


The number of parameter sets to include in the format description. This parameter must be at least 2.


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


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


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


Returned newly-created video CMFormatDescription.


This function parses the dimensions provided by the parameter sets and creates a format description suitable for a raw H.264 stream.The parameter sets' data can come from raw NAL units and must have any emulation prevention bytes needed.The supported NAL unit types to be included in the format description are 7 (sequence parameter set), 8 (picture parameter set) and 13 (sequence parameter set extension). At least one sequence parameter set and one picture parameter set must be provided.

See Also

Video-Specific Functions

func CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers() -> CFArray

Returns an array of the keys that are used both as CMVideoFormatDescription extensions and CVImageBuffer attachments and attributes.

func CMVideoFormatDescriptionGetPresentationDimensions(CMVideoFormatDescription, usePixelAspectRatio: Bool, useCleanAperture: Bool) -> CGSize

Returns the dimensions, adjusted to take pixel aspect ratio and/or clean aperture into account.

func CMSwapBigEndianImageDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus

Converts an ImageDescription data structure from big-endian to host-endian in place.

func CMSwapHostEndianImageDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus

Converts an ImageDescription data structure from host-endian to big-endian in place.