$ show sorayuki/obs-multi-rtmp
This repository is an OBS Studio plugin that enables simultaneous streaming to multiple RTMP (and SRT/RIST, WHIP) destinations from a single OBS session. It provides a dockable Qt-based user interface where users can configure an arbitrary number of streaming targets, each with independent encoder settings (video and audio) or the option to reuse the current OBS streaming/recording encoder. The plugin manages per-target start/stop, bulk start/stop, and can synchronize with OBS's built-in streaming start/stop events. The architecture is a standard OBS plugin: it registers a dock via the obs-frontend-api, creates a main widget (MultiOutputWidget) that hosts a scrollable list of target cards (PushWidgetImpl), and provides an editor dialog (EditOutputWidgetImpl) for adding/modifying targets. Configurations are persisted in a JSON file (obs-multi-rtmp.json) within the OBS profile directory, with support for export/import. The build system uses CMake with platform-specific presets and GitHub Actions for CI/CD across Windows, macOS, and Linux, including Flatpak packaging. Key strengths include a reusable JSON utility (json-util.hpp), a generic OBS properties widget (obs-properties-widget) that can render any obs_properties tree with two-way data binding, and an RAII scope guard (Finally) in helpers.h. The code demonstrates solid C++ practices, cross-platform awareness, and careful handling of encoder sharing to avoid resource conflicts. However, the plugin is tightly coupled to OBS internals, has no automated tests, and some source files exceed 500 lines mixing UI and business logic.
The LLM identified 3 files worth highlighting for reuse:
Provides safe, type-checked extraction of JSON values using nlohmann-json with std::optional return types. Includes overloads for integers, floats, booleans, strings, and nested objects. The pattern isolates error handling (missing keys, type mismatch) into a reusable utility that can be adopted in any C++ project using nlohmann-json.
Contains a generic C++ RAII scope guard implementation ('Finally') that executes a cleanup lambda when the object goes out of scope. Also includes platform-independent macros for unused variable suppression and constants for special encoder placeholders. The Finally pattern is a classic, nonβobvious utility that can be extracted to any C++ project.
Implements a QWidget that dynamically renders any OBS property tree (obs_properties) as a Qt form with two-way data binding. Automatically handles property changes and calls the corresponding OBS modified callback, enabling reuse across plugins that need to display OBS settings dialogs. The widget is self-contained and only depends on Qt widgets and the OBS API.