While I don't know how, I do know that there is a way to have mesa for most things while having AMF encoder for encoding. Nobara has this set up out of the box so there is some way. Maybe you could search for it using a search engine
Does it really? I know when I looked into it a bit ago the main dev for nobara had a video about how to install it and use it but it didn't let you split that out. You could quickly change back and forth between mesa and amdgpu but if you tried to run amf with mesa it would hard lock and crash
It has been some time since I tried out Nobara so I might be wrong. I just remember that Nobara page lists having amf encoder support out of the box as a feature