<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 15.4.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoToolbox",
  "identifier" : "/documentation/VideoToolbox/VTFrameProcessorOpticalFlow/init(forwardFlow:backwardFlow:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Video Toolbox"
    ],
    "preciseIdentifier" : "c:objc(cs)VTFrameProcessorOpticalFlow(im)initWithForwardFlow:backwardFlow:"
  },
  "title" : "init(forwardFlow:backwardFlow:)"
}
-->

# init(forwardFlow:backwardFlow:)

Creates an object with forward and backward optical flow pixel buffers.

```
init?(forwardFlow: CVPixelBuffer, backwardFlow: CVPixelBuffer)
```

## Parameters

`forwardFlow`

A pixel buffer that contains forward optical flow. This value must be non-NULL and IOSurface backed.

`backwardFlow`

A pixel buffer that contains backward optical flow. his value must be non-NULL and IOSurface backed.

## Discussion

Instances retain the buffers backing them. Returns NULL if a NULL CVPixelBuffer is provided or if CVPixelBuffers are not IOSurface backed.

---

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)