Changing Frame Rate

I have set up an AVCaptureSession that connects to a video Preview Layer, and I am trying to give the option of changing the currect active format (Dimensions and FPS).

However after changing the camera settings the video preview layer is runnning a lot slower now. What could be the issue?

Code Block language
try backCamera.lockForConfiguration()
backCamera.activeFormat = recordingOptions[indexPath.row].0
let duration = recordingOptions[indexPath.row].1
backCamera.activeVideoMinFrameDuration = CMTime(seconds: 1, preferredTimescale: Int32(duration))
backCamera.activeVideoMaxFrameDuration = CMTime(seconds: 1, preferredTimescale: Int32(duration))
backCamera.unlockForConfiguration()


Changing Frame Rate
 
 
Q