<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMSampleBuffer/setOutputPresentationTimeStamp(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Media",
      "CoreMedia"
    ],
    "preciseIdentifier" : "s:So17CMSampleBufferRefa9CoreMediaE30setOutputPresentationTimeStampyySo6CMTimeaKF"
  },
  "title" : "setOutputPresentationTimeStamp(_:)"
}
-->

# setOutputPresentationTimeStamp(_:)

Sets an output presentation timestamp to use in place of a calculated value.

```
func setOutputPresentationTimeStamp(_ pts: CMTime) throws
```

## Parameters

`pts`

The output presentation timestamp.

## Discussion

This value is the time at which the system should present the decoded, trimmed, stretched and possibly reversed samples. By default, retrieving the value of the `outputPresentationTimeStamp` property calculates the time dynamically. You can use this method to set a specific value for `outputPresentationTimeStamp`.

For general forward playback in a scaled edit, calculate the timestamp as follows:

`((PresentationTimeStamp + TrimDurationAtStart - EditStartMediaTime) / EditSpeedMultiplier) + EditStartTrackTime`

For general reversed playback, calculate the timestamp as shown below:

`((PresentationTimeStamp + Duration - TrimDurationAtEnd - EditStartMediaTime) / EditSpeedMultiplier) + EditStartTrackTime`

---

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)