Class

AVAssetTrack

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

Declaration

@interface AVAssetTrack : NSObject

Overview

AVAssetTrack adopts the AVAsynchronousKeyValueLoading protocol. You can use the protocol’s statusOfValueForKey:error: method to determine if a track property can be accessed without blocking the calling thread. If a property’s status is a value other than AVKeyValueStatusLoaded, you should use the protocol’s loadValuesAsynchronouslyForKeys:completionHandler: method to asynchronously load the key prior to use. To cancel pending load requests for all keys of AVAssetTrack you must message its owning AVAsset object (for example, [track.asset cancelLoading]).

Topics

Retrieving Track Information

asset

The asset of which the track is a part.

trackID

The persistent unique identifier for this track.

mediaType

The media type for the track.

- hasMediaCharacteristic:

Returns a Boolean value that indicates whether the track references media with the specified media characteristic.

AVMediaCharacteristic

The options for specifying media type characteristics.

formatDescriptions

The format descriptions of the media samples referenced by the track.

enabled

A Boolean value that indicates whether the track is enabled according to the state stored in its container.

playable

A Boolean value that indicates whether the track is playable in the current environment.

selfContained

A Boolean value that indicates whether the track references sample data contained only within its storage container.

estimatedDataRate

The estimated data rate, in bits per second, of the media data referenced by the track.

totalSampleDataLength

The total number of bytes of sample data required by the track.

decodable

A Boolean value that indicates whether the receiver is decodable in the current environment.

Retrieving Temporal Properties

timeRange

The time range of the track within the overall timeline of the asset.

naturalTimeScale

The natural time scale of the media referenced by this track.

Retrieving Language Properties

languageCode

The language associated with the track, as an ISO 639-2/T language code.

extendedLanguageTag

The language tag associated with the track, as a BCP 47 language tag.

Retrieving Visual Characteristics

naturalSize

The natural dimensions of the media data referenced by the track.

preferredTransform

The transform specified in the track’s storage container as the preferred transformation of the visual media data for display purposes.

Retrieving Audible Characteristics

preferredVolume

The volume specified in the track’s storage container as the preferred volume of the audible media data.

Retrieving Frame-Based Characteristics

nominalFrameRate

The frame rate of the track, in frames per second.

minFrameDuration

The minimum duration of the track’s frames.

requiresFrameReordering

A Boolean value that indicates whether samples in the track may have different values for their presentation and decode timestamps.

Finding Track Segments

segments

The time mappings from the track’s media samples to its timeline.

- segmentForTrackTime:

Returns the track segment that corresponds with, or is closest to, the specified track time.

- samplePresentationTimeForTrackTime:

Maps the specified track time through the appropriate time mapping and returns the resulting sample presentation time.

Managing Metadata

metadata

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

commonMetadata

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

availableMetadataFormats

An array containing the metadata formats available for the track.

- metadataForFormat:

Creates an array of metadata objects, one for each metadata item in the container of the specified format.

AVMetadataFormat

A value that defines a metadata format.

Working with Associated Tracks

availableTrackAssociationTypes

An array of association types used to associate the track with other tracks.

- associatedTracksOfType:

Creates an array containing other tracks associated with the track that uses the specified association type.

AVTrackAssociationType

Constants for identifying how other tracks are associated with a track.

Creating Sample Cursors

canProvideSampleCursors

A Boolean value that indicates whether the asset track can provide instances of sample cursors to traverse its media samples and discover information.

- makeSampleCursorWithPresentationTimeStamp:

Creates an instance of a sample cursor and positions it at or near the specified presentation timestamp.

- makeSampleCursorAtFirstSampleInDecodeOrder

Creates an instance of a sample cursor and positions it at the receiver's first media sample in decode order.

- makeSampleCursorAtLastSampleInDecodeOrder

Creates an instance of a sample cursor and positions it at the receiver's last media sample in decode order.

Instance Properties

Relationships

Inherits From

See Also

Media Assets

About the Asset Model

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

AVAsset

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

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.