1

I'm emulating Android with avdmanager and emulator, and I find that when I configure a camera as emulated, no camera control appears in the emulator. However, I do get a camera control when I set the camera to virtualscene.

What do I need to do to get an 'emulated' camera? I'd like to be able to specify an image (but not have to navigate through a virtual machine in order to place that image into my camera, as 'virtualscene' requires of me). I don't have Android Studio installed, just the command line tools.

This is the relevant part of my avd's config file (~/.android/avd/y.avd/config.ini):

hw.camera.back = virtualscene
hw.camera.front = emulated

In this example, I've emulated a Pixel C with Android API 30 Tag/ABI: google_apis/x86.

You can see a camera menu item in this image, which represents my 'virtualscene' config. Camera control is present

You can see NO camera menu item in this image, which represents my 'emulated' config. Lacking camera control

JellicleCat
  • 28,480
  • 24
  • 109
  • 162
  • Related: [How can I send a virtual camera to Genymotion or Android Studio Emulator in Ubuntu?](https://stackoverflow.com/q/65007357/295004) – Morrison Chang Mar 08 '22 at 02:41
  • Thanks, Morrison, but that content isn't related enough to be of use. Its focus is streaming, and half of the conversation is for Genymotion. – JellicleCat Mar 08 '22 at 15:33
  • I was referencing the OBS variation. See other answer to: [Android emulator camera custom image](https://stackoverflow.com/q/13818389/295004) for static image. – Morrison Chang Mar 08 '22 at 19:01

1 Answers1

0

My emulator's menu also does not show the camera setting. I was able to gain control over the camera emulation via command-line arguments. First, I had the emulator list the possible values with -webcam-list (they do not necessarily match the system's numbering). Then I chose the appropriate video device with -camera-back webcam1. Whether the device is a real world camera or a virtual camera (e.g. v4l2loopback) fed by OBS or ffmpeg (e.g. ffmpeg -hide_banner -loop 1 -r 10 -i image.png -filter:v format=yuv420p -f v4l2 /dev/video1) is up to you.

Side-note -help-camera-front also mentions a video playback feature, but I could not make it work.

Hermann
  • 604
  • 7
  • 23