Configure OBS Studio VA-API Encoder on Linux
This guide provides a straightforward tutorial on how to configure OBS Studio to use the VA-API (Video Acceleration API) hardware encoder on Linux. You will learn how to verify your system’s hardware acceleration support, install the necessary drivers, and adjust the settings within OBS Studio to enable efficient, low-CPU video encoding using your AMD or Intel graphics card.
Step 1: Install VA-API Drivers
Before configuring OBS Studio, you must ensure that your Linux system has the correct VA-API drivers installed for your hardware.
For Intel Graphics: *
Ubuntu/Debian:
sudo apt install intel-media-va-driver-non-free vainfo *
Fedora:
sudo dnf install intel-media-driver vainfo * Arch
Linux:
sudo pacman -S intel-media-driver vainfo
For AMD Graphics: * Ubuntu/Debian:
sudo apt install mesa-va-drivers vainfo *
Fedora:
sudo dnf install mesa-dri-drivers vainfo * Arch
Linux:
sudo pacman -S mesa libva-mesa-driver vainfo
Step 2: Verify VA-API Installation
To confirm that VA-API is working correctly on your system, open your terminal and run the following command:
vainfoIf configured correctly, the terminal will output a list of supported
video profiles and entrypoints (such as VAEntrypointVLD and
VAEntrypointEncPicture). If you receive an error, restart
your system or ensure your user belongs to the video or
render group.
Step 3: Configure OBS Studio
Once the drivers are verified, open OBS Studio and follow these steps to enable VA-API encoding:
- Click on Settings in the bottom-right corner of the OBS window.
- Navigate to the Output tab in the left sidebar.
- Change the Output Mode dropdown at the top from Simple to Advanced.
- Select either the Streaming or Recording tab depending on which one you want to configure.
- Locate the Video Encoder dropdown menu.
- Select H.264 / AVC Encoder (VAAPI) or HEVC / H.265 Encoder (VAAPI).
Step 4: Fine-Tune Encoder Settings
After selecting the VA-API encoder, adjust the following settings for optimal performance:
- Rate Control: Set this to CBR (Constant Bitrate) for streaming or CQP (Constant QP) for high-quality local recording.
- Bitrate: Enter your desired streaming bitrate
(e.g.,
6000 Kbpsfor 1080p at 60fps). - Speed: Set the preset to balanced or quality. If you experience dropped frames, lower this setting to speed.
Click Apply and then OK to save your settings. OBS Studio is now configured to use your GPU for hardware-accelerated encoding on Linux.