Go to Settings → Output
Select "Advanced" Output Mode at the top and then navigate to "Replay Buffer" tap and Enable it with the checkbox.
Select the replay buffer desired time and if you have a good amount of memory in your system, increase the Maximum memory a little. I have set mine to 2048 MB later on.
In the settings menu, navigate to "Hotkeys" and then search for "Replay" in the hotkey search bar at the top.
You can set both the "Start Replay Buffer" and "Stop Replay Buffer" hotkeys to the same shortcut if you want it to work like a toggle. The sound notification script below would be helpful to make out the state of the replay buffer then.
Note: If you're running OBS Studio Flatpak on wayland, you might need to use this script to enable global hotkeys even when the app is not in focus.
This is a simple Lua script that plays a .wav sound whenever the replay buffer is saved, enabled, or disabled. It has been adapted for Linux support using PulseAudio or ALSA.
- Ensure that aplay (ALSA) or paplay (PulseAudio) is installed on your system. Run 'aplay' or 'paplay' and see if the commands work for you, if not, try installing them following your own distro's instructions. This script is set to use 'paplay'by default.
Ensure that the sound file is in a format supported by the utility (e.g., .wav for aplay and .wav/.ogg for paplay).
-
Use the sounds in the repo or any .wav sound but make sure to match its name either in "Replay_Buffer_Sound.lua" (edit with any text editor) or rename your .wav files to match what is already in the script.
-
Put the audio files in the same location with "Replay_Buffer_Sound.lua"
- A good way to keep things tidy is to create a separate "scripts" folder somewhere in your Home and keep all your scripts there in case you need to back up your OBS Settings.
-
Go to OBS → Tools → Scripts → + and then select the script file.
This Lua script was forked from https://gist.github.com/snakecase/e816384a071cec31efbb4b9e429c108d
Make sure to enable the system tray and minimize to system tray in the general settings (See pic below)
Set up OBS Studio to auto-start using your own desktop environment's autostart options and then add the launch argument "--startreplaybuffer" to start the replay buffer automatically at startup.
For example on Linux Mint using Cinnamon 6.2.9:
On Bazzite using KDE Plasma 6.6:
Thank you guys!

