Encoding a DMABuf into a video stream with VAAPI

Victor Jaquez vjaquez at igalia.com
Mon Apr 17 16:02:37 UTC 2023


On Mon, 17 Apr 2023 at 17:18, xaterus at gmail.com wrote:
> Hello,
> 
> sorry for the late reply, I had to take a break from the project.
> The intel-media-va-driver fixed the
> "gstvaapifilter.c:1373:gst_vaapi_filter_set_property:<vaapifilter0>
> VA" PRoblem.
> 
> 
> But I still have the problem that my pipeline does not work.
> 
> > appsrc name=source format=time ! video/x-raw(memory:DMABuf),width=1024,height=768,framerate=(fraction)60/1,format=BGRx ! vapostproc ! vah264enc ! h264parse ! mp4mux ! filesink location=../test.mp4
> 
> > Error received from element capsfilter0: Filter caps do not completely specify the output format
> > Debugging information: ../subprojects/gstreamer/plugins/elements/gstcapsfilter.c(458): gst_capsfilter_prepare_buf (): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0:
> > Output caps are unfixed: EMPTY
> > Error received from element source: Internal data stream error.
> > Debugging information: ../subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3132): gst_base_src_loop (): /GstPipeline:pipeline0/GstAppSrc:source:
> > streaming stopped, reason error (-5)
> 
> 
> It seems that vapostproc can't convert from
> video/x-raw(memory:DMABuf), format=BGRx to
> to video/x-raw(memory:DMABuf), format=NV12 which is needed for
> vah264enc. Or do I have a mistake somewhere else?

You can see what formats actually vapostproc support by inspecting it:

gst-inspect-1.0 vapostproc

And in my platform (intel skylake) it doesn't support BGRx for DMABuf:

video/x-raw(memory:DMABuf)
                  width: [ 16, 16384 ]
                 height: [ 16, 16384 ]
                 format: { (string)NV12, (string)I420, (string)YV12, (string)YUY2, (string)Y42B, (string)RGBP, (string)P010_10LE, (string)RGB, (string)BGRA, (string)RGBA, (string)BGR10A2_LE, (string)VUYA, (string)Y210, (string)Y410, (string)P012_LE, (string)Y212_LE, (string)Y412_LE }

In this case, you should either convert to any of this color formats, or use
system memory-based buffers, which does support BGRx:

video/x-raw
                  width: [ 16, 16384 ]
                 height: [ 16, 16384 ]
                 format: { (string)ARGB, (string)BGRA, (string)ABGR, (string)RGBA, (string)xRGB, (string)BGRx, (string)xBGR, (string)RGBx, (string)BGR10A2_LE, (string)RGB16, (string)RGBP, (string)VUYA, (string)GRAY8, (string)NV12, (string)NV21, (string)YUY2, (string)UYVY, (string)YV12, (string)I420, (string)Y42B, (string)Y444, (string)P010_10LE }

vmjl

> 
> Thanks in advance and Greetings
> Michael
> 
> Am Fr., 24. Feb. 2023 um 12:15 Uhr schrieb Victor Jaquez via
> gstreamer-devel <gstreamer-devel at lists.freedesktop.org>:
> >
> > On Thu, 23 Feb 2023 at 20:59, xaterus--- via gstreamer-devel wrote:
> > > Hi,
> > >
> > > Am Mi., 22. Feb. 2023 um 12:30 Uhr schrieb Victor Jaquez via
> > > gstreamer-devel <gstreamer-devel at lists.freedesktop.org>:
> > > > What hardware are you using?
> > > OS: Ubuntu 22.10 x86_64
> > > Host: Esprimo Q958
> > > Kernel: 5.19.0-32-generic
> > > Uptime: 4 mins
> > > Packages: 2292 (dpkg), 13 (snap)
> > > Shell: bash 5.2.2
> > > Resolution: 1920x1080
> > > DE: GNOME 43.1
> > > WM: Mutter
> > > WM Theme: Adwaita
> > > Theme: Yaru [GTK2/3]
> > > Icons: Yaru [GTK2/3]
> > > Terminal: gnome-terminal
> > > CPU: Intel i5-8500T (6) @ 3.500GHz
> > > GPU: Intel CoffeeLake-S GT2 [UHD Graphics 630]
> > > Memory: 2965MiB / 15741MiB
> > >
> > > > Can you post the output of vainfo command?
> > > libva info: VA-API version 1.15.0
> > > libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
> > > libva info: Found init function __vaDriverInit_1_14
> > > libva info: va_openDriver() returns 0
> > > vainfo: VA-API version: 1.15 (libva 2.12.0)
> > > vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.3 ()
> > > vainfo: Supported profile and entrypoints
> > >       VAProfileMPEG2Simple            :    VAEntrypointVLD
> > >       VAProfileMPEG2Main              :    VAEntrypointVLD
> > >       VAProfileH264Main               :    VAEntrypointVLD
> > >       VAProfileH264Main               :    VAEntrypointEncSliceLP
> > >       VAProfileH264High               :    VAEntrypointVLD
> > >       VAProfileH264High               :    VAEntrypointEncSliceLP
> > >       VAProfileJPEGBaseline           :    VAEntrypointVLD
> > >       VAProfileJPEGBaseline           :    VAEntrypointEncPicture
> > >       VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
> > >       VAProfileH264ConstrainedBaseline:    VAEntrypointEncSliceLP
> > >       VAProfileVP8Version0_3          :    VAEntrypointVLD
> > >       VAProfileHEVCMain               :    VAEntrypointVLD
> > >       VAProfileHEVCMain10             :    VAEntrypointVLD
> > >       VAProfileVP9Profile0            :    VAEntrypointVLD
> > >       VAProfileVP9Profile2            :    VAEntrypointVLD
> > >
> > > Do I need other Hardware?
> >
> > Oh. I guess you need to install intel-media-va-driver-non-free
> >
> > Since intel-media-va-driver cuts out all the proprietary internal blobs.
> >
> > >
> > > Regarding the tiling, I didn't understand exactly if it would work
> > > with I915_FORMAT_MOD_X_TILED or only with linear ?
> >
> > For rendering linear is expected to work. Other modifiers depends on other factors.
> >
> > vmjl
> >
> >
> > >
> > > Thanks in advance and Greetings
> > > Michael
> > >
> 


More information about the gstreamer-devel mailing list