-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: implement support for AMD AMF codecs #163
base: stable
Are you sure you want to change the base?
Conversation
a024caf
to
1e35a2a
Compare
New changes thus far:
|
Given this is using the AMF codec pretty some changes to the config.toml to tell it to use the codec will be required. For testing could you supply the required changes you made to your config.toml |
The needed changes are in the diff logs for the default config files. |
I'll document the changes, but really, it's for the best that everyone who wishes to apply them manually look at the |
I amended the OP again with a third edit. |
Added instructions for mounting your own AMF runtime into the Wolf container. You need |
patch -Np1 -i $SOURCE_PATH/gst-amf-headers.patch | ||
patch -Np1 -i $SOURCE_PATH/gst-amf-av1-usage.patch | ||
patch -Np1 -i $SOURCE_PATH/gst-amf-linux.patch | ||
git submodule update --recursive --remote |
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.
Shouldn't the patches be applied after doing git submodule update
?
I've got it working on AWS! 🚀 Instead of hard-coding the version of the library in the mount like
Ex: I have With the following command: docker run --rm -it -v /opt/amdgpu-pro/lib/x86_64-linux-gnu/:/opt/amdgpu-pro/lib/x86_64-linux-gnu:ro --privileged ghcr.io/games-on-whales/gstreamer:1.24.6 bash -c "ldconfig && gst-inspect-1.0 amfcodec" I can finally see them! There are a whole bunch of warnings printed:
I assume these are all related to the missing AV1 encoder, just logging this here; we can deal with them later if needed. |
Can't mount that folder on Arch, the AUR package installs them directly to |
This is a draft until things settle.
Some notes:
The gstreamer Dockerfile applies a patch from my Gist repo. I probably should have stuffed that patch into this repo instead. I wasn't thinking clearly enough last night to realize that Docker has access to the local files of this repo.
Edit 4: You need to mount your local distribution's compatible AMF libraries into the image as read-only volumes:
Either for Docker run:
Edit 5: Here, have a Docker Compose preset, assuming you built all these images locally:
Edit 2: The version of AMF that this image set creates requires bleeding edge AMDGPU VCN firmware. I hope it's possible to update your test machines to the latest available linux-firmware package.
Edit 3: Basically, whatever Docker host you run this on requires the
amdgpu
kernel module to interface with the GPU, and the latest availablelinux-firmware
package or equivalent for your distribution. This should at least beUbuntu 24.04
or whatever other LTS is available from 2024, or a more bleeding edge distribution if you prefer. After all, the AMF package this bundles is targetingUbuntu 24.04
, and is running on anUbuntu 24.10
image.Edit: Some editing instructions for your config.toml, based on the current v4 format, in case you don't want to reset your config and paste in your UUID and device pairings:
First, look at your
gstreamer.video
default_source
setting. If there is amax-bytes=0
, it should be removed. If there is amax-buffers
, it should be changed to5
or so.Second, for every
gstreamer.video.defaults.*
plugin entry already in existence, this may be worth tweaking, but not applicable to AMF. If the first part of thevideo_params
isqueue !
, it should be changed toqueue leaky=downstream max-size-buffers=5 !
. If it already has theleaky=downstream
part, change themax-size-buffers
to5
or so. This seems to help some codecs. Just so long as theleaky
parameter is there, of course.Third, add the default plugin settings for
amfcodec
, directly underneath thegstreamer.video.defaults.qsv
section:Finally, add the three codec sections, in the
[[gstreamer.video.*_encoders]]
sections, below the respectiveplugin_name = 'qsv'
sections, and directly above the respectiveplugin_name = 'vaapi'
sections. If they are not ordered before thevaapi
sections, thevaapi
sections will take priority, as they are tried in order of the config file:AV1:
H.264:
HEVC: