From: Thomas Huth <thuth@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
"David Milosevic" <david.milosevic@9elements.com>
Cc: qemu-devel@nongnu.org,
Marcello Sylvester Bauer <marcello.bauer@9elements.com>,
pizhenwei@bytedance.com
Subject: Re: [RFC] Proposal for a QEMU video subsystem for cameras and webcams
Date: Mon, 10 Mar 2025 17:57:07 +0100 [thread overview]
Message-ID: <1cd5fa82-50db-418c-bd9e-ce6fda3c6ee4@redhat.com> (raw)
In-Reply-To: <87senk7rro.fsf@draig.linaro.org>
On 10/03/2025 17.51, Alex Bennée wrote:
> David Milosevic <david.milosevic@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.
... but USB video would also be nice, wouldn't it? That could enable guests
to use webcams without needing additional virtio drivers for it, I think?
>> 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 \
Just a quick comment here: QEMU tries often to avoid to introduce new
top-level command line switches nowadays. Would it be possible to use
"-object" for this instead, like it is e.g. done with the memory backends or
rng backends?
Thomas
>> -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
>
next prev parent reply other threads:[~2025-03-10 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 16:23 [RFC] Proposal for a QEMU video subsystem for cameras and webcams David Milosevic
2025-03-10 16:51 ` Alex Bennée
2025-03-10 16:57 ` Thomas Huth [this message]
2025-03-11 11:19 ` zhenwei pi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1cd5fa82-50db-418c-bd9e-ce6fda3c6ee4@redhat.com \
--to=thuth@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=david.milosevic@9elements.com \
--cc=marcello.bauer@9elements.com \
--cc=pizhenwei@bytedance.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).