setOutputPresentationTimeStamp(_:)
Sets an output presentation timestamp to use in place of a calculated value.
Declaration
func setOutputPresentationTimeStamp(_ pts: CMTime) throwsParameters
- 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