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

# AVVideoComposition

An object that describes how to compose video frames at particular points in time.

```
class AVVideoComposition
```

## 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

[`init(configuration:)`](/documentation/AVFoundation/AVVideoComposition/init(configuration:))

Initialize an AVVideoComposition with a configuration.

[`AVVideoComposition.Configuration`](/documentation/AVFoundation/AVVideoComposition/Configuration)

Configurable properties for initializing a new AVVideoComposition instance.

[`init(applyingFiltersTo:applier:)`](/documentation/AVFoundation/AVVideoComposition/init(applyingFiltersTo:applier:))

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

[`videoCompositionWithVideoComposition:`](/documentation/AVFoundation/AVVideoComposition/videoCompositionWithVideoComposition:)

Pass-through initializer, for internal use in AVFoundation only

[`videoComposition(with:applyingCIFiltersWithHandler:completionHandler:)`](/documentation/AVFoundation/AVVideoComposition/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.

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

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

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

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

An output video frame processed with Core Image filtering.

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

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

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

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

[`init(asset:applyingCIFiltersWithHandler:)`](/documentation/AVFoundation/AVVideoComposition/init(asset:applyingCIFiltersWithHandler:))

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

### Inspecting the video composition

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

The size at which the video composition should render.

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

The scale at which the video composition should render.

[`frameDuration`](/documentation/AVFoundation/AVVideoComposition/frameDuration)

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

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

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

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

The color primaries used for video composition.

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

The transfer function used for video composition.

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

The YCbCr matrix used for video composition.

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

A custom compositor class to use.

[`outputBufferDescription`](/documentation/AVFoundation/AVVideoComposition/outputBufferDescription-3ayt8)

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

[`outputBufferDescription`](/documentation/AVFoundation/AVVideoComposition/outputBufferDescription-3wsar)

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.      

[`spatialVideoConfigurations`](/documentation/AVFoundation/AVVideoComposition/spatialVideoConfigurations-2ipps)

Indicates the spatial configurations that are available to associate with the output of the video composition.   

[`spatialVideoConfigurations`](/documentation/AVFoundation/AVVideoComposition/spatialVideoConfigurations-80iab)

Indicates the spatial configurations that are available to associate with the output of the video composition.   

[`AVSpatialVideoConfiguration`](/documentation/AVFoundation/AVSpatialVideoConfiguration-c.class)

An AVSpatialVideoConfiguration specifies spatial video properties.

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

### Validating the time range

[`isValid(for:assetDuration:timeRange:validationDelegate:)`](/documentation/AVFoundation/AVVideoComposition/isValid(for:assetDuration:timeRange:validationDelegate:))

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

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

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

[`determineValidity(for:timeRange:validationDelegate:completionHandler:)`](/documentation/AVFoundation/AVVideoComposition/determineValidity(for:timeRange:validationDelegate:completionHandler:))

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

[`isValid(for:timeRange:validationDelegate:)`](/documentation/AVFoundation/AVVideoComposition/isValid(for:timeRange:validationDelegate:))

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

### Reading instructions

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

The video composition instructions.

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

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

### Identifying source tracks

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

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

[`sourceSampleDataTrackIDs`](/documentation/AVFoundation/AVVideoComposition/sourceSampleDataTrackIDs-2hgue)

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

[`sourceSampleDataTrackIDs`](/documentation/AVFoundation/AVVideoComposition/sourceSampleDataTrackIDs-3nrgi)

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

### Configuring HDR metadata

[`perFrameHDRDisplayMetadataPolicy`](/documentation/AVFoundation/AVVideoComposition/perFrameHDRDisplayMetadataPolicy-swift.property)

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.



---

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)