David Milosevic <david.milose...@9elements.com> writes: > Dear QEMU Developers, > > I would like to propose the development of a video subsystem in QEMU, with > the initial > implementation focusing on UVC video device emulation and support for multiple > backends, including V4L2, GStreamer, and libcamera. > > This work is already in progress at 9elements, and we would like to upstream > it. > > == Motivation > > Currently, USB pass-through is the only way to make video devices available > to guests, which > > - excludes non-USB cameras (e.g., MIPI) > - performs poorly with high-resolution cameras > - does not work with USB 3.0 video devices (Issue #1613) > > == Proposal > > We aim to introduce a video subsystem in QEMU that allows for the > implementation of various > video devices, similar to how QEMU handles audio. The first device > implementation will be > UVC (USB Video Class) device emulation, with support for multiple backends. > Future extensions > could include virtio-video or other PCI-based video devices.
Are you aware of virtio-media? It was an alternative proposal to virtio-video which effectively becomes an encapsulation of v4l to the guest. Kernel patches: https://lore.kernel.org/lkml/20250201-virtio-media-v2-1-ac8406814...@gmail.com/ VirtIO spec: https://lore.kernel.org/virtio-comment/20250120085015.956057-1-aest...@redhat.com/T/ > Supported backends: > > - Video4Linux (V4L2) > - GStreamer > - libcamera > > == Example: V4L2 Backend > > Once implemented, a typical QEMU command line for using a V4L2 backend would > look like this > > ./build/qemu-system-x86_64 \ > -device qemu-xhci \ > -videodev v4l2,id=cam0,device=/dev/video0 \ > -device usb-video,videodev=cam0 > > This sets up a UVC emulated device in the guest, using /dev/video0 from the > host via the V4L2 backend. > > == Next Steps > > We welcome feedback on design considerations and integration approaches. Let > us know > if there are existing discussions or preferred directions for this work. > > Best regards, > > David Milosevic > Firmware Developer > 9elements -- Alex Bennée Virtualisation Tech Lead @ Linaro