aboutsummaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/gpu-screen-recorder.env2
-rw-r--r--extra/gpu-screen-recorder.service4
-rwxr-xr-xextra/meson_post_install.sh11
3 files changed, 14 insertions, 3 deletions
diff --git a/extra/gpu-screen-recorder.env b/extra/gpu-screen-recorder.env
index ce9f223..e542992 100644
--- a/extra/gpu-screen-recorder.env
+++ b/extra/gpu-screen-recorder.env
@@ -9,3 +9,5 @@ FRAMERATE=60
REPLAYDURATION=60
OUTPUTDIR=/run/media/dec05eba/SSD1TB/Videos/aaaa
KEYINT=2
+ENCODER=gpu
+RESTORE_PORTAL_SESSION=yes \ No newline at end of file
diff --git a/extra/gpu-screen-recorder.service b/extra/gpu-screen-recorder.service
index 6933f66..d4d9f3b 100644
--- a/extra/gpu-screen-recorder.service
+++ b/extra/gpu-screen-recorder.service
@@ -16,7 +16,9 @@ Environment=OUTPUTDIR=%h/Videos
Environment=MAKEFOLDERS=no
Environment=COLOR_RANGE=limited
Environment=KEYINT=2
-ExecStart=/bin/sh -c 'AUDIO="${AUDIO_DEVICE:-$(pactl get-default-sink).monitor}"; gpu-screen-recorder -v no -w $WINDOW -c $CONTAINER -q $QUALITY -k $CODEC -ac $AUDIO_CODEC -a "$AUDIO" -a "$SECONDARY_AUDIO_DEVICE" -f $FRAMERATE -r $REPLAYDURATION -o "$OUTPUTDIR" -mf $MAKEFOLDERS $ADDITIONAL_ARGS -cr $COLOR_RANGE -keyint $KEYINT'
+Environment=ENCODER=gpu
+Environment=RESTORE_PORTAL_SESSION=yes
+ExecStart=/bin/sh -c 'AUDIO="${AUDIO_DEVICE:-$(pactl get-default-sink).monitor}"; gpu-screen-recorder -v no -w "$WINDOW" -c "$CONTAINER" -q "$QUALITY" -k "$CODEC" -ac "$AUDIO_CODEC" -a "$AUDIO" -a "$SECONDARY_AUDIO_DEVICE" -f "$FRAMERATE" -r "$REPLAYDURATION" -o "$OUTPUTDIR" -mf "$MAKEFOLDERS" $ADDITIONAL_ARGS -cr "$COLOR_RANGE" -keyint "$KEYINT" -restore-portal-session "$RESTORE_PORTAL_SESSION" -encoder "$ENCODER"'
KillSignal=SIGINT
Restart=on-failure
RestartSec=5s
diff --git a/extra/meson_post_install.sh b/extra/meson_post_install.sh
index f1f6a5a..0b4aab3 100755
--- a/extra/meson_post_install.sh
+++ b/extra/meson_post_install.sh
@@ -1,5 +1,12 @@
#!/bin/sh
-setcap cap_sys_admin+ep ${MESON_INSTALL_DESTDIR_PREFIX}/bin/gsr-kms-server \
+# Needed to remove password prompt when recording a monitor on amd/intel or nvidia wayland
+/sbin/setcap cap_sys_admin+ep ${MESON_INSTALL_DESTDIR_PREFIX}/bin/gsr-kms-server \
|| echo "\n!!! Please re-run install as root\n"
-setcap cap_sys_nice+ep ${MESON_INSTALL_DESTDIR_PREFIX}/bin/gpu-screen-recorder
+
+# Cant do this because it breaks desktop portal (create session)!!!.
+# For some reason the desktop portal tries to access /proc/gpu-screen-recorder-pid/root from the portal process
+# which doesn't work because for some reason CAP_SYS_NICE on a program makes /proc/self/root not readable by other processes.
+# This is needed to allow gpu screen recorder to run faster than a heavy games fps, for example when trying to record at 60 fps
+# but the game drops to 45 fps in some place. That would also make gpu screen recorder drop to 45 fps unless this setcap is used.
+#/sbin/setcap cap_sys_nice+ep ${MESON_INSTALL_DESTDIR_PREFIX}/bin/gpu-screen-recorder