[Spice-devel] Few questions regarding Gstreamer
Frediano Ziglio
fziglio at redhat.com
Wed Aug 2 15:56:06 UTC 2017
>
> Hi Armin,
>
> Thanks for your questions.
>
> On Wed, Aug 02, 2017 at 06:56:07PM +0430, Armin Ranjbar wrote:
> > Hello List,
> >
> > Thanks for the effort on Spice :)
> >
> > given recent changes by Victor, i'm not sure how can i verify that i'm
> > actually using Gstreamer to encode or decode the stream:
>
> Things to consider:
> - GStreamer is not default option for encoding
> - You have to enable stream encoding [0] as it is disabled by default
> - mjpeg is the default encoding/decoding video-codec
>
> [0] if you use libvirt, you can add streaming mode with:
> virsh edit $domain
> <graphics type='spice' autoport='yes'>
> <streaming mode='all'/>
> </graphics>
>
> > 1> how can i make sure that server is using gstreamer to encode the stream?
> > setting GST_DEBUG and SPICE_DEBUG i can't see anything gstreamer specific
> > in servers logs.
>
> There are pending work to better configuration in the host for that. The
> easiest way is to use spicy and chose a video codec which is not mjpeg
> (h264, vp8, vp9); Go to options > preferred video codec type > h264
>
> This will send a message to the spice server to use h264 instead of
> mjpeg and only gstreamer can encode it.
>
> > 2> how can i make sure same thing happens on client side? again with debug
> > options, i can see that spicy is streaming using channel-display.c:1840 not
> > channel-display-gst.c.
>
> You can also use mjpeg decoders in GStremear (it actually works well)
> but you will need to build spice-gtk with --disable-builtin-mjpeg, so
> every new stream will use gstreamer.
>
> Note that we don't stream all the content all the time. Video streams
> start/stop based on detection of regions that have high frequency of
> updates, you can check [1] for a better understanding.
>
> [1] https://youtu.be/C5ox_M-k63w
>
> >
> > 3> afaik video encoding and compression selection is for now specific to
> > spicy, how can i set these options using remote-viewer?
>
> The video-codec message is part of spice-protocol and implemented in
> spice-gtk. We have an API in spice-gtk which spicy uses but none other
> client does at the moment.
>
> The goal is to automatically detect which video codecs we can hw decode
> in the client and send this to spice-server. That is not implemented
> yet.
>
> > note that i'm building both spice and spice-gtk from latest git commit,
> >
> > ---
> > Armin ranjbar
>
> Let me know if you have any issues or suggestions!
>
> Cheers,
> toso
>
Another option is to use the spice-server recording/replay capabilities.
Once you register a session with some video (like playing something
from youtube or better a normal video so you don't get all ADs)
you can use spice-server-replay to play it. The useful options are
- "-S" setting the streaming type, to force you can use 2 (all);
- "-v" the video codecs used by the replay server, like "gstreamer:vp8";
- "-s" the streaming is affected by the timing, you have to try different
values;
- "--skip" combined with the "-s" you can skip part of it (like
VM booting for instance);
- "-c" your client command, usually remote-viewer with the specific
options.
I think there are client debugging options to check you are using
streaming and the expected encoder (surely Victor knows these
options more than me).
Frediano
More information about the Spice-devel
mailing list