Class

AVMutableVideoComposition

An object that represents a mutable video composition.

Declaration

@interface AVMutableVideoComposition : AVVideoComposition

Overview

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 comprises 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 also 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

+ videoComposition

Creates a new mutable video composition.

+ videoCompositionWithPropertiesOfAsset:

Creates a new mutable video composition with the specified asset properties.

+ videoCompositionWithAsset:applyingCIFiltersWithHandler:

Creates a mutable 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

The 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.

Relationships

Inherits From

See Also

Video Composition

AVVideoComposition

An object that represents an immutable 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.