简体   繁体   English

在Android模拟器中将网络摄像头用作摄像头的示例项目

[英]Sample Project for using webcam as camera in android emulator

I've started developing for Android. 我已经开始为Android开发。 I want to write an barcode scanning app, but without a way to activate the camera in the emulator it could be annoying. 我想编写一个条形码扫描应用程序,但是如果无法在模拟器中激活相机,可能会很烦人。

Does anybody knows a way to use the USB-Webcam of my PC as an Android Camera ? 有人知道将PC的USB网络摄像头用作Android摄像头的方法吗? I've searched everywhere i know there is a lib from tomgibara, but it would be really nice if some has got an sample project for this. 我到处搜索过我知道存在tomgibara的lib,但是如果有人为此提供了示例项目,那将非常好。

At the moment the Emulator only asks for the capturing device, but when i start now the camera app from android i only see this dummy camera site with this chessy squares. 目前,仿真器仅要求捕获设备,但是当我现在启动android的摄像头应用程序时,我只会看到这个带有假象牙方块的虚拟摄像头站点。

Thank you for all of your help. 感谢您的所有帮助。

You can specify which camera to use and how in the emulator command line using the options 您可以使用选项在emulator命令行中指定要使用的摄像机以及如何使用

-fake-camera <mode>                   set fake camera emulation mode

where mode can be one of back , front , or off , and 其中mode可以是backfrontoff ,并且

-webcam name=<name>[,dir=<direction>] setup web camera emulation

where name is a valid connected camera name and dir is one of front or back . 其中name是有效的已连接摄像机名称,dir是frontback The connected camera names can be obtained by using the special option -webcam list . 可以使用特殊选项-webcam list获得连接的摄像机名称。 For example, in Linux you can obtain something like 例如,在Linux中,您可以获得类似

List of web cameras connected to the computer:
 Camera 'webcam0' is connected to device '/dev/video0' on channel 0 using pixel format 'YUYV'

单击“确定”后,我可以按照上述方式运行模拟器,但“ fake-camera”选项无济于事=(它允许我选择要使用的照相机,然后单击“确定”,模拟器将启动,但是不使用网络摄像头作为前置或后置摄像头=(是否有可能是不支持的摄像头?如果是,是否支持哪些摄像头?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM