iOS使用低AVCaptureSessionPreset进行视频输出时捕获高分辨率照片 [英] iOS Capture high resolution photo while using a low AVCaptureSessionPreset for video output

查看:1209
本文介绍了iOS使用低AVCaptureSessionPreset进行视频输出时捕获高分辨率照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和下面的问题几乎相同:

I have pretty much the same question as this one below:

在拍摄照片时切换AVCaptureSession预设

然而问题是(自我)答案没有帮我一点。我想知道是否有人知道如何做到这一点。

The issue however is that the (self) answer doesn't help me one bit. I am wondering if someone has a clue as to how to do this.

我正在捕捉视频帧,所以我可以处理它们并用它们做点什么。为此,我使用 AVCaptureSessionPrese640x480 ,因为我需要获得一个体面的计算帧时可以获得的所有帧速率。现在,当用户想要拍摄照片时,我希望他能够以尽可能高的分辨率拍摄照片。为此,我不赞成:

I am capture video frames so I can process them and do something with them. For this, I am using the AVCaptureSessionPrese640x480 as I need all the frame rate I can get while getting a decent frame for computation. Now, when the user wants to capture the photo, I want him to be able to capture the photo in the highest resolution possible. For this, I am not in the favor of:

[captureSession beginConfiguration];
captureSession.sessionPreset = <some_preset>
[captureSession commitConfiguration];

我试过这个,我在某些情况下收到错误;但由于某些原因,屏幕仍有一定的滞后性,我不再相信这一点了。

I have tried this and I am getting an error in some cases; but still there is a definite lag on the screen for some reason and I don't trust this anymore.

是否有明确的方法可以从中获取高分辨率图像相机以非常低的分辨率捕获视频输出(例如640x480)?

Is there a definite way of getting a high resolution image from the camera while capturing video output in a very low resolution (for e.g. 640x480)?

推荐答案

对于iPhone6和iPhone6 +,您可以使用新API
[AVCaptureStillImageOutput setHighResolutionStillImageOutputEnabled:YES]
当此标志打开时(默认情况下关闭),您可以捕获高分辨率使用低分辨率捕获会话时的静止图像。

For iPhone6 and iPhone6+, you can use the new API [AVCaptureStillImageOutput setHighResolutionStillImageOutputEnabled:YES] When this flag has been turned on (it is off by default), you can capture the high res still image while using a low resolution capture session.

这篇关于iOS使用低AVCaptureSessionPreset进行视频输出时捕获高分辨率照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆