iOS慢动作记录
我正在尝试制作一个定制的录像机iPhone应用程序,我需要支持240 fps。但是,当我将我的iOS慢动作记录,ios,video,recording,slowmotion,Ios,Video,Recording,Slowmotion,我正在尝试制作一个定制的录像机iPhone应用程序,我需要支持240 fps。但是,当我将我的AVCaptureDevice设置为使用该格式和activeVideoMaxFrameDuration时,整个视频视图就会冻结。如果我用60帧,120帧,一切都很好,没有任何问题 对于输出部分,我使用的是AVCaptureMovieFileOutput,如果需要的话,我还设置了曝光自动对焦模式 [self.videoConnection setPreferredVideoStabilizationMod
AVCaptureDevice
设置为使用该格式和activeVideoMaxFrameDuration
时,整个视频视图就会冻结。如果我用60帧,120帧,一切都很好,没有任何问题
对于输出部分,我使用的是AVCaptureMovieFileOutput,如果需要的话,我还设置了曝光自动对焦模式
[self.videoConnection setPreferredVideoStabilizationMode:AVCaptureVideoStabilizationModeOff];
if ([self.videoDevice isExposureModeSupported:AVCaptureExposureModeAutoExpose] &&
[self.videoDevice lockForConfiguration:&error]) {
[self.videoDevice setExposureMode:AVCaptureExposureModeContinuousAutoExposure];
[self.videoDevice unlockForConfiguration];
}
if ([self.videoDevice isFocusModeSupported:AVCaptureFocusModeAutoFocus] &&
[self.videoDevice lockForConfiguration:&error]) {
[self.videoDevice setFocusMode:AVCaptureFocusModeContinuousAutoFocus];
[self.videoDevice unlockForConfiguration];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self tapInView:nil];
});
解决方案与自动对焦和曝光有关。当设备的相机处于120/240fps模式时,我们需要禁用手动对焦和曝光,但仍保持自动对焦和自动曝光打开。这将防止相机冻结