How to access webcam connected using USB in Android AVD

Viewed 1119

I am trying to access Webcam(connected using USB)from the android studio AVD. I have selected "webcam0" in avd camera setting but it is taking the laptop's default camera. I want to access the webcam that is connected using USB. Any idea, please? Android studio AVD camera settings

1 Answers

I have solved the issue using the link below.

https://developer.android.com/studio/run/emulator-commandline

It worked with windows and the steps are-

  1. Start the emulator command: cd C:\Users\USERNAME\AppData\Local\Android\Sdk\emulator

  2. Check the Available AVD and webcams

    List of AVDs:: emulator -list-avds

    Webcam Lists: emulator @AVD_NAME_FROM_THE_ABOVE_LIST -webcam-list

  3. Run AVD by assigning a specific camera from the list of available webcams

    emulator @AVD_NAME_FROM_THE_ABOVE_LIST -camera-back webcam1 Here webcam1 is assigned to the back camera. The front camera can also be changed with the command below.

emulator @AVD_NAME_FROM_THE_ABOVE_LIST -camera-front webcam1
Related