Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Log streaming service recommended maximums #11733

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 16 additions & 1 deletion frontend/utility/AdvancedOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,22 @@ void AdvancedOutput::UpdateStreamSettings()
int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec");
obs_service_apply_encoder_settings(main->GetService(), settings, nullptr);
if (!enforceBitrate) {
blog(LOG_INFO, "User is ignoring service bitrate limits.");
int maxVideoBitrate;
int maxAudioBitrate;
obs_service_get_max_bitrate(main->GetService(), &maxVideoBitrate, &maxAudioBitrate);

std::string videoBitRateLogString = maxVideoBitrate > 0 ? std::to_string(maxVideoBitrate)
: "None";
std::string audioBitRateLogString = maxAudioBitrate > 0 ? std::to_string(maxAudioBitrate)
: "None";

blog(LOG_INFO,
"User is ignoring service bitrate limits.\n"
"Service Recommendations:\n"
"\tvideo bitrate: %s\n"
"\taudio bitrate: %s",
videoBitRateLogString.c_str(), audioBitRateLogString.c_str());

obs_data_set_int(settings, "bitrate", bitrate);
}

Expand Down
15 changes: 14 additions & 1 deletion frontend/utility/SimpleOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,20 @@ void SimpleOutput::Update()
obs_service_apply_encoder_settings(main->GetService(), videoSettings, audioSettings);

if (!enforceBitrate) {
blog(LOG_INFO, "User is ignoring service bitrate limits.");
int maxVideoBitrate;
int maxAudioBitrate;
obs_service_get_max_bitrate(main->GetService(), &maxVideoBitrate, &maxAudioBitrate);

std::string videoBitrateLogString = maxVideoBitrate > 0 ? std::to_string(maxVideoBitrate) : "None";
std::string audioBitrateLogString = maxAudioBitrate > 0 ? std::to_string(maxAudioBitrate) : "None";

blog(LOG_INFO,
"User is ignoring service bitrate limits.\n"
"Service Recommendations:\n"
"\tvideo bitrate: %s\n"
"\taudio bitrate: %s",
videoBitrateLogString.c_str(), audioBitrateLogString.c_str());

obs_data_set_int(videoSettings, "bitrate", videoBitrate);
obs_data_set_int(audioSettings, "bitrate", audioBitrate);
}
Expand Down
Loading