---
title: "CMSampleBufferGetPresentationTimeStamp(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmsamplebuffergetpresentationtimestamp(_:)"
---

# CMSampleBufferGetPresentationTimeStamp(_:)

Returns the presentation timestamp that’s the earliest numerically of all the samples in a sample buffer.

## Declaration

```swift
func CMSampleBufferGetPresentationTimeStamp(_ sbuf: CMSampleBuffer) -> CMTime
```

## Parameters

- `sbuf`: The CMSampleBuffer being interrogated.

## Return Value

Return Value Numerically earliest sample presentation timestamp in the CMSampleBuffer.  kCMTimeInvalid is returned if there is an error.

## Discussion

Discussion For in-presentation-order samples, this is the presentation timestamp of the first sample. For out-of-presentation-order samples, this is the presentation timestamp of the sample that will be presented first, which isn’t necessarily the first sample in the buffer.

## See Also

### Inspecting Duration and Timing

- [CMSampleBufferGetDuration(_:)](coremedia/cmsamplebuffergetduration(_:).md)
- [CMSampleBufferGetDecodeTimeStamp(_:)](coremedia/cmsamplebuffergetdecodetimestamp(_:).md)
- [CMSampleBufferGetOutputDuration(_:)](coremedia/cmsamplebuffergetoutputduration(_:).md)
- [CMSampleBufferGetOutputDecodeTimeStamp(_:)](coremedia/cmsamplebuffergetoutputdecodetimestamp(_:).md)
- [CMSampleBufferGetOutputPresentationTimeStamp(_:)](coremedia/cmsamplebuffergetoutputpresentationtimestamp(_:).md)
- [CMSampleBufferSetOutputPresentationTimeStamp(_:newValue:)](coremedia/cmsamplebuffersetoutputpresentationtimestamp(_:newvalue:).md)
- [CMSampleBufferGetSampleTimingInfo(_:at:timingInfoOut:)](coremedia/cmsamplebuffergetsampletiminginfo(_:at:timinginfoout:).md)
- [CMSampleBufferGetSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)](coremedia/cmsamplebuffergetsampletiminginfoarray(_:entrycount:arraytofill:entriesneededout:).md)
- [CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)](coremedia/cmsamplebuffergetoutputsampletiminginfoarray(_:entrycount:arraytofill:entriesneededout:).md)
