Android摄像头本机访问:启动preVIEW()VS的startRecording() [英] Android camera native access : startPreview() vs startRecording()

查看:550
本文介绍了Android摄像头本机访问:启动preVIEW()VS的startRecording()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图让相机从本地code在安卓ICS的工作: 大多数手册参考开始preVIEW()方式。但浏览AOSP code我还发现的startRecording()的方法在< Camera.h> 这里说,这是从接口ICameraRecordingProxy 的,允许记录在记录过程中接收视频帧

Trying to get camera working from native code in Android ICS: most manuals refer to startPreview() method . But browsing AOSP code I've found also 'startRecording()' method in <Camera.h>. Here said that it is from interface ICameraRecordingProxy "that allows the recorder to receive video frames during recording"

所以,问题是 - 在性能方面是'的startRecording的方式效率比'开始preVIEW'?

So the question is - in terms of performance is 'startRecording' approach more efficient than 'startPreview'?

对进入本土code的目标只有一个就是服务表现,Java的照相机太慢了,和OpenCV没有提供FPS的要求水平以及..

The only one goal of going into native code is performace, Java 'Camera' is too slow, and OpenCV does not provide required level of FPS as well..

编辑:目标平台是:API级别= 17,设备全志A31开发板,1280x720x30FPS。 我们的任务是从相机捕获帧,对其进行修改,EN code(H264),并存储到SD卡。 纯java MediaRecorder写MP4文件1280x720x30。节目现场preVIEW上是没有必要的屏幕。

target platform is: API level=17, device Allwinner A31 development board, 1280x720x30FPS. The task is to capture frames from camera, modify them, encode (H264) and store to SD card. pure java MediaRecorder write mp4 file with 1280x720x30. Show live preview on screen is not needed.

OpenCV的-demo1的本机模式使1920x1080x2(Java模式相同)。简单的Java方法与空previewCallback最大的FPS值为15。

OpenCV-demo1 in native mode gives 1920x1080x2 (same in java mode). Simple java approach with empty PreviewCallback maximal FPS is 15.

感谢你在前进。

推荐答案

关闭主题: 我能够使用本地接入相机和使用的硬件H264连接codeR达到1280×720与FPS = 30。也可以修改(水印)数据对飞保持FPS高。 没有其他方法 - 任何Java或OpenCV的人给我更多的每秒15帧(可能是我没努力。)

to close topic: I was able to reach 1280x720 with FPS=30 using native access to camera and use hardware H264 encoder. Also can modify (watermark) data on the fly keeping FPS high. None of other approaches - any JAVA or OpenCV could give more that 15 FPS (may be I did not try hard..)

的startRecording()完美的作品

startRecording() works perfectly

感谢您的评论

这篇关于Android摄像头本机访问:启动preVIEW()VS的startRecording()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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