An abstract class that defines an interface for reading a single collection of samples of a common media type from an asset reader object.


class AVAssetReaderOutput : NSObject


There are several subclasses of AVAssetReaderOutput for specific tasks, such as AVAssetReaderTrackOutput or AVAssetReaderVideoCompositionOutput.

You can read the media data of an asset by adding one or more concrete instances of AVAssetReaderOutput to an AVAssetReader object using add(_:).


Copying a Buffer

func copyNextSampleBuffer() -> CMSampleBuffer?

Copies the next sample buffer for the output.

var alwaysCopiesSampleData: Bool

A Boolean value that indicates whether to vend data in buffers before copying.

Inspecting the Media Type

var mediaType: AVMediaType

A string representing the media type of the track represented by the output.

Configuring Reading Settings

func markConfigurationAsFinal()

Informs the receiver not to continue reconfiguring the time ranges, and allows the attached asset reader to change its status to completed.

func reset(forReadingTimeRanges: [NSValue])

Restarts reading with a new set of time ranges.

var supportsRandomAccess: Bool

A Boolean value that indicates whether the asset reader output supports reconfiguration of the time ranges.


Inherits From

Conforms To

See Also

File Import

class AVAssetReader

A reader object used to obtain the media data of an asset, either file-based or consisting of an assemblage of media data from multiple sources.

class AVAssetReaderAudioMixOutput

An object that defines an interface for reading audio samples that result from mixing the audio from one or more tracks.

class AVAssetReaderTrackOutput

An object that defines an interface for reading media data from a single track of an asset reader's asset.

class AVAssetReaderSampleReferenceOutput

An object that defines an interface for reading sample references from a single asset track.

class AVAssetReaderVideoCompositionOutput

An object that reads video frames composited from the frames in one or more tracks of a reader's assets.

class AVAssetReaderOutputMetadataAdaptor

An object that defines an interface for reading metadata.

class AVAssetImageGenerator

An object that provides thumbnail or preview images of assets independently of playback.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software