Contents

AVMetadataItem

A metadata item for an audiovisual asset or one of its tracks.

Declaration

class AVMetadataItem

Mentioned in

Overview

To effectively use AVMetadataItem, you need to understand how AVFoundation organizes metadata. To simplify finding and filtering metadata items, the framework groups related metadata into key spaces:

  • Format-specific key spaces. The framework defines several format-specific key spaces. They roughly correlate to a particular container or file format, such as QuickTime (QuickTime metadata and user data) or MP3 (ID3). However, a single asset may contain metadata values across multiple key spaces. To retrieve an asset’s complete collection of format-specific metadata, you use its metadata property.

  • Common key space. There are several common metadata values, such as a movie’s creation date or description, that can exist across multiple key spaces. To help normalize access to this common metadata, the framework provides a common key space that gives access to a limited set of metadata values common to several key spaces. This makes it easy to retrieve commonly used metadata without concern for the specific format. To retrieve an asset’s collection of common metadata, you use its commonMetadata property.

Metadata items have keys that accord with the specification of the container format from which they’re drawn. Full details of the metadata formats, metadata keys, and metadata key spaces supported by AVFoundation are available in AVMetadataKeySpace and AVMetadataKey.

To load values of a metadata item when you access them for the first time, use the methods from the AVAsynchronousKeyValueLoading protocol. The AVAsset class and other classes in turn provide their metadata as needed so that you can obtain objects from those arrays without incurring overhead for items you don’t inspect.

To filter arrays of metadata items, you use the methods of this class. For example, you can filter by key and key space, by locale, and by preferred language.

Topics

Creating a metadata item

Identifying metadata items

Loading values

Accessing keys and key spaces

Accessing timing

Accessing language support

Filtering arrays of metadata items

Translating metadata items

Accessing values

Initializers

Default Implementations

See Also

Metadata