【发布时间】:2015-02-21 21:39:46
【问题描述】:
我一直在使用 avfoundation 并尝试通过以下代码缩放视频并录制或在录制时缩放
[CaptureSession startRunning];
NSError *error;
[VideoDevice lockForConfiguration:&error];
[VideoDevice setActiveFormat:[VideoDevice.formats objectAtIndex:15]];
[VideoDevice rampToVideoZoomFactor:5.0 withRate:1.0];
[VideoDevice unlockForConfiguration];
当我打电话时
[MovieFileOutput startRecordingToOutputFileURL:outputURL recordingDelegate:self];
它在扔
[AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] - no active/enabled connections.'
如果我只是拍摄静止图像,则变焦工作正常,我可以拍摄静止图像,但我不仅不能在变焦后拍摄视频,也不能在录制时变焦。
由此推断IOS不支持静态视频缩放?
我还认为,当我更改支持缩放的视频活动格式时,它会导致崩溃,尽管我正在使用
[CaptureSession setSessionPreset:AVCaptureSessionPresetHigh];
在我的配置中。
请指教!
【问题讨论】:
-
@Roecrew 请您仔细阅读我的问题吗?我做了你提到的同样的事情,但我的问题是如何缩放而不是如何在录制时缩放。
标签: ios objective-c iphone video avfoundation