Constant bitrate option as default for streaming

This commit is contained in:
dec05eba
2024-10-12 17:43:27 +02:00
parent 9d76b0861e
commit dfafdd9ef5
5 changed files with 25 additions and 4 deletions

View File

@@ -83,6 +83,8 @@ namespace gsr {
};
struct Config {
Config();
MainConfig main_config;
StreamingConfig streaming_config;
RecordConfig record_config;

View File

@@ -12,6 +12,10 @@
#define CONFIG_FILE_VERSION 1
namespace gsr {
Config::Config() {
streaming_config.record_options.video_quality = "custom";
}
static std::optional<KeyValue> parse_key_value(std::string_view line) {
const size_t space_index = line.find(' ');
if(space_index == std::string_view::npos)

View File

@@ -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()

View File

@@ -10,11 +10,22 @@
#include <stdlib.h>
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");

View File

@@ -195,11 +195,14 @@ namespace gsr {
list->add_widget(std::make_unique<Label>(&get_theme().body_font, "Video quality:", get_theme().text_color));
auto video_quality_box = std::make_unique<ComboBox>(&get_theme().body_font);
video_quality_box->add_item("Custom (Constant bitrate)", "custom");
video_quality_box->add_item("Custom (Constant bitrate, recommended for live streaming)", "custom");
video_quality_box->add_item("Medium", "medium");
video_quality_box->add_item("High (Recommended for live streaming)", "high");
video_quality_box->add_item("High", "high");
video_quality_box->add_item("Very high (Recommended)", "very_high");
video_quality_box->add_item("Ultra", "ultra");
if(type == Type::STREAM)
video_quality_box->set_selected_item("custom");
else
video_quality_box->set_selected_item("very_high");
video_quality_box_ptr = video_quality_box.get();
list->add_widget(std::move(video_quality_box));