[Spice-devel] [PATCH spice-server v3 3/5] Add an helper to test VideoEncoder

Frediano Ziglio fziglio at redhat.com
Thu Nov 24 16:13:40 UTC 2016


ping

> 
> > 
> > On Wed, 2016-11-09 at 10:19 +0000, Frediano Ziglio wrote:
> > > Add an utility to make possible to check various features of
> > > VideoEncoder.
> > > 2 GStreamer plugins are used in a chain like this:
> > >   (1) input pipeline -> (2) video encoder -> (3) output pipeline
> > > While converting output from (1) is compared with output of (3)
> > > making sure the streaming is working correctly.
> > > You can set various options:
> > > - part of the input pipeline description to allow specifying
> > > different
> > >   video from GStreamer test ones to a video file;
> > > - the encoder to use;
> > > - different image properties to use for (2) input:
> > >   - different bit depth;
> > >   - top/down or down/up;
> > > - initial bitrate.
> > > 
> > > The idea is to use this helper in combination with a shell script
> > > and some video sources to make able to test various settings.
> > > Also can be used to extend the current encoder list.
> > > 
> > > As an example you can use a command like
> > > 
> > > $ ./gst-test -e gstreamer:vp8 -i \
> > >   'filesrc location=bbb_sunflower_1080p_30fps_normal.mp4 \
> > >   ! decodebin ! videoconvert'
> > > 
> > > to check vp8 encoding.
> > > 
> > > Currently it does not emulate bandwidth changes as stream reports
> > > from the client are not coded.
> > 
> > 
> > Can you give some examples of concrete things that you would test or do
> > with this utility? It's a lot of code to review, and I don't really
> > have a clear understanding of what benefits it provides yet.
> > 
> 
> One example is the testing for formats supported (see patch with
> script and other to remove untested formats).
> Another example is testing encoding part of the frames. This is required
> for some Virgl resolution (I found trying to play OpenArena).
> It can be used for some unit testing as it used only video encoders
> and do not require to setup VMs or similar.
> In the TODO list there is adding support for testing bandwidth
> regulation. This will help improving the responsiveness of Virgl
> (or even normal video) avoiding to queue too much frames increasing
> latency. Still in TODO as including in this version would be a bit
> too much.
> Could be also used to test that the settings used for new plugins
> (we'll need VP9 support and VAAPI) are working as expected.
> Another TODO in my list is EGL support to be able to check if
> streamer is able to use this kind of frames (possibly won't be
> supported with GStreamer 1.0).
> 
> Frediano
> 
> 
> > 
> > 
> > > 
> > > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > > ---
> > >  server/tests/Makefile.am |   9 +
> > >  server/tests/gst-test.c  | 957
> > > +++++++++++++++++++++++++++++++++++++++++++++++
> > >  2 files changed, 966 insertions(+)
> > >  create mode 100644 server/tests/gst-test.c
> > > 
> > > Changes since v2:
> > > - add description to the program;
> > > - separate caps and decoder in EncoderInfo;
> > > - specify clipping units;
> > > - expand a macro.
> > > (all comments by Christophe).
> > > 
> > > diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
> > > index 8580a9a..c799779 100644
> > > --- a/server/tests/Makefile.am
> > > +++ b/server/tests/Makefile.am
> > > @@ -57,6 +57,7 @@ noinst_PROGRAMS =				\
> > >  	test_vdagent				\
> > >  	test_display_width_stride		\
> > >  	spice-server-replay			\
> > > +	gst-test				\
> > >  	$(check_PROGRAMS)			\
> > >  	$(NULL)
> > >  
> > > @@ -105,3 +106,11 @@ libstat_test4_a_SOURCES = stat-test.c
> > >  libstat_test4_a_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_COMPRESS_STAT=1
> > > -DTEST_RED_WORKER_STAT=1 -DTEST_NAME=stat_test4
> > >  
> > >  test_qxl_parsing_LDADD = ../libserver.la $(LDADD)
> > > +
> > > +gst_test_SOURCES = gst-test.c \
> > > +	$(NULL)
> > > +gst_test_CPPFLAGS = \
> > > +	$(AM_CPPFLAGS) \
> > > +	$(GSTREAMER_0_10_CFLAGS)		\
> > > +	$(GSTREAMER_1_0_CFLAGS)			\
> > > +	$(NULL)
> > > diff --git a/server/tests/gst-test.c b/server/tests/gst-test.c
> > > new file mode 100644
> > > index 0000000..62f1f1c
> > > --- /dev/null
> > > +++ b/server/tests/gst-test.c
> > > @@ -0,0 +1,957 @@
> > > +/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
> > > +/*
> > > +   Copyright (C) 2016 Red Hat, Inc.
> > > +
> > > +   This library is free software; you can redistribute it and/or
> > > +   modify it under the terms of the GNU Lesser General Public
> > > +   License as published by the Free Software Foundation; either
> > > +   version 2.1 of the License, or (at your option) any later
> > > version.
> > > +
> > > +   This library is distributed in the hope that it will be useful,
> > > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > > +   Lesser General Public License for more details.
> > > +
> > > +   You should have received a copy of the GNU Lesser General Public
> > > +   License along with this library; if not, see <http://www.gnu.org/
> > > licenses/>.
> > > +*/

....

Frediano


More information about the Spice-devel mailing list