mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Constant bitrate option as default for streaming
This commit is contained in:
@@ -83,6 +83,8 @@ namespace gsr {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Config {
|
struct Config {
|
||||||
|
Config();
|
||||||
|
|
||||||
MainConfig main_config;
|
MainConfig main_config;
|
||||||
StreamingConfig streaming_config;
|
StreamingConfig streaming_config;
|
||||||
RecordConfig record_config;
|
RecordConfig record_config;
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#define CONFIG_FILE_VERSION 1
|
#define CONFIG_FILE_VERSION 1
|
||||||
|
|
||||||
namespace gsr {
|
namespace gsr {
|
||||||
|
Config::Config() {
|
||||||
|
streaming_config.record_options.video_quality = "custom";
|
||||||
|
}
|
||||||
|
|
||||||
static std::optional<KeyValue> parse_key_value(std::string_view line) {
|
static std::optional<KeyValue> parse_key_value(std::string_view line) {
|
||||||
const size_t space_index = line.find(' ');
|
const size_t space_index = line.find(' ');
|
||||||
if(space_index == std::string_view::npos)
|
if(space_index == std::string_view::npos)
|
||||||
|
|||||||
@@ -731,7 +731,6 @@ namespace gsr {
|
|||||||
"-cursor", config->record_config.record_options.record_cursor ? "yes" : "no",
|
"-cursor", config->record_config.record_options.record_cursor ? "yes" : "no",
|
||||||
"-cr", config->record_config.record_options.color_range.c_str(),
|
"-cr", config->record_config.record_options.color_range.c_str(),
|
||||||
"-fm", framerate_mode.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(),
|
"-k", config->record_config.record_options.video_codec.c_str(),
|
||||||
"-f", fps.c_str(),
|
"-f", fps.c_str(),
|
||||||
"-o", output_file.c_str()
|
"-o", output_file.c_str()
|
||||||
|
|||||||
@@ -10,11 +10,22 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
namespace gsr {
|
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) {
|
bool exec_program_daemonized(const char **args) {
|
||||||
/* 1 argument */
|
/* 1 argument */
|
||||||
if(args[0] == nullptr)
|
if(args[0] == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
debug_print_args(args);
|
||||||
|
|
||||||
pid_t pid = vfork();
|
pid_t pid = vfork();
|
||||||
if(pid == -1) {
|
if(pid == -1) {
|
||||||
perror("Failed to vfork");
|
perror("Failed to vfork");
|
||||||
@@ -45,6 +56,8 @@ namespace gsr {
|
|||||||
if(args[0] == nullptr)
|
if(args[0] == nullptr)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
debug_print_args(args);
|
||||||
|
|
||||||
pid_t pid = vfork();
|
pid_t pid = vfork();
|
||||||
if(pid == -1) {
|
if(pid == -1) {
|
||||||
perror("Failed to vfork");
|
perror("Failed to vfork");
|
||||||
|
|||||||
@@ -195,12 +195,15 @@ namespace gsr {
|
|||||||
list->add_widget(std::make_unique<Label>(&get_theme().body_font, "Video quality:", get_theme().text_color));
|
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);
|
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("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("Very high (Recommended)", "very_high");
|
||||||
video_quality_box->add_item("Ultra", "ultra");
|
video_quality_box->add_item("Ultra", "ultra");
|
||||||
video_quality_box->set_selected_item("very_high");
|
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();
|
video_quality_box_ptr = video_quality_box.get();
|
||||||
list->add_widget(std::move(video_quality_box));
|
list->add_widget(std::move(video_quality_box));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user