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

# VTCompressionSessionEncodeMultiImageFrameWithOutputHandler

Passes a multi-image frame to a compression session for encoding and provides a callback to handle the output.

```
extern OSStatus VTCompressionSessionEncodeMultiImageFrameWithOutputHandler(VTCompressionSessionRef session, CMTaggedBufferGroupRef taggedBufferGroup, CMTime presentationTimeStamp, CMTime duration, CFDictionaryRef frameProperties, VTEncodeInfoFlags *infoFlagsOut, VTCompressionOutputHandler outputHandler);
```

## Parameters

`session`

The compression session.

`taggedBufferGroup`

A <doc://com.apple.documentation/documentation/CoreMedia/CMTaggedBufferGroupRef> that contains the multiple images for a video frame to compress.

`presentationTimeStamp`

The presentation timestamp for this frame to attach to the sample buffer. Each presentation timestamp that you pass to a session must be greater than the previous one.

`duration`

The presentation duration for this frame to attach to the sample buffer. Pass a value of <doc://com.apple.documentation/documentation/CoreMedia/CMTime/invalid> if you don’t have duration information.

`frameProperties`

A dictionary that specifies additional properties for encoding this frame. Some session properties may also change between frames, which affect subsequently encoded frames.

`infoFlagsOut`

Points to a [`VTEncodeInfoFlags`](/documentation/VideoToolbox/VTEncodeInfoFlags) value to receive information about the encode operation.

    The system sets the [`asynchronous`](/documentation/VideoToolbox/VTEncodeInfoFlags/asynchronous)     flag if the encode runs asynchronously.

    The system sets the [`frameDropped`](/documentation/VideoToolbox/VTEncodeInfoFlags/frameDropped)     flag if the encoding process dropped a frame (synchronously).

    Pass     `NULL`     if you don’t want to receive this information.

`outputHandler`

A callback the system invokes when it completes encoding a frame.

    The system may invoke this callback asynchronously, on a different thread from the one that calls [`VTCompressionSessionEncodeMultiImageFrameWithOutputHandler`](/documentation/VideoToolbox/VTCompressionSessionEncodeMultiImageFrameWithOutputHandler)    .

## Return Value

An `OSStatus` value that indicates the result of the operation.

## Discussion

The system doesn’t guarantee that encoded frames be output before the function returns. The session and encoder retain the image buffer as long as necessary.

You can’t call this function on a session created with a [`VTCompressionOutputCallback`](/documentation/VideoToolbox/VTCompressionOutputCallback).

> Important:
> Don’t modify the pixel data after making this call.

---

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)