Add constant bitrate option

This commit is contained in:
dec05eba
2024-10-09 19:08:55 +02:00
parent 61c9b4918e
commit 9d76b0861e
5 changed files with 60 additions and 13 deletions

View File

@@ -717,6 +717,7 @@ namespace gsr {
// TODO: Validate input, fallback to valid values
const std::string fps = std::to_string(config->record_config.record_options.fps);
const std::string video_bitrate = std::to_string(config->record_config.record_options.video_bitrate);
const std::string output_file = config->record_config.save_directory + "/Video_" + get_date_str() + "." + container_to_file_extension(config->record_config.container.c_str());
const std::string audio_tracks_merged = merge_audio_tracks(config->record_config.record_options.audio_tracks);
const std::string framerate_mode = config->record_config.record_options.framerate_mode == "auto" ? "vfr" : config->record_config.record_options.framerate_mode;
@@ -736,6 +737,16 @@ namespace gsr {
"-o", output_file.c_str()
};
if(config->record_config.record_options.video_quality == "custom") {
args.push_back("-bm");
args.push_back("cbr");
args.push_back("-q");
args.push_back(video_bitrate.c_str());
} else {
args.push_back("-q");
args.push_back(config->record_config.record_options.video_quality.c_str());
}
if(config->record_config.record_options.record_area_option == "window" || config->record_config.record_options.record_area_option == "focused") {
args.push_back("-s");
args.push_back(region);