---
title: "VTCompressionSessionBeginPass(_:flags:_:)"
framework: videotoolbox
role: symbol
role_heading: Function
path: "videotoolbox/vtcompressionsessionbeginpass(_:flags:_:)"
---

# VTCompressionSessionBeginPass(_:flags:_:)

Marks the start of a specific compression pass.

## Declaration

```swift
func VTCompressionSessionBeginPass(_ session: VTCompressionSession, flags beginPassFlags: VTCompressionSessionOptionFlags, _ reserved: UnsafeMutablePointer<UInt32>?) -> OSStatus
```

## Parameters

- `session`: A compression session.
- `beginPassFlags`: Pass doc://com.apple.videotoolbox/documentation/VideoToolbox/VTCompressionSessionOptionFlags/beginFinalPass to inform the encoder that the pass must be the final pass.
- `reserved`: A reserved value.

## Discussion

Discussion During multipass encoding, this function must be called before VTCompressionSessionEncodeFrame(_:imageBuffer:presentationTimeStamp:duration:frameProperties:sourceFrameRefcon:infoFlagsOut:). It’s an error to call this function when multipass encoding is not enabled by setting kVTCompressionPropertyKey_MultiPassStorage.

## Topics

### Option Flags

- [VTCompressionSessionOptionFlags](videotoolbox/vtcompressionsessionoptionflags.md)

## See Also

### Performing Multiple Passes

- [VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:)](videotoolbox/vtcompressionsessionendpass(_:furtherpassesrequestedout:_:).md)
- [VTCompressionSessionGetTimeRangesForNextPass(_:timeRangeCountOut:timeRangeArrayOut:)](videotoolbox/vtcompressionsessiongettimerangesfornextpass(_:timerangecountout:timerangearrayout:).md)
