Pārlūkot izejas kodu

frontend: Log streaming service recommended maximums

Log the maximum recommended audio and video bitrate when the
user ticks the "Ignore streaming service setting recommendations" box.
prgmitchell 10 mēneši atpakaļ
vecāks
revīzija
84a5662df8

+ 16 - 1
frontend/utility/AdvancedOutput.cpp

@@ -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);
 		}
 

+ 14 - 1
frontend/utility/SimpleOutput.cpp

@@ -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);
 	}