UI: Add "enforce streaming service settings"
Add a checkbox named "Enforce streaming service encoder settings" checkbox to advanced output. Disabling this checkbox allows the user to optionally disable the enforcement of streaming service encoder settings. I had a user complain that they didn't want to always have the service's preferred encoder settings forced on them.
This commit is contained in:
parent
fc574a0d7b
commit
c2832b8b1c
@ -244,6 +244,7 @@ Basic.Settings.Output.UseBufferSize="Use Custom Buffer Size"
|
||||
Basic.Settings.Output.Adv.Rescale="Rescale Output"
|
||||
Basic.Settings.Output.Adv.AudioTrack="Audio Track"
|
||||
Basic.Settings.Output.Adv.Streaming="Streaming"
|
||||
Basic.Settings.Output.Adv.ApplyServiceSettings="Enforce streaming service encoder settings"
|
||||
Basic.Settings.Output.Adv.Audio.Track1="Track 1"
|
||||
Basic.Settings.Output.Adv.Audio.Track2="Track 2"
|
||||
Basic.Settings.Output.Adv.Audio.Track3="Track 3"
|
||||
|
@ -760,17 +760,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="advOutEncLabel">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Encoder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="advOutEncoder"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="advOutUseRescale">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
@ -786,7 +786,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QComboBox" name="advOutRescale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -796,14 +796,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.AudioTrack</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QWidget" name="widget_8" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
@ -858,6 +858,16 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="advOutApplyService">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.Adv.ApplyServiceSettings</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -401,6 +401,8 @@ inline void AdvancedOutput::SetupStreaming()
|
||||
"TrackIndex");
|
||||
int trackCount = config_get_int(main->Config(), "AdvOut",
|
||||
"TrackCount");
|
||||
bool applyServiceSettings = config_get_bool(main->Config(), "AdvOut",
|
||||
"ApplyServiceSettings");
|
||||
unsigned int cx = 0;
|
||||
unsigned int cy = 0;
|
||||
|
||||
@ -414,16 +416,33 @@ inline void AdvancedOutput::SetupStreaming()
|
||||
|
||||
obs_output_set_video_encoder(streamOutput, h264Streaming);
|
||||
|
||||
if (applyServiceSettings) {
|
||||
obs_service_apply_encoder_settings(main->GetService(),
|
||||
h264Streaming, nullptr);
|
||||
}
|
||||
|
||||
if (multitrack) {
|
||||
int i = 0;
|
||||
for (; i < trackCount; i++)
|
||||
for (; i < trackCount; i++) {
|
||||
obs_output_set_audio_encoder(streamOutput, aacTrack[i],
|
||||
i);
|
||||
|
||||
if (applyServiceSettings)
|
||||
obs_service_apply_encoder_settings(
|
||||
main->GetService(), nullptr,
|
||||
aacTrack[i]);
|
||||
}
|
||||
|
||||
for (; i < 4; i++)
|
||||
obs_output_set_audio_encoder(streamOutput, nullptr, i);
|
||||
|
||||
} else {
|
||||
obs_output_set_audio_encoder(streamOutput,
|
||||
aacTrack[trackIndex - 1], 0);
|
||||
|
||||
if (applyServiceSettings)
|
||||
obs_service_apply_encoder_settings(main->GetService(),
|
||||
nullptr, aacTrack[trackIndex - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,6 +414,8 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
config_set_default_bool (basicConfig, "AdvOut", "Reconnect", true);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "RetryDelay", 2);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "MaxRetries", 20);
|
||||
config_set_default_bool (basicConfig, "AdvOut", "ApplyServiceSettings",
|
||||
true);
|
||||
config_set_default_bool (basicConfig, "AdvOut", "UseRescale", false);
|
||||
config_set_default_bool (basicConfig, "AdvOut", "Multitrack", false);
|
||||
config_set_default_uint (basicConfig, "AdvOut", "TrackIndex", 1);
|
||||
|
@ -157,6 +157,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->advOutTrack2, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack3, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutApplyService, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecType, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecPath, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecEncoder, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
@ -617,10 +618,13 @@ void OBSBasicSettings::LoadAdvOutputStreamingSettings()
|
||||
"RescaleRes");
|
||||
int trackIndex = config_get_int(main->Config(), "AdvOut",
|
||||
"TrackIndex");
|
||||
bool applyServiceSettings = config_get_bool(main->Config(), "AdvOut",
|
||||
"ApplyServiceSettings");
|
||||
|
||||
ui->advOutReconnect->setChecked(reconnect);
|
||||
ui->advOutRetryDelay->setValue(retryDelay);
|
||||
ui->advOutMaxRetries->setValue(maxRetries);
|
||||
ui->advOutApplyService->setChecked(applyServiceSettings);
|
||||
ui->advOutUseRescale->setChecked(rescale);
|
||||
ui->advOutRescale->setCurrentText(rescaleRes);
|
||||
|
||||
@ -1060,6 +1064,7 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
SaveCheckBox(ui->advOutReconnect, "AdvOut", "Reconnect");
|
||||
SaveSpinBox(ui->advOutRetryDelay, "AdvOut", "RetryDelay");
|
||||
SaveSpinBox(ui->advOutMaxRetries, "AdvOut", "MaxRetries");
|
||||
SaveCheckBox(ui->advOutApplyService, "AdvOut", "ApplyServiceSettings");
|
||||
SaveComboData(ui->advOutEncoder, "AdvOut", "Encoder");
|
||||
SaveCheckBox(ui->advOutUseRescale, "AdvOut", "Rescale");
|
||||
SaveCombo(ui->advOutRescale, "AdvOut", "RescaleRes");
|
||||
|
Loading…
x
Reference in New Issue
Block a user