Similar to the win-capture-audio plugin by bozbez that allows for the capturing of audio from specific applications except for systems that use PulseAudio as their main sound server. Also influenced by the existing linux-pulseaudio
plugin built into OBS as well as the pactl utility built into PulseAudio NOTE: This plugin is still experimental and under development. Bugs are expected
Note: This plugin is not under active development and has not been updated to support OBS 28.0 as I do not have time at the moment. If you wish to continue development of this plugin, feel free to fork the repo
PulseAudio uses a client server model to manage sound. Unfortunately (at least from what I can tell) it does not allow recording directly from a specific application as clients and the corresponding sink-inputs do not have monitors that can be recorded from. The way to get around this is to load a new combine-sink
module, set the combine-sink
module's sink (output) to be the same sink as the application, and then move the application's sink to be the new combine-sink
module. Because the combine-sink
module has a monitor, we can read the audio data from the monitor while the audio is still being sent to desired location. Note: While not ideal, this is actually the same method that Zoom
uses in order to capture and share desktop audio on Linux devices running a PulseAudio server.
Simply add the source, select the application, and the audio should be recorded.
- Each of these sources will end up loading its own
combine-sink
module. If you have a lot of these sources, you will end up with a lot of pulse modules being loaded. There may be a better way to reuse existing loaded modules instead creating new ones everytime, however there is something to be said for keeping each source in isolation, especially when different sources are on different scenes. - The functionality of this plugin depends heavily on loading the
combine-sink
pulse module. If the module is not available or cannot be loaded for whatever reason, the plugin will not function. - If OBS crashes before the plugin is able to destroy and clean itself up, lingering
combine-sink
modules will remain loaded afterwards. This may lead to unintended behavior when OBS is restarted. - Unexepcted behavior with applications like Chrome that unreister their sink-input
- This plugin is still experimental. Lots of other bugs are expected.
- libpulse
Debain installer can be found in the Releases section. A tar file containing the actual plugin library and data files can also be found and extracted for other non-Debian based systems.
git clone https://github.com/jbwong05/obs-pulseaudio-app-capture.git
cd obs-pulseaudio-app-capture
mkdir build && cd build
# If you are on Ubuntu, add the `-DBUILD_UBUNTU=true` flag to your cmake command
cmake ..
# If dependencies are not on your path, you can manually specify their paths with the following:
cmake -DQTDIR=<path to Qt dir> -DLIBOBS_INCLUDE_DIR=<path to the libobs sub-folder in obs-studio's source code> -DLIBOBS_LIB=<path to libobs.so> -DOBS_FRONTEND_LIB=<path to libobs-frontend-api.so> ..
make
sudo make install