<!--
{
  "availability" : [
    "ProVideo Encoder Extensions: 1.0.0 -",
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Professional Video Applications",
  "identifier" : "/documentation/professional_video_applications/CompressorMediaDecoder/copyFrame(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Professional Video Applications"
    ],
    "preciseIdentifier" : "c:objc(pl)CompressorMediaDecoder(im)copyFrame:"
  },
  "title" : "copyFrame(_:)"
}
-->

# copyFrame(_:)

Returns the decoded video frame indicated by the frame number.

```
func copyFrame(_ frameNumber: Int64) -> IOSurface!
```

## Parameters

`frameNumber`

The video frame to retrieve.

## Return Value

IOSurface-based video frame buffers.

## Discussion

Use the values in the [`decodingAttributes()`](/documentation/professional_video_applications/CompressorMediaDecoder/decodingAttributes()) dictionary to find the video attributes, such as height and pixel ratio, of the decoded frame.

---

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)