<!--
{
  "availability" : [
    "iOS: 4.0.0 - 26.0.0",
    "iPadOS: 4.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.7.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVMutableVideoComposition",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMutableVideoComposition"
  },
  "title" : "AVMutableVideoComposition"
}
-->

# AVMutableVideoComposition

A mutable video composition subclass.

```
class AVMutableVideoComposition
```

## Overview

If you use the built-in video compositor, the instructions a video composition contain can specify a spatial transformation, an opacity value, and a cropping rectangle for each video source. This values can vary over time by applying linear ramping functions.

You can create a custom video compositor by implementing the [`AVVideoCompositing`](/documentation/AVFoundation/AVVideoCompositing) protocol. The system provides the custom video compositor with pixel buffers for each of its video sources during playback, and can perform arbitrary graphical operations on them to produce visual output.

## Topics

### Creating a video composition

[`videoComposition(withPropertiesOf:completionHandler:)`](/documentation/AVFoundation/AVMutableVideoComposition/videoComposition(withPropertiesOf:completionHandler:))

Returns a new video composition that’s configured to present the video tracks of the specified asset.

[`videoComposition(withPropertiesOf:prototypeInstruction:completionHandler:)`](/documentation/AVFoundation/AVMutableVideoComposition/videoComposition(withPropertiesOf:prototypeInstruction:completionHandler:))

Returns a new mutable video composition with the specified asset properties and a prototype video composition instruction.

[`videoComposition(with:applyingCIFiltersWithHandler:completionHandler:)`](/documentation/AVFoundation/AVMutableVideoComposition/videoComposition(with:applyingCIFiltersWithHandler:completionHandler:))

Returns a new video composition that’s configured to apply Core Image filters to each video frame of the specified asset.

[`videoComposition`](/documentation/AVFoundation/AVMutableVideoComposition/videoComposition)

Creates a new mutable video composition.

[`init(propertiesOf:)`](/documentation/AVFoundation/AVMutableVideoComposition/init(propertiesOf:))

Creates a mutable video composition with the specified asset properties.

[`init(propertiesOf:prototypeInstruction:)`](/documentation/AVFoundation/AVMutableVideoComposition/init(propertiesOf:prototypeInstruction:))

Creates a mutable video composition with the specified asset properties and a prototype video composition instruction.

[`init(asset:applyingCIFiltersWithHandler:)`](/documentation/AVFoundation/AVMutableVideoComposition/init(asset: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`](/documentation/AVFoundation/AVMutableVideoComposition/frameDuration)

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

[`renderSize`](/documentation/AVFoundation/AVMutableVideoComposition/renderSize)

The size at which the video composition should render.

[`renderScale`](/documentation/AVFoundation/AVMutableVideoComposition/renderScale)

The scale at which the video composition should render.

[`animationTool`](/documentation/AVFoundation/AVMutableVideoComposition/animationTool)

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

[`outputBufferDescription`](/documentation/AVFoundation/AVMutableVideoComposition/outputBufferDescription)

The output buffers of the video composition can be specified with the outputBufferDescription. The value is an array of CMTagCollectionRef objects that describes the output buffers.

### Specifying composition instructions

[`instructions`](/documentation/AVFoundation/AVMutableVideoComposition/instructions)

The video composition instructions.

[`AVVideoCompositionInstructionProtocol`](/documentation/AVFoundation/AVVideoCompositionInstructionProtocol)

A protocol that defines the interface for a video composition instruction.

### Configuring HDR metadata

[`perFrameHDRDisplayMetadataPolicy`](/documentation/AVFoundation/AVMutableVideoComposition/perFrameHDRDisplayMetadataPolicy)

Configures the policy for display of HDR display metadata on the rendered frame.

[`AVVideoComposition.PerFrameHDRDisplayMetadataPolicy`](/documentation/AVFoundation/AVVideoComposition/PerFrameHDRDisplayMetadataPolicy-swift.struct)

A type that defines the policy for handling of per frame HDR metadata.

### Configuring color

[`colorPrimaries`](/documentation/AVFoundation/AVMutableVideoComposition/colorPrimaries)

The color primaries used for video composition.

[`colorTransferFunction`](/documentation/AVFoundation/AVMutableVideoComposition/colorTransferFunction)

The transfer function used for video composition.

[`colorYCbCrMatrix`](/documentation/AVFoundation/AVMutableVideoComposition/colorYCbCrMatrix)

The YCbCr matrix used for video composition.

### Identifying source tracks

[`sourceTrackIDForFrameTiming`](/documentation/AVFoundation/AVMutableVideoComposition/sourceTrackIDForFrameTiming)

An identifier of the source track from which the video composition derives frame timing.

[`sourceSampleDataTrackIDs`](/documentation/AVFoundation/AVMutableVideoComposition/sourceSampleDataTrackIDs-7i02t)

The identifiers of source sample data tracks in the composition that the object requires to compose frames.

[`sourceSampleDataTrackIDs`](/documentation/AVFoundation/AVMutableVideoComposition/sourceSampleDataTrackIDs-21o6b)

The identifiers of source sample data tracks in the composition that the compositor requires to compose frames.

### Specifying a custom compositor

[`customVideoCompositorClass`](/documentation/AVFoundation/AVMutableVideoComposition/customVideoCompositorClass)

The custom compositor class to use.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)