How to build the va plugins vah264enc element?

As per the topic, how do I get a build that includes vah264enc? by default (meson setup build) its not getting built. I also tried with -Dvaapi but suspect this is relating to the old vappi stuff - its not obvious whats what in this regard.

[1.24] dan@melon ~/tmp/gstreamer/build $ gst-inspect-1.0 va
Xlib:  extension "DRI2" missing on display ":1".
Plugin Details:
  Name                     va
  Description              VA-API codecs plugin
  Filename                 /home/dan/tmp/gstreamer/build/subprojects/gst-plugins-bad/sys/va/libgstva.so
  Version                  1.24.12.1
  License                  LGPL
  Source module            gst-plugins-bad
  Documentation            https://gstreamer.freedesktop.org/documentation/va/
  Binary package           GStreamer Bad Plug-ins git
  Origin URL               Unknown package origin


  0 features:

[1.24] dan@melon ~/tmp/gstreamer/build $ gst-inspect-1.0 vah264enc
No such element or plugin 'vah264enc'

I cant see anything in the output of the setup phase that looks relevant re why it might not be getting built, but then i don’t really know what to look for other than vah264enc, vaapi, va-api etc.

The same question here. I also need to use vah264enc. But couldn’t get it neither from precompiled binaries nor compiling from the source code.

@mangodan2003 show, please, your build script.

For the purposes of obtaining the above, and to rule out any other factors, the above was simply a completely manual:

git clone https://gitlab.freedesktop.org/gstreamer/gstreamer
cd gstreamer
git checkout 1.24
meson setup build
cd build
ninja

Or are you requesting the output of the meson setup build step?

Edit: Just a comment to add that I have libva installed and this is on a Gentoo system so that includes the development headers.
I notice that as well as libva there is also a libva-intel-media-driver - it feels a bit like guess work but I tried installing this too to no avail.

When registering the plugin’s elements, gstva queries the VA-API driver for what it profiles and entry points supports, and elements are registered accordingly.

If your setup doesn’t show any feature is either because either isn’t a useful driver installed, or perhaps the hardware doesn’t support VA-API at all.

To check that you can run the VA-API utility command vainfo.

Thanks for the reply, that gives me something to investigate. I was not expecting the list of available plugin elements to be as dynamic as that. I assumed they were either built or not built and the results would reflect that.

Is there any documentation specifically for va and the va-api requirements? Anything I find seems to relate to the older gstreamer-vaapi. There is a link for va-api e.g. at the top of the vah264enc docs but it seems to just be a corporate/marketing looking home page.

https://gstreamer.freedesktop.org/documentation/va/index.html?gi-language=c

https://gstreamer.freedesktop.org/documentation/va/vah264enc.html?gi-language=c#vah264enc

Hi, again! Kind people helped me to find that if you run sudo gst-inspect-1.0 va you will get the encoder!
What a heck, isn`t :slight_smile:

Now I’m trying to find out how to run it without sudo but straight under the $USER.

That is one of the first things I tried here, so I have something else missing / incorrect.
Try checking if your user is in the video (or equivelant) group - I’m assuming you are not running in a UI / Desktop environment.

Well I have several environments. The sudo worked for me while running in UI environment and my $USER neither in render nor in video group. I’ve add the $USER to the render and video group but it haven’t solved the issue.

The another environment is a docker container, and there is no root user, so i’ve just scratching my head to find out how to run hardware encoder there.

Rergarding requirements, they are the same as gstreamer-vaapi or any other VA-API based application, since they use the same library and API: libva.

I agree: we’ll need to open an issue fo gstva documentation, particularly explaining its dynamic register of elements.

for example, this troubleshooting post for GStreamer-VAAPI also helps to understand GstVA

This is an interesting data point as the old vaapih264enc element works.

Have you restarted or used nwgrp / a new session etc/ since adding your user to the required groups? Check the permissions on your video devices (found under /dev/dri).

I’ve add $USER to video and render group. I’ve log out but still it haven’t worked form me.
Here is the permissions for video devices

you can run

GST_REGISTRY= gst-inspect-1.0 --gst-disable-registry-fork --gst-debug=va*:8 va

to check the logs while registering the plugin’s elements

I’m not sure what do you mean by run the line above? Could you elaborate more.

I meant gst-inspect-1.0 command