mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-27 00:08:54 -04:00
UI: Use hardware encoding by default if available
If the user doesn't use the auto-configuration on first use, set the default encoders used in simple output mode to hardware encoders.
This commit is contained in:
1 parent
93ba6e7128
commit
9fee895359
5 files changed
+32
-5
No files matched your search
@@ -1185,8 +1185,6 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
"flv");
|
||||
config_set_default_uint (basicConfig, "SimpleOutput", "VBitrate",
|
||||
2500);
|
||||
config_set_default_string(basicConfig, "SimpleOutput", "StreamEncoder",
|
||||
SIMPLE_ENCODER_X264);
|
||||
config_set_default_uint (basicConfig, "SimpleOutput", "ABitrate", 160);
|
||||
config_set_default_bool (basicConfig, "SimpleOutput", "UseAdvanced",
|
||||
false);
|
||||
@@ -1196,8 +1194,6 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
"veryfast");
|
||||
config_set_default_string(basicConfig, "SimpleOutput", "RecQuality",
|
||||
"Stream");
|
||||
config_set_default_string(basicConfig, "SimpleOutput", "RecEncoder",
|
||||
SIMPLE_ENCODER_X264);
|
||||
config_set_default_bool(basicConfig, "SimpleOutput", "RecRB", false);
|
||||
config_set_default_int(basicConfig, "SimpleOutput", "RecRBTime", 20);
|
||||
config_set_default_int(basicConfig, "SimpleOutput", "RecRBSize", 512);
|
||||
@@ -1326,6 +1322,20 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
return true;
|
||||
}
|
||||
|
||||
extern bool EncoderAvailable(const char *encoder);
|
||||
|
||||
void OBSBasic::InitBasicConfigDefaults2()
|
||||
{
|
||||
bool oldEncDefaults = config_get_bool(App()->GlobalConfig(),
|
||||
"General", "Pre23Defaults");
|
||||
bool useNV = EncoderAvailable("ffmpeg_nvenc") && !oldEncDefaults;
|
||||
|
||||
config_set_default_string(basicConfig, "SimpleOutput", "StreamEncoder",
|
||||
useNV ? SIMPLE_ENCODER_NVENC : SIMPLE_ENCODER_X264);
|
||||
config_set_default_string(basicConfig, "SimpleOutput", "RecEncoder",
|
||||
useNV ? SIMPLE_ENCODER_NVENC : SIMPLE_ENCODER_X264);
|
||||
}
|
||||
|
||||
bool OBSBasic::InitBasicConfig()
|
||||
{
|
||||
ProfileScope("OBSBasic::InitBasicConfig");
|
||||
@@ -1557,6 +1567,8 @@ void OBSBasic::OBSInit()
|
||||
cef = obs_browser_init_panel();
|
||||
#endif
|
||||
|
||||
InitBasicConfigDefaults2();
|
||||
|
||||
CheckForSimpleModeX264Fallback();
|
||||
|
||||
blog(LOG_INFO, STARTUP_SEPARATOR);
|
||||
|
||||
Reference in new issue
Block a user