Currently I am working on an App, where I want to play a video really fast, up to 20 times of the normal play rate. I just realized now, that AVPlayer
of AVFoundation
just supports a playback rate of 2.0 . With a higher rate the video doesn't play fluently anymore.
Do you have any suggestions about other video frameworks, which you could recommend in order to solve my problem?
Thank you very much in advance!
In case someone is still stuck with this and wants
AVPlayer
to play a video faster than 2.0:You'll need to create an
AVMutableComposition
and scale the time range to the desired one. After doing that, you can further multiply it usingAVPlayer
's playback rate, up to 2x.This SO answer explains how to do it.
Here's a Swift version:
myAVPlayer.currentItem.audioTimePitchAlgorithm
has default valueAVAudioTimePitchAlgorithmLowQualityZeroLatency
available rates for this mode: {0.5, 0.666667, 0.8, 1.0, 1.25, 1.5, 2.0}change
audioTimePitchAlgorithm
tomyAVPlayer.currentItem.audioTimePitchAlgorithm = AVAudioTimePitchAlgorithmVarispeed
rates from 0,03125x to 32x