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

# AVAsynchronousCIImageFilteringRequest

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

```
class AVAsynchronousCIImageFilteringRequest
```

## Overview

You use this class when creating a composition for Core Image filtering with the [`init(asset:applyingCIFiltersWithHandler:)`](/documentation/AVFoundation/AVVideoComposition/init(asset:applyingCIFiltersWithHandler:)) method. In that method call, you provide a block to be called by AVFoundation as it processes each frame of video, and the block’s sole parameter is a [`AVAsynchronousCIImageFilteringRequest`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest) object. Use that object both to the video frame image to be filtered and allows you to return a filtered image to AVFoundation for display or export. The code listing below shows an example of applying a filter to an asset.

```swift
guard let filter = CIFilter(name: "CIGaussianBlur") else { return }
let composition = AVVideoComposition(asset: asset) { request in
    // Clamp to avoid blurring transparent pixels at the image edges.
    let source = request.sourceImage.clampedToExtent()
    filter.setValue(source, forKey: kCIInputImageKey)

    // Vary filter parameters based on the video timing.
    let seconds = CMTimeGetSeconds(request.compositionTime)
    filter.setValue(seconds * 10.0, forKey: kCIInputRadiusKey)
            
    // Crop the blurred output to the bounds of the original image.
    if let output = filter.outputImage?.cropped(to: request.sourceImage.extent) {
        request.finish(with: output, context: nil)
    } else {
        request.finish(with: AppError.customError)
    }
}
```

> Tip:
> To use the created video composition for playback, create an ``doc://com.apple.avfoundation/documentation/AVFoundation/AVPlayerItem`` object from the same asset used as the composition’s source, then assign the composition to the player item’s ``doc://com.apple.avfoundation/documentation/AVFoundation/AVPlayerItem/videoComposition`` property. To export the composition to a new movie file, create an ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetExportSession`` object from the same source asset, then assign the composition to the export session’s ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetExportSession/videoComposition`` property.

## Topics

### Getting the image to be filtered

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

The current video frame image.

### Getting contextual information for filtering

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

The time in the video composition corresponding to the frame being processed.

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

The width and height, in pixels, of the frame being processed.

### Returning the filtered image

[`finish(with:context:)`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/finish(with:context:))

Provides the filtered video frame image to AVFoundation for further processing or display.

[`finish(with:)`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/finish(with:))

Notifies AVFoundation that you cannot fulfill the image filtering request.



---

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)