How to start the OBS replay buffer automatically for games
Make a KeyRoutines routine with Game started and Game stopped triggers. On start, Open app opens OBS, a Wait until with OBS is connected holds until KeyRoutines can talk to it, and OBS: record / stream / replay starts the replay buffer; on stop, the same step stops it.
Steps
- 1
Turn on OBS's WebSocket server
In OBS, open Tools, WebSocket Server Settings and turn the server on. KeyRoutines reads its port and password from OBS by itself.
- 2
Watch your games
Add Game started and Game stopped triggers, and an If with Started by trigger set to Game started.
- 3
Open OBS and wait
In the If branch, add Open app for OBS with If running set to reuse, then Wait until with OBS is connected.
- 4
Start the buffer
Add OBS: record / stream / replay with the replay buffer and start.
- 5
Stop it after
In the Else branch, add OBS: record / stream / replay with the replay buffer and stop.
Tips
- OBS: switch scene before starting the buffer makes sure the right capture is in the clip.
Questions
- Is controlling OBS free?
- Yes. Switching scenes and starting or stopping recording, streaming and the replay buffer are free. Sources, filters and OBS events are Pro.
- Does it capture the game itself?
- OBS does the capturing. KeyRoutines only tells OBS when to start and stop.