Make Android Emulator use physical usb camera

南楼画角 提交于 2019-12-11 00:25:48

问题


Android Studio, latest Google SDK emulator. I have set back camera emulation mode to Webcam0 to get my usb camera connected to emulator. Unfortunately, it's not working. My camera works without any problems on host computer, for example this:

ffplay /dev/video0

gives me camera video playback. When I run emulator with above settings, camera on emulator just says "Unable connect to camera", then closes itself. Have anybody ever succeded with connecting physical camera to Android emulator? I have found some similar problems out there, but none of them has been resolved.


回答1:


you can try to edit the config.ini of the AVD in ~/.android/avd/avd_name/config.ini like in this link http://viralpatel.net/blogs/enable-camera-in-android-emulator/ or use Android Studio directly like in this Android: How to use webcam in emulator?

if this isn't working see Lekensteyn's answer (2nd) in Connect USB device to Android Emulator?. it describes how a USB device can be passed through to a QEMU emulator. Android emulator is modified QEMU for more details see https://developer.android.com/studio/run/emulator-commandline.html

to find out if your webcam is recognized anyway try emulator @avd_name -webcam-list to get the available AVD use android list avd

more on passing through a USB device to QEMU emulator is also in https://unix.stackexchange.com/questions/250938/qemu-usb-passthrough-windows-guest



来源:https://stackoverflow.com/questions/44699625/make-android-emulator-use-physical-usb-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!