Android AVD 与“模拟”相机显示根本没有相机

发布于 2025-01-12 13:02:43 字数 786 浏览 2 评论 0原文

我使用 avdmanageremulator 模拟 Android,我发现当我将相机配置为 emulated 时,模拟器中不会出现相机控件。但是,当我将相机设置为virtualscene时,我确实获得了相机控制。

我需要做什么才能获得“模拟”相机?我希望能够指定一个图像(但不必通过虚拟机导航才能将该图像放入我的相机中,因为“虚拟场景”需要我)。我没有安装 Android Studio,只安装了命令行工具。

这是我的 avd 配置文件 (~/.android/avd/y.avd/config.ini) 的相关部分:

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

在此示例中,我使用 Android API 30 标签模拟了 Pixel C /ABI:google_apis/x86。

您可以在此图像中看到一个相机菜单项,它代表我的“virtualscene”配置。 相机控制存在

您可以在此图像中看到没有相机菜单项,它代表我的“模拟”配置。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晚风撩人 2025-01-19 13:02:43

我的模拟器的菜单也不显示相机设置。我能够通过命令行参数来控制相机模拟。首先,我让模拟器使用 -webcam-list 列出可能的值(它们不一定与系统的编号匹配)。然后我使用 -camera-back webcam1 选择适当的视频设备。设备是现实世界的相机还是由 OBS 或 ffmpeg 提供的虚拟相机(例如 v4l2loopback)(例如 ffmpeg -hide_banner -loop 1 -r 10 -i image.png -filter: v format=yuv420p -f v4l2 /dev/video1) 由您决定。

旁注 -help-camera-front 还提到了视频播放功能,但我无法使其工作。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文