-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD vaapi encoder #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Resolves part of #34. |
gst-vaapi is required to be included in the build procedures. @danisla Please keep it in mind. |
@ehfd are there any changes to the gstreamer source compilation needed to get vaapi support? What are the runtime libs required? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the requirements to get the vaapih264enc
elements? Are they currently compiled with the gstreamer base image, or are there additional compile-time or runtime dependencies?
@danisla bundle GST-VAAPI (VA drivers required in host of course) |
I don't have an i965 to test with, so just to confirm, no changes to the |
@danisla I do not see it as an available plugin on GStreamer compiled with Selkies 1.3.1. |
The gstreamer ubuntu20.04 build logs shows that the
Can someone please propose and test a change to the |
Note: set
# Mandatory GST deps
libm = cc.find_library('m', required : false)
gst_dep = dependency('gstreamer-1.0', version : gst_req,
fallback : ['gstreamer', 'gst_dep'])
gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
fallback : ['gstreamer', 'gst_base_dep'])
gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'pbutils_dep'])
gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'allocators_dep'])
gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'video_dep'])
gstcodecparsers_dep = dependency('gstreamer-codecparsers-1.0', version : gst_req,
fallback : ['gst-plugins-bad', 'gstcodecparsers_dep'])
gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'gstgl_dep'], required: false)
gstglproto_dep = dependency('', required : false)
gstglx11_dep = dependency('', required : false)
gstglwayland_dep = dependency('', required : false)
gstglegl_dep = dependency('', required : false) All dependencies, even not required, should also be there. |
@danisla libva, libwayland, libdrm |
hmm, yes, to build vaapi subproject was painful. I built it manualy. Also note, for runtime, i965-va-driver-shaders is needed. |
Should we stop here for now, perhaps? Edit: yeah for sure, let's wait on this until we see vah264enc. |
It makes sense, it was really not easy to build it properly. |
I think this PR is ready to be revived, now that |
@xhejtman The vaapi issue with the framerate last time might have been with |
I've been testing with gstreamer 1.21.1, and
However, regardless of encoder setting, gstreamer segfaults when running with webrtcbin on gst-1.21.1. Also I am on the fence for supporting non-stable gstreamer releases (odd numbered releases) because of issues like this.., |
which intel driver are you using? It works with shader only. Also, vapostproc is problematic. I would start either with SW/CPU video convert. And perhaps use different intel driver. iHD is mostly buggy. |
@xhejtman the vaapi codecs and vapostproc seemed to work just fine, I don't think the issue was with the vaapi plugin, but rather with webrtc in gstreamer v1.21.1. Like I said, the x264enc pipeline doesn't work on 1.21.1 either. I'm probably just going to stick with the stable releases of gstreamer since odd releases are not stable. |
Relevant? @danisla : I think we also need to check if dependencies have changed in 276fe41.
|
@xhejtman I'm having trouble getting this to work with 1.20.4. This is what my vainfo output looks like:
then
|
@danisla First thing. Is /dev/dri/cardX from an Intel GPU accessible? |
yes, as you can see from my previous comment, the |
I'll try to fiddle with the build process now. Though I don't have a Linux node with Intel right now. |
gst1-21-1.txt |
I would like to see this working with 1.20.4 if possible. I am assuming that is what @xhejtman got it working with. We control the gstreamer build so we should be able to make it work if we know the build steps. |
I also see a segfault on 1.21.1. I believe it might be related to https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1508, although not limited to NVIDIA |
I don't think it's related to the encoder, it segfaults for me with any encoder. See my previous comment:
|
I understand the odd numbered releases are unreliable, but I do still need to determine if it's on our side or it's the code. On second look, it happens right when the SDP connection is established on any encoder, yes. |
@danisla Let me refresh my container and setup again. Edit: I definitely did not confuse versions. They work in a certain condition, but is inconsistent... Need to find what happened. |
Overall, however, the behavior of 1.21 is too puzzling to be used for Selkies. |
Do you have i965-va-driver or i965-va-driver-shaders? |
@xhejtman Check https://github.com/selkies-project/selkies-gstreamer/blob/gst-1.21.1/Dockerfile.example and https://github.com/selkies-project/selkies-gstreamer/blob/gst-1.21.1/addons/gstreamer/Dockerfile. Overall: 276fe41 |
so, it looks like you have the shaders version. strange, so it might be related to particular intel gpu, some might work, some might not. |
I got it working with gstreamer 1.20, was missing a build time dependency of I'll create a new PR to update to the gstreamer 1.20 branch with vaapi support. |
Does it happen to work with the VA plugin (not VAAPI)? It probably needs a plugin rank change if in 1.20. |
Only vaapi, the va plugin does not have the encoder elements in gstreamer 1.20, we'll have to wait until 1.22 to support the new va plugin. |
Please change the docs too if there are runtime dependency changes. |
Issue with Selkies on GST 1.21.x raised on https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1605 |
Implemented in 736292c |
added vaapi encoder properly