aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-09 23:33:24 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-09 23:33:24 +0100
commit8b3afca0c676aef7e821330e8698220fca79f15c (patch)
treed944c348bb5f60fbade2c49a864c951f8932eadf
parentdb1934b4ea47bb19d8f18517737e263589c5d7ea (diff)
Readd (requires root access text), move hdr video codec options to bottom
-rw-r--r--TODO2
-rw-r--r--com.dec05eba.gpu_screen_recorder.appdata.xml9
-rw-r--r--src/main.cpp30
3 files changed, 23 insertions, 18 deletions
diff --git a/TODO b/TODO
index 1581ce7..7d487bd 100644
--- a/TODO
+++ b/TODO
@@ -14,9 +14,9 @@ Add translation support (using gettext, which uses .mo files and _ macro). It sh
file with correct locale. Or if they know how to use git they can use that directly.
Add option to start replay on system startup (use the gpu screen recorder systemd file?) and use the settings from the replay page.
Dont add this option if not running systemd, or disable the button then.
- If on amd/intel or wayland then check if has cap, if not then show a popup box with a prompt asking to remove password prompt to continue.
Fix screen capture breaking after suspend/monitor change on nvidia x11.
Add note about replaying can get bugged on suspend unless nvidia reg for suspend is added (because cuda breaks, nvidia driver bug).
Detect suspend before it happens and unload cuda/nvenc then and reload after suspend. This is a workaround to nvidia driver bug that breaks cuda on suspend.
+ Disable the gpu screen recorders aur/source package systemd service if enabled in the gui since these are two different services. Or make that service and gui service the same and work with the same (gui) config file.
The program should minimize to taskbar on minimize.
Remove the need to install gpu screen recorder flatpak as system. This can now be done because of kms-server-proxy. \ No newline at end of file
diff --git a/com.dec05eba.gpu_screen_recorder.appdata.xml b/com.dec05eba.gpu_screen_recorder.appdata.xml
index 5a43abf..1577b5c 100644
--- a/com.dec05eba.gpu_screen_recorder.appdata.xml
+++ b/com.dec05eba.gpu_screen_recorder.appdata.xml
@@ -36,20 +36,23 @@
<li>FLAC</li>
</ul>
<p>
+ Recording a monitor requires (restricted) root access which means that you have to install GPU Screen Recorder system-wide: flatpak install flathub --system com.dec05eba.gpu_screen_recorder
+ and pkexec needs to be installed on the system and a polkit agent needs to be running.
+ </p>
+ <p>
Videos are in variable framerate format. Very out of date video players might have an issue playing such videos. It's recommend to use MPV to play such videos, otherwise you might experience stuttering in the video. You can select constant frame rate mode in advanced view if you need it.
</p>
<p>
If the video doesn't play or you get green/yellow overlay then your video player is missing H264/HEVC video codec. Either install the video codecs or use mpv.
</p>
<p>
- Recording a monitor requires (restricted) root access which means that you have to install GPU Screen Recorder system-wide: flatpak install flathub --system com.dec05eba.gpu_screen_recorder
- and pkexec needs to be installed on the system and a polkit agent needs to be running.
+ If the video is glitched with checkerboard pattern and you are using and Intel integrated GPU on wayland then this is a known issue and right now the only solution is to record on X11 instead.
</p>
<p>
If H264/HEVC video encoding option is not available on your AMD/Intel system but you know that your supports those codecs then you may need to install mesa-extra freedesktop runtime by running this command: flatpak install --system org.freedesktop.Platform.GL.default//23.08-extra
</p>
<p>
- Recording a single window is also only possible on X11. Hotkeys are not supported on wayland either (wayland doesn't really support this). Use X11 if you want a proper desktop experience in general.
+ Recording a single window is only possible on X11. Hotkeys are not supported on wayland either (wayland doesn't really support this). Use X11 if you want a proper desktop experience in general.
</p>
<p>AV1 is currently not supported in the flatpak for Nvidia since GPU Screen Recorder uses an older ffmpeg version to support older Nvidia cards. Install GPU Screen Recorder from source or from AUR if you want to use AV1 on Nvidia.</p>
<p>On some Intel integrated GPUs the video can appear glitched when recording on Wayland. The only known workaround at the moment is to record on X11.</p>
diff --git a/src/main.cpp b/src/main.cpp
index edd8944..d676e00 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -116,6 +116,7 @@ static std::string record_file_current_filename;
static bool nvfbc_installed = false;
static bool wayland = false;
+static bool flatpak = false;
static gsr_egl egl;
struct AudioInput {
@@ -217,7 +218,7 @@ static bool is_inside_flatpak(void) {
}
static bool is_pkexec_installed() {
- if(is_inside_flatpak())
+ if(flatpak)
return system("flatpak-spawn --host pkexec --version") == 0;
else
return is_program_installed({ "pkexec", 6 });
@@ -1299,7 +1300,7 @@ static bool show_pkexec_flatpak_error_if_needed() {
return true;
}
- if(is_inside_flatpak() && !flatpak_is_installed_as_system()) {
+ if(flatpak && !flatpak_is_installed_as_system()) {
if(wayland) {
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
"GPU Screen Recorder needs to be installed system-wide to record your monitor on Wayland. To install GPU Screen recorder system-wide, you can run this command:\n"
@@ -2281,6 +2282,9 @@ static GtkWidget* create_common_settings_page(GtkStack *stack, GtkApplication *a
label += std::to_string(monitor->size.x);
label += "x";
label += std::to_string(monitor->size.y);
+ if(flatpak && (wayland || gpu_inf.vendor != GPU_VENDOR_NVIDIA)) {
+ label += ", requires root access";
+ }
label += ")";
// Leak on purpose, what are you gonna do? stab me?
@@ -2424,24 +2428,20 @@ static GtkWidget* create_common_settings_page(GtkStack *stack, GtkApplication *a
video_codec_input_menu = GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new());
gtk_combo_box_text_append(video_codec_input_menu, "auto", "Auto (Recommended)");
if(got_supported_video_codecs) {
- if(supported_video_codecs.h264) {
+ if(supported_video_codecs.h264)
gtk_combo_box_text_append(video_codec_input_menu, "h264", "H264");
- }
- if(supported_video_codecs.hevc) {
+ if(supported_video_codecs.hevc)
gtk_combo_box_text_append(video_codec_input_menu, "hevc", "HEVC");
- if(wayland && gpu_inf.vendor != GPU_VENDOR_NVIDIA)
- gtk_combo_box_text_append(video_codec_input_menu, "hevc_hdr", "HEVC (HDR)");
- }
- if(supported_video_codecs.av1) {
+ if(supported_video_codecs.av1)
gtk_combo_box_text_append(video_codec_input_menu, "av1", "AV1");
- if(wayland && gpu_inf.vendor != GPU_VENDOR_NVIDIA)
- gtk_combo_box_text_append(video_codec_input_menu, "av1_hdr", "AV1 (HDR)");
+
+ if(wayland) {
+ gtk_combo_box_text_append(video_codec_input_menu, "hevc_hdr", "HEVC (HDR)");
+ gtk_combo_box_text_append(video_codec_input_menu, "av1_hdr", "AV1 (HDR)");
}
} else {
gtk_combo_box_text_append(video_codec_input_menu, "h264", "H264");
gtk_combo_box_text_append(video_codec_input_menu, "hevc", "HEVC");
- if(wayland && gpu_inf.vendor != GPU_VENDOR_NVIDIA)
- gtk_combo_box_text_append(video_codec_input_menu, "hevc_hdr", "HEVC (HDR)");
}
gtk_widget_set_hexpand(GTK_WIDGET(video_codec_input_menu), true);
gtk_grid_attach(video_codec_grid, GTK_WIDGET(video_codec_input_menu), 1, 0, 1, 1);
@@ -3022,7 +3022,7 @@ static void load_config(const gpu_info &gpu_inf) {
if(config.main_config.codec != "auto" && config.main_config.codec != "h264" && config.main_config.codec != "h265" && config.main_config.codec != "hevc" && config.main_config.codec != "av1" && config.main_config.codec != "hevc_hdr" && config.main_config.codec != "av1_hdr")
config.main_config.codec = "auto";
- if((!wayland || gpu_inf.vendor == GPU_VENDOR_NVIDIA) && (config.main_config.codec == "hevc_hdr" || config.main_config.codec == "av1_hdr"))
+ if(!wayland && (config.main_config.codec == "hevc_hdr" || config.main_config.codec == "av1_hdr"))
config.main_config.codec = "auto";
if(config.main_config.audio_codec != "opus" && config.main_config.audio_codec != "aac" && config.main_config.audio_codec != "flac")
@@ -3215,6 +3215,8 @@ static const char* gpu_vendor_to_name(gpu_vendor vendor) {
}
static void activate(GtkApplication *app, gpointer) {
+ flatpak = is_inside_flatpak();
+
Display *dpy = XOpenDisplay(NULL);
wayland = !dpy || is_xwayland(dpy);
if(!wayland && !dpy) {