IOS AVCaptureSession - How to get / set the number of recorded frames per second?

I am new to AVCaptureSession and want to better understand how to work with it. Therefore, I managed to capture the video stream as a dedicated CIImages and convert them to UIImages. Now I want to be able to get the number of frames per second captured and, preferably, be able to set it.

Any idea how to do this?

+7
source share
2 answers

To set the value, you can use the AVCaptureConnection videoMinFrameDuration accessor.

See AVCaptureConnection Documentation

Consider the output be AVCaptureVideoDataOutput .

 AVCaptureConnection *conn = [output connectionWithMediaType:AVMediaTypeVideo]; if (conn.isVideoMinFrameDurationSupported) conn.videoMinFrameDuration = CMTimeMake(1, CAPTURE_FRAMES_PER_SECOND); if (conn.isVideoMaxFrameDurationSupported) conn.videoMaxFrameDuration = CMTimeMake(1, CAPTURE_FRAMES_PER_SECOND); 

For more information, see my answer in this SO question

+7
source

AVCaptureConnection videoMinFrameDuration deprecated.

You can use the AVCaptureDevice properties to detect the supported video frame rate ranges and set the minimum and maximum frame rates using the properties.

device.activeFormat.videoSupportedFrameRateRanges return all the video frame rate ranges supported by the device.

device.activeVideoMinFrameDuration and device.activeVideoMaxFrameDuration can be used to indicate frame duration.

+10
source

All Articles