<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 10.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoToolbox",
  "identifier" : "/documentation/VideoToolbox/VTCompressionOutputHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Video Toolbox"
    ],
    "preciseIdentifier" : "c:@T@VTCompressionOutputHandler"
  },
  "title" : "VTCompressionOutputHandler"
}
-->

# VTCompressionOutputHandler

A callback for the system to invoke when it’s finished compressing a frame.

```
typealias VTCompressionOutputHandler = @Sendable (OSStatus, VTEncodeInfoFlags, CMSampleBuffer?) -> Void
```

## Parameters

`status`

`noErr` if compression was successful; an error code if compression was not successful.

`infoFlags`

Contains information about the encode operation.

    The [`asynchronous`](/documentation/VideoToolbox/VTEncodeInfoFlags/asynchronous)     bit may be set if the encode ran asynchronously.

    The [`frameDropped`](/documentation/VideoToolbox/VTEncodeInfoFlags/frameDropped)     bit may be set if the frame was dropped.

`sampleBuffer`

Contains the compressed frame if compression was successful and the frame was not dropped; otherwise, `NULL`.

## Discussion

When you encode a frame, you pass in a callback block to be called for that compressed frame.  This block is called in decode order (which is not necessarily the same as display order).

---

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)