---
title: "VTCompressionSessionGetTimeRangesForNextPass(_:timeRangeCountOut:timeRangeArrayOut:)"
framework: videotoolbox
role: symbol
role_heading: Function
path: "videotoolbox/vtcompressionsessiongettimerangesfornextpass(_:timerangecountout:timerangearrayout:)"
---

# VTCompressionSessionGetTimeRangesForNextPass(_:timeRangeCountOut:timeRangeArrayOut:)

Retrieves the time ranges for the next pass.

## Declaration

```swift
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 doc://com.apple.videotoolbox/documentation/VideoToolbox/VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:), or until the compression session is invalidated or finalized.

## Discussion

Discussion If VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:) sets furtherPassesRequestedOut to 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, or when VTCompressionSessionEndPass did not set furtherPassesRequestedOut to true.

## See Also

### Performing Multiple Passes

- [VTCompressionSessionBeginPass(_:flags:_:)](videotoolbox/vtcompressionsessionbeginpass(_:flags:_:).md)
- [VTCompressionSessionEndPass(_:furtherPassesRequestedOut:_:)](videotoolbox/vtcompressionsessionendpass(_:furtherpassesrequestedout:_:).md)
