Easy way to get good (4k 60fps) OBS encoding performance with AMD GPUs

Out of the box, OBS’s VA-API hardware encoding performance with AMD GPUs is rather abysmal. Even on the newest generation of AMD GPUs (RDNA2 architecture, e.g. 6900XT), OBS can do 1440p 30fps max. 1440p 60fps, 4k 30fps and of course 4k 60fps recording typically looks like a slideshow.

I was searching for a solution to this, and most commonly suggested workarounds involved:

  1. Using AMD AMF. I did not want to go this route as I did not want to use AMD’s installer script, since it is not integrated with the distro package managers very well, does not work with Flatpak and is proprietary software.

  2. Using a custom fork of obs, specifically obs-hevc-vaapi-git which has some patches unlocking HEVC VAAPI recording in OBS. I did not really want to go down this path either, as I do not use Arch and building it myself would be quite difficult.

Enter the obs-gstreamer plugin. With this plugin, all you need to do is:

  1. In OBS settings > Output > Streaming choose “GStreamer Encoder” as the encoder and “VAAPI” as the encoder type.

  2. For recording, go to the Recording tab and choose “Use stream encoder” as the encoder

With this, coupled alongside the obs-vkcapture plugin, my 6900XT is capable of doing 100% smooth 4K 60fps gameplay recording.

To install, you need the following flatpak packages:

  • com.obsproject.Studio
  • com.obsproject.Studio.Plugin.Gstreamer
  • org.freedesktop.Platform.GStreamer.gstreamer-vaapi
  • Optionally install com.obsproject.Studio.Plugin.OBSVkCapture for capturing game footage^1

[1] You will additionally have to:

  • Install org.freedesktop.Platform.VulkanLayer.OBSVkCapture when running games e.g. Steam via flatpak

  • Install the capture tools natively when e.g. running games via Lutris installed through apt/pacman etc

(Originally posted here)

3 Likes

Gstreamer + gamecapture is doing much better than VAAPI + Pipewire Capture (current OBS default).
For desktop capture Pipewire is really good, but a little inferior to gamecapture for games, at least with my RX 580.
I showed the comparison on my blog (in PT-BR)

1 Like