安卓:与&QUOT录像;连续"自动对焦 [英] Android: record video with "continuous" auto-focus

查看:496
本文介绍了安卓:与&QUOT录像;连续"自动对焦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的录像;一切正常,除了要求连续对焦。这是我做的(都尝试在surfaceCreated和surfaceChanged没有成功):

I work on video recording; everything works except for requesting continuous focus. This is what I do (tried both in surfaceCreated and surfaceChanged with no success):

camera = Camera.open();
camera.setPreviewDisplay(holder);

Parameters parameters = camera.getParameters();

然后我做任何

then I do either

parameters.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);

parameters.set("focus-mode", "continuous-video");

两者都应该做同样的事情;然后,我设置的参数

both should do the same thing; then I set parameters with

camera.setParameters(parameters);

这最后一行老是死机!所以,做我错过了什么?

This last line always crashes! So do I miss something?

顺便说一句,我在测试类似Desire HD的,的Galaxy S,Galaxy Tab的7和10.1,其中必须有连续自动对焦支持,而新设备;至少它们的内置摄像头的应用程序支持。

By the way, I test on rather new devices like Desire HD, Galaxy S, Galaxy Tab 7 and 10.1, which must have support for continuous auto-focus; at least their built-in camera apps support it.

推荐答案

好吧,我有几分解决了这个问题:我是能够进行手动对焦摄像头调用相机#自动对焦(...)

Ok, I have sort of solution to this problem: I was able to manually focus camera calling Camera#autoFocus(...).

这仍然有严重的问题。首先,调用自动对焦在拍摄视频时不工作的一些三星设备。此外,它是不是一个好主意,迫使用户视频录制过程中手动对焦。

This still has serious issues. First, calling autofocus while shooting video is not working on some Samsung devices. Also it's not a good idea to force your users to manually focus the camera during video recording.

所以,如果你能为一般集中你的视频,同时记录 - 你的建议将是非常有益

So if you were able to normally focus your videos while recording - your advice would be very helpful.

这篇关于安卓:与&QUOT录像;连续"自动对焦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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