spice, dmabuf, egl and streaming

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

spice, dmabuf, egl and streaming

Frediano Ziglio
Hi,
  I'm a member of spice team (http://www.spice-space.org/) in RedHat.
We are using GStreamer to handle streaming of video remotely using different
compression coders (H264, MJPEG, VP8).

We are facing a new challenge, streaming frames from 3d card!
Of course we want it faster as possible. Some graphics cards implements
compression so we would like to use this feature if present and potentially
not extracting the texture from the graphics card. This is not always possible
(libraries not installed, not supported by card, etc) so we need also a fallback.
Potentially we can start with an EGL texture which can be easily converted to
a dmabuf if needed. Note however that not all dmabuf supports mmap which seems
the way gst_dmabuf_allocator_new allocator works so potentially EGL texture is
better.
There is a current experimental patch which is using gstreamer vaapi library
but extract the raw image from the texture. Looking at vaapi seems that you
can convert a dmabuf to a VASurfaceID to avoid the memory copy but seems
not used by gstreamer vaapi. I saw there is a gst_vaapi_surface_new_from_egl_image
but I don't understand how to make the code call it.

Frediano
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: spice, dmabuf, egl and streaming

Victor Jaquez
Hi Frediano,

On 06/30/16 at 10:39am, Frediano Ziglio wrote:

> Hi,
>   I'm a member of spice team (http://www.spice-space.org/) in RedHat.
> We are using GStreamer to handle streaming of video remotely using different
> compression coders (H264, MJPEG, VP8).
>
> We are facing a new challenge, streaming frames from 3d card!
> Of course we want it faster as possible. Some graphics cards implements
> compression so we would like to use this feature if present and potentially
> not extracting the texture from the graphics card. This is not always possible
> (libraries not installed, not supported by card, etc) so we need also a fallback.
> Potentially we can start with an EGL texture which can be easily converted to
> a dmabuf if needed. Note however that not all dmabuf supports mmap which seems
> the way gst_dmabuf_allocator_new allocator works so potentially EGL texture is
> better.
> There is a current experimental patch which is using gstreamer vaapi library
> but extract the raw image from the texture. Looking at vaapi seems that you
> can convert a dmabuf to a VASurfaceID to avoid the memory copy but seems
> not used by gstreamer vaapi. I saw there is a gst_vaapi_surface_new_from_egl_image
> but I don't understand how to make the code call it.

Right now gstreamer-vaapi can import dmabuf into a VASurface to encode them. I
have tested it with v4l2src, but I would be very happy to know if it works
with other dmabuf sources.

In the case of EGL, it was supported only for pushing decoded buffers to
downstream, nonetheless right now is dead code [1]. We have to re-enable it
and adapt it to GstGLMemory interfaces.

1. https://bugzilla.gnome.org/show_bug.cgi?id=767203

vmjl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: spice, dmabuf, egl and streaming

Frediano Ziglio
> Hi Frediano,
>
> On 06/30/16 at 10:39am, Frediano Ziglio wrote:
> > Hi,
> >   I'm a member of spice team (http://www.spice-space.org/) in RedHat.
> > We are using GStreamer to handle streaming of video remotely using
> > different
> > compression coders (H264, MJPEG, VP8).
> >
> > We are facing a new challenge, streaming frames from 3d card!
> > Of course we want it faster as possible. Some graphics cards implements
> > compression so we would like to use this feature if present and potentially
> > not extracting the texture from the graphics card. This is not always
> > possible
> > (libraries not installed, not supported by card, etc) so we need also a
> > fallback.
> > Potentially we can start with an EGL texture which can be easily converted
> > to
> > a dmabuf if needed. Note however that not all dmabuf supports mmap which
> > seems
> > the way gst_dmabuf_allocator_new allocator works so potentially EGL texture
> > is
> > better.
> > There is a current experimental patch which is using gstreamer vaapi
> > library
> > but extract the raw image from the texture. Looking at vaapi seems that you
> > can convert a dmabuf to a VASurfaceID to avoid the memory copy but seems
> > not used by gstreamer vaapi. I saw there is a
> > gst_vaapi_surface_new_from_egl_image
> > but I don't understand how to make the code call it.
>
> Right now gstreamer-vaapi can import dmabuf into a VASurface to encode them.
> I
> have tested it with v4l2src, but I would be very happy to know if it works
> with other dmabuf sources.
>

I'm quite new to gstreamer. Can you point me on some information how to
do it? At the moment we receive dma buffers from another software (Qemu).
More appropriately they are DRM primes which implements dma buffers.

How to push them to a pipeline ? Can I use appsrc ?

> In the case of EGL, it was supported only for pushing decoded buffers to
> downstream, nonetheless right now is dead code [1]. We have to re-enable it
> and adapt it to GstGLMemory interfaces.
>
> 1. https://bugzilla.gnome.org/show_bug.cgi?id=767203
>
> vmjl

Frediano
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: spice, dmabuf, egl and streaming

Nicolas Dufresne-4


Le 2016-07-18 06:43, "Frediano Ziglio" <[hidden email]> a écrit :
>
> I'm quite new to gstreamer. Can you point me on some information how to
> do it? At the moment we receive dma buffers from another software (Qemu).
> More appropriately they are DRM primes which implements dma buffers.

You can wrap them using gst_dmabuf_allocator_new(). Then append that to an empty GstBuffer, add if needed a GstVideMeta (if you have stride that is not width * bytesPerPixels). You can then push those buffers using aposrc, glupload should be able to import. Note, you need to force egl if on X11, as this feature is not available in GLX.

>
> How to push them to a pipeline ? Can I use appsrc ?
>
> > In the case of EGL, it was supported only for pushing decoded buffers to
> > downstream, nonethelessright now is dead code [1]. We have to re-enable it
> > and adapt it to GstGLMemory interfaces.
> >
> > 1. https://bugzilla.gnome.org/show_bug.cgi?id=767203
> >
> > vmjl
>
> Frediano
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel