Class

AVVideoComposition

An object that represents an immutable video composition.

Declaration

@interface AVVideoComposition : NSObject

Overview

The AVFoundation framework also provides a mutable subclass, AVMutableVideoComposition, that you can use to create new videos.

A video composition describes, for any time in the aggregate time range of its instructions, the number and IDs of video tracks that are to be used in order to produce a composed video frame corresponding to that time. When AVFoundation’s built-in video compositor is used, the instructions an AVVideoComposition contain can specify a spatial transformation, an opacity value, and a cropping rectangle for each video source, and these can vary over time via simple linear ramping functions.

You can implement your own custom video compositor by implementing the AVVideoCompositing protocol; a custom video compositor is provided with pixel buffers for each of its video sources during playback and other operations and can perform arbitrary graphical operations on them in order to produce visual output.

Topics

Creating a Video Composition Object

+ videoCompositionWithPropertiesOfAsset:

Creates a video composition object configured to present the video tracks of the specified asset.

+ videoCompositionWithAsset:applyingCIFiltersWithHandler:

Creates a video composition configured to apply Core Image filters to each video frame of the specified asset.

Configuring Video Composition Properties

frameDuration

A time interval for which the video composition should render composed video frames.

renderSize

The size at which the video composition should render.

renderScale

The scale at which the video composition should render.

instructions

The video composition instructions.

AVVideoCompositionInstruction

Methods you can implement to represent operations to be performed by a compositor.

animationTool

A video composition tool to use with Core Animation in offline rendering.

customVideoCompositorClass

A custom compositor class to use.

sourceTrackIDForFrameTiming

A value that indicates whether frame timing for the video composition is derived from the source's asset track.

colorPrimaries

The color primaries used for video composition.

colorTransferFunction

The transfer function used for video composition.

colorYCbCrMatrix

The YCbCr matrix used for video composition.

Validating the Time Range

- isValidForAsset:timeRange:validationDelegate:

Indicates whether the time ranges of the composition’s instructions conform to validation requirements.

AVVideoCompositionValidationHandling

Methods you can implement to indicate whether validation of a video composition should continue after specific errors are found.

Relationships

Inherits From

See Also

Video Composition

AVMutableVideoComposition

An object that represents a mutable video composition.

AVAsynchronousCIImageFilteringRequest

An object that supprts using Core Image filters to process an individual video frame in a video composition.

AVAsynchronousVideoCompositionRequest

An object that contains the information necessary for a video compositor to render an output pixel buffer.

AVMutableVideoCompositionInstruction

An operation performed by a compositor.

AVMutableVideoCompositionLayerInstruction

An object used to modify the transform, cropping, and opacity ramps applied to a given track in a mutable composition.

AVVideoCompositionCoreAnimationTool

An object used to incorporate Core Animation into a video composition.

AVVideoCompositionInstruction

An operation performed by a compositor.

AVVideoCompositionLayerInstruction

An object used to modify the transform, cropping, and opacity ramps applied to a given track in a composition.

AVVideoCompositionRenderContext

An object that defines the context within which custom compositors render new output pixel buffers.