Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/services/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,16 @@ export class SettingsService extends StatefulService<ISettingsServiceState> {
this.setSettings('Output', this.state.Output.formData);
}

setDefaultVideoEncoder() {
const mode: string = this.findSettingValue(this.state.Output.formData, 'Untitled', 'Mode');

if (mode === 'Advanced') {
this.setSettingValue('Output', 'Encoder', 'obs_x264');
} else {
this.setSettingValue('Output', 'StreamEncoder', 'x264');
}
}

/**
* List all settings by category to the console
* @remark For debugging purposes only
Expand All @@ -769,6 +779,10 @@ export class SettingsService extends StatefulService<ISettingsServiceState> {
}
}

isValidEncoder(streamType: 'Stream' | 'StreamSecond' | 'Both') {
return obs.NodeObs.OBS_settings_isValidEncoder(streamType);
}

isEnhancedBroadcasting() {
return obs.NodeObs.OBS_settings_isEnhancedBroadcasting();
}
Expand Down
40 changes: 40 additions & 0 deletions app/services/streaming/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,46 @@ export class StreamingService
// save current settings in store so we can re-use them if something will go wrong
this.SET_GO_LIVE_SETTINGS(settings);



//if !streamShift, !multistream, and dual output mode is enabled, check for valid encoder and prompt user to change if necessary
if (!settings.streamShift && !this.views.isMultiplatformMode && this.views.isDualOutputMode) {
let streamToCheck = 'Both';

//special case for YouTube dual streaming because it doesn't use Stream/StreamSecond, just uses the main stream
const ytSettings = getDefined(settings.platforms.youtube);
if (ytSettings?.display === 'both') {
streamToCheck = 'Stream';
}

const validEncoder = this.settingsService.isValidEncoder(streamToCheck as 'Stream' | 'StreamSecond' | 'Both');
if (!validEncoder) {
const choice = remote.dialog.showMessageBoxSync(this.windowsService.windows.child, {
type: 'error',
message:
'The currently configured encoder is not supported for the selected Dual Output destinations. Would you like to reset the stream encoder to Software (x264) or select a different encoder in settings?',
Comment thread
mhoyer-streamlabs marked this conversation as resolved.
defaultId: 2,
cancelId: 0,
buttons: ['Cancel', 'Open Settings', 'Use x264'],
noLink: true,
});
if (choice === 0) {
const newError = createStreamError('DUAL_OUTPUT_SETUP_FAILED');
newError.details =
'The currently configured encoder is not supported for the selected Dual Output destinations. Please reset the stream encoder to Software (x264) or select a different encoder in settings.';
this.setError(newError);
return;
}
else if (choice === 1) {
this.settingsService.actions.showSettings('Output');
return;
}
else {
this.settingsService.actions.setDefaultVideoEncoder();
}
}
}

// show the GoLive checklist
this.UPDATE_STREAM_INFO({ lifecycle: 'runChecklist' });

Expand Down
Loading