Ios AVF基金会没有';不允许以240fps的速度捕获视频

Ios AVF基金会没有';不允许以240fps的速度捕获视频,ios,avfoundation,video-capture,Ios,Avfoundation,Video Capture,我曾多次尝试在上面的iOS 7版本中捕获240fps的视频。但所有的尝试都失败了。我的代码如下 CGFloat frameRate = 240.f; for (AVCaptureDeviceFormat *videoFormat in [self.inputCamera formats]) { CMFormatDescriptionRef videoFormatDescriptionRef = videoFormat.formatDescription; Float64 max

我曾多次尝试在上面的iOS 7版本中捕获240fps的视频。但所有的尝试都失败了。我的代码如下

CGFloat frameRate = 240.f;

for (AVCaptureDeviceFormat *videoFormat in [self.inputCamera formats]) {
    CMFormatDescriptionRef videoFormatDescriptionRef = videoFormat.formatDescription;
    Float64 maxFrameRate = ((AVFrameRateRange *) [videoFormat.videoSupportedFrameRateRanges objectAtIndex:0]).maxFrameRate;

    if (maxFrameRate >= frameRate && CMFormatDescriptionGetMediaSubType(videoFormatDescriptionRef) == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {

        if ([self.inputCamera lockForConfiguration:nil]) {

            self.inputCamera.activeFormat = videoFormat;
            [self.inputCamera setActiveVideoMinFrameDuration:CMTimeMake(600.f/(CGFloat)_frameRate, 600)];
            [self.inputCamera setActiveVideoMaxFrameDuration:CMTimeMake(600.f/(CGFloat)_frameRate, 600)];

            [self.inputCamera unlockForConfiguration];
        }
    }
}

AVCaptureConnection *connection = [videoOutput connectionWithMediaType:AVMediaTypeVideo];
if ( connection ) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    if ([connection respondsToSelector:@selector(setVideoMinFrameDuration:)])
        connection.videoMinFrameDuration = CMTimeMake(1, _frameRate);

    if ([connection respondsToSelector:@selector(setVideoMaxFrameDuration:)])
        connection.videoMaxFrameDuration = CMTimeMake(1, _frameRate);
#pragma clang diagnostic pop
}
如果我试图直接将帧速率设置为240fps,它就会崩溃。因此,我必须在iOS支持的值和240 fps之间设置最小值

有人能帮我吗


尊敬。

我认为最大速度为60 fps,这取决于您选择的捕获设备