The abstract class used to model timed audiovisual media such as videos and sounds.


@interface AVAsset : NSObject


An AVAsset defines the collective properties of the tracks that comprise the asset. You create an AVAsset by initializing it with a local or remote URL pointing to a media resource, as shown in the following example:

let url: URL = // Local or Remote Asset URL
let asset = AVAsset(url: url)

AVAsset is an abstract class, so when you create an asset as shown in the example, you’re actually creating an instance of one of its concrete subclasses called AVURLAsset. In many cases this is a suitable way of creating an asset, but you can also directly instantiate an AVURLAsset when you need more fine-grained control over its initialization. The initializer for AVURLAsset accepts an options dictionary, with which you tailor the asset’s initialization to your particular use case. For instance, if you’re creating an asset for an HLS stream, you may want to prevent it from retrieving its media when a user is connected to a cellular network. You can do this as shown in the following example:

let url: URL = // Remote Asset URL
let options = [AVURLAssetAllowsCellularAccessKey: false]
let asset = AVURLAsset(url: url, options: options)

You can also instantiate an asset using other concrete subclasses that extend the basic model for audiovisual media in useful ways, as AVComposition does for temporal editing.

Because of the nature of timed audiovisual media, upon successful initialization of an asset, some or all of the values for its keys may not be immediately available. The value of any key can be requested at any time, and the asset always returns its value synchronously, although it may have to block the calling thread to do so. To avoid blocking, you can register your interest in particular keys and be notified when their values become available. For further details, see AVAsynchronousKeyValueLoading.

To play an instance of AVAsset, initialize an instance of AVPlayerItem with it, use the player item to set up its presentation state (such as whether only a limited timeRange of the asset should be played), and provide the player item to an AVPlayer object according to whether the item is to be played by itself or with a collection of other items.

You can insert AVAsset objects into an AVMutableComposition object to assemble audiovisual constructs from one or more source assets.

Subclassing Notes

It isn't currently possible to subclass AVAsset to handle streaming protocols or file formats that aren't supported by the framework.


Creating an Asset

+ assetWithURL:

Returns an asset for inspection of a media resource.

Loading Data

- cancelLoading

Cancels the loading of all values for all observers.

Inspecting an Asset


The duration of the asset.


A Boolean value that indicates whether the asset provides precise timing.


A value that indicates the creation date of the asset.


The encoded or authored size of the visual portion of the asset.


The natural rate at which the asset is to be played.


The preferred transform to apply to the visual content of the asset for presentation or processing.


The preferred volume at which the audible media of the asset is to be played.


The display criteria that define the optimal TV display mode for the asset.


An object containing properties that define the display criteria for a media asset.

Determining Usability

The usability properties have a value of YES when the indicated operation can be performed, even if only true under a specific set of conditions. These properties only return NO when there is no condition under which the associated operation can be performed.


A Boolean value that indicates whether the asset, or its URL, can be used to initialize an instance of a player item.


A Boolean value that indicates whether the asset can be exported using an asset export session.


A Boolean value that indicates whether the asset’s media data can be extracted using an asset reader.


A Boolean value that indicates whether the asset can be used within a segment of a composition track.


A Boolean value that indicates whether the asset has protected content.


A Boolean value that indicates whether the asset is compatible with AirPlay Video.


A Boolean value that indicates whether the asset can be written to the Saved Photos album.

Accessing Tracks


The collection of all tracks contained by the asset.


An array containing all of the track groups in the asset.

- trackWithTrackID:

Returns the track associated with a specified track identifier.

- tracksWithMediaType:

Returns an array of asset tracks associated with an asset for the specified media type.

- tracksWithMediaCharacteristic:

Returns an array of asset tracks associated with an asset for the specified characteristic.

- unusedTrackID

Returns an ID that's unused by any of the tracks in the asset.

Accessing Metadata


The lyrics of the asset, in a language suitable for the current locale.


An array of metadata items for all metadata identifiers for which a value is available.


An array of metadata items for each common metadata key for which a value is available.


An array of strings, each representing a metadata format that’s available to the asset.

- metadataForFormat:

Returns an array of metadata items found in the container with the specified format.

Using Chapter Metadata

Presenting Chapter Markers

Add chapter markers to enable users to quickly navigate your content.


The locales available for chapter metadata in the asset.

- chapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:

Returns an array of chapters with a given title locale and containing specified keys.

- chapterMetadataGroupsBestMatchingPreferredLanguages:

Returns an array of chapters whose locale best matches the list of preferred languages.

Finding Media Selections


The default media selections for this asset’s media selection groups.


An array of media characteristics for which a media selection option is available.

- mediaSelectionGroupForMediaCharacteristic:

Returns a media selection group object that contains one or more options with the specified media characteristic.

Managing Reference Restrictions


The asset’s reference restrictions.

Working with Fragmented Movies


A Boolean value that indicates whether the asset is capable of being extended by fragments.


A Boolean value that indicates whether the asset is extended by at least one movie fragment.


The total duration of fragments that currently exist, or may exist in the future.

Specifying Media Characteristics


The options for specifying media type characteristics.

Instance Properties


Inherits From

See Also

Media Assets

About the Asset Model

Understand how assets are used as the building blocks for media players.


An object that provides the track-level inspection interface for an asset’s media tracks.

Asset Manipulation

Retrieve assets for playback or to gather information about an asset.

Asset File Import and Export

Import and export media samples to and from the file system.