<!--
{
  "availability" : [
    "iOS: 6.0.0 - 27.0.0",
    "iPadOS: 6.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.8.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerItemVideoOutput/copyPixelBuffer(forItemTime:itemTimeForDisplay:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerItemVideoOutput(im)copyPixelBufferForItemTime:itemTimeForDisplay:"
  },
  "title" : "copyPixelBuffer(forItemTime:itemTimeForDisplay:)"
}
-->

# copyPixelBuffer(forItemTime:itemTimeForDisplay:)

Retrieves an image that is appropriate for display at the specified item time, and marks the image as acquired.

```
func copyPixelBuffer(forItemTime itemTime: CMTime, itemTimeForDisplay outItemTimeForDisplay: UnsafeMutablePointer<CMTime>?) -> CVPixelBuffer?
```

## Parameters

`itemTime`

The time at which you want to retrieve the image from the item.

`outItemTimeForDisplay`

The time by which you intend to use the returned pixel buffer. You may specify `nil` for this parameter if you do not have a specific deadline.

## Return Value

A pixel buffer containing the image data to display or `nil` if nothing should be displayed at the specified time. The caller is responsible for calling <doc://com.apple.documentation/documentation/CoreVideo/CVBufferRelease> on the returned data when it is no longer needed.

## Discussion

Typically, you call this method in response to a CVDisplayLink callback or a <doc://com.apple.documentation/documentation/QuartzCore/CADisplayLink> delegate method call when the [`hasNewPixelBuffer(forItemTime:)`](/documentation/AVFoundation/AVPlayerItemVideoOutput/hasNewPixelBuffer(forItemTime:)) method also returns <doc://com.apple.documentation/documentation/Swift/true>.

After calling this method, the video output object marks the pixel buffer data as having been acquired. This causes the [`hasNewPixelBuffer(forItemTime:)`](/documentation/AVFoundation/AVPlayerItemVideoOutput/hasNewPixelBuffer(forItemTime:)) method to return <doc://com.apple.documentation/documentation/Swift/false> unless newer data becomes available.

---

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)