<!--
{
  "availability" : [
    "iOS: 9.0.0 - 18.0.0",
    "iPadOS: 9.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.11.0 - 15.0.0",
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVVideoComposition/init(asset:applyingCIFiltersWithHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVVideoComposition(cm)videoCompositionWithAsset:applyingCIFiltersWithHandler:"
  },
  "title" : "init(asset:applyingCIFiltersWithHandler:)"
}
-->

# init(asset:applyingCIFiltersWithHandler:)

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

```
init(asset: AVAsset, applyingCIFiltersWithHandler applier: @escaping @Sendable (AVAsynchronousCIImageFilteringRequest) -> Void)
```

## Parameters

`asset`

The asset whose configuration matches the intended use of the video composition.

`applier`

A block that AVFoundation calls when processing each video frame.

    The block takes a single parameter and has no return value:

- request: An [`AVAsynchronousCIImageFilteringRequest`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest) object representing the frame to be processed.

## Return Value

A new video composition object.

## Discussion

Apple discourages using this method in iOS 16, tvOS 16, and macOS 13 or later. Create a video composition asynchronously using [`videoComposition(with:applyingCIFiltersWithHandler:completionHandler:)`](/documentation/AVFoundation/AVVideoComposition/videoComposition(with:applyingCIFiltersWithHandler:completionHandler:)) instead.

To process video frames using Core Image filters—whether for display or export—create a composition with this method. AVFoundation calls your applier block one time for each frame to display (or processed for export) from the asset’s first enabled video track. In that block, you access the video frame and return a filtered result using the provided [`AVAsynchronousCIImageFilteringRequest`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest) object. Use that object’s [`sourceImage`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/sourceImage) property to get the video frame in the form of a <doc://com.apple.documentation/documentation/CoreImage/CIImage> object you can apply filters to. Pass the result of your filters to the `request` object’s [`finish(with:context:)`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/finish(with:context:)) method. (If your filter rendering fails, call the `request` object’s [`finish(with:)`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/finish(with:)) method if you can’t apply filters).

Creating a composition with this method sets values for the following properties:

- The value of the [`frameDuration`](/documentation/AVFoundation/AVVideoComposition/frameDuration) property accommodates the [`nominalFrameRate`](/documentation/AVFoundation/AVAssetTrack/nominalFrameRate) value for the asset’s first enabled video track. If the nominal frame rate is zero, AVFoundation uses a default frame rate of 30 fps.
- The [`renderSize`](/documentation/AVFoundation/AVVideoComposition/renderSize) property value a size that encompasses the asset’s first enabled video track, respecting the track’s [`preferredTransform`](/documentation/AVFoundation/AVAssetTrack/preferredTransform) property.
- The [`renderScale`](/documentation/AVFoundation/AVVideoComposition/renderScale) property value is `1.0`.

---

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)