public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/obs-studio] epel9: Update obs-studio to 31.1.0~rc1
@ 2026-10-10 20:01 Asahi Lina
0 siblings, 0 replies; only message in thread
From: Asahi Lina @ 2026-10-10 20:01 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/obs-studio
Branch : epel9
Commit : 607e8f096307ba54877719c97bc95fd90d461a3d
Author : Asahi Lina <lina@asahilina.net>
Date : 2025-07-04T06:26:20-04:00
Stats : +512/-886 in 9 file(s)
URL : https://src.fedoraproject.org/rpms/obs-studio/c/607e8f096307ba54877719c97bc95fd90d461a3d?branch=epel9
Log:
Update obs-studio to 31.1.0~rc1
Rebase patches after upstream rework
Update obs-websocket to 5.6.1
Update obs-browser to 9ffe3828da5
Re-enable CEF support
---
diff --git a/0101-UI-Consistently-reference-the-software-H264-encoder-.patch b/0101-UI-Consistently-reference-the-software-H264-encoder-.patch
deleted file mode 100644
index 3ec81c2..0000000
--- a/0101-UI-Consistently-reference-the-software-H264-encoder-.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 3f14b23975f1673b110a21d25a5d2336afb988f5 Mon Sep 17 00:00:00 2001
-From: Neal Gompa <neal@gompa.dev>
-Date: Sat, 7 Jan 2023 23:15:13 -0500
-Subject: [PATCH 101/103] UI: Consistently reference the software H264 encoder
- properly
-
-The code here assumes that the only software encoder is the x264-based
-H.264 encoder. That may not always remain true. This change adjusts
-the encoder string to indicate that it's an H.264 encoder from x264.
----
- UI/data/locale/en-US.ini | 4 ++--
- UI/window-basic-auto-config-test.cpp | 6 +++---
- UI/window-basic-settings-stream.cpp | 2 +-
- UI/window-basic-settings.cpp | 4 ++--
- 4 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini
-index 572b15f15..2065dbc48 100644
---- a/UI/data/locale/en-US.ini
-+++ b/UI/data/locale/en-US.ini
-@@ -1034,7 +1034,7 @@ Basic.Settings.Output.Simple.Warn.Encoder="Warning: Recording with a software en
- Basic.Settings.Output.Simple.Warn.Lossless="Warning: Lossless quality generates tremendously large file sizes! Lossless quality can use upward of 7 gigabytes of disk space per minute at high resolutions and framerates. Lossless is not recommended for long recordings unless you have a very large amount of disk space available. Replay buffer is unavailable when using lossless quality."
- Basic.Settings.Output.Simple.Warn.Lossless.Msg="Are you sure you want to use lossless quality?"
- Basic.Settings.Output.Simple.Warn.Lossless.Title="Lossless quality warning!"
--Basic.Settings.Output.Simple.Encoder.Software="Software (x264)"
-+Basic.Settings.Output.Simple.Encoder.Software.X264.H264="Software (x264)"
- Basic.Settings.Output.Simple.Encoder.Hardware.QSV.H264="Hardware (QSV, H.264)"
- Basic.Settings.Output.Simple.Encoder.Hardware.QSV.AV1="Hardware (QSV, AV1)"
- Basic.Settings.Output.Simple.Encoder.Hardware.AMD.H264="Hardware (AMD, H.264)"
-@@ -1045,7 +1045,7 @@ Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.AV1="Hardware (NVENC, AV1)"
- Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.HEVC="Hardware (NVENC, HEVC)"
- Basic.Settings.Output.Simple.Encoder.Hardware.Apple.H264="Hardware (Apple, H.264)"
- Basic.Settings.Output.Simple.Encoder.Hardware.Apple.HEVC="Hardware (Apple, HEVC)"
--Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU="Software (x264 low CPU usage preset, increases file size)"
-+Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU.X264.H264="Software (x264 low CPU usage preset, increases file size)"
- Basic.Settings.Output.Simple.Codec.AAC="AAC"
- Basic.Settings.Output.Simple.Codec.AAC.Default="AAC (Default)"
- Basic.Settings.Output.Simple.Codec.Opus="Opus"
-diff --git a/UI/window-basic-auto-config-test.cpp b/UI/window-basic-auto-config-test.cpp
-index b53f37aa2..d941e6f68 100644
---- a/UI/window-basic-auto-config-test.cpp
-+++ b/UI/window-basic-auto-config-test.cpp
-@@ -981,7 +981,7 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
- }
-
- #define ENCODER_TEXT(x) "Basic.Settings.Output.Simple.Encoder." x
--#define ENCODER_SOFTWARE ENCODER_TEXT("Software")
-+#define ENCODER_X264 ENCODER_TEXT("Software.X264.H264")
- #define ENCODER_NVENC ENCODER_TEXT("Hardware.NVENC.H264")
- #define ENCODER_QSV ENCODER_TEXT("Hardware.QSV.H264")
- #define ENCODER_AMD ENCODER_TEXT("Hardware.AMD.H264")
-@@ -1020,7 +1020,7 @@ void AutoConfigTestPage::FinalizeResults()
- auto encName = [](AutoConfig::Encoder enc) -> QString {
- switch (enc) {
- case AutoConfig::Encoder::x264:
-- return QTStr(ENCODER_SOFTWARE);
-+ return QTStr(ENCODER_X264);
- case AutoConfig::Encoder::NVENC:
- return QTStr(ENCODER_NVENC);
- case AutoConfig::Encoder::QSV:
-@@ -1033,7 +1033,7 @@ void AutoConfigTestPage::FinalizeResults()
- return QTStr(QUALITY_SAME);
- }
-
-- return QTStr(ENCODER_SOFTWARE);
-+ return QTStr(ENCODER_X264);
- };
-
- auto newLabel = [this](const char *str) -> QLabel * {
-diff --git a/UI/window-basic-settings-stream.cpp b/UI/window-basic-settings-stream.cpp
-index 885c49f8a..7296d7328 100644
---- a/UI/window-basic-settings-stream.cpp
-+++ b/UI/window-basic-settings-stream.cpp
-@@ -1663,7 +1663,7 @@ void OBSBasicSettings::ResetEncoders(bool streamOnly)
-
- #define ENCODER_STR(str) QTStr("Basic.Settings.Output.Simple.Encoder." str)
-
-- ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software"), QString(SIMPLE_ENCODER_X264));
-+ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.X264.H264"), QString(SIMPLE_ENCODER_X264));
- #ifdef _WIN32
- if (service_supports_encoder(vcodecs, "obs_qsv11"))
- ui->simpleOutStrEncoder->addItem(ENCODER_STR("Hardware.QSV.H264"), QString(SIMPLE_ENCODER_QSV));
-diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp
-index d8a35501b..334213699 100644
---- a/UI/window-basic-settings.cpp
-+++ b/UI/window-basic-settings.cpp
-@@ -4735,8 +4735,8 @@ void OBSBasicSettings::FillSimpleRecordingValues()
- ADD_QUALITY("HQ");
- ADD_QUALITY("Lossless");
-
-- ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software"), QString(SIMPLE_ENCODER_X264));
-- ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU"), QString(SIMPLE_ENCODER_X264_LOWCPU));
-+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.X264.H264"), QString(SIMPLE_ENCODER_X264));
-+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU.X264.H264"), QString(SIMPLE_ENCODER_X264_LOWCPU));
- if (EncoderAvailable("obs_qsv11"))
- ui->simpleOutRecEncoder->addItem(ENCODER_STR("Hardware.QSV.H264"), QString(SIMPLE_ENCODER_QSV));
- if (EncoderAvailable("obs_qsv11_av1"))
---
-2.47.0
-
diff --git a/0101-frontend-Consider-settings-changed-if-an-output-sett.patch b/0101-frontend-Consider-settings-changed-if-an-output-sett.patch
new file mode 100644
index 0000000..a1bc23f
--- /dev/null
+++ b/0101-frontend-Consider-settings-changed-if-an-output-sett.patch
@@ -0,0 +1,90 @@
+From d87d043a4dc833b8e353a60365bcdc143c2e1264 Mon Sep 17 00:00:00 2001
+From: Asahi Lina <lina@asahilina.net>
+Date: Tue, 1 Jul 2025 16:48:12 +0900
+Subject: [PATCH 1/4] frontend: Consider settings changed if an output setting
+ was reset
+
+If the previous selection is no longer available, the UI would default
+to the first index, but not allow the user to save the change (which
+then becomes impossible to save if the setting only has one possible
+value, since you can never trigger the "changed" status).
+
+If the settings load process clamped any setting to the default, enable
+the apply button and consider the setting changed.
+---
+ frontend/settings/OBSBasicSettings.cpp | 28 +++++++++++++++++++++++---
+ 1 file changed, 25 insertions(+), 3 deletions(-)
+
+diff --git a/frontend/settings/OBSBasicSettings.cpp b/frontend/settings/OBSBasicSettings.cpp
+index 32e2d92debb6..1a2ab64fee80 100644
+--- a/frontend/settings/OBSBasicSettings.cpp
++++ b/frontend/settings/OBSBasicSettings.cpp
+@@ -1737,19 +1737,30 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
+ ui->simpleOutAdvanced->setChecked(advanced);
+ ui->simpleOutCustom->setText(custom);
+
++ bool outputSettingReset = false;
++
+ idx = ui->simpleOutRecQuality->findData(QString(recQual));
+- if (idx == -1)
++ if (idx == -1) {
++ ui->simpleOutRecQuality->setProperty("changed", QVariant(true));
+ idx = 0;
++ outputSettingReset = true;
++ }
+ ui->simpleOutRecQuality->setCurrentIndex(idx);
+
+ idx = ui->simpleOutStrEncoder->findData(QString(streamEnc));
+- if (idx == -1)
++ if (idx == -1) {
++ ui->simpleOutStrEncoder->setProperty("changed", QVariant(true));
+ idx = 0;
++ outputSettingReset = true;
++ }
+ ui->simpleOutStrEncoder->setCurrentIndex(idx);
+
+ idx = ui->simpleOutStrAEncoder->findData(QString(streamAudioEnc));
+- if (idx == -1)
++ if (idx == -1) {
++ ui->simpleOutStrAEncoder->setProperty("changed", QVariant(true));
+ idx = 0;
++ outputSettingReset = true;
++ }
+ ui->simpleOutStrAEncoder->setCurrentIndex(idx);
+
+ idx = ui->simpleOutRecEncoder->findData(QString(recEnc));
+@@ -1765,6 +1776,10 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
+ ui->simpleRBMegsMax->setValue(rbSize);
+
+ SimpleStreamingEncoderChanged();
++ if (outputSettingReset) {
++ outputsChanged = true;
++ EnableApplyButton(true);
++ }
+ }
+
+ static inline QString makeFormatToolTip()
+@@ -1905,6 +1920,10 @@ void OBSBasicSettings::LoadAdvOutputStreamingEncoderProperties()
+
+ ui->advOutEncoder->insertItem(0, encName, QT_UTF8(type));
+ SetComboByValue(ui->advOutEncoder, type);
++ } else {
++ ui->advOutEncoder->setProperty("changed", QVariant(true));
++ outputsChanged = true;
++ EnableApplyButton(true);
+ }
+ }
+
+@@ -2011,6 +2030,9 @@ void OBSBasicSettings::LoadAdvOutputRecordingEncoderProperties()
+ SetComboByValue(ui->advOutRecEncoder, type);
+ } else {
+ ui->advOutRecEncoder->setCurrentIndex(-1);
++ ui->advOutRecEncoder->setProperty("changed", QVariant(true));
++ outputsChanged = true;
++ EnableApplyButton(true);
+ }
+ }
+ }
+--
+2.49.0
+
diff --git a/0102-frontend-Allow-invalid-recording-encoder-if-quality-.patch b/0102-frontend-Allow-invalid-recording-encoder-if-quality-.patch
new file mode 100644
index 0000000..c70fc8a
--- /dev/null
+++ b/0102-frontend-Allow-invalid-recording-encoder-if-quality-.patch
@@ -0,0 +1,41 @@
+From 22cb8efe8915ab3bb9574cb1711f25a1a525f5aa Mon Sep 17 00:00:00 2001
+From: Asahi Lina <lina@asahilina.net>
+Date: Tue, 1 Jul 2025 16:50:08 +0900
+Subject: [PATCH 2/4] frontend: Allow invalid recording encoder if quality set
+ to "Stream"
+
+The combo box is only visible if quality isn't "Stream", so otherwise an
+invalid/missing selection cannot be corrected. Only do the check when
+it's relevant.
+---
+ frontend/settings/OBSBasicSettings.cpp | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/frontend/settings/OBSBasicSettings.cpp b/frontend/settings/OBSBasicSettings.cpp
+index 1a2ab64fee80..de322bc1ee8f 100644
+--- a/frontend/settings/OBSBasicSettings.cpp
++++ b/frontend/settings/OBSBasicSettings.cpp
+@@ -3719,8 +3719,7 @@ bool OBSBasicSettings::QueryAllowedToClose()
+ bool invalidFormat = false;
+ bool invalidTracks = false;
+ if (simple) {
+- if (ui->simpleOutRecEncoder->currentIndex() == -1 || ui->simpleOutStrEncoder->currentIndex() == -1 ||
+- ui->simpleOutRecAEncoder->currentIndex() == -1 || ui->simpleOutStrAEncoder->currentIndex() == -1)
++ if (ui->simpleOutStrEncoder->currentIndex() == -1 || ui->simpleOutStrAEncoder->currentIndex() == -1)
+ invalidEncoder = true;
+
+ if (ui->simpleOutRecFormat->currentIndex() == -1)
+@@ -3730,6 +3729,10 @@ bool OBSBasicSettings::QueryAllowedToClose()
+ QString format = ui->simpleOutRecFormat->currentData().toString();
+ if (SimpleOutGetSelectedAudioTracks() == 0 && qual != "Stream" && format != "flv")
+ invalidTracks = true;
++
++ if (qual != "Stream" &&
++ (ui->simpleOutRecEncoder->currentIndex() == -1 || ui->simpleOutRecAEncoder->currentIndex() == -1))
++ invalidEncoder = true;
+ } else {
+ if (ui->advOutRecEncoder->currentIndex() == -1 || ui->advOutEncoder->currentIndex() == -1 ||
+ ui->advOutRecAEncoder->currentIndex() == -1 || ui->advOutAEncoder->currentIndex() == -1)
+--
+2.49.0
+
diff --git a/0102-obs-ffmpeg-Add-initial-support-for-the-OpenH264-H.26.patch b/0102-obs-ffmpeg-Add-initial-support-for-the-OpenH264-H.26.patch
deleted file mode 100644
index a0f7b09..0000000
--- a/0102-obs-ffmpeg-Add-initial-support-for-the-OpenH264-H.26.patch
+++ /dev/null
@@ -1,317 +0,0 @@
-From ad4e561685ac5d7e228c3bf1d1d6a62dd961d294 Mon Sep 17 00:00:00 2001
-From: Neal Gompa <neal@gompa.dev>
-Date: Sun, 26 Mar 2023 06:06:31 -0400
-Subject: [PATCH 102/103] obs-ffmpeg: Add initial support for the OpenH264
- H.264 software codec
-
-This allows users to leverage the OpenH264 codec from Cisco to encode
-H.264 video content. It is significantly reduced in capability from
-alternatives, but it does the job.
-
-This also provides a framework for adding support for other H.264
-software codecs provided through FFmpeg.
----
- plugins/obs-ffmpeg/CMakeLists.txt | 1 +
- plugins/obs-ffmpeg/data/locale/en-US.ini | 3 +
- plugins/obs-ffmpeg/obs-ffmpeg-h264.c | 244 +++++++++++++++++++++++
- plugins/obs-ffmpeg/obs-ffmpeg.c | 2 +
- 4 files changed, 250 insertions(+)
- create mode 100644 plugins/obs-ffmpeg/obs-ffmpeg-h264.c
-
-diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt
-index 6bc0ab087..35b8c0c40 100644
---- a/plugins/obs-ffmpeg/CMakeLists.txt
-+++ b/plugins/obs-ffmpeg/CMakeLists.txt
-@@ -32,6 +32,7 @@ target_sources(
- obs-ffmpeg-av1.c
- obs-ffmpeg-compat.h
- obs-ffmpeg-formats.h
-+ obs-ffmpeg-h264.c
- obs-ffmpeg-hls-mux.c
- obs-ffmpeg-mux.c
- obs-ffmpeg-mux.h
-diff --git a/plugins/obs-ffmpeg/data/locale/en-US.ini b/plugins/obs-ffmpeg/data/locale/en-US.ini
-index e8b73293c..c69d3475f 100644
---- a/plugins/obs-ffmpeg/data/locale/en-US.ini
-+++ b/plugins/obs-ffmpeg/data/locale/en-US.ini
-@@ -121,4 +121,7 @@ NVENC.CheckDrivers="Try installing the latest <a href=\"https://obsproject.com/g
-
- AV1.8bitUnsupportedHdr="OBS does not support 8-bit output of Rec. 2100."
-
-+H264.UnsupportedVideoFormat="Only video formats using 8-bit color are supported."
-+H264.UnsupportedColorSpace="Only the Rec. 709 color space is supported."
-+
- ReconnectDelayTime="Reconnect Delay"
-diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-h264.c b/plugins/obs-ffmpeg/obs-ffmpeg-h264.c
-new file mode 100644
-index 000000000..7ed1cd209
---- /dev/null
-+++ b/plugins/obs-ffmpeg/obs-ffmpeg-h264.c
-@@ -0,0 +1,244 @@
-+/******************************************************************************
-+ Copyright (C) 2023 by Neal Gompa <neal@gompa.dev>
-+ Partly derived from obs-ffmpeg-av1.c by Hugh Bailey <obs.jim@gmail.com>
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+******************************************************************************/
-+
-+#include "obs-ffmpeg-video-encoders.h"
-+
-+#define do_log(level, format, ...) \
-+ blog(level, "[H.264 encoder: '%s'] " format, obs_encoder_get_name(enc->ffve.encoder), ##__VA_ARGS__)
-+
-+#define error(format, ...) do_log(LOG_ERROR, format, ##__VA_ARGS__)
-+#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
-+#define info(format, ...) do_log(LOG_INFO, format, ##__VA_ARGS__)
-+#define debug(format, ...) do_log(LOG_DEBUG, format, ##__VA_ARGS__)
-+
-+enum h264_encoder_type {
-+ H264_ENCODER_TYPE_OH264,
-+};
-+
-+struct h264_encoder {
-+ struct ffmpeg_video_encoder ffve;
-+ enum h264_encoder_type type;
-+
-+ DARRAY(uint8_t) header;
-+};
-+
-+static const char *oh264_getname(void *unused)
-+{
-+ UNUSED_PARAMETER(unused);
-+ return "OpenH264";
-+}
-+
-+static void h264_video_info(void *data, struct video_scale_info *info)
-+{
-+ UNUSED_PARAMETER(data);
-+
-+ // OpenH264 only supports I420
-+ info->format = VIDEO_FORMAT_I420;
-+}
-+
-+static bool h264_update(struct h264_encoder *enc, obs_data_t *settings)
-+{
-+ const char *profile = obs_data_get_string(settings, "profile");
-+ int bitrate = (int)obs_data_get_int(settings, "bitrate");
-+ int keyint_sec = 0; // This is not supported by OpenH264
-+ const char *rc_mode = "quality"; // We only want to use quality mode
-+ int allow_skip_frames = 1; // This is required for quality mode
-+
-+ video_t *video = obs_encoder_video(enc->ffve.encoder);
-+ const struct video_output_info *voi = video_output_get_info(video);
-+ struct video_scale_info info;
-+
-+ info.format = voi->format;
-+ info.colorspace = voi->colorspace;
-+ info.range = voi->range;
-+
-+ enc->ffve.context->thread_count = 0;
-+
-+ h264_video_info(enc, &info);
-+
-+ av_opt_set(enc->ffve.context->priv_data, "rc_mode", rc_mode, 0);
-+ av_opt_set(enc->ffve.context->priv_data, "profile", profile, 0);
-+ av_opt_set_int(enc->ffve.context->priv_data, "allow_skip_frames", allow_skip_frames, 0);
-+
-+ const char *ffmpeg_opts = obs_data_get_string(settings, "ffmpeg_opts");
-+ ffmpeg_video_encoder_update(&enc->ffve, bitrate, keyint_sec, voi, &info, ffmpeg_opts);
-+ info("settings:\n"
-+ "\tencoder: %s\n"
-+ "\trc_mode: %s\n"
-+ "\tbitrate: %d\n"
-+ "\tprofile: %s\n"
-+ "\twidth: %d\n"
-+ "\theight: %d\n"
-+ "\tffmpeg opts: %s\n",
-+ enc->ffve.enc_name, rc_mode, bitrate, profile, enc->ffve.context->width, enc->ffve.height, ffmpeg_opts);
-+
-+ enc->ffve.context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
-+ return ffmpeg_video_encoder_init_codec(&enc->ffve);
-+}
-+
-+static void h264_destroy(void *data)
-+{
-+ struct h264_encoder *enc = data;
-+
-+ ffmpeg_video_encoder_free(&enc->ffve);
-+ da_free(enc->header);
-+ bfree(enc);
-+}
-+
-+static void on_first_packet(void *data, AVPacket *pkt, struct darray *da)
-+{
-+ struct h264_encoder *enc = data;
-+
-+ da_copy_array(enc->header, enc->ffve.context->extradata, enc->ffve.context->extradata_size);
-+
-+ darray_copy_array(1, da, pkt->data, pkt->size);
-+}
-+
-+static void *h264_create_internal(obs_data_t *settings, obs_encoder_t *encoder, const char *enc_lib,
-+ const char *enc_name)
-+{
-+ video_t *video = obs_encoder_video(encoder);
-+ const struct video_output_info *voi = video_output_get_info(video);
-+
-+ switch (voi->format) {
-+ // planar 4:2:0 formats
-+ case VIDEO_FORMAT_I420: // three-plane
-+ case VIDEO_FORMAT_NV12: // two-plane, luma and packed chroma
-+ // packed 4:2:2 formats
-+ case VIDEO_FORMAT_YVYU:
-+ case VIDEO_FORMAT_YUY2: // YUYV
-+ case VIDEO_FORMAT_UYVY:
-+ // packed uncompressed formats
-+ case VIDEO_FORMAT_RGBA:
-+ case VIDEO_FORMAT_BGRA:
-+ case VIDEO_FORMAT_BGRX:
-+ case VIDEO_FORMAT_BGR3:
-+ case VIDEO_FORMAT_Y800: // grayscale
-+ // planar 4:4:4
-+ case VIDEO_FORMAT_I444:
-+ // planar 4:2:2
-+ case VIDEO_FORMAT_I422:
-+ // planar 4:2:0 with alpha
-+ case VIDEO_FORMAT_I40A:
-+ // planar 4:2:2 with alpha
-+ case VIDEO_FORMAT_I42A:
-+ // planar 4:4:4 with alpha
-+ case VIDEO_FORMAT_YUVA:
-+ // packed 4:4:4 with alpha
-+ case VIDEO_FORMAT_AYUV:
-+ break;
-+ default:; // Make the compiler do the right thing
-+ const char *const text = obs_module_text("H264.UnsupportedVideoFormat");
-+ obs_encoder_set_last_error(encoder, text);
-+ blog(LOG_ERROR, "[H.264 encoder] %s", text);
-+ return NULL;
-+ }
-+
-+ switch (voi->colorspace) {
-+ case VIDEO_CS_DEFAULT:
-+ case VIDEO_CS_709:
-+ break;
-+ default:; // Make the compiler do the right thing
-+ const char *const text = obs_module_text("H264.UnsupportedColorSpace");
-+ obs_encoder_set_last_error(encoder, text);
-+ blog(LOG_ERROR, "[H.264 encoder] %s", text);
-+ return NULL;
-+ }
-+
-+ struct h264_encoder *enc = bzalloc(sizeof(*enc));
-+
-+ if (strcmp(enc_lib, "libopenh264") == 0)
-+ enc->type = H264_ENCODER_TYPE_OH264;
-+
-+ if (!ffmpeg_video_encoder_init(&enc->ffve, enc, encoder, enc_lib, NULL, enc_name, NULL, on_first_packet))
-+ goto fail;
-+ if (!h264_update(enc, settings))
-+ goto fail;
-+
-+ return enc;
-+
-+fail:
-+ h264_destroy(enc);
-+ return NULL;
-+}
-+
-+static void *oh264_create(obs_data_t *settings, obs_encoder_t *encoder)
-+{
-+ return h264_create_internal(settings, encoder, "libopenh264", "OpenH264");
-+}
-+
-+static bool h264_encode(void *data, struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet)
-+{
-+ struct h264_encoder *enc = data;
-+ return ffmpeg_video_encode(&enc->ffve, frame, packet, received_packet);
-+}
-+
-+void h264_defaults(obs_data_t *settings)
-+{
-+ obs_data_set_default_int(settings, "bitrate", 2500);
-+ obs_data_set_default_string(settings, "profile", "main");
-+}
-+
-+obs_properties_t *h264_properties(enum h264_encoder_type type)
-+{
-+ UNUSED_PARAMETER(type); // Only one encoder right now...
-+ obs_properties_t *props = obs_properties_create();
-+ obs_property_t *p;
-+
-+ p = obs_properties_add_list(props, "profile", obs_module_text("Profile"), OBS_COMBO_TYPE_LIST,
-+ OBS_COMBO_FORMAT_STRING);
-+ obs_property_list_add_string(p, "constrained_baseline", "constrained_baseline");
-+ obs_property_list_add_string(p, "main", "main");
-+ obs_property_list_add_string(p, "high", "high");
-+
-+ p = obs_properties_add_int(props, "bitrate", obs_module_text("Bitrate"), 50, 300000, 50);
-+ obs_property_int_set_suffix(p, " Kbps");
-+
-+ obs_properties_add_text(props, "ffmpeg_opts", obs_module_text("FFmpegOpts"), OBS_TEXT_DEFAULT);
-+
-+ return props;
-+}
-+
-+obs_properties_t *oh264_properties(void *unused)
-+{
-+ UNUSED_PARAMETER(unused);
-+ return h264_properties(H264_ENCODER_TYPE_OH264);
-+}
-+
-+static bool h264_extra_data(void *data, uint8_t **extra_data, size_t *size)
-+{
-+ struct h264_encoder *enc = data;
-+
-+ *extra_data = enc->header.array;
-+ *size = enc->header.num;
-+ return true;
-+}
-+
-+struct obs_encoder_info oh264_encoder_info = {
-+ .id = "ffmpeg_openh264",
-+ .type = OBS_ENCODER_VIDEO,
-+ .codec = "h264",
-+ .get_name = oh264_getname,
-+ .create = oh264_create,
-+ .destroy = h264_destroy,
-+ .encode = h264_encode,
-+ .get_defaults = h264_defaults,
-+ .get_properties = oh264_properties,
-+ .get_extra_data = h264_extra_data,
-+ .get_video_info = h264_video_info,
-+};
-diff --git a/plugins/obs-ffmpeg/obs-ffmpeg.c b/plugins/obs-ffmpeg/obs-ffmpeg.c
-index df631a672..ac8423e90 100644
---- a/plugins/obs-ffmpeg/obs-ffmpeg.c
-+++ b/plugins/obs-ffmpeg/obs-ffmpeg.c
-@@ -35,6 +35,7 @@ extern struct obs_encoder_info pcm24_encoder_info;
- extern struct obs_encoder_info pcm32_encoder_info;
- extern struct obs_encoder_info alac_encoder_info;
- extern struct obs_encoder_info flac_encoder_info;
-+extern struct obs_encoder_info oh264_encoder_info;
- #ifdef ENABLE_FFMPEG_NVENC
- extern struct obs_encoder_info h264_nvenc_encoder_info;
- #ifdef ENABLE_HEVC
-@@ -349,6 +350,7 @@ bool obs_module_load(void)
- obs_register_output(&ffmpeg_hls_muxer);
- obs_register_output(&replay_buffer);
- obs_register_encoder(&aac_encoder_info);
-+ register_encoder_if_available(&oh264_encoder_info, "libopenh264");
- register_encoder_if_available(&svt_av1_encoder_info, "libsvtav1");
- register_encoder_if_available(&aom_av1_encoder_info, "libaom-av1");
- obs_register_encoder(&opus_encoder_info);
---
-2.47.0
-
diff --git a/0103-UI-Add-support-for-OpenH264-as-the-worst-case-fallba.patch b/0103-UI-Add-support-for-OpenH264-as-the-worst-case-fallba.patch
index a2c7f6b..cae574f 100644
--- a/0103-UI-Add-support-for-OpenH264-as-the-worst-case-fallba.patch
+++ b/0103-UI-Add-support-for-OpenH264-as-the-worst-case-fallba.patch
@@ -1,229 +1,118 @@
-From aedf69c2e8b2c84dab50dcbb669f42ffec815692 Mon Sep 17 00:00:00 2001
+From 3d474df58055e447343897e4ca8fe86133f0931b Mon Sep 17 00:00:00 2001
From: Neal Gompa <neal@gompa.dev>
Date: Tue, 28 Mar 2023 05:08:49 -0400
-Subject: [PATCH 103/103] UI: Add support for OpenH264 as the worst-case
- fallback
+Subject: [PATCH 3/4] UI: Add support for OpenH264 as the worst-case fallback
OpenH264 exists as the codec of last resort, so it is implemented
such that it is only used as the software codec if x264 is not
available.
---
- UI/data/locale/en-US.ini | 1 +
- UI/window-basic-auto-config-test.cpp | 46 +++++++++++++++++++---------
- UI/window-basic-auto-config.cpp | 16 +++++++++-
- UI/window-basic-auto-config.hpp | 3 ++
- UI/window-basic-main-outputs.cpp | 6 ++--
- UI/window-basic-main-profiles.cpp | 31 +++++++++++--------
- UI/window-basic-main.cpp | 13 ++++++--
- UI/window-basic-main.hpp | 3 +-
- UI/window-basic-settings-stream.cpp | 12 ++++++--
- UI/window-basic-settings.cpp | 16 ++++++++--
- 10 files changed, 107 insertions(+), 40 deletions(-)
+ frontend/data/locale/en-US.ini | 1 +
+ frontend/settings/OBSBasicSettings.cpp | 15 +++++-
+ frontend/settings/OBSBasicSettings_Stream.cpp | 12 +++--
+ frontend/utility/SimpleOutput.cpp | 6 ++-
+ frontend/widgets/OBSBasic.cpp | 13 ++++--
+ frontend/widgets/OBSBasic.hpp | 3 +-
+ frontend/widgets/OBSBasic_Profiles.cpp | 31 +++++++------
+ frontend/wizards/AutoConfig.cpp | 15 +++++-
+ frontend/wizards/AutoConfig.hpp | 3 ++
+ frontend/wizards/AutoConfigTestPage.cpp | 46 +++++++++++++------
+ 10 files changed, 105 insertions(+), 40 deletions(-)
-diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini
-index 2065dbc48..9507d78a6 100644
---- a/UI/data/locale/en-US.ini
-+++ b/UI/data/locale/en-US.ini
-@@ -1034,6 +1034,7 @@ Basic.Settings.Output.Simple.Warn.Encoder="Warning: Recording with a software en
- Basic.Settings.Output.Simple.Warn.Lossless="Warning: Lossless quality generates tremendously large file sizes! Lossless quality can use upward of 7 gigabytes of disk space per minute at high resolutions and framerates. Lossless is not recommended for long recordings unless you have a very large amount of disk space available. Replay buffer is unavailable when using lossless quality."
+diff --git a/frontend/data/locale/en-US.ini b/frontend/data/locale/en-US.ini
+index da7c09be7a7c..4ed196c9cb92 100644
+--- a/frontend/data/locale/en-US.ini
++++ b/frontend/data/locale/en-US.ini
+@@ -1053,6 +1053,7 @@ Basic.Settings.Output.Simple.Warn.Lossless="Warning: Lossless quality generates
Basic.Settings.Output.Simple.Warn.Lossless.Msg="Are you sure you want to use lossless quality?"
Basic.Settings.Output.Simple.Warn.Lossless.Title="Lossless quality warning!"
+ Basic.Settings.Output.Simple.Encoder.Software="Software (x264)"
+Basic.Settings.Output.Simple.Encoder.Software.OpenH264.H264="Software (OpenH264)"
- Basic.Settings.Output.Simple.Encoder.Software.X264.H264="Software (x264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV.H264="Hardware (QSV, H.264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV.AV1="Hardware (QSV, AV1)"
-diff --git a/UI/window-basic-auto-config-test.cpp b/UI/window-basic-auto-config-test.cpp
-index d941e6f68..5b5051919 100644
---- a/UI/window-basic-auto-config-test.cpp
-+++ b/UI/window-basic-auto-config-test.cpp
-@@ -192,7 +192,8 @@ void AutoConfigTestPage::TestBandwidthThread()
-
- const char *serverType = wiz->customServer ? "rtmp_custom" : "rtmp_common";
-
-- OBSEncoderAutoRelease vencoder = obs_video_encoder_create("obs_x264", "test_x264", nullptr, nullptr);
-+ OBSEncoderAutoRelease vencoder = obs_video_encoder_create((wiz->x264Available ? "obs_x264" : "ffmpeg_openh264"),
-+ "test_h264", nullptr, nullptr);
- OBSEncoderAutoRelease aencoder = obs_audio_encoder_create("ffmpeg_aac", "test_aac", nullptr, 0, nullptr);
- OBSServiceAutoRelease service = obs_service_create(serverType, "test_service", nullptr, nullptr);
+ Basic.Settings.Output.Simple.Encoder.Hardware.AMD.H264="Hardware (AMD, H.264)"
+diff --git a/frontend/settings/OBSBasicSettings.cpp b/frontend/settings/OBSBasicSettings.cpp
+index de322bc1ee8f..fcbe4fd03071 100644
+--- a/frontend/settings/OBSBasicSettings.cpp
++++ b/frontend/settings/OBSBasicSettings.cpp
+@@ -3365,6 +3365,11 @@ void OBSBasicSettings::SaveOutputSettings()
+ do. This only exists to make sure that the x264 preset doesn't
+ get overwritten with empty data. */
+ presetType = "ApplePreset";
++ else if (encoder == SIMPLE_ENCODER_OPENH264)
++ /* The OpenH264 encoder does not have presets like the other encoders
++ do. This only exists to make sure that the x264 preset doesn't
++ get overwritten with empty data. */
++ presetType = "OpenH264Preset";
+ else
+ presetType = "Preset";
-@@ -224,10 +225,11 @@ void AutoConfigTestPage::TestBandwidthThread()
- obs_data_set_string(service_settings, "key", key.c_str());
+@@ -4739,8 +4744,11 @@ void OBSBasicSettings::FillSimpleRecordingValues()
+ ADD_QUALITY("HQ");
+ ADD_QUALITY("Lossless");
- obs_data_set_int(vencoder_settings, "bitrate", wiz->startingBitrate);
-- obs_data_set_string(vencoder_settings, "rate_control", "CBR");
-- obs_data_set_string(vencoder_settings, "preset", "veryfast");
-- obs_data_set_int(vencoder_settings, "keyint_sec", 2);
--
-+ if (wiz->x264Available) {
-+ obs_data_set_string(vencoder_settings, "rate_control", "CBR");
-+ obs_data_set_string(vencoder_settings, "preset", "veryfast");
-+ obs_data_set_int(vencoder_settings, "keyint_sec", 2);
+- ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software"), QString(SIMPLE_ENCODER_X264));
+- ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU"), QString(SIMPLE_ENCODER_X264_LOWCPU));
++ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.OpenH264.H264"), QString(SIMPLE_ENCODER_OPENH264));
++ if (EncoderAvailable("obs_x264")) {
++ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software"), QString(SIMPLE_ENCODER_X264));
++ ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU"), QString(SIMPLE_ENCODER_X264_LOWCPU));
+ }
- obs_data_set_int(aencoder_settings, "bitrate", 32);
-
- OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
-@@ -555,7 +557,8 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
- /* -----------------------------------*/
- /* create obs objects */
-
-- OBSEncoderAutoRelease vencoder = obs_video_encoder_create("obs_x264", "test_x264", nullptr, nullptr);
-+ OBSEncoderAutoRelease vencoder = obs_video_encoder_create((wiz->x264Available ? "obs_x264" : "ffmpeg_openh264"),
-+ "test_h264", nullptr, nullptr);
- OBSEncoderAutoRelease aencoder = obs_audio_encoder_create("ffmpeg_aac", "test_aac", nullptr, 0, nullptr);
- OBSOutputAutoRelease output = obs_output_create("null_output", "null", nullptr, nullptr);
-
-@@ -567,16 +570,20 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
- obs_data_set_int(aencoder_settings, "bitrate", 32);
-
- if (wiz->type != AutoConfig::Type::Recording) {
-- obs_data_set_int(vencoder_settings, "keyint_sec", 2);
-+ if (wiz->x264Available) {
-+ obs_data_set_int(vencoder_settings, "keyint_sec", 2);
-+ obs_data_set_string(vencoder_settings, "rate_control", "CBR");
-+ obs_data_set_string(vencoder_settings, "preset", "veryfast");
-+ }
- obs_data_set_int(vencoder_settings, "bitrate", wiz->idealBitrate);
-- obs_data_set_string(vencoder_settings, "rate_control", "CBR");
- obs_data_set_string(vencoder_settings, "profile", "main");
-- obs_data_set_string(vencoder_settings, "preset", "veryfast");
- } else {
-- obs_data_set_int(vencoder_settings, "crf", 20);
-- obs_data_set_string(vencoder_settings, "rate_control", "CRF");
-+ if (wiz->x264Available) {
-+ obs_data_set_int(vencoder_settings, "crf", 20);
-+ obs_data_set_string(vencoder_settings, "rate_control", "CRF");
-+ obs_data_set_string(vencoder_settings, "preset", "veryfast");
-+ }
- obs_data_set_string(vencoder_settings, "profile", "high");
-- obs_data_set_string(vencoder_settings, "preset", "veryfast");
- }
-
- /* -----------------------------------*/
-@@ -923,7 +930,10 @@ void AutoConfigTestPage::TestStreamEncoderThread()
- else
- wiz->streamingEncoder = AutoConfig::Encoder::AMD;
- } else {
-- wiz->streamingEncoder = AutoConfig::Encoder::x264;
-+ if (wiz->x264Available)
-+ wiz->streamingEncoder = AutoConfig::Encoder::x264;
-+ else
-+ wiz->streamingEncoder = AutoConfig::Encoder::OpenH264;
- }
+ if (EncoderAvailable("obs_qsv11"))
+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Hardware.QSV.H264"), QString(SIMPLE_ENCODER_QSV));
+ if (EncoderAvailable("obs_qsv11_av1"))
+@@ -4889,6 +4897,9 @@ void OBSBasicSettings::SimpleStreamingEncoderChanged()
- #ifdef __linux__
-@@ -967,7 +977,10 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
- else
- wiz->recordingEncoder = AutoConfig::Encoder::AMD;
+ defaultPreset = "balanced";
+ preset = curAMDAV1Preset;
++ } else if (encoder == SIMPLE_ENCODER_OPENH264) {
++ ui->simpleOutPreset->setVisible(false);
++ ui->simpleOutPresetLabel->setVisible(false);
} else {
-- wiz->recordingEncoder = AutoConfig::Encoder::x264;
-+ if (wiz->x264Available)
-+ wiz->streamingEncoder = AutoConfig::Encoder::x264;
-+ else
-+ wiz->streamingEncoder = AutoConfig::Encoder::OpenH264;
- }
-
- if (wiz->recordingEncoder != AutoConfig::Encoder::NVENC) {
-@@ -981,6 +994,7 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
- }
- #define ENCODER_TEXT(x) "Basic.Settings.Output.Simple.Encoder." x
-+#define ENCODER_OPENH264 ENCODER_TEXT("Software.OpenH264.H264")
- #define ENCODER_X264 ENCODER_TEXT("Software.X264.H264")
- #define ENCODER_NVENC ENCODER_TEXT("Hardware.NVENC.H264")
- #define ENCODER_QSV ENCODER_TEXT("Hardware.QSV.H264")
-@@ -1019,6 +1033,8 @@ void AutoConfigTestPage::FinalizeResults()
-
- auto encName = [](AutoConfig::Encoder enc) -> QString {
- switch (enc) {
-+ case AutoConfig::Encoder::OpenH264:
-+ return QTStr(ENCODER_OPENH264);
- case AutoConfig::Encoder::x264:
- return QTStr(ENCODER_X264);
- case AutoConfig::Encoder::NVENC:
-@@ -1033,7 +1049,7 @@ void AutoConfigTestPage::FinalizeResults()
- return QTStr(QUALITY_SAME);
- }
-
-- return QTStr(ENCODER_X264);
-+ return QTStr(ENCODER_OPENH264);
- };
-
- auto newLabel = [this](const char *str) -> QLabel * {
-diff --git a/UI/window-basic-auto-config.cpp b/UI/window-basic-auto-config.cpp
-index 6b1667609..d64eb6bd1 100644
---- a/UI/window-basic-auto-config.cpp
-+++ b/UI/window-basic-auto-config.cpp
-@@ -1044,6 +1044,8 @@ AutoConfig::AutoConfig(QWidget *parent) : QWizard(parent)
- streamPage->ui->useMultitrackVideo->setChecked(hardwareEncodingAvailable && multitrackVideoEnabled);
- streamPage->ServiceChanged();
-
-+ TestSoftwareEncoding();
-+ TestHardwareEncoding();
- if (!hardwareEncodingAvailable) {
- delete streamPage->ui->preferHardware;
- streamPage->ui->preferHardware = nullptr;
-@@ -1069,6 +1071,16 @@ AutoConfig::~AutoConfig()
- EnableThreadedMessageBoxes(false);
+ #define PRESET_STR(val) QString(Str("Basic.Settings.Output.EncoderPreset." val)).arg(val)
+diff --git a/frontend/settings/OBSBasicSettings_Stream.cpp b/frontend/settings/OBSBasicSettings_Stream.cpp
+index ce74a1cb1bab..74bc9cbcccb2 100644
+--- a/frontend/settings/OBSBasicSettings_Stream.cpp
++++ b/frontend/settings/OBSBasicSettings_Stream.cpp
+@@ -1471,7 +1471,9 @@ static QString get_adv_fallback(const QString &enc)
+ return "com.apple.videotoolbox.videoencoder.ave.avc";
+ if (enc == "obs_qsv11_av1")
+ return "obs_qsv11";
+- return "obs_x264";
++ if (EncoderAvailable("obs_x264"))
++ return "obs_x264";
++ return "ffmpeg_openh264";
}
-+void AutoConfig::TestSoftwareEncoding()
-+{
-+ size_t idx = 0;
-+ const char *id;
-+ while (obs_enum_encoder_types(idx++, &id)) {
-+ if (strcmp(id, "obs_x264") == 0)
-+ x264Available = true;
-+ }
-+}
-+
- void AutoConfig::TestHardwareEncoding()
- {
- size_t idx = 0;
-@@ -1144,8 +1156,10 @@ inline const char *AutoConfig::GetEncoderId(Encoder enc)
- return SIMPLE_ENCODER_AMD;
- case Encoder::Apple:
+ static QString get_adv_audio_fallback(const QString &enc)
+@@ -1500,7 +1502,9 @@ static QString get_simple_fallback(const QString &enc)
return SIMPLE_ENCODER_APPLE_H264;
-- default:
-+ case Encoder::x264:
- return SIMPLE_ENCODER_X264;
-+ default:
-+ return SIMPLE_ENCODER_OPENH264;
- }
- };
-
-diff --git a/UI/window-basic-auto-config.hpp b/UI/window-basic-auto-config.hpp
-index 7e31bdf89..a97545153 100644
---- a/UI/window-basic-auto-config.hpp
-+++ b/UI/window-basic-auto-config.hpp
-@@ -45,6 +45,7 @@ class AutoConfig : public QWizard {
- };
-
- enum class Encoder {
-+ OpenH264,
- x264,
- NVENC,
- QSV,
-@@ -104,6 +105,7 @@ class AutoConfig : public QWizard {
- bool qsvAvailable = false;
- bool vceAvailable = false;
- bool appleAvailable = false;
-+ bool x264Available = false;
+ if (enc == SIMPLE_ENCODER_QSV_AV1)
+ return SIMPLE_ENCODER_QSV;
+- return SIMPLE_ENCODER_X264;
++ if (EncoderAvailable("obs_x264"))
++ return SIMPLE_ENCODER_X264;
++ return SIMPLE_ENCODER_OPENH264;
+ }
- int startingBitrate = 2500;
- bool customServer = false;
-@@ -121,6 +123,7 @@ class AutoConfig : public QWizard {
- int specificFPSNum = 0;
- int specificFPSDen = 0;
+ bool OBSBasicSettings::ServiceSupportsCodecCheck()
+@@ -1675,7 +1679,9 @@ void OBSBasicSettings::ResetEncoders(bool streamOnly)
-+ void TestSoftwareEncoding();
- void TestHardwareEncoding();
- bool CanTestServer(const char *server);
+ #define ENCODER_STR(str) QTStr("Basic.Settings.Output.Simple.Encoder." str)
-diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp
-index 30d203174..5a1bde826 100644
---- a/UI/window-basic-main-outputs.cpp
-+++ b/UI/window-basic-main-outputs.cpp
-@@ -546,7 +546,9 @@ void SimpleOutput::LoadStreamingPreset_Lossy(const char *encoderId)
+- ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software"), QString(SIMPLE_ENCODER_X264));
++ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.OpenH264.H264"), QString(SIMPLE_ENCODER_OPENH264));
++ if (service_supports_encoder(vcodecs, "obs_x264"))
++ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software"), QString(SIMPLE_ENCODER_X264));
+ #ifdef _WIN32
+ if (service_supports_encoder(vcodecs, "obs_qsv11"))
+ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Hardware.QSV.H264"), QString(SIMPLE_ENCODER_QSV));
+diff --git a/frontend/utility/SimpleOutput.cpp b/frontend/utility/SimpleOutput.cpp
+index b62846309c47..95d1115ac6c1 100644
+--- a/frontend/utility/SimpleOutput.cpp
++++ b/frontend/utility/SimpleOutput.cpp
+@@ -80,7 +80,9 @@ void SimpleOutput::LoadStreamingPreset_Lossy(const char *encoderId)
/* mistakes have been made to lead us to this. */
const char *get_simple_output_encoder(const char *encoder)
{
@@ -234,7 +123,7 @@ index 30d203174..5a1bde826 100644
return "obs_x264";
} else if (strcmp(encoder, SIMPLE_ENCODER_X264_LOWCPU) == 0) {
return "obs_x264";
-@@ -578,7 +580,7 @@ const char *get_simple_output_encoder(const char *encoder)
+@@ -112,7 +114,7 @@ const char *get_simple_output_encoder(const char *encoder)
#endif
}
@@ -243,11 +132,72 @@ index 30d203174..5a1bde826 100644
}
void SimpleOutput::LoadRecordingPreset()
-diff --git a/UI/window-basic-main-profiles.cpp b/UI/window-basic-main-profiles.cpp
-index 9b346e8d4..75c3e06e9 100644
---- a/UI/window-basic-main-profiles.cpp
-+++ b/UI/window-basic-main-profiles.cpp
-@@ -736,7 +736,7 @@ void OBSBasic::ActivateProfile(const OBSProfile &profile, bool reset)
+diff --git a/frontend/widgets/OBSBasic.cpp b/frontend/widgets/OBSBasic.cpp
+index e56b7e277913..48586f001c93 100644
+--- a/frontend/widgets/OBSBasic.cpp
++++ b/frontend/widgets/OBSBasic.cpp
+@@ -519,6 +519,8 @@ static const double scaled_vals[] = {1.0, 1.25, (1.0 / 0.75), 1.5, (1.0 / 0.6),
+ #define DEFAULT_CONTAINER "hybrid_mp4"
+ #endif
+
++extern bool EncoderAvailable(const char *encoder);
++
+ bool OBSBasic::InitBasicConfigDefaults()
+ {
+ QList<QScreen *> screens = QGuiApplication::screens();
+@@ -680,7 +682,9 @@ bool OBSBasic::InitBasicConfigDefaults()
+ config_set_default_bool(activeConfiguration, "AdvOut", "UseRescale", false);
+ config_set_default_uint(activeConfiguration, "AdvOut", "TrackIndex", 1);
+ config_set_default_uint(activeConfiguration, "AdvOut", "VodTrackIndex", 2);
+- config_set_default_string(activeConfiguration, "AdvOut", "Encoder", "obs_x264");
++
++ bool useX264 = EncoderAvailable("obs_x264");
++ config_set_default_string(activeConfiguration, "AdvOut", "Encoder", (useX264 ? "obs_x264" : "ffmpeg_openh264"));
+
+ config_set_default_string(activeConfiguration, "AdvOut", "RecType", "Standard");
+
+@@ -796,10 +800,13 @@ void OBSBasic::InitBasicConfigDefaults2()
+ bool oldEncDefaults = config_get_bool(App()->GetUserConfig(), "General", "Pre23Defaults");
+ bool useNV = EncoderAvailable("ffmpeg_nvenc") && !oldEncDefaults;
+
++ bool useX264 = EncoderAvailable("obs_x264");
++ const char *h264_fallback = (useX264 ? SIMPLE_ENCODER_X264 : SIMPLE_ENCODER_OPENH264);
++
+ config_set_default_string(activeConfiguration, "SimpleOutput", "StreamEncoder",
+- useNV ? SIMPLE_ENCODER_NVENC : SIMPLE_ENCODER_X264);
++ useNV ? SIMPLE_ENCODER_NVENC : h264_fallback);
+ config_set_default_string(activeConfiguration, "SimpleOutput", "RecEncoder",
+- useNV ? SIMPLE_ENCODER_NVENC : SIMPLE_ENCODER_X264);
++ useNV ? SIMPLE_ENCODER_NVENC : h264_fallback);
+
+ const char *aac_default = "ffmpeg_aac";
+ if (EncoderAvailable("CoreAudio_AAC"))
+diff --git a/frontend/widgets/OBSBasic.hpp b/frontend/widgets/OBSBasic.hpp
+index 48e9960fa2b0..fece7580b9db 100644
+--- a/frontend/widgets/OBSBasic.hpp
++++ b/frontend/widgets/OBSBasic.hpp
+@@ -75,6 +75,7 @@ struct Rect;
+
+ #define SIMPLE_ENCODER_X264 "x264"
+ #define SIMPLE_ENCODER_X264_LOWCPU "x264_lowcpu"
++#define SIMPLE_ENCODER_OPENH264 "ffmpeg_openh264"
+ #define SIMPLE_ENCODER_QSV "qsv"
+ #define SIMPLE_ENCODER_QSV_AV1 "qsv_av1"
+ #define SIMPLE_ENCODER_NVENC "nvenc"
+@@ -885,7 +886,7 @@ private:
+ void UpdateProfileEncoders();
+ std::vector<std::string> GetRestartRequirements(const ConfigFile &config) const;
+ void ResetProfileData();
+- void CheckForSimpleModeX264Fallback();
++ void CheckForSimpleModeH264Fallback();
+
+ public:
+ inline const OBSProfileCache &GetProfileCache() const noexcept { return profiles; };
+diff --git a/frontend/widgets/OBSBasic_Profiles.cpp b/frontend/widgets/OBSBasic_Profiles.cpp
+index 4c655915fe1e..381a8662ed49 100644
+--- a/frontend/widgets/OBSBasic_Profiles.cpp
++++ b/frontend/widgets/OBSBasic_Profiles.cpp
+@@ -734,7 +734,7 @@ void OBSBasic::ActivateProfile(const OBSProfile &profile, bool reset)
void OBSBasic::UpdateProfileEncoders()
{
InitBasicConfigDefaults2();
@@ -256,7 +206,7 @@ index 9b346e8d4..75c3e06e9 100644
}
void OBSBasic::ResetProfileData()
-@@ -784,10 +784,11 @@ std::vector<std::string> OBSBasic::GetRestartRequirements(const ConfigFile &conf
+@@ -782,10 +782,11 @@ std::vector<std::string> OBSBasic::GetRestartRequirements(const ConfigFile &conf
return result;
}
@@ -269,7 +219,7 @@ index 9b346e8d4..75c3e06e9 100644
bool qsv_supported = false;
bool qsv_av1_supported = false;
bool amd_supported = false;
-@@ -804,7 +805,9 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
+@@ -802,7 +803,9 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
const char *id;
while (obs_enum_encoder_types(idx++, &id)) {
@@ -280,7 +230,7 @@ index 9b346e8d4..75c3e06e9 100644
amd_supported = true;
else if (strcmp(id, "obs_qsv11") == 0)
qsv_supported = true;
-@@ -827,69 +830,71 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
+@@ -825,69 +828,71 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
apple_hevc_supported = true;
#endif
}
@@ -362,145 +312,192 @@ index 9b346e8d4..75c3e06e9 100644
return false;
}
#endif
-diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp
-index 47cac8dcc..866c81d9e 100644
---- a/UI/window-basic-main.cpp
-+++ b/UI/window-basic-main.cpp
-@@ -1586,6 +1586,8 @@ extern void CheckExistingCookieId();
- #define DEFAULT_CONTAINER "hybrid_mp4"
- #endif
+diff --git a/frontend/wizards/AutoConfig.cpp b/frontend/wizards/AutoConfig.cpp
+index 86e6ccea875c..67f1497dce28 100644
+--- a/frontend/wizards/AutoConfig.cpp
++++ b/frontend/wizards/AutoConfig.cpp
+@@ -176,6 +176,7 @@ AutoConfig::AutoConfig(QWidget *parent) : QWizard(parent)
+ streamPage->ui->key->setText(key.c_str());
+
+ TestHardwareEncoding();
++ TestSoftwareEncoding();
-+extern bool EncoderAvailable(const char *encoder);
+ int bitrate = config_get_int(main->Config(), "SimpleOutput", "VBitrate");
+ bool multitrackVideoEnabled = config_has_user_value(main->Config(), "Stream1", "EnableMultitrackVideo")
+@@ -210,6 +211,16 @@ AutoConfig::~AutoConfig()
+ EnableThreadedMessageBoxes(false);
+ }
+
++void AutoConfig::TestSoftwareEncoding()
++{
++ size_t idx = 0;
++ const char *id;
++ while (obs_enum_encoder_types(idx++, &id)) {
++ if (strcmp(id, "obs_x264") == 0)
++ x264Available = true;
++ }
++}
+
- bool OBSBasic::InitBasicConfigDefaults()
+ void AutoConfig::TestHardwareEncoding()
{
- QList<QScreen *> screens = QGuiApplication::screens();
-@@ -1747,7 +1749,9 @@ bool OBSBasic::InitBasicConfigDefaults()
- config_set_default_bool(activeConfiguration, "AdvOut", "UseRescale", false);
- config_set_default_uint(activeConfiguration, "AdvOut", "TrackIndex", 1);
- config_set_default_uint(activeConfiguration, "AdvOut", "VodTrackIndex", 2);
-- config_set_default_string(activeConfiguration, "AdvOut", "Encoder", "obs_x264");
-+
-+ bool useX264 = EncoderAvailable("obs_x264");
-+ config_set_default_string(activeConfiguration, "AdvOut", "Encoder", (useX264 ? "obs_x264" : "ffmpeg_openh264"));
+ size_t idx = 0;
+@@ -285,8 +296,10 @@ inline const char *AutoConfig::GetEncoderId(Encoder enc)
+ return SIMPLE_ENCODER_AMD;
+ case Encoder::Apple:
+ return SIMPLE_ENCODER_APPLE_H264;
+- default:
++ case Encoder::x264:
+ return SIMPLE_ENCODER_X264;
++ default:
++ return SIMPLE_ENCODER_OPENH264;
+ }
+ };
- config_set_default_string(activeConfiguration, "AdvOut", "RecType", "Standard");
+diff --git a/frontend/wizards/AutoConfig.hpp b/frontend/wizards/AutoConfig.hpp
+index 92fa568f98ac..65cabb8f6774 100644
+--- a/frontend/wizards/AutoConfig.hpp
++++ b/frontend/wizards/AutoConfig.hpp
+@@ -27,6 +27,7 @@ class AutoConfig : public QWizard {
+ };
-@@ -1865,10 +1869,13 @@ void OBSBasic::InitBasicConfigDefaults2()
- bool oldEncDefaults = config_get_bool(App()->GetUserConfig(), "General", "Pre23Defaults");
- bool useNV = EncoderAvailable("ffmpeg_nvenc") && !oldEncDefaults;
+ enum class Encoder {
++ OpenH264,
+ x264,
+ NVENC,
+ QSV,
+@@ -86,6 +87,7 @@ class AutoConfig : public QWizard {
+ bool qsvAvailable = false;
+ bool vceAvailable = false;
+ bool appleAvailable = false;
++ bool x264Available = false;
-+ bool useX264 = EncoderAvailable("obs_x264");
-+ const char *h264_fallback = (useX264 ? SIMPLE_ENCODER_X264 : SIMPLE_ENCODER_OPENH264);
-+
- config_set_default_string(activeConfiguration, "SimpleOutput", "StreamEncoder",
-- useNV ? SIMPLE_ENCODER_NVENC : SIMPLE_ENCODER_X264);
-+ useNV ? SIMPLE_ENCODER_NVENC : h264_fallback);
- config_set_default_string(activeConfiguration, "SimpleOutput", "RecEncoder",
-- useNV ? SIMPLE_ENCODER_NVENC : SIMPLE_ENCODER_X264);
-+ useNV ? SIMPLE_ENCODER_NVENC : h264_fallback);
+ int startingBitrate = 2500;
+ bool customServer = false;
+@@ -104,6 +106,7 @@ class AutoConfig : public QWizard {
+ int specificFPSDen = 0;
- const char *aac_default = "ffmpeg_aac";
- if (EncoderAvailable("CoreAudio_AAC"))
-diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp
-index 81bb7b478..45d51f919 100644
---- a/UI/window-basic-main.hpp
-+++ b/UI/window-basic-main.hpp
-@@ -70,6 +70,7 @@ class OBSBasicVCamConfig;
+ void TestHardwareEncoding();
++ void TestSoftwareEncoding();
+ bool CanTestServer(const char *server);
- #define SIMPLE_ENCODER_X264 "x264"
- #define SIMPLE_ENCODER_X264_LOWCPU "x264_lowcpu"
-+#define SIMPLE_ENCODER_OPENH264 "ffmpeg_openh264"
- #define SIMPLE_ENCODER_QSV "qsv"
- #define SIMPLE_ENCODER_QSV_AV1 "qsv_av1"
- #define SIMPLE_ENCODER_NVENC "nvenc"
-@@ -1304,7 +1305,7 @@ private:
- void UpdateProfileEncoders();
- std::vector<std::string> GetRestartRequirements(const ConfigFile &config) const;
- void ResetProfileData();
-- void CheckForSimpleModeX264Fallback();
-+ void CheckForSimpleModeH264Fallback();
+ virtual void done(int result) override;
+diff --git a/frontend/wizards/AutoConfigTestPage.cpp b/frontend/wizards/AutoConfigTestPage.cpp
+index c6547ba1b149..3de259a5e15a 100644
+--- a/frontend/wizards/AutoConfigTestPage.cpp
++++ b/frontend/wizards/AutoConfigTestPage.cpp
+@@ -119,7 +119,8 @@ void AutoConfigTestPage::TestBandwidthThread()
- public:
- inline const OBSProfileCache &GetProfileCache() const noexcept { return profiles; };
-diff --git a/UI/window-basic-settings-stream.cpp b/UI/window-basic-settings-stream.cpp
-index 7296d7328..0d296abbc 100644
---- a/UI/window-basic-settings-stream.cpp
-+++ b/UI/window-basic-settings-stream.cpp
-@@ -1459,7 +1459,9 @@ static QString get_adv_fallback(const QString &enc)
- return "com.apple.videotoolbox.videoencoder.ave.avc";
- if (enc == "obs_qsv11_av1")
- return "obs_qsv11";
-- return "obs_x264";
-+ if (EncoderAvailable("obs_x264"))
-+ return "obs_x264";
-+ return "ffmpeg_openh264";
- }
+ const char *serverType = wiz->customServer ? "rtmp_custom" : "rtmp_common";
- static QString get_adv_audio_fallback(const QString &enc)
-@@ -1488,7 +1490,9 @@ static QString get_simple_fallback(const QString &enc)
- return SIMPLE_ENCODER_APPLE_H264;
- if (enc == SIMPLE_ENCODER_QSV_AV1)
- return SIMPLE_ENCODER_QSV;
-- return SIMPLE_ENCODER_X264;
-+ if (EncoderAvailable("obs_x264"))
-+ return SIMPLE_ENCODER_X264;
-+ return SIMPLE_ENCODER_OPENH264;
- }
+- OBSEncoderAutoRelease vencoder = obs_video_encoder_create("obs_x264", "test_x264", nullptr, nullptr);
++ OBSEncoderAutoRelease vencoder = obs_video_encoder_create((wiz->x264Available ? "obs_x264" : "ffmpeg_openh264"),
++ "test_h264", nullptr, nullptr);
+ OBSEncoderAutoRelease aencoder = obs_audio_encoder_create("ffmpeg_aac", "test_aac", nullptr, 0, nullptr);
+ OBSServiceAutoRelease service = obs_service_create(serverType, "test_service", nullptr, nullptr);
- bool OBSBasicSettings::ServiceSupportsCodecCheck()
-@@ -1663,7 +1667,9 @@ void OBSBasicSettings::ResetEncoders(bool streamOnly)
+@@ -151,10 +152,11 @@ void AutoConfigTestPage::TestBandwidthThread()
+ obs_data_set_string(service_settings, "key", key.c_str());
- #define ENCODER_STR(str) QTStr("Basic.Settings.Output.Simple.Encoder." str)
+ obs_data_set_int(vencoder_settings, "bitrate", wiz->startingBitrate);
+- obs_data_set_string(vencoder_settings, "rate_control", "CBR");
+- obs_data_set_string(vencoder_settings, "preset", "veryfast");
+- obs_data_set_int(vencoder_settings, "keyint_sec", 2);
+-
++ if (wiz->x264Available) {
++ obs_data_set_string(vencoder_settings, "rate_control", "CBR");
++ obs_data_set_string(vencoder_settings, "preset", "veryfast");
++ obs_data_set_int(vencoder_settings, "keyint_sec", 2);
++ }
+ obs_data_set_int(aencoder_settings, "bitrate", 32);
-- ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.X264.H264"), QString(SIMPLE_ENCODER_X264));
-+ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.OpenH264.H264"), QString(SIMPLE_ENCODER_OPENH264));
-+ if (service_supports_encoder(vcodecs, "obs_x264"))
-+ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.X264.H264"), QString(SIMPLE_ENCODER_X264));
- #ifdef _WIN32
- if (service_supports_encoder(vcodecs, "obs_qsv11"))
- ui->simpleOutStrEncoder->addItem(ENCODER_STR("Hardware.QSV.H264"), QString(SIMPLE_ENCODER_QSV));
-diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp
-index 334213699..6954b0627 100644
---- a/UI/window-basic-settings.cpp
-+++ b/UI/window-basic-settings.cpp
-@@ -3364,6 +3364,11 @@ void OBSBasicSettings::SaveOutputSettings()
- do. This only exists to make sure that the x264 preset doesn't
- get overwritten with empty data. */
- presetType = "ApplePreset";
-+ else if (encoder == SIMPLE_ENCODER_OPENH264)
-+ /* The OpenH264 encoder does not have presets like the other encoders
-+ do. This only exists to make sure that the x264 preset doesn't
-+ get overwritten with empty data. */
-+ presetType = "OpenH264Preset";
- else
- presetType = "Preset";
+ OBSBasic *main = OBSBasic::Get();
+@@ -482,7 +484,8 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
+ /* -----------------------------------*/
+ /* create obs objects */
-@@ -4735,8 +4740,12 @@ void OBSBasicSettings::FillSimpleRecordingValues()
- ADD_QUALITY("HQ");
- ADD_QUALITY("Lossless");
+- OBSEncoderAutoRelease vencoder = obs_video_encoder_create("obs_x264", "test_x264", nullptr, nullptr);
++ OBSEncoderAutoRelease vencoder = obs_video_encoder_create((wiz->x264Available ? "obs_x264" : "ffmpeg_openh264"),
++ "test_h264", nullptr, nullptr);
+ OBSEncoderAutoRelease aencoder = obs_audio_encoder_create("ffmpeg_aac", "test_aac", nullptr, 0, nullptr);
+ OBSOutputAutoRelease output = obs_output_create("null_output", "null", nullptr, nullptr);
-- ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.X264.H264"), QString(SIMPLE_ENCODER_X264));
-- ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU.X264.H264"), QString(SIMPLE_ENCODER_X264_LOWCPU));
-+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.OpenH264.H264"), QString(SIMPLE_ENCODER_OPENH264));
-+ if (EncoderAvailable("obs_x264")) {
-+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.X264.H264"), QString(SIMPLE_ENCODER_X264));
-+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU.X264.H264"),
-+ QString(SIMPLE_ENCODER_X264_LOWCPU));
-+ }
- if (EncoderAvailable("obs_qsv11"))
- ui->simpleOutRecEncoder->addItem(ENCODER_STR("Hardware.QSV.H264"), QString(SIMPLE_ENCODER_QSV));
- if (EncoderAvailable("obs_qsv11_av1"))
-@@ -4885,6 +4894,9 @@ void OBSBasicSettings::SimpleStreamingEncoderChanged()
+@@ -494,16 +497,20 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
+ obs_data_set_int(aencoder_settings, "bitrate", 32);
- defaultPreset = "balanced";
- preset = curAMDAV1Preset;
-+ } else if (encoder == SIMPLE_ENCODER_OPENH264) {
-+ ui->simpleOutPreset->setVisible(false);
-+ ui->simpleOutPresetLabel->setVisible(false);
+ if (wiz->type != AutoConfig::Type::Recording) {
+- obs_data_set_int(vencoder_settings, "keyint_sec", 2);
++ if (wiz->x264Available) {
++ obs_data_set_int(vencoder_settings, "keyint_sec", 2);
++ obs_data_set_string(vencoder_settings, "rate_control", "CBR");
++ obs_data_set_string(vencoder_settings, "preset", "veryfast");
++ }
+ obs_data_set_int(vencoder_settings, "bitrate", wiz->idealBitrate);
+- obs_data_set_string(vencoder_settings, "rate_control", "CBR");
+ obs_data_set_string(vencoder_settings, "profile", "main");
+- obs_data_set_string(vencoder_settings, "preset", "veryfast");
} else {
+- obs_data_set_int(vencoder_settings, "crf", 20);
+- obs_data_set_string(vencoder_settings, "rate_control", "CRF");
++ if (wiz->x264Available) {
++ obs_data_set_int(vencoder_settings, "crf", 20);
++ obs_data_set_string(vencoder_settings, "rate_control", "CRF");
++ obs_data_set_string(vencoder_settings, "preset", "veryfast");
++ }
+ obs_data_set_string(vencoder_settings, "profile", "high");
+- obs_data_set_string(vencoder_settings, "preset", "veryfast");
+ }
- #define PRESET_STR(val) QString(Str("Basic.Settings.Output.EncoderPreset." val)).arg(val)
+ /* -----------------------------------*/
+@@ -850,7 +857,10 @@ void AutoConfigTestPage::TestStreamEncoderThread()
+ else
+ wiz->streamingEncoder = AutoConfig::Encoder::AMD;
+ } else {
+- wiz->streamingEncoder = AutoConfig::Encoder::x264;
++ if (wiz->x264Available)
++ wiz->streamingEncoder = AutoConfig::Encoder::x264;
++ else
++ wiz->streamingEncoder = AutoConfig::Encoder::OpenH264;
+ }
+
+ #ifdef __linux__
+@@ -894,7 +904,10 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
+ else
+ wiz->recordingEncoder = AutoConfig::Encoder::AMD;
+ } else {
+- wiz->recordingEncoder = AutoConfig::Encoder::x264;
++ if (wiz->x264Available)
++ wiz->streamingEncoder = AutoConfig::Encoder::x264;
++ else
++ wiz->streamingEncoder = AutoConfig::Encoder::OpenH264;
+ }
+
+ if (wiz->recordingEncoder != AutoConfig::Encoder::NVENC) {
+@@ -909,6 +922,7 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
+
+ #define ENCODER_TEXT(x) "Basic.Settings.Output.Simple.Encoder." x
+ #define ENCODER_SOFTWARE ENCODER_TEXT("Software")
++#define ENCODER_OPENH264 ENCODER_TEXT("Software.OpenH264")
+ #define ENCODER_NVENC ENCODER_TEXT("Hardware.NVENC.H264")
+ #define ENCODER_QSV ENCODER_TEXT("Hardware.QSV.H264")
+ #define ENCODER_AMD ENCODER_TEXT("Hardware.AMD.H264")
+@@ -946,6 +960,8 @@ void AutoConfigTestPage::FinalizeResults()
+
+ auto encName = [](AutoConfig::Encoder enc) -> QString {
+ switch (enc) {
++ case AutoConfig::Encoder::OpenH264:
++ return QTStr(ENCODER_OPENH264);
+ case AutoConfig::Encoder::x264:
+ return QTStr(ENCODER_SOFTWARE);
+ case AutoConfig::Encoder::NVENC:
+@@ -960,7 +976,7 @@ void AutoConfigTestPage::FinalizeResults()
+ return QTStr(QUALITY_SAME);
+ }
+
+- return QTStr(ENCODER_SOFTWARE);
++ return QTStr(ENCODER_OPENH264);
+ };
+
+ auto newLabel = [this](const char *str) -> QLabel * {
--
-2.47.0
+2.49.0
diff --git a/52d57cf70ca70f55378112f6eeb5708fb7680a6b.patch b/52d57cf70ca70f55378112f6eeb5708fb7680a6b.patch
deleted file mode 100644
index 803b868..0000000
--- a/52d57cf70ca70f55378112f6eeb5708fb7680a6b.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From 52d57cf70ca70f55378112f6eeb5708fb7680a6b Mon Sep 17 00:00:00 2001
-From: stephematician <steph.fn.contact@proton.me>
-Date: Wed, 19 Mar 2025 13:59:21 +1100
-Subject: [PATCH] linux-v4l2: Fix virtual camera start failure
-
-Add function that tries to reset v4l2loopback output for module versions
-from 0.12.5 to 0.12.7. If successful, then set flag that STREAMON and
-STREAMOFF are necessary each time the device is opened/closed.
----
- plugins/linux-v4l2/v4l2-output.c | 57 ++++++++++++++++++++++++++++++--
- 1 file changed, 54 insertions(+), 3 deletions(-)
-
-diff --git a/plugins/linux-v4l2/v4l2-output.c b/plugins/linux-v4l2/v4l2-output.c
-index 366fc474f69d4e..d5e4e0f6ad57fb 100644
---- a/plugins/linux-v4l2/v4l2-output.c
-+++ b/plugins/linux-v4l2/v4l2-output.c
-@@ -15,6 +15,7 @@ struct virtualcam_data {
- obs_output_t *output;
- int device;
- uint32_t frame_size;
-+ bool use_caps_workaround;
- };
-
- static const char *virtualcam_name(void *unused)
-@@ -110,11 +111,54 @@ static void *virtualcam_create(obs_data_t *settings, obs_output_t *output)
- return vcam;
- }
-
-+bool try_reset_output_caps(const char *device)
-+{
-+ struct v4l2_capability capability;
-+ struct v4l2_format format;
-+ int fd;
-+
-+ blog(LOG_INFO, "Attempting to reset output capability of '%s'", device);
-+
-+ fd = open(device, O_RDWR);
-+ if (fd < 0)
-+ return false;
-+
-+ format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
-+ if (ioctl(fd, VIDIOC_G_FMT, &format) < 0)
-+ goto reset_fail_close_fd;
-+
-+ if (ioctl(fd, VIDIOC_S_FMT, &format) < 0)
-+ goto reset_fail_close_fd;
-+
-+ if (ioctl(fd, VIDIOC_STREAMON, &format.type) < 0)
-+ goto reset_fail_close_fd;
-+
-+ if (ioctl(fd, VIDIOC_STREAMOFF, &format.type) < 0)
-+ goto reset_fail_close_fd;
-+
-+ close(fd);
-+
-+ fd = open(device, O_RDWR);
-+ if (fd < 0)
-+ return false;
-+
-+ if (ioctl(fd, VIDIOC_QUERYCAP, &capability) < 0)
-+ goto reset_fail_close_fd;
-+
-+ close(fd);
-+ return (capability.device_caps & V4L2_CAP_VIDEO_OUTPUT) != 0;
-+
-+reset_fail_close_fd:
-+ close(fd);
-+ return false;
-+}
-+
- static bool try_connect(void *data, const char *device)
- {
-+ static bool use_caps_workaround = false;
- struct virtualcam_data *vcam = (struct virtualcam_data *)data;
-- struct v4l2_format format;
- struct v4l2_capability capability;
-+ struct v4l2_format format;
- struct v4l2_streamparm parm;
-
- uint32_t width = obs_output_get_width(vcam->output);
-@@ -130,6 +174,13 @@ static bool try_connect(void *data, const char *device)
- if (ioctl(vcam->device, VIDIOC_QUERYCAP, &capability) < 0)
- goto fail_close_device;
-
-+ if (!use_caps_workaround && !(capability.device_caps & V4L2_CAP_VIDEO_OUTPUT)) {
-+ if (!try_reset_output_caps(device))
-+ goto fail_close_device;
-+ use_caps_workaround = true;
-+ }
-+ vcam->use_caps_workaround = use_caps_workaround;
-+
- format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
-
- if (ioctl(vcam->device, VIDIOC_G_FMT, &format) < 0)
-@@ -165,7 +216,7 @@ static bool try_connect(void *data, const char *device)
- memset(&parm, 0, sizeof(parm));
- parm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
-
-- if (ioctl(vcam->device, VIDIOC_STREAMON, &parm) < 0) {
-+ if (vcam->use_caps_workaround && ioctl(vcam->device, VIDIOC_STREAMON, &parm.type) < 0) {
- blog(LOG_ERROR, "Failed to start streaming on '%s' (%s)", device, strerror(errno));
- goto fail_close_device;
- }
-@@ -241,7 +292,7 @@ static void virtualcam_stop(void *data, uint64_t ts)
- struct v4l2_streamparm parm = {0};
- parm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
-
-- if (ioctl(vcam->device, VIDIOC_STREAMOFF, &parm) < 0) {
-+ if (vcam->use_caps_workaround && ioctl(vcam->device, VIDIOC_STREAMOFF, &parm) < 0) {
- blog(LOG_WARNING, "Failed to stop streaming on video device %d (%s)", vcam->device, strerror(errno));
- }
-
diff --git a/obs-studio-UI-use-fdk-aac-by-default.patch b/obs-studio-UI-use-fdk-aac-by-default.patch
index 4eb3a90..58f78f3 100644
--- a/obs-studio-UI-use-fdk-aac-by-default.patch
+++ b/obs-studio-UI-use-fdk-aac-by-default.patch
@@ -6,13 +6,13 @@ Subject: [PATCH] UI: Default to fdk-aac for AAC when auto-configuring settings
We always have the FDK-AAC codec available, and it's a better
codec anyway.
---
- UI/window-basic-auto-config-test.cpp | 4 ++--
+ frontend/wizards/AutoConfigTestPage.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/UI/window-basic-auto-config-test.cpp b/UI/window-basic-auto-config-test.cpp
+diff --git a/frontend/wizards/AutoConfigTestPage.cpp b/frontend/wizards/AutoConfigTestPage.cpp
index 5b5051919..9c4769e0a 100644
---- a/UI/window-basic-auto-config-test.cpp
-+++ b/UI/window-basic-auto-config-test.cpp
+--- a/frontend/wizards/AutoConfigTestPage.cpp
++++ b/frontend/wizards/AutoConfigTestPage.cpp
@@ -194,7 +194,7 @@ void AutoConfigTestPage::TestBandwidthThread()
OBSEncoderAutoRelease vencoder = obs_video_encoder_create((wiz->x264Available ? "obs_x264" : "ffmpeg_openh264"),
diff --git a/obs-studio.spec b/obs-studio.spec
index 8943612..e549d0b 100644
--- a/obs-studio.spec
+++ b/obs-studio.spec
@@ -15,8 +15,17 @@
# x264 is not in Fedora
%bcond x264 0
-# CEF is not packaged yet...
+%if ! (0%{?fedora} >= 42)
+# CEF is only available in F42+
%bcond cef 0
+%else
+%ifarch %{x86_64} %{arm64}
+# CEF is only available on x86_64 and aarch64
+%bcond cef 1
+%else
+%bcond cef 0
+%endif
+%endif
%if "%{__isa_bits}" == "64"
%global lib64_suffix ()(64bit)
@@ -24,17 +33,20 @@
%global libvlc_soversion 5
-%global obswebsocket_version 5.5.5
-%global obsbrowser_commit 4023fad79e2e9ff277b706432fe33eddbdab6d6a
-%global cef_version 6533
+%global obswebsocket_version 5.6.1
+%global obsbrowser_commit 9ffe3828da5fa87d481ad2df2ecb178154818a60
+
+# Upstream does not declare this yet. Arbitrarily pick 133.4 since upstream
+# commits reference support for 133 ("Enable building with CEF 6943").
+%global cef_api_version 13304
#global commit ad859a3f66daac0d30eebcc9b07b0c2004fb6040
#global snapdate 202303261743
#global shortcommit %%(c=%%{commit}; echo ${c:0:7})
Name: obs-studio
-Version: 31.0.3
-Release: 3%{?dist}
+Version: 31.1.0~rc1
+Release: 1%{?dist}
Summary: Open Broadcaster Software Studio
# OBS itself is GPL-2.0-or-later, while various plugin dependencies are of various other licenses
@@ -52,15 +64,12 @@ Source2: https://github.com/obsproject/obs-browser/archive/%{obsbrowser_c
# Backports from upstream
# Proposed upstream
+## From: https://github.com/obsproject/obs-studio/pull/12326
+Patch0101: 0101-frontend-Consider-settings-changed-if-an-output-sett.patch
+Patch0102: 0102-frontend-Allow-invalid-recording-encoder-if-quality-.patch
## From: https://github.com/obsproject/obs-studio/pull/8529
-Patch0101: 0101-UI-Consistently-reference-the-software-H264-encoder-.patch
-Patch0102: 0102-obs-ffmpeg-Add-initial-support-for-the-OpenH264-H.26.patch
Patch0103: 0103-UI-Add-support-for-OpenH264-as-the-worst-case-fallba.patch
-Patch0104: add_missing_include.patch
-## From: https://github.com/obsproject/obs-studio/pull/11906
-## https://github.com/obsproject/obs-studio/commit/52d57cf70ca70f55378112f6eeb5708fb7680a6b.patch
-Patch0105: 52d57cf70ca70f55378112f6eeb5708fb7680a6b.patch
# Downstream Fedora patches
## Use fdk-aac by default
Patch1001: obs-studio-UI-use-fdk-aac-by-default.patch
@@ -76,6 +85,7 @@ BuildRequires: desktop-file-utils
BuildRequires: alsa-lib-devel
BuildRequires: asio-devel
+BuildRequires: extra-cmake-modules
BuildRequires: fdk-aac-free-devel
BuildRequires: ffmpeg-free-devel
BuildRequires: fontconfig-devel
@@ -133,9 +143,6 @@ Requires: /usr/bin/ffmpeg
## Note, we can do this because openh264 is provided in a default-enabled
## third party repository provided by Cisco.
Recommends: openh264%{?_isa}
-%if %{with x264}
-Requires: x264%{?_isa}
-%endif
# Ensure QtWayland is installed when libwayland-client is installed
Requires: (qt6-qtwayland%{?_isa} if libwayland-client%{?_isa})
@@ -178,11 +185,13 @@ software for video recording and live streaming.
%files
%doc README.rst
-%license UI/data/license/gplv2.txt
+%license frontend/data/license/gplv2.txt
%license COPYING
%{_bindir}/obs
%{_bindir}/obs-ffmpeg-mux
+%ifarch %{x86_64}
%{_bindir}/obs-nvenc-test
+%endif
%{_datadir}/metainfo/com.obsproject.Studio.metainfo.xml
%{_datadir}/applications/com.obsproject.Studio.desktop
%{_datadir}/icons/hicolor/*/apps/com.obsproject.Studio.*
@@ -236,13 +245,14 @@ Header files for Open Broadcaster Software
%if %{with cef}
%package plugin-browser
Summary: Open Broadcaster Software Studio - CEF-based browser plugin
-BuildRequires: obs-cef-devel
+BuildRequires: cef-devel
# Filter out bogus libcef.so requires as this is handled manually
# with an explicit dependency
%global __requires_exclude ^libcef\\.so.*$
-Requires: (obs-cef%{?_isa} with obs-cef(abi) = %{cef_version})
+# Require the correct CEF API support
+%{?_cef_api_requires:%_cef_api_requires %{cef_api_version}}
Requires: obs-studio%{?_isa} = %{version}-%{release}
Supplements: obs-studio%{?_isa}
@@ -288,6 +298,11 @@ tar -xf %{SOURCE1} -C plugins/obs-websocket --strip-components=1
tar -xf %{SOURCE2} -C plugins/obs-browser --strip-components=1
%autopatch -p1
+# This is provided by cef-devel systemwide
+rm cmake/finders/FindCEF.cmake
+
+# Fix obs-browser rpath setting
+sed -e 's,INSTALL_RPATH ".*",INSTALL_RPATH "%{_libdir}/cef/",' -i plugins/obs-browser/cmake/os-linux.cmake
%if ! %{with x264}
# disable x264 plugin
@@ -327,12 +342,17 @@ cp plugins/obs-qsv11/obs-qsv11-LICENSE.txt .fedora-rpm/licenses/plugins/
%build
+# libcef_wrapper needs to be built static
+%undefine _cmake_shared_libs
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOBS_VERSION_OVERRIDE=%{version_no_tilde} \
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \
-DUNIX_STRUCTURE=1 -GNinja \
%if ! %{with cef}
-DENABLE_BROWSER=OFF \
+%else
+ -DENABLE_BROWSER=ON \
+ -DCEF_API_VERSION=%{cef_api_version} \
%endif
-DENABLE_JACK=ON \
-DENABLE_LIBFDK=ON \
@@ -365,6 +385,13 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainf
%changelog
+* Tue Jul 01 2025 Asahi Lina <lina@asahilina.net> - 31.1.0~rc1-1
+- Update obs-studio to 31.1.0~rc1
+- Rebase patches after upstream rework
+- Update obs-websocket to 5.6.1
+- Update obs-browser to 9ffe3828da5
+- Re-enable CEF support
+
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 31.0.3-3
- Rebuilt for Python 3.14
diff --git a/sources b/sources
index fc6b3a2..7a61f50 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
-SHA512 (obs-studio-31.0.3.tar.gz) = eeb59c0ccc530a04ead3389839efad6ae6b7b757ec5bf6df7b9bb0c393f0fa5fcec0e27e34c7e4801e11ef071518f423bb527cbf81fc3d29533d3757914706d8
-SHA512 (obs-websocket-5.5.5.tar.gz) = 94c7a3699747d15492dc03288fa8bf9fd8204e8c6d070ba2ee316aa2d457f62409d381087d0fd361337fbd72d3c48e5840da7bdecc48495d0d18651e33480488
-SHA512 (obs-browser-4023fad79e2e9ff277b706432fe33eddbdab6d6a.tar.gz) = d976ea8b1dd63a892e56664682552da5d4712d7af72f2c3f94dad5fa3e713aa082f655bc96037814cccfe3ef4af8ffdf8dcb7d377629a14d271124086ab18c7c
+SHA512 (obs-studio-31.1.0-rc1.tar.gz) = f554fe652623f92cdc020dd1533d3878801bcc3ebfcc84167b8639785c21419aefccc5e8ade6c0030aecdf3b53177d1769e3c626763ce12fa7a02db2008991ae
+SHA512 (obs-websocket-5.6.1.tar.gz) = 99ebb3d49640af431baeed8bf7871cf1d845936d5f0ce432b6f6fbeddce6764ab4a553bd21d9b055daaf6444b15361a0d0bbec3e19e1eb7e430bb40ba8eb6b16
+SHA512 (obs-browser-9ffe3828da5fa87d481ad2df2ecb178154818a60.tar.gz) = 3b1fcfc126221b5d36725192359678afd1ad82cee0ccec5b22fd96573fb32f95b49777418e8ed6127d681ff04e49bd371088aca45d54de4c9a66a61d79d63c12
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-10 20:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10 20:01 [rpms/obs-studio] epel9: Update obs-studio to 31.1.0~rc1 Asahi Lina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox