An object that provides thumbnail or preview images of assets independently of playback.
- iOS 4.0+
- macOS 10.7+
- tvOS 9.0+
- Mac Catalyst 13.0+Beta
AVAssetImageGenerator uses the default enabled video track(s) to generate images. Generating a single image in isolation can require the decoding of a large number of video frames with complex interdependencies. If you require a series of images, you can achieve far greater efficiency using the asynchronous method,
generateCGImagesAsynchronously(forTimes:completionHandler:), which employs decoding efficiencies similar to those used during playback.
You create an asset generator using
assetImageGeneratorWithAsset:. These methods may succeed even if the asset possesses no visual tracks at the time of initialization. You can test whether an asset has any tracks with the visual characteristic using the
AVAsset class’s method
The actual time of a generated image is within the range [
requestedTimeToleranceAfter] and may differ from the requested time for efficiency.
Assets that represent mutable compositions or mutable movies may gain visual tracks after initialization of an associated image generator.
Creating an Image Generator
Managing Image-Generation Time Tolerances
Configuring Image-Generation Behavior
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.
An abstract class that defines an interface for reading a single collection of samples of a common media type from an asset reader object.
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