0
我想製作一個自定義錄像機的iPhone應用程序,我需要支持240 fps。但是,當我將AVCaptureDevice
設置爲使用格式和activeVideoMaxFrameDuration
時,整個視頻視圖就會被凍結。如果我使用60fps,120fps,一切正常,沒有任何問題。iOS慢動作記錄
對於輸出部分,我正在使用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];
});