aboutsummaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/gpu-screen-recorder.env11
-rw-r--r--extra/gpu-screen-recorder.service25
-rw-r--r--extra/gsr-nvidia.conf1
-rwxr-xr-xextra/install_preserve_video_memory.sh8
-rwxr-xr-xextra/meson_post_install.sh5
5 files changed, 50 insertions, 0 deletions
diff --git a/extra/gpu-screen-recorder.env b/extra/gpu-screen-recorder.env
new file mode 100644
index 0000000..e776bd6
--- /dev/null
+++ b/extra/gpu-screen-recorder.env
@@ -0,0 +1,11 @@
+WINDOW=screen
+CONTAINER=mp4
+QUALITY=very_high
+CODEC=hevc
+AUDIO_CODEC=opus
+AUDIO_DEVICE=alsa_output.pci-0000_0a_00.4.iec958-stereo.monitor
+SECONDARY_AUDIO_DEVICE=alsa_input.some-mic.mono-fallback
+FRAMERATE=60
+REPLAYDURATION=60
+OUTPUTDIR=/run/media/dec05eba/SSD1TB/Videos/aaaa
+KEYINT=2
diff --git a/extra/gpu-screen-recorder.service b/extra/gpu-screen-recorder.service
new file mode 100644
index 0000000..6933f66
--- /dev/null
+++ b/extra/gpu-screen-recorder.service
@@ -0,0 +1,25 @@
+[Unit]
+Description=GPU Screen Recorder Service
+
+[Service]
+EnvironmentFile=-%h/.config/gpu-screen-recorder.env
+Environment=WINDOW=screen
+Environment=CONTAINER=mp4
+Environment=QUALITY=very_high
+Environment=CODEC=auto
+Environment=AUDIO_CODEC=opus
+Environment=AUDIO_DEVICE=
+Environment=SECONDARY_AUDIO_DEVICE=
+Environment=FRAMERATE=60
+Environment=REPLAYDURATION=30
+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'
+KillSignal=SIGINT
+Restart=on-failure
+RestartSec=5s
+
+[Install]
+WantedBy=default.target
diff --git a/extra/gsr-nvidia.conf b/extra/gsr-nvidia.conf
new file mode 100644
index 0000000..10cbf7d
--- /dev/null
+++ b/extra/gsr-nvidia.conf
@@ -0,0 +1 @@
+options nvidia NVreg_PreserveVideoMemoryAllocations=1
diff --git a/extra/install_preserve_video_memory.sh b/extra/install_preserve_video_memory.sh
new file mode 100755
index 0000000..c5cf658
--- /dev/null
+++ b/extra/install_preserve_video_memory.sh
@@ -0,0 +1,8 @@
+#!/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
new file mode 100755
index 0000000..f1f6a5a
--- /dev/null
+++ b/extra/meson_post_install.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+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