aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--dbus/client/dbus_client.c4
-rw-r--r--dbus/client/dbus_client.h2
-rw-r--r--extra/gpu-screen-recorder.service4
-rw-r--r--meson.build2
-rw-r--r--project.conf2
-rw-r--r--src/egl.c6
7 files changed, 17 insertions, 5 deletions
diff --git a/README.md b/README.md
index 2ec6ddf..62f0066 100644
--- a/README.md
+++ b/README.md
@@ -193,3 +193,5 @@ KDE Plasma version 6.2 broke HDR and ICC profiles for screen recorders. This was
I don't know how well recording HDR works in wayland compositors other than KDE plasma.
## GPU Screen Recorder starts lagging after 30-40 minutes when launching GPU Screen Recorder from steam command launcher
This is a [steam issue](https://github.com/ValveSoftware/steam-for-linux/issues/11446). Prepend the gpu-screen-recorder command with `LD_PREFIX=""`, for example `LD_PREFIX="" gpu-screen-recorder -w screen -o video.mp4`.
+## The video isn't smooth when gpu usage is 100%
+If you are using the flatpak version of GPU Screen Recorder then try installing GPU Screen Recorder from aur or source instead. Flatpak has a limitation that prevents GPU Screen Recorder from running faster when playing very heavy games.
diff --git a/dbus/client/dbus_client.c b/dbus/client/dbus_client.c
index 2fc9511..31f4158 100644
--- a/dbus/client/dbus_client.c
+++ b/dbus/client/dbus_client.c
@@ -3,6 +3,7 @@
#include <sys/socket.h>
#include <sys/wait.h>
+#include <sys/prctl.h>
#include <unistd.h>
#include <poll.h>
@@ -66,6 +67,9 @@ bool gsr_dbus_client_init(gsr_dbus_client *self, const char *screencast_restore_
char socket_pair_server_str[32];
snprintf(socket_pair_server_str, sizeof(socket_pair_server_str), "%d", self->socket_pair[1]);
+ /* Needed for NixOS for example, to make sure gsr-dbus-server doesn't inherit cap_sys_nice */
+ prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL, 0, 0, 0);
+
const char *args[] = { "gsr-dbus-server", socket_pair_server_str, self->screencast_restore_token ? self->screencast_restore_token : "", NULL };
execvp(args[0], (char *const*)args);
diff --git a/dbus/client/dbus_client.h b/dbus/client/dbus_client.h
index c9e8182..98a1ecf 100644
--- a/dbus/client/dbus_client.h
+++ b/dbus/client/dbus_client.h
@@ -2,7 +2,7 @@
#define GSR_DBUS_CLIENT_H
/*
- Using a client-server architecture is needed for dbus because cap_sys_nice doesn't work with desktop portal.
+ Using a client-server architecture is needed for dbus because cap_sys_nice breaks desktop portal.
The main binary has cap_sys_nice and we launch a new child-process without it which uses uses desktop portal.
*/
diff --git a/extra/gpu-screen-recorder.service b/extra/gpu-screen-recorder.service
index 1938a36..7054e17 100644
--- a/extra/gpu-screen-recorder.service
+++ b/extra/gpu-screen-recorder.service
@@ -5,7 +5,7 @@ Description=GPU Screen Recorder Service
EnvironmentFile=-%h/.config/gpu-screen-recorder.env
Environment=WINDOW=screen
Environment=CONTAINER=mp4
-Environment=QUALITY=50000
+Environment=QUALITY=40000
Environment=BITRATE_MODE=cbr
Environment=CODEC=auto
Environment=AUDIO_CODEC=opus
@@ -27,4 +27,4 @@ Restart=on-failure
RestartSec=5s
[Install]
-WantedBy=default.target \ No newline at end of file
+WantedBy=default.target
diff --git a/meson.build b/meson.build
index d6b49dc..0a0bb60 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('gpu-screen-recorder', ['c', 'cpp'], version : '5.5.2', default_options : ['warning_level=2'])
+project('gpu-screen-recorder', ['c', 'cpp'], version : '5.5.3', default_options : ['warning_level=2'])
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
if get_option('buildtype') == 'debug'
diff --git a/project.conf b/project.conf
index 4bf23da..0f3f566 100644
--- a/project.conf
+++ b/project.conf
@@ -1,7 +1,7 @@
[package]
name = "gpu-screen-recorder"
type = "executable"
-version = "5.5.2"
+version = "5.5.3"
platforms = ["posix"]
[config]
diff --git a/src/egl.c b/src/egl.c
index 8e38589..dd84325 100644
--- a/src/egl.c
+++ b/src/egl.c
@@ -39,6 +39,12 @@ static void reset_cap_nice(void) {
if(!caps)
return;
+ cap_flag_value_t cap_sys_nice_value = CAP_CLEAR;
+ cap_get_flag(caps, CAP_SYS_NICE, CAP_EFFECTIVE, &cap_sys_nice_value);
+ if(cap_sys_nice_value == CAP_CLEAR) {
+ fprintf(stderr, "gsr warning: cap_sys_nice capability is missing on the gpu-screen-recorder binary, performance might be affected. If you are using the flatpak version of gpu-screen-recorder then the only fix is to use a non-flatpak version of gpu-screen-recorder\n");
+ }
+
const cap_value_t cap_to_remove = CAP_SYS_NICE;
cap_set_flag(caps, CAP_EFFECTIVE, 1, &cap_to_remove, CAP_CLEAR);
cap_set_flag(caps, CAP_PERMITTED, 1, &cap_to_remove, CAP_CLEAR);