From dfafdd9ef5e8fefa4ac2431c3243cf61c994a6f4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 12 Oct 2024 17:43:27 +0200 Subject: Constant bitrate option as default for streaming --- include/Config.hpp | 2 ++ src/Config.cpp | 4 ++++ src/Overlay.cpp | 1 - src/Process.cpp | 13 +++++++++++++ src/gui/SettingsPage.cpp | 9 ++++++--- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/Config.hpp b/include/Config.hpp index 0d2c822..5766009 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -83,6 +83,8 @@ namespace gsr { }; struct Config { + Config(); + MainConfig main_config; StreamingConfig streaming_config; RecordConfig record_config; diff --git a/src/Config.cpp b/src/Config.cpp index 2f99625..ec2f777 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -12,6 +12,10 @@ #define CONFIG_FILE_VERSION 1 namespace gsr { + Config::Config() { + streaming_config.record_options.video_quality = "custom"; + } + static std::optional parse_key_value(std::string_view line) { const size_t space_index = line.find(' '); if(space_index == std::string_view::npos) diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 34988f1..ece6030 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -731,7 +731,6 @@ namespace gsr { "-cursor", config->record_config.record_options.record_cursor ? "yes" : "no", "-cr", config->record_config.record_options.color_range.c_str(), "-fm", framerate_mode.c_str(), - "-q", config->record_config.record_options.video_quality.c_str(), "-k", config->record_config.record_options.video_codec.c_str(), "-f", fps.c_str(), "-o", output_file.c_str() diff --git a/src/Process.cpp b/src/Process.cpp index 822e82e..f9c896c 100644 --- a/src/Process.cpp +++ b/src/Process.cpp @@ -10,11 +10,22 @@ #include namespace gsr { + static void debug_print_args(const char **args) { + fprintf(stderr, "gsr-overlay info: running command:"); + while(*args) { + fprintf(stderr, " %s", *args); + ++args; + } + fprintf(stderr, "\n"); + } + bool exec_program_daemonized(const char **args) { /* 1 argument */ if(args[0] == nullptr) return false; + debug_print_args(args); + pid_t pid = vfork(); if(pid == -1) { perror("Failed to vfork"); @@ -45,6 +56,8 @@ namespace gsr { if(args[0] == nullptr) return -1; + debug_print_args(args); + pid_t pid = vfork(); if(pid == -1) { perror("Failed to vfork"); diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index 2e7035b..8b06499 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -195,12 +195,15 @@ namespace gsr { list->add_widget(std::make_unique