<!--
{
  "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/VTCompressionSessionGetTimeRangesForNextPass(_:timeRangeCountOut:timeRangeArrayOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Video Toolbox"
    ],
    "preciseIdentifier" : "c:@F@VTCompressionSessionGetTimeRangesForNextPass"
  },
  "title" : "VTCompressionSessionGetTimeRangesForNextPass(_:timeRangeCountOut:timeRangeArrayOut:)"
}
-->

# VTCompressionSessionGetTimeRangesForNextPass(_:timeRangeCountOut:timeRangeArrayOut:)

Retrieves the time ranges for the next pass.

```
func VTCompressionSessionGetTimeRangesForNextPass(_ session: VTCompressionSession, timeRangeCountOut: UnsafeMutablePointer<CMItemCount>, timeRangeArrayOut: UnsafeMutablePointer<UnsafePointer<CMTimeRange>?>) -> OSStatus
```

## Parameters

`session`

The compression session.

`timeRangeCountOut`

A pointer to the item count (<doc://com.apple.documentation/documentation/CoreMedia/CMItemCount>) to receive the number of `CMTimeRanges`.

`timeRangeArrayOut`

A pointer to a C array of `CMTimeRanges`. The storage for this array belongs to the compression session and should not be modified.The pointer is valid until the next call to [`VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:)`](/documentation/VideoToolbox/VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:)), or until the compression session is invalidated or finalized.

## Discussion

If [`VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:)`](/documentation/VideoToolbox/VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:)) sets `furtherPassesRequestedOut` to <doc://com.apple.documentation/documentation/Swift/true>, call this function to find out the time ranges for the next pass.  Source frames outside these time ranges should be skipped. Each time range includes any frame at its start time and does not include any frame at its end time.

It’s an error to call this function when multipass encoding has not been enabled by setting [`kVTCompressionPropertyKey_MultiPassStorage`](/documentation/VideoToolbox/kVTCompressionPropertyKey_MultiPassStorage), or when `VTCompressionSessionEndPass` did not set f`urtherPassesRequestedOut` to <doc://com.apple.documentation/documentation/Swift/true>.

---

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)