<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoToolbox",
  "identifier" : "/documentation/VideoToolbox/VTMotionEstimationSessionEstimateMotionVectors",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Video Toolbox"
    ],
    "preciseIdentifier" : "c:@F@VTMotionEstimationSessionEstimateMotionVectors"
  },
  "title" : "VTMotionEstimationSessionEstimateMotionVectors"
}
-->

# VTMotionEstimationSessionEstimateMotionVectors

Creates a new pixel buffer that contains motion vectors between the input pixel buffers.

```
extern OSStatus VTMotionEstimationSessionEstimateMotionVectors(VTMotionEstimationSessionRef session, CVPixelBufferRef referenceImage, CVPixelBufferRef currentImage, VTMotionEstimationFrameFlags motionEstimationFrameFlags, CFDictionaryRef additionalFrameOptions, VTMotionEstimationOutputHandler outputHandler);
```

## Parameters

`session`

The motion-estimation session.

`referenceImage`

The reference image.

`currentImage`

The current image.

`motionEstimationFrameFlags`

A bit field with per-frame options. See `kVTMotionEstimationFrameFlags_CurrentBufferWillBeNextReferenceBuffer`.

`additionalFrameOptions`

A way to pass additional information that doesn’t fit in `motionEstimationFrameFlags`;
currently the system expects it to be `NULL`.

`outputHandler`

The block invoked by the syetem when the processing request is completed. If the
`VTMotionEstimationSessionCreateMotionEstimation` call returns an error, the system does not invoke the block.

## Return Value

If the call was successful, returns `noErr`; otherwise, returns an error code, such as `kVTMotionEstimationNotSupportedErr`.

## Discussion

The motion-estimation session compares the reference frame to the current frame, and generates motion vectors in
the form of a `CVPixelBuffer`.

---

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)