---
title: VTCompressionOutputHandler
framework: videotoolbox
role: symbol
role_heading: Type Alias
path: videotoolbox/vtcompressionoutputhandler
---

# VTCompressionOutputHandler

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

## Declaration

```swift
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 doc://com.apple.videotoolbox/documentation/VideoToolbox/VTEncodeInfoFlags/asynchronous bit may be set if the encode ran asynchronously. The doc://com.apple.videotoolbox/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

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).

## See Also

### Callbacks

- [VTCompressionOutputCallback](videotoolbox/vtcompressionoutputcallback.md)
