我正在使用UIImagePickerController
来捕捉视频并存储它。当我尝试使用静态图像捕获时,一切正常,但是当我在视频模式下打开UIImagePickerController
时,图片总是有点模糊。当我尝试聚焦不同的物体时,我看到焦点发生了变化,但它仍然有点模糊(所以永远不会真正对焦)。这是iOS 9
的已知问题吗?我还尝试了一些来自互联网的示例项目,但结果相同。我尝试使用iPhone 6s
和iPhone 6
。
这是我使用的代码:
func actionSheet(sheet: ActionSheet, didSelectOption option: Int) {
let picker = UIImagePickerController()
picker.delegate = self
picker.navigationBar.tintColor = UIColor.whiteColor()
let statusView = UIView(frame: UIApplication.sharedApplication().statusBarFrame)
statusView.y = (-(UIApplication.sharedApplication().statusBarFrame.height))
statusView.backgroundColor = colorBlue
picker.navigationBar.insertSubview(statusView, atIndex: 1)
if sheet.tag == actionSheetTagTakePicture {
picker.allowsEditing = true
picker.sourceType = option == 1 ? .Camera : .PhotoLibrary
if option == 1 {
picker.cameraDevice = .Front
}
}
else {
picker.mediaTypes = [kUTTypeMovie as String]
picker.sourceType = option == 1 ? .Camera : .SavedPhotosAlbum
if option == 1 {
picker.cameraDevice = UIImagePickerControllerCameraDevice.Rear
picker.cameraDevice = .Rear
picker.cameraCaptureMode = .Video
}
}
self.presentViewController(picker, animated: true, completion: nil)
}
答案 0 :(得分:4)
好的,事实证明.videoQuality
的默认设置为.TypeMedium
。结果导致:
我改变了这样的设置:
picker.videoQuality = .TypeIFrame960x540
现在一切正常,视频也是16:9