Android中的连拍模式相机,可以拍摄多张照片 [英] Burst mode camera in Android which can take multiple pictures
问题描述
我试图在我的应用中实现连拍模式相机,它可以以每秒 5-10(或更多)张快照的速度拍摄多张照片.
I was trying to implement a burst mode camera in my app, which can take multiple pictures at the rate of 5-10(or more) snaps per second.
仅供参考,我已经看到了之前的问题这里,这里和这里 - 尝试并以速度失败.此外,这些问题很老,没有全面的答案来解决所有问题,例如如何管理堆等.
FYI I already saw the previous questions here, here and here - tried and failed with speed. Also the questions are old and there are no comprehensive answers addressing all the concerns like how to manage heap etc.
如果有人能提供有用的指导、最佳实践或 SSCCE,我将不胜感激.
I would really appreciate if someone can help with useful pointers, best practice or maybe an SSCCE.
更新:
尝试以 15+snaps/sec 拉取预览帧成功,但问题是预览大小是有限的.在nexus 5上我只能得到1920x1080 约为 2mp,而全分辨率图片可能在n5 是 8mp :-(
Tried successfully with pulling preview frames @ 15+snaps/sec, but the problem is preview size is limited. On nexus 5 I can get only 1920x1080 which is ~2mp, whereas the full resolution pic possible on n5 is 8mp :-(
推荐答案
制造商提供的特定于设备的 API 很少,获得跨设备工作的突发模式"的唯一方法是使用预览帧作为图像.takePicture()
无法保证您何时能够再次调用 takePicture()
.
Short of device-specific APIs offered by their manufacturers, the only way you can get a "burst mode" that has a shot of working across devices will be to use the preview frames as the images. takePicture()
has no guarantees of when you will be able to call takePicture()
again.
这篇关于Android中的连拍模式相机,可以拍摄多张照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!