-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
obs-ffmpeg: Make AMF encoder work on Linux #7206
Conversation
nowrep once again making awesome things happen on linux. this plugin works great. For Nobara (Fedora) we set this up so our users can use the AMF encoder easily: https://github.com/CosmicFusion/fedora-amdgpu-pro I just tested your plugin on a 6900 XT and was able to record 1440p60 just fine. GPUOpen-LibrariesAndSDKs/AMF#334 I'll try to test later on the full official driver stack on ubuntu |
UPDATE: After digging around the pro packaging, we got h.265 to work via custom ffmpeg -- it needs amdgpu's libdrm (we packaged that today in the same repo) and opencl-filesystem from fedora repos -- these two fix the GPUOpen bug listed (ill post an update letting them know). If we can get the h.265 option added to this PR i'd be happy to test. |
It checks for hevc support at runtime, you can test it manually by running |
it's working here with custom ffmpeg with the options i noted -- do you have discord or something we can have a discussion about it? if you're on fedora i can help get you sorted on the amd pro driver side |
I prefer e-mail or IRC nowrep at libera.chat |
Changes:
|
Just dropping in a confirmation that this works great now, worked with nowrep to get the drivers sorted on his side and everything's all good: |
i have perfected my amdgpu-pro repackging (what @GloriousEggroll uses in nobara) , and this plugin works well on all gpus , with 4k support on all gpus (not great on lower end ones like polaris) , and h265 on RX5XXX and RX6XXX .. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
You only need to install latest amf and amdgpu-pro vulkan driver, nothing else. For Arch see Ashark/archlinux-amdgpu-pro#78 Also please keep the driver install troubleshooting outside this pull request. Pull request is ready for review, everything works just the same as on Windows (assuming your drivers are installed correctly, and of course without texture encoding). |
Just tested this PR & cloned the following repo and installed it: https://github.com/HannesMann/archlinux-amdgpu-pro I can safely say that everything is functional when using the right amd-pro driver. Tested on Arch Linux & an RX 6700 XT |
Forgive my ignorance, but is there any benefit to using this instead of something like this GStreamer based obs-vaapi or the older obs-gstreamer plugins or the even older hevc-vaapi patch? I've used all of those for HEVC encoding on my RX 5700 XT and they've all worked fine. |
I get a huge quality difference with way lower bitrate. Specially useful if streaming rather than recording |
@DashCruft i use this same spec but the https://github.com/HannesMann/archlinux-amdgpu-pro dont work for me, |
latest amd firmware from 2022-09-13 (on fedora its amd-gpu-firmware, others may be linux-firmware) broke AMF again. Last known working firmware was 2022-08-15. If you dowgrade firmware packages please note you also have to regenerate initramfs and reboot. On fedora 36: Please note this is a firmware issue and -not- an issue with this PR. |
@GloriousEggroll oh and I get something strange in my obs, I don't know if it's because of all this strange setup that is needed for the AMF to work. |
Just to confirm with the firmware 08-15 and the https://github.com/HannesMann/archlinux-amdgpu-pro now my hevc seem to work and the twitch bug are gone, great work ppl :) arch with 6700xt too |
On my new RX 6800 this is literally the only way to get decent encoding quality. obs-vaapi/gstreamer-vaapi or the built in vaapi either require bit rate so high you can only record or the quality is so bad its unusable. My old RX480 is okish with VAAPI but i guess not RDNA2. Works flawlessly and the quality is the best you can get with an AMDGPU, only better option on linux for AMDGPUs would be when the bargain bin ARC GPUs come rolling out if they have an encoder as a dedicated card. Currently on Arch you need just the amf-amdgpu-pro and the linux-firmware 20220815 like has been mentioned but otherwise easy to setup. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Again I'll ask to keep troubleshooting out of this PR, thanks. @daedalao Your build is missing jack plugin. |
This build sadly did not work for me. If the issue is on my side, feel free to contact me helping me to fix the issue, since @nowrep asked us to keep the troubleshooting out of this. Using Kubuntu 22.04.01 checked out obs/master and fetch-cherry-picked commit e2a95d6 amf Test was positive
Here is my startscript with the relevant env varscd into /usr is necessary because I had some issues with loading the locale
And finally the obs output
|
can you try a make like this https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=obs-studio-amf? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This merge request seems to only work windows, those encoders never pop up on Linux no matter what, this pr is to get those encoders on Linux.
…________________________________
From: Lucas de Paula Ferreira ***@***.***>
Sent: Saturday, November 19, 2022 6:15:16 AM
To: obsproject/obs-studio ***@***.***>
Cc: Ward Nakchbandi (Cosmic Fusion) ***@***.***>; Comment ***@***.***>
Subject: Re: [obsproject/obs-studio] obs-ffmpeg: Make AMF encoder work on Linux (PR #7206)
#6508<#6508> seems to be merged and adds this func too
—
Reply to this email directly, view it on GitHub<#7206 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AT63FLONA2JT6EYSZAYXWIDWJBH5JANCNFSM572VZKJA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This PR doesn't touch anything to do with Windows. The encoder implementations are platform specific, and unrelated to each other. |
To be able to use this feature, the user will need to switch to the AMD proprietary driver stack or play between two driver (mesa/amdpro). Which is a bad thing UI/UX wise. Moreover the feature is not possible on Flatpak. If the feature is not usable without some workaround, this PR has design issues. |
It can be changed so that it switches to proprietary driver automatically without user having to manually set
As long as the proprietary driver is inside the Flatpak runtime, I see no reason why it wouldn't work. Nvidia proprietary driver works with Flatpak too. |
If you mean having a workaround inside OBS code, it is still design issue. OBS should not manage which Vulkan driver has to be used.
The proprietary driver is not available on Flatpak (Flathub) unlike Nvidia's. Surely because AMD does not allow redistribution of their binaries on "unsupported platform". Edit: I may have misunderstood but Flatpak use only drivers included in runtimes and never the host. |
That wouldn't work anyway : the icd files and amf.so files , are placed differently on various Distros and third party packages and scripts , for example on ubuntu and fedora you would ; along side the icd being in /opt/amdgpu-pro rather than the system path , you have the AMF.so files in /opt/amdgpu-pro which need to be loaded (a.k.a loaded via LD_LIBRARY_PATH) , this isn't needed in arch ass arch packages have AMF in the system path.
…________________________________
From: tytan652 ***@***.***>
Sent: Saturday, November 19, 2022 9:39:32 AM
To: obsproject/obs-studio ***@***.***>
Cc: Ward Nakchbandi (Cosmic Fusion) ***@***.***>; Comment ***@***.***>
Subject: Re: [obsproject/obs-studio] obs-ffmpeg: Make AMF encoder work on Linux (PR #7206)
It can be changed so that it switches to proprietary driver automatically without user having to manually set VK_ICD_FILENAMES.
If you mean having a workaround inside OBS code, it is still design issue. OBS should not manage which Vulkan driver has to be used.
As long as the proprietary driver is inside the Flatpak runtime, I see no reason why it wouldn't work. Nvidia proprietary driver works with Flatpak too.
The proprietary driver is not available on Flatpak (Flathub) unlike Nvidia's. Surely because AMD does not allow redistribution of their binaries on "unsupported platform".
—
Reply to this email directly, view it on GitHub<#7206 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AT63FLPVO6W2M3323MLFPPTWJB73JANCNFSM572VZKJA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
AFAIK this merge request all it does is enable some features if it detects they are available on the system. The fact that this features are a pain in the ass to get installed is not an OBS or this MR problem. If Flatpak can't get this features is an issue between Flatpak and AMD (Regarding redistribution). I would not consider this MR to have a Design issue. The real problem is outside of OBS |
I know how to repackage AMD drivers : I repackage for the AUR (cfe varients which was AUR updated to 20.40), fedora, and non LTS ubuntu, but for Flatpak we need to use "extra-sources" functionality to not have redist legal issues, and simply couldn't find any resources to learn flatpak
…________________________________
From: José Miguel Sarasola ***@***.***>
Sent: Saturday, November 19, 2022 10:11:20 AM
To: obsproject/obs-studio ***@***.***>
Cc: Ward Nakchbandi (Cosmic Fusion) ***@***.***>; Comment ***@***.***>
Subject: Re: [obsproject/obs-studio] obs-ffmpeg: Make AMF encoder work on Linux (PR #7206)
AFAIK this merge request all it does is enable some features if it detects they are available on the system. The fact that this features are a pain in the ass to get installed is not an OBS or this MR problem. If Flatpak can't get this features is an issue between Flatpak and AMD (Regarding redistribution).
I would not consider this MR to have a Design issue. The real problem is outside of OBS
—
Reply to this email directly, view it on GitHub<#7206 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AT63FLMX5WU3HO4CCF6TLGDWJCDSRANCNFSM572VZKJA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This AUR package provides a custom desktop entry that apply the workaround, which is also a workaround in itself. This package is in a way providing biased feedback about this PR, because of this desktop entry workaround. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm going to go ahead and lock comments for now, as this has derailed from conversation about the actual PR, and is nothing but a mess of troubleshooting and questions about "how do I do X thing". If we have any questions for the PR author, we will comment here and open comments again. If anyone has any comments on the PR itself, please stop by our #development channel in our Discord, and those conversations can happen there. We see this PR, and will review it as soon as we have time. |
9e0e825
to
1b62220
Compare
Only the fallback encoders are available (no texture support). Requires AMD proprietary Vulkan driver, using different driver will be detected on startup and the encoders disabled.
Description
Add Linux support for AMF encoder.
Only the fallback encoders are available (no texture support).
Requires AMD proprietary Vulkan driver, using different driver
will be detected on startup and the encoders disabled.
Motivation and Context
AMF is also available on Linux and thus users on Linux should be able to use it in OBS too.
How Has This Been Tested?
Tested with RX 6700 XT using latest driver version 22.20 on Arch Linux.
Types of changes
Checklist: