<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 10.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoToolbox",
  "identifier" : "/documentation/VideoToolbox/VTCompressionSessionBeginPass(_:flags:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Video Toolbox"
    ],
    "preciseIdentifier" : "c:@F@VTCompressionSessionBeginPass"
  },
  "title" : "VTCompressionSessionBeginPass(_:flags:_:)"
}
-->

# VTCompressionSessionBeginPass(_:flags:_:)

Marks the start of a specific compression pass.

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

## Parameters

`session`

A compression session.

`beginPassFlags`

Pass [`beginFinalPass`](/documentation/VideoToolbox/VTCompressionSessionOptionFlags/beginFinalPass) to inform the encoder that the pass must be the final pass.

`reserved`

A reserved value.

## Discussion

During multipass encoding, this function must be called before [`VTCompressionSessionEncodeFrame(_:imageBuffer:presentationTimeStamp:duration:frameProperties:sourceFrameRefcon:infoFlagsOut:)`](/documentation/VideoToolbox/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`](/documentation/VideoToolbox/kVTCompressionPropertyKey_MultiPassStorage).

## Topics

### Option Flags

[`VTCompressionSessionOptionFlags`](/documentation/VideoToolbox/VTCompressionSessionOptionFlags)

Flags to pass to a compression session.



---

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)