On 10.06.25 14:20, Daniel P. Berrangé wrote:
On Tue, Jun 10, 2025 at 03:30:24PM +0400, Marc-André Lureau wrote:
Hi

On Fri, Jun 6, 2025 at 11:16 AM Daniel P. Berrangé <berra...@redhat.com>
wrote:

Apparently you cannot mix and match freely, it has a rather fixed set of
actually working values.

See here and related code:
https://gitlab.freedesktop.org/spice/spice/-/blob/master/server/reds.cpp?ref_type=heads#L3468

That's just showing the built-in defaults - the parsing code is
not enforcing any constraints. The impl though cleary only allows
'mjpeg' with 'spice':

   
https://gitlab.freedesktop.org/spice/spice/-/blob/master/server/mjpeg-encoder.c#L1371

Tbh, I don't think the encoder matters much, and I don't know why it was
decided to associate it with video codec names.

AFAICT the only way in which the encoder matters is to distinguish the
built-in "mjpeg" impl from the gstreamer "mjpeg" coder.

Maybe the spice API should provide a simpler form: accept only codec names.

In the meantime, qemu should perhaps add the "working" encoder prefixes
(spice: for mjpeg, gstreamer: for others)  itself and not expose any extra
option to the user?

Ths question is whether we need to be able to request the gstreamer
'mjpeg' impl ?

If we do, and we also assume that 'spice' will never gain any more codec
impls as built-ins, we could do

   builtin, mjpeg, vp8, vp9, h264

With 'spice' you mean only that the builtin will not get any more codecs right? because I want to do an MR for spice gstreamer to add more codecs, like av1.

Also It might be useful to set more parameters in future, like chroma sub-sampling or which GStreamer plugin is wanted like: msdk, va, vaapi....

Another point is that it can actually be a list of codecs like:
gstreamer:vp8;gstreamer:h264;spice:mjpeg

Which is maybe not clear from the current documentation, which might rather be:
[,video-codecs=<encoder>:<codec>[;...]]

This is useful the specify the allowed codecs and also set the priority.



where 'builtin' is the standard mjpeg encoder ?

Alternatively we could just go with

   mjpeg, vp8, vp9, h264

and in the unlikely event we need to be able to skip the built-in mjpeg,
we could add  a boolean 'prefer-gstreamer=on|off'

With regards,
Daniel

Greetings,
Michael


Reply via email to