diff options
Diffstat (limited to 'extra')
-rw-r--r-- | extra/gpu-screen-recorder.env | 6 | ||||
-rw-r--r-- | extra/gpu-screen-recorder.service | 7 | ||||
-rwxr-xr-x | extra/install_preserve_video_memory.sh | 8 | ||||
-rwxr-xr-x | extra/meson_post_install.sh | 16 |
4 files changed, 23 insertions, 14 deletions
diff --git a/extra/gpu-screen-recorder.env b/extra/gpu-screen-recorder.env index ce9f223..8ce1edb 100644 --- a/extra/gpu-screen-recorder.env +++ b/extra/gpu-screen-recorder.env @@ -3,9 +3,11 @@ CONTAINER=mp4 QUALITY=very_high CODEC=h264 AUDIO_CODEC=opus -AUDIO_DEVICE=alsa_output.pci-0000_0a_00.4.iec958-stereo.monitor -SECONDARY_AUDIO_DEVICE=alsa_input.some-mic.mono-fallback +AUDIO_DEVICE=default_output +SECONDARY_AUDIO_DEVICE=default_input 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..d0912ec 100644 --- a/extra/gpu-screen-recorder.service +++ b/extra/gpu-screen-recorder.service @@ -8,7 +8,7 @@ Environment=CONTAINER=mp4 Environment=QUALITY=very_high Environment=CODEC=auto Environment=AUDIO_CODEC=opus -Environment=AUDIO_DEVICE= +Environment=AUDIO_DEVICE=default_output Environment=SECONDARY_AUDIO_DEVICE= Environment=FRAMERATE=60 Environment=REPLAYDURATION=30 @@ -16,7 +16,10 @@ 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 +Environment=ADDITIONAL_ARGS= +ExecStart=gpu-screen-recorder -v no -w "${WINDOW}" -c "${CONTAINER}" -q "${QUALITY}" -k "${CODEC}" -ac "${AUDIO_CODEC}" -a "${AUDIO_DEVICE}" -a "${SECONDARY_AUDIO_DEVICE}" -f "${FRAMERATE}" -r "${REPLAYDURATION}" -o "${OUTPUTDIR}" -df "${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/install_preserve_video_memory.sh b/extra/install_preserve_video_memory.sh deleted file mode 100755 index c5cf658..0000000 --- a/extra/install_preserve_video_memory.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -script_dir=$(dirname "$0") -cd "$script_dir" - -[ $(id -u) -ne 0 ] && echo "You need root privileges to run the install script" && exit 1 - -install -Dm644 gsr-nvidia.conf /etc/modprobe.d/gsr-nvidia.conf diff --git a/extra/meson_post_install.sh b/extra/meson_post_install.sh index f1f6a5a..7bf0d96 100755 --- a/extra/meson_post_install.sh +++ b/extra/meson_post_install.sh @@ -1,5 +1,17 @@ #!/bin/sh -setcap cap_sys_admin+ep ${MESON_INSTALL_DESTDIR_PREFIX}/bin/gsr-kms-server \ +# Needed to remove password prompt when recording a monitor (without desktop portal option) on amd/intel or nvidia wayland +/usr/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. +# The reason portal reads that file might be because portal seems to have a security feature where its able to identify the +# process and if the session token is stolen by another application then it will ignore the session token as it wasn't that +# application that created the session token. +# --- +# This is needed (for EGL_CONTEXT_PRIORITY_HIGH_IMG) to allow gpu screen recorder to run faster than the heaviest application on AMD. +# For example when trying to record a game at 60 fps and 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. +#/usr/sbin/setcap cap_sys_nice+ep ${MESON_INSTALL_DESTDIR_PREFIX}/bin/gpu-screen-recorder |