0

I am adding 60fps video files to an AVMutableComposition and I am wondering if its possible to play that composition back at half speed.

This is where its adding to the video track

do {
        try videoTrack?.insertTimeRange(CMTimeRangeMake(start: start, duration: duration),
                                                   of: asset.tracks(withMediaType: AVMediaType.video)[0] ,
                                                   at: lastTime)
    } catch {
        print("Failed to insert video track")
    }

And thats the part that plays it back in a window

    let videoPlayer = AVPlayer(playerItem: playerItem)
    playerLayer.player = videoPlayer
    videoPlayer.play()

Any pointers to how the playback could be slowed down to 30fps?

jodldoe
  • 67
  • 7

1 Answers1

0
    videoPlayer.play()
    videoPlayer.rate = 0.5

Seems to do the trick, but I don't know of a way to check if its playing 60fps at 30fps, or the default framerate at half speed.

jodldoe
  • 67
  • 7