<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVVideoCompositing",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(pl)AVVideoCompositing"
  },
  "title" : "AVVideoCompositing"
}
-->

# AVVideoCompositing

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

```
protocol AVVideoCompositing : NSObjectProtocol, Sendable
```

## Overview

For each AVFoundation object of class [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem), [`AVAssetExportSession`](/documentation/AVFoundation/AVAssetExportSession), [`AVAssetImageGenerator`](/documentation/AVFoundation/AVAssetImageGenerator), or [`AVAssetReaderVideoCompositionOutput`](/documentation/AVFoundation/AVAssetReaderVideoCompositionOutput) that has a non-`nil` value for its `videoComposition` property, and the value of the [`customVideoCompositorClass`](/documentation/AVFoundation/AVVideoComposition/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`](/documentation/AVFoundation/AVVideoComposition).

The system creates a custom video compositor instance when you assign `videoComposition` an instance of [`AVVideoComposition`](/documentation/AVFoundation/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

[`sourcePixelBufferAttributes`](/documentation/AVFoundation/AVVideoCompositing/sourcePixelBufferAttributes)

The pixel buffer attributes that the compositor accepts for source frames.

[`requiredPixelBufferAttributesForRenderContext`](/documentation/AVFoundation/AVVideoCompositing/requiredPixelBufferAttributesForRenderContext)

The pixel buffer attributes that the compositor requires for pixel buffers that it creates.

[`supportsHDRSourceFrames`](/documentation/AVFoundation/AVVideoCompositing/supportsHDRSourceFrames)

A Boolean value that indicates whether the compositor handles source frames that contain high dynamic range (HDR) properties.

[`supportsWideColorSourceFrames`](/documentation/AVFoundation/AVVideoCompositing/supportsWideColorSourceFrames)

A Boolean value that indicates whether the compositor handles source frames that contains wide color properties.

[`canConformColorOfSourceFrames`](/documentation/AVFoundation/AVVideoCompositing/canConformColorOfSourceFrames)

A Boolean value that indicates whether the compositor conforms the color space of source frames to the composition color space.

[`supportsSourceTaggedBuffers`](/documentation/AVFoundation/AVVideoCompositing/supportsSourceTaggedBuffers)

### Observing render context changes

[`renderContextChanged(_:)`](/documentation/AVFoundation/AVVideoCompositing/renderContextChanged(_:))

Tells the compositor that the composition changed render contexts.

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

An object that defines the context in which custom compositors render pixel buffers.

### Preparing to render frames

[`anticipateRendering(using:)`](/documentation/AVFoundation/AVVideoCompositing/anticipateRendering(using:))

Informs a custom video compositor about upcoming rendering requests.

[`prerollForRendering(using:)`](/documentation/AVFoundation/AVVideoCompositing/prerollForRendering(using:))

Tells a custom video compositor to perform any work in the prerolling phase.

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

Information about upcoming composition requests, such as composition start time and end time.

### Rendering the composition

[`startRequest(_:)`](/documentation/AVFoundation/AVVideoCompositing/startRequest(_:))

Directs a custom video compositor object to create a new pixel buffer composed asynchronously from a collection of sources.

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

An object that contains information a video compositor needs to render an output pixel buffer.

[`cancelAllPendingVideoCompositionRequests()`](/documentation/AVFoundation/AVVideoCompositing/cancelAllPendingVideoCompositionRequests())

Directs a custom video compositor object to cancel or finish all pending video composition requests.



---

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)