From 6539bacc4ede50029f39c46af7ca3ca16e48385c Mon Sep 17 00:00:00 2001 From: Michael Fabian Dirks Date: Thu, 9 Feb 2017 02:54:19 +0100 Subject: [PATCH] UI: Add support for other codecs This changes the logic to show all encoders in the Recording tab but only show selected supported codecs in the Streaming tab (at least with Advanced Output Mode). The only (to my knowledge) streaming format that supports other formats than H264 is WebRTC, which in theory should support H264, VP8, VP9 and HEVC. However I don't know about any ingest server that works well with it yet. Closes jp9000/obs-studio#794 --- UI/window-basic-settings.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index bcbe46d8b..a2db7ea05 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -695,15 +695,28 @@ void OBSBasicSettings::LoadEncoderTypes() const char *codec = obs_get_encoder_codec(type); uint32_t caps = obs_get_encoder_caps(type); - if (strcmp(codec, "h264") != 0) + if (obs_get_encoder_type(type) != OBS_ENCODER_VIDEO) continue; + + const char* streaming_codecs[] = { + "h264", + //"hevc", + }; + bool is_streaming_codec = false; + for (const char* test_codec : streaming_codecs) { + if (strcmp(codec, test_codec) == 0) { + is_streaming_codec = true; + break; + } + } if ((caps & OBS_ENCODER_CAP_DEPRECATED) != 0) continue; QString qName = QT_UTF8(name); QString qType = QT_UTF8(type); - ui->advOutEncoder->addItem(qName, qType); + if (is_streaming_codec) + ui->advOutEncoder->addItem(qName, qType); ui->advOutRecEncoder->addItem(qName, qType); } }