Skip to content

Commit

Permalink
UI: Add warning if starting the output fails
Browse files Browse the repository at this point in the history
This is mainly to give visual feedback to those affected by NVENC not
working with older driver versions. Currenlty obs fails silently which
could go unnoticed for users who are using hotkeys as well as confuse
users who are not trained to read their logs when issues occur.

Closes #788
  • Loading branch information
derrod authored and jp9000 committed Feb 15, 2017
1 parent f83bd9f commit 6bc1ecc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
6 changes: 6 additions & 0 deletions UI/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ ConfirmRemove.Title="Confirm Remove"
ConfirmRemove.Text="Are you sure you wish to remove '$1'?"
ConfirmRemove.TextMultiple="Are you sure you wish to remove %1 items?"

# output start messages
Output.StartStreamFailed="Failed to start streaming"
Output.StartRecordingFailed="Failed to start recording"
Output.StartReplayFailed="Failed to start replay buffer"
Output.StartFailedGeneric="Starting the output failed. Please check the log for details.\n\nNote: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date."

# output connect messages
Output.ConnectFail.Title="Failed to connect"
Output.ConnectFail.BadPath="Invalid Path or Connection URL. Please check your settings to confirm that they are valid."
Expand Down
23 changes: 18 additions & 5 deletions UI/window-basic-main-outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,13 @@ bool SimpleOutput::StartRecording()
UpdateRecording();
if (!ConfigureRecording(false))
return false;
if (!obs_output_start(fileOutput))
if (!obs_output_start(fileOutput)) {
QMessageBox::critical(main,
QTStr("Output.StartRecordingFailed"),
QTStr("Output.StartFailedGeneric"));
return false;
}

return true;
}

Expand All @@ -847,8 +852,13 @@ bool SimpleOutput::StartReplayBuffer()
UpdateRecording();
if (!ConfigureRecording(true))
return false;
if (!obs_output_start(replayBuffer))
if (!obs_output_start(replayBuffer)) {
QMessageBox::critical(main,
QTStr("Output.StartReplayFailed"),
QTStr("Output.StartFailedGeneric"));
return false;
}

return true;
}

Expand Down Expand Up @@ -1399,11 +1409,14 @@ bool AdvancedOutput::StartRecording()
obs_data_release(settings);
}

if (obs_output_start(fileOutput)) {
return true;
if (!obs_output_start(fileOutput)) {
QMessageBox::critical(main,
QTStr("Output.StartRecordingFailed"),
QTStr("Output.StartFailedGeneric"));
return false;
}

return false;
return true;
}

void AdvancedOutput::StopStreaming(bool force)
Expand Down
6 changes: 5 additions & 1 deletion UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3876,6 +3876,11 @@ void OBSBasic::StartStreaming()
sysTrayStream->setText(ui->streamButton->text());
sysTrayStream->setEnabled(true);
}

QMessageBox::critical(this,
QTStr("Output.StartStreamFailed"),
QTStr("Output.StartFailedGeneric"));
return;
}

bool recordWhenStreaming = config_get_bool(GetGlobalConfig(),
Expand All @@ -3887,7 +3892,6 @@ void OBSBasic::StartStreaming()
"BasicWindow", "ReplayBufferWhileStreaming");
if (replayBufferWhileStreaming)
StartReplayBuffer();

}

#ifdef _WIN32
Expand Down

1 comment on commit 6bc1ecc

@SuslikV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...If you are using the NVENC or AMD encoders...

I think, pointing to NVIDIA or AMD is not a fair option. Any encoder may fail. Or you think your coding is better than others do?

Please sign in to comment.