本文介绍了iOS AVCaptureSession-如何获取/设置每秒记录的帧数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我是AVCaptureSession的新手,希望更好地了解如何使用它.因此,我设法将视频流捕获为单独的CIImages,并将其转换为UIImages.现在,我希望能够捕获每秒的帧数,并且最好能够进行设置.

I'm new to AVCaptureSession and wish to better understand how to work with it.So I managed capturing the video stream as separated CIImages and convert them to UIImages.Now I wish to be able to get the number of Frames Per Second captured and preferably to be able to set it.

有什么想法吗?

推荐答案

您可以使用AVCaptureConnectionvideoMinFrameDuration访问器来设置值.

You could use AVCaptureConnection's videoMinFrameDuration accessor to set the value.

请参见 AVCaptureConnection文档

考虑outputAVCaptureVideoDataOutput对象.

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);

更多信息,请参见此 SO问题

这篇关于iOS AVCaptureSession-如何获取/设置每秒记录的帧数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 14:08