Contents

AVVideoCompositing

A protocol that defines the methods custom video compositors must implement.

Declaration

protocol AVVideoCompositing : NSObjectProtocol, Sendable

Overview

For each AVFoundation object of class AVPlayerItem, AVAssetExportSession, AVAssetImageGenerator, or AVAssetReaderVideoCompositionOutput that has a non-nil value for its videoComposition property, and the value of the customVideoCompositorClass property of the AVVideoComposition isn’t nil, AVFoundation creates and uses an instance of that custom video compositor class to process the instructions contained in the AVVideoComposition.

The system creates a custom video compositor instance when you assign videoComposition an instance of AVVideoComposition that’s associated with a different custom video compositor class than the object was previously using.

When creating instances of custom video compositors, AVFoundation initializes them by calling init and then makes them available as the value of the customVideoCompositor property of the object. You then can do any additional setup or configuration to the custom compositor.

The AVFoundation object retains the custom video compositor instances for as long as the value of the videoComposition property indicates that there’s an instance of the same custom video compositor class. This is true even when the value changes from one instance of AVVideoComposition to another associated instance with the same custom video compositor class.

Topics

Inspecting processing requirements

Observing render context changes

Preparing to render frames

Rendering the composition

See Also

Custom video compositing