80 Commits
Author SHA1 Message Date
Nick von KaenelandRyan Foster f40cf8dd72 frontend: Scale simple output recording audio bitrate by channel count
The recording audio bitrate was hardcoded to 192 kbps regardless of
channel layout. For a 5.1 mix this yields ~32 kbps per channel which is
very low quality. Scale proportionally from the stereo reference (192
kbps) using the active channel count, snapping to the closest bitrate
supported by the selected encoder (AAC or Opus).

Stereo recordings are unchanged (192 * 2 / 2 = 192 kbps).
2026-08-21 13:14:46 -04:00
Warchamp7andRyan Foster 4abbcf0b6d frontend: Update invokeMethod to use functions 2026-08-10 16:27:32 -04:00
Warchamp7andRyan Foster 7546be7266 frontend: Fix default thumbnail positioning 2026-07-21 14:07:32 -04:00
Richard StanwayandRyan Foster 9d38a93831 frontend: Add Image SAFER to DLL blocklist
More useless "security" software to try to prevent screenshots that
installs global hooks and kernel drivers. Crash reports indicate that
their hook attaches to and subsequently crashes OBS.
2026-07-14 15:12:13 -04:00
derrodandRyan Foster f7e4fba19f frontend: Add defunct Twitch Soundtrack plugin to DLL blocklist 2026-07-14 13:47:07 -04:00
LinuxUserGDandRyan Foster 7a52bedca1 frontend: Add missing <functional> include
Fixes the compile error `no template named 'function' in namespace 'std'`
2026-07-01 16:17:37 -04:00
Warchamp7andRyan Foster 30b63c6849 Update C++ files with braces 2026-06-09 13:41:19 -04:00
PatTheMavandRyan Foster 0db6d4f88c frontend: Use conditional custom Sparkle feed
When OBS runs via Rosetta 2 emulation on an Apple Silicon host, the
next automatic update via Sparkle should use a native Apple Silicon
build rather than the newest Intel build.

This is achieved by setting a custom feed URL on the delegate object
which will then respond with this URL (or alternatively with "nil")
when Sparkle calls the appropriate delegate method.
2026-06-08 18:49:46 -04:00
PatTheMavandRyan Foster d91999b4cf frontend: Add feedUrlStringForUpdater delegate
Adds necessary delegate method to OBSSupdateDelegate to provide
alternative AppCast feed URL at runtime.

The NSString pointer is allowed to be "nil" as Sparkle will only use
a non-nil return value to change from the default feed URL.
2026-06-08 18:49:46 -04:00
Warchamp7andRyan Foster 9f4320ec70 frontend: Adjust shutdown logic more 2026-06-08 12:01:28 -04:00
PatTheMavandRyan Foster f61619ce30 frontend: Fix multitrack custom config handling
Custom configuration for multitrack-enabled services is only supposed
to be available for the "rtmp_custom" service type, as that's also
the condition for the corresponding text input to become visible in the
settings dialog.

When a user switches their desired service from the custom service back
to another service that also supports multitrack, the custom service
configuration is still present and will be applied even though it
should only be effective for the custom service.

This change makes the simple decision to ignore any available custom
multitrack configuration if the service is not "rtmp_custom" and
requires an "auto_config_url" to be available in that case. Otherwise
the "rtmp_custom" service requires an "custom_config" to be available.

That way the implementation reflects the behavior of the settings dialog
and will not lead to the present unexpected behavior, including:

* The custom configuration is "merged" with the config ID provided
  via the "auto_config_url".
* A non-custom service might fail to configure because the custom config
  is applied and might be missing required fields.
* A non-custom service might succeed to configure because the custom
  config is applied and has all required fields, but the service was
  meant for an entirely different service.

Additionally the unused "MultitrackVideoDeveloperModeEnabled" function
was removed. For simplicity's sake, all legacy code paths that allowed
interference or custom overrides with the service configuration for
established services are removed.

If such functionality is still desired, it needs to be reimplemented in
a service-agnostic way, taking the possibility of other multitrack-
capable services into account.
2026-06-05 16:43:12 -04:00
Alex LuccisanoandRyan Foster af77628900 frontend: Fix null settings and DBR for custom configs
When using custom RTMP output with a JSON config that omits
encoder settings, settings.dump() produces "null" which
obs_data_create_from_json cannot parse. Fall back to
obs_data_create() for null/non-object settings so encoders
use their defaults.

Additionally, when bitrate_interpolation_points is absent,
the code unconditionally set interpolation_table_data as
empty arrays. This caused build_dbr_interpolation_table to
wipe the default linear table, leaving DBR enabled but
unable to adjust bitrates during congestion. Only set the
interpolation data when all encoders provide it, otherwise
fall back to the default linear 0-to-max interpolation.
2026-06-05 14:11:55 -04:00
Ruwen HahnandRyan Foster cd95b3bf49 frontend: Add dynamic bitrate support to multitrack video
The bitrate interpolation points are sent in JSON configuration and
need to be forwarded to `create_video_encoders()`. Also remove the
`HandleIncompatibleSettings()` handler because there are no longer any
incompatible settings.
2026-06-05 14:11:55 -04:00
Warchamp7andRyan Foster 638f885e5d frontend: Fix thumbnail update rate 2026-05-19 13:36:52 -04:00
12597e9484 frontend: Replace add source dropdown with dialog
Co-Authored-By: Lain <134130700+Lain-B@users.noreply.github.com>
2026-05-07 15:31:10 -04:00
cg2121andRyan Foster 750c016161 frontend, libobs: Add OBSProperties OBSPtr type
We no longer have to manually destroy obs_properties_t.
2026-05-06 17:27:36 -04:00
Sebastian BeckmannandRyan Foster e38e9f8070 frontend: Pass std::string as result from RemoteTextThread
RemoteTextThread and WhatsNewInfoThread explicitly convert their results
into QString, but many consumers need std::string, converting them
back. Let's just use std::string directly and only convert to QString
where actually needed.
2026-05-06 14:15:44 -04:00
trilkkandRyan Foster 9776a227ef frontend: Add needed FreeBSD sys/ headers for libprocstat.h to compile 2026-02-05 16:54:16 -05:00
Warchamp7andRyan Foster 694680e8c0 frontend: Revert Add Source dialog update
This reverts commit 5fc2476913.
2026-01-28 12:13:20 -05:00
5fc2476913 frontend: Replace add source dropdown with dialog
Co-Authored-By: Lain <134130700+Lain-B@users.noreply.github.com>
2026-01-14 14:49:38 -05:00
Anton KesyandRyan Foster 22016f309c frontend: Fix typos 2026-01-14 13:47:30 -05:00
Warchamp7andRyan Foster a42a6c4c5f frontend: Refactor and update Audio Mixer 2026-01-13 16:34:33 -05:00
Warchamp7andRyan Foster 92a83e4c4c frontend: Sync Preview/Program size and positioning 2026-01-08 19:58:07 -05:00
Sebastian BeckmannandRyan Foster f6a56227eb frontend: Remove implicit capture of "this" using "="
Implicitly capturing "this" with the capture default "=" is deprecated
with C++20. We fix this by either explicitly passing this, or by copying
the required members manually.
While this exposes some rather expensive copies like the QList
selectedItems in OBSBasic_Preview, it doesn't introduce them ("=" copies
implicitly).
2025-12-18 17:30:42 -05:00
Sebastian BeckmannandRyan Foster f80d35fa4a frontend: Remove "using namespace std" from headers
This is very dangerous as it propagates down everywhere the headers are
included in.
2025-12-17 18:51:35 -05:00
gxalphaandRyan Foster 5129612b6c frontend,shared: Replace and disable contextless connect calls
# Conflicts:
#	frontend/OBSApp.cpp
2025-12-17 16:35:45 -05:00
gxalphaandRyan Foster 9b1d1493ab frontend,shared: Replace and disable QByteArray to char * casts 2025-12-17 16:35:45 -05:00
Sebastian BeckmannandRyan Foster 63d7f7fb55 frontend: Replace #defines in YoutubeApiWrappers 2025-12-17 16:35:45 -05:00
Sean DuBoisandRyan Foster cd4d624ec3 obs-webrtc: Add Simulcast Support 2025-12-17 13:41:59 -05:00
Warchamp7andRyan Foster 34a0a6a530 frontend: Remove crash handler earlier in shutdown 2025-12-04 15:05:23 -05:00
Warchamp7andRyan Foster 14572498dc frontend: Adjust application shutdown logic
Improves app shutdown in a few ways, including separating out different
pieces of the OBSBasic close handler into their own functions.

Removes the crash handler sentinel earlier when the main window is closed,
preventing unclean shutdown warnings when a plugin causes issues. While not
ideal, the dialog is not useful when we cannot specify which plugin caused the
problem.

Increases shutdown priority of the main application so that when OBS interrupts
the session ending, CEF is not closed at the same time. This fixes a crash.

Additional safeguards and event handling to try to ensure a smoother shutdown.
2025-12-01 16:40:34 -05:00
PatTheMavandRyan Foster e35b16cba9 frontend: Enable multitrack RTMP option for custom RTMP services
This removes the need to provide an undocumented launch argument to
enable custom RTMP service configurations to use multitrack encoding
and also provide a custom configuration.
2025-09-26 01:48:39 -04:00
PenwywernandRyan Foster e216a0eab0 frontend: Don't attempt multitrack without config url 2025-09-15 16:47:44 -04:00
PatTheMavandRyan Foster e8d4224992 frontend: Change crash sentinel location to separate subdirectory
Putting the crash sentinel in the main "obs-studio" directory carries
the risk of unwanted deletion of files in the same directory, which
usually contains user configuration files like "user.ini" and
"global.ini".

Even though the code will ignore any file that does not start with the
crash sentinel prefix string, the code itself would allow changing the
prefix to "global.ini" and thus inadvertently delete the global
configuration file as well.

To further reduce the risk, this change will put the sentinels in a
separate sub-directory that should only ever contain sentinel files,
all of which can possibly deleted without any data loss for the user.
2025-09-03 13:01:44 -04:00
747f67e150 frontend: Do not enable crash log upload without log file
Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
2025-09-02 15:28:33 -04:00
Sebastian BeckmannandRyan Foster 7685a0c78b frontend: Set cursor width for OBSHotkeyEdit to 0
This hides the cursor from the OBSHotkeyEdit spin boxes even when they
are in focus.
Uses a shared style owned by OBSApp.
2025-08-23 13:01:02 -04:00
PatTheMavandRyan Foster 272825b46a frontend: Add CrashHandler class
The CrashHandler class encapsulates all functionality around unsafe
shutdown detection as well as crash log discovery and log upload.

Each (functional) CrashHandler should be initialized with an app launch
UUID, which enables the handler to disambiguate a sentinel file for the
current app launch from those of prior app launches.
2025-08-22 15:38:12 -04:00
derrodandRyan Foster 0619198c25 frontend: Add Hybrid MOV to format list 2025-08-21 18:14:33 -04:00
cg2121andRyan Foster 33e8a23386 frontend: Auto release OBSDataArray objects
Makes sure that all obs data array objects in cpp files are using
auto release RAII wrappers.
2025-08-20 12:59:53 -04:00
Dennis SädtlerandRyan Foster ef057dd3af frontend: Fix and simplify initialization of supported_codecs 2025-08-19 18:44:49 -04:00
Sebastian BeckmannandRyan Foster 28ca612d9e frontend: Remove unused OBSContextBarProxyStyle
All usages of OBSContextBarProxyStyle were removed in [1], so the class
is completely unused now. It should be deleted.

[1] 8dcfae9a39
2025-08-19 14:25:37 -04:00
Dennis SädtlerandRyan Foster a45bbe134f frontend: Do not set maximum_video_tracks if user has set it to "Auto" 2025-07-18 13:07:37 -04:00
Damian Marcin SzymańskiandRyan Foster 9331fb7dac frontend: Fix build failure with Clang 20+ in OBSCanvas
Canvas is a move-only type without a copy constructor. Since C++17
requires types stored in std::optional to be copy-constructible unless
explicitly allowed, Clang 20+ emits an error when attempting to
instantiate std::optional<Canvas>.

While GCC allows this as an extension, Clang enforces the standard
more strictly.

This PR replaces std::optional<Canvas> with std::unique_ptr<Canvas> to
resolve the build error with Clang 20+ while keeping functional
behavior identical.

Tested with GCC 15.1.0 and Clang 20.1.7.

Co-Authored-By: Ryan Foster <ryan@obsproject.com>
2025-07-15 14:29:05 -04:00
Dennis SädtlerandRyan Foster e474a3723b frontend: Allow 5 multitrack reconnect attempts before re-running GCC 2025-05-07 15:46:50 -04:00
cg2121andRyan Foster d7cce79d7e frontend: Use static_cast when casting from void pointers
Using static_cast is preferred here, as it is safer to use than
reinterpret_cast.
2025-05-05 20:47:10 -04:00
Dennis SädtlerandRyan Foster 0552062390 frontend: Allow selecting additional canvases for multitrack 2025-05-05 17:17:20 -04:00
Dennis SädtlerandRyan Foster 8117c89b9a frontend: Update multitrack API model
"revision" was defined to be a string in the schema but accepted
integers, this is enforced with the new schema version.
2025-05-05 17:17:20 -04:00
Dennis SädtlerandRyan Foster 811072d0fd frontend: Always limit multitrack video encoders to libobs maximum 2025-05-05 17:17:20 -04:00
cg2121andRyan Foster 345fe56b6e frontend: Make sure all QObject subclasses have Q_OBJECT macro
Went through and found all QObject subclasses that didn't have
a Q_OBJECT macro.
2025-05-05 13:10:39 -04:00
Dennis SädtlerandRyan Foster afd7619c98 frontend: Add OBS::Canvas class 2025-05-02 14:35:22 -04:00