Add OBS/ffmpeg instructions with AMD vaapi

This commit is contained in:
ducoterra
2023-06-22 09:03:55 -04:00
parent 11f422e7cc
commit e1a7114c7a

View File

@@ -102,7 +102,8 @@ And timers to run the btrbk services on a regular schedule.
Description=Run btrbk_snapshots every hour
[Timer]
OnCalendar=hourly
OnCalendar=hourlyalways want to give it a device name; the implicit selection may be right in some cases but it's better not to rely on it.
AccuracySec=10min
Persistent=true
Unit=btrbk_snapshots.service
@@ -334,10 +335,14 @@ flatpak update
## Steam
### Install ProtonUp-Qt
```bash
flatpak install flathub net.davidotek.pupgui2
```
### Install Steam
```bash
sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install steam
@@ -348,9 +353,24 @@ cd ~/.local/share/Steam/
./steam.sh --reset
```
### Enable OBS Game Capture
<https://github.com/nowrep/obs-vkcapture>
```bash
sudo dnf install cmake gcc gcc-c++ obs-studio-devel mesa-libGL-devel vulkan-loader-devel
git clone ssh://git@gitea.reeseapps.com:2222/mirrors/obs-vkcapture.git
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make && make install
```
Add `env OBS_VKCAPTURE=1 %command%` to your launch options for the game you want to capture.
## OBS
https://www.reddit.com/r/linux_gaming/comments/w4i3qf/easy_way_to_get_good_4k_60fps_obs_encoding/
<https://www.reddit.com/r/linux_gaming/comments/w4i3qf/easy_way_to_get_good_4k_60fps_obs_encoding>
```bash
sudo flatpak install \
@@ -360,10 +380,44 @@ sudo flatpak install \
com.obsproject.Studio.Plugin.OBSVkCapture
```
Create a new scene and add "Game Capture" to it. When you start a game with the above
launch option (`env OBS_VKCAPTURE=1 %command%`) OBS will automatically pick it up.
Use advanced settings to select the GStreamer encoder and the VA-API encoder type.
![obs_hardware_encoding_settings](obs_hardware_encoding.png)
## FFMPEG with hardware encoding/decoding
First you'll need mesa-va-drivers-freeworld which provides x264 and hevc support for
vaapi decoding. First you'll need to install [https://rpmfusion.org/Configuration](rpm fusion).
Then the freeworld drivers need to be swapped with mesa-va-drivers:
```bash
sudo dnf swap mesa-va-drivers mesa-va-drivers-freeworld
```
To check what hardware decoding is supported by your system you'll need vainfo:
```bash
sudo dnf install libva-utils
```
Running `vainfo` will show all available profiles. You should see H264, HEVC, AV1, and VP9.
Then with ffmpeg you can run
```bash
ffmpeg \
-hwaccel vaapi \
-vaapi_device /dev/dri/renderD128 \
-hwaccel_output_format vaapi \
-i input.mkv \
-c:v hevc_vaapi \
-b:v 0 \
test.mp4
```
## Power Button Behavior
The power button is controlled from 2 locations: