A metadata item associated with an audiovisual asset or one of its tracks.
- iOS 4.0+
- macOS 10.7+
- tvOS 9.0+
- watchOS 2.0+
- Mac Catalyst 13.0+Beta
To effectively use
AVMetadata, 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 a number of 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
Common key space. There are a number of 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
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
To load values of a metadata item “lazily,” you use the methods from the
AVAsynchronous protocol (see Asynchronous Loading). The
AVAsset class and other classes in turn provide their metadata lazily so that you can obtain objects from those arrays without incurring overhead for items you don’t ultimately 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.