From b80d45f132317db8dac766e2fe87c84b61fa16b4 Mon Sep 17 00:00:00 2001 From: Penwywern Date: Wed, 3 Apr 2024 17:49:15 +0200 Subject: [PATCH] UI: Log available encoders on load --- UI/window-basic-main.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 16916f28d..7679abaff 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1983,6 +1983,34 @@ void OBSBasic::ResetOutputs() "Failed to initialize video. Your GPU may not be supported, " \ "or your graphics drivers may need to be updated." +static inline void LogEncoders() +{ + constexpr uint32_t hide_flags = OBS_ENCODER_CAP_DEPRECATED | + OBS_ENCODER_CAP_INTERNAL; + + auto list_encoders = [](obs_encoder_type type) { + size_t idx = 0; + const char *encoder_type; + + while (obs_enum_encoder_types(idx++, &encoder_type)) { + if (obs_get_encoder_caps(encoder_type) & hide_flags || + obs_get_encoder_type(encoder_type) != type) { + continue; + } + + blog(LOG_INFO, "\t- %s (%s)", encoder_type, + obs_encoder_get_display_name(encoder_type)); + } + }; + + blog(LOG_INFO, "---------------------------------"); + blog(LOG_INFO, "Available Encoders:"); + blog(LOG_INFO, " Video Encoders:"); + list_encoders(OBS_ENCODER_VIDEO); + blog(LOG_INFO, " Audio Encoders:"); + list_encoders(OBS_ENCODER_AUDIO); +} + void OBSBasic::OBSInit() { ProfileScope("OBSBasic::OBSInit"); @@ -2079,6 +2107,8 @@ void OBSBasic::OBSInit() CheckForSimpleModeX264Fallback(); + LogEncoders(); + blog(LOG_INFO, STARTUP_SEPARATOR); if (!InitService())