KeyRoutines
Gaming setupWorks on Free

How to start OBS recording automatically when a game launches

Use KeyRoutines' Game started and Game stopped triggers with an If on Started by trigger. On start, Open app opens OBS, a Wait until with OBS is connected holds until OBS is ready, OBS: switch scene picks your game scene and OBS: record / stream / replay starts recording; on stop, the same step stops it and Show notification tells you where the file went.

Steps

  1. 1

    Add the game triggers

    Add Game started and Game stopped for the game you want recorded.

  2. 2

    Get OBS ready

    In the start branch, add Open app for OBS and a Wait until with OBS is connected, with a time limit of about 30 seconds.

  3. 3

    Start recording

    Add OBS: switch scene with your game scene, then OBS: record / stream / replay set to start the recording.

  4. 4

    Stop and report

    In the stop branch, add OBS: record / stream / replay set to stop the recording, then Show notification with the file path from its outputs.

Tips

  • OBS needs its WebSocket server turned on under Tools, WebSocket Server Settings; KeyRoutines reads the port and password from there.
  • OBS: record / stream / replay never waits or retries on its own, which is why the Wait until comes first.

Questions

Recording or replay buffer?
Recording saves the whole session. If you only want clips, start the replay buffer instead with the same step.
Is this free?
Yes. Game triggers, OBS is connected, OBS: switch scene and OBS: record / stream / replay are all free.

Blocks this routine uses

Trigger · GamesFree

Game started

Game started fires when any game in your launchers, or one game you pick, starts running. It is how gaming setups begin: switching to the headset, raising the refresh rate and pausing animated wallpapers as the game loads.

Trigger · GamesFree

Game stopped

Game stopped fires when a game you pick, or any game in your launchers, has fully closed. It is the other half of a gaming setup, undoing what Game started changed.

Condition · Flow and routinesFree

Started by trigger

Started by trigger checks which of a routine's own triggers began this run. That lets one routine react a little differently to a hotkey, a schedule or an app opening without keeping separate copies.

Step · AppsFree

Open app

Open app starts a program, a Store app, a shortcut or a game from your library. It is the first step of most setup routines, from a morning work session to a full streaming setup.

Condition · OBS StudioFree

OBS is connected

OBS is connected is a condition that is true when KeyRoutines can talk to OBS Studio. Its most common job is sitting right after Open app OBS, holding the routine until OBS is ready to take commands.

Step · OBS StudioFree

OBS: switch scene

OBS: switch scene changes the scene OBS shows to viewers. It's free and needs no setup beyond turning on OBS's WebSocket server.

Step · OBS StudioFree

OBS: record / stream / replay

OBS: record / stream / replay controls OBS's outputs from a routine: recording, the live stream, the replay buffer and the virtual camera. Gaming routines often use it to start the replay buffer when a game launches.

Step · NotificationsFree

Show notification

Show notification pops up a regular Windows notification from KeyRoutines and copies it to the bell. A typical use is the last step of a setup routine, like telling you a game is ready.

More how-to guides

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.