Returns the key associated with the metadata for the given local id.


func CMMetadataFormatDescriptionGetKeyWithLocalID(_ desc: CMMetadataFormatDescription, localKeyID: OSType) -> CFDictionary?



Format description being interrogated.


Local Id identifying the key associated with the metadata description.

Return Value

A new dictionary containing the key specified by the localKeyID, or NULL if there is no key corresponding to the localKeyID.


When writing a metadata track to a QuickTime movie, you can store many different kinds of metadata in one track. The format description for the track describes all of the kinds of metadata that might be present in that track. And each kind of metadata has an id assigned to it which is unique from the others in the group. So when individual samples of metadata are written (or read back later), they don't contain their full description, instead they just contain the unique id (called the local id) that was assigned to them. For instance, GPS might be local id 1, and face data might be local id 2. When someone pulls such a sample from a movie and wants to do a reverse lookup, they can call CMMetadataFormatDescriptionGetKeyWithLocalID, using the local id they've got, to get the Key associated with this metadata.

See Also

Metadata-Specific Functions

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

Converts a MetadataDescription data structure from big-endian to host-endian in place.

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

Converts a MetadataDescription data structure from host-endian to big-endian in place.

func CMMetadataFormatDescriptionGetIdentifiers(CMMetadataFormatDescription) -> CFArray?

Gets an array of metadata identifiers from a metadata format description.