Basic UI: Add advanced encoder settings
This commit is contained in:
parent
938b7c4395
commit
ded272e777
@ -203,6 +203,9 @@ Basic.Settings.Output.AudioBitrate="Audio Bitrate"
|
||||
Basic.Settings.Output.Reconnect="Automatically Reconnect"
|
||||
Basic.Settings.Output.RetryDelay="Retry Delay (seconds)"
|
||||
Basic.Settings.Output.MaxRetries="Maximum Retries"
|
||||
Basic.Settings.Output.Advanced="Advanced Encoder Settings"
|
||||
Basic.Settings.Output.X264Preset="x264 CPU Preset"
|
||||
Basic.Settings.Output.CustomX264Settings="Custom x264 Settings"
|
||||
|
||||
# basic mode 'video' settings
|
||||
Basic.Settings.Video="Video"
|
||||
|
@ -514,6 +514,80 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="simpleOutAdvanced">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Advanced</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="simpleOutCustomX264"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.CustomX264Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.X264Preset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QComboBox" name="simpleOutPreset">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">ultrafast</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">superfast</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">veryfast</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">faster</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">fast</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">medium</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">slow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">slower</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1103,5 +1177,69 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>simpleOutAdvanced</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>simpleOutPreset</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>439</x>
|
||||
<y>240</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>432</x>
|
||||
<y>256</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>simpleOutAdvanced</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>label_24</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>482</x>
|
||||
<y>241</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>308</x>
|
||||
<y>266</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>simpleOutAdvanced</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>simpleOutCustomX264</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>459</x>
|
||||
<y>234</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>452</x>
|
||||
<y>292</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>simpleOutAdvanced</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>label_23</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>554</x>
|
||||
<y>236</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>286</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
@ -438,6 +438,10 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
config_set_default_uint (basicConfig, "SimpleOutput", "RetryDelay", 2);
|
||||
config_set_default_uint (basicConfig, "SimpleOutput", "MaxRetries",
|
||||
20);
|
||||
config_set_default_bool (basicConfig, "SimpleOutput", "UseAdvanced",
|
||||
false);
|
||||
config_set_default_string(basicConfig, "SimpleOutput", "Preset",
|
||||
"veryfast");
|
||||
|
||||
config_set_default_uint (basicConfig, "Video", "BaseCX", cx);
|
||||
config_set_default_uint (basicConfig, "Video", "BaseCY", cy);
|
||||
@ -1976,11 +1980,22 @@ void OBSBasic::SetupEncoders()
|
||||
"VBitrate");
|
||||
int audioBitrate = config_get_uint(basicConfig, "SimpleOutput",
|
||||
"ABitrate");
|
||||
bool advanced = config_get_bool(basicConfig, "SimpleOutput",
|
||||
"UseAdvanced");
|
||||
const char *preset = config_get_string(basicConfig,
|
||||
"SimpleOutput", "Preset");
|
||||
const char *custom = config_get_string(basicConfig,
|
||||
"SimpleOutput", "x264Settings");
|
||||
|
||||
obs_data_set_int(x264Settings, "bitrate", videoBitrate);
|
||||
obs_data_set_int(x264Settings, "buffer_size", videoBitrate);
|
||||
obs_data_set_bool(x264Settings, "cbr", true);
|
||||
|
||||
if (advanced) {
|
||||
obs_data_set_string(x264Settings, "preset", preset);
|
||||
obs_data_set_string(x264Settings, "x264opts", custom);
|
||||
}
|
||||
|
||||
obs_data_set_int(aacSettings, "bitrate", audioBitrate);
|
||||
|
||||
obs_encoder_update(x264, x264Settings);
|
||||
|
@ -145,6 +145,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->simpleOutReconnect, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleOutRetryDelay, SCROLL_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleOutMaxRetries, SCROLL_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleOutAdvanced, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleOutPreset, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleOutCustomX264, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->channelSetup, COMBO_CHANGED, AUDIO_RESTART);
|
||||
HookWidget(ui->sampleRate, COMBO_CHANGED, AUDIO_RESTART);
|
||||
HookWidget(ui->desktopAudioDevice1, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
@ -432,6 +435,12 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
|
||||
"RetryDelay");
|
||||
int maxRetries = config_get_uint(main->Config(), "SimpleOutput",
|
||||
"MaxRetries");
|
||||
bool advanced = config_get_bool(main->Config(), "SimpleOutput",
|
||||
"UseAdvanced");
|
||||
const char *preset = config_get_string(main->Config(), "SimpleOutput",
|
||||
"Preset");
|
||||
const char *custom = config_get_string(main->Config(), "SimpleOutput",
|
||||
"x264Settings");
|
||||
|
||||
ui->simpleOutputPath->setText(path);
|
||||
ui->simpleOutputVBitrate->setValue(videoBitrate);
|
||||
@ -442,6 +451,9 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
|
||||
ui->simpleOutReconnect->setChecked(reconnect);
|
||||
ui->simpleOutRetryDelay->setValue(retryDelay);
|
||||
ui->simpleOutMaxRetries->setValue(maxRetries);
|
||||
ui->simpleOutAdvanced->setChecked(advanced);
|
||||
ui->simpleOutPreset->setCurrentText(preset);
|
||||
ui->simpleOutCustomX264->setText(custom);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadOutputSettings()
|
||||
@ -614,6 +626,9 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
SaveCheckBox(ui->simpleOutReconnect, "SimpleOutput", "Reconnect");
|
||||
SaveSpinBox(ui->simpleOutRetryDelay, "SimpleOutput", "RetryDelay");
|
||||
SaveSpinBox(ui->simpleOutMaxRetries, "SimpleOutput", "MaxRetries");
|
||||
SaveCheckBox(ui->simpleOutAdvanced, "SimpleOutput", "UseAdvanced");
|
||||
SaveCombo(ui->simpleOutPreset, "SimpleOutput", "Preset");
|
||||
SaveEdit(ui->simpleOutCustomX264, "SimpleOutput", "x264Settings");
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveAudioSettings()
|
||||
|
Loading…
x
Reference in New Issue
Block a user