<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVPixelBufferGetBaseAddress(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@F@CVPixelBufferGetBaseAddress"
  },
  "title" : "CVPixelBufferGetBaseAddress(_:)"
}
-->

# CVPixelBufferGetBaseAddress(_:)

Returns the base address of the pixel buffer.

```
func CVPixelBufferGetBaseAddress(_ pixelBuffer: CVPixelBuffer) -> UnsafeMutableRawPointer?
```

## Parameters

`pixelBuffer`

The pixel buffer whose base address you want to obtain.

## Return Value

The base address of the pixel buffer.

## Discussion

The pointer returned by this function depends on the type of buffer and the conditions under which it was created.

- For chunky buffers, returns a pointer to the pixel at (0,0) in the buffer.
- For planar buffers, returns a pointer to a [`CVPlanarComponentInfo`](/documentation/CoreVideo/CVPlanarComponentInfo) structure, or `NULL` if no such structure is present.

Because this function returns `NULL` for some planar buffers, you should call [`CVPixelBufferGetBaseAddressOfPlane(_:_:)`](/documentation/CoreVideo/CVPixelBufferGetBaseAddressOfPlane(_:_:)) and [`CVPixelBufferGetBytesPerRowOfPlane(_:_:)`](/documentation/CoreVideo/CVPixelBufferGetBytesPerRowOfPlane(_:_:)) to get information about a planar buffer.

Retrieving the base address for a pixel buffer requires that the buffer base address be locked using the [`CVPixelBufferLockBaseAddress(_:_:)`](/documentation/CoreVideo/CVPixelBufferLockBaseAddress(_:_:)) function.

---

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)