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.
SDKs
- iOS 4.1+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- AVFoundation
Declaration
class AVAssetReader : NSObject
Overview
AVAsset
lets you:
Read raw un-decoded media samples directly from storage, obtain samples decoded into renderable forms.
Mix multiple audio tracks of the asset and compose multiple video tracks by using
AVAsset
andReader Audio Mix Output AVAsset
.Reader Video Composition Output
The AVAsset
pipelines are multithreaded internally. After you initiate reading with init(asset:)
, a reader loads and processes a reasonable amount of sample data ahead of use so that retrieval operations such as copy
(AVAsset
) can have very low latency. AVAsset
is not intended for use with real-time sources, and its performance is not guaranteed for real-time operations.