Jump to content
LaunchBox Community Forums

OBS Studio Replay Buffer


invada

Recommended Posts

I just wanted to share ?

I discovered OBS Studio many moons ago and used to to compile a "nostalgia" set of recordings when I got old games working that I used to play when I was a kid. I eventually gave up and discovering eXoDOS has made the process almost superfluous seeing as LaunchBox "playlists" can now have all the games in a nice collection across different platforms etc. The take away from this was I found OBS Studio to be the best free game recording software after testing a bunch.

Anyway, fast forward to LaunchBox integrating OBS Studio and like ETA Prime's video, I set mine to record with F12. Great! I've recorded a few things to show my partner who like to watch bits and pieces of games but is often not around when I make it to a certain part. This is when I started exploring OBS a bit more, excited by my new found appreciation for it. People might not be aware but the "buffer recording" feature, allows you to keep a running recording of say 60 seconds. When something cool happens, you can press a hot key and save the last 60 seconds. I've found this great! It's reminiscent of GTA IV when they added a similar feature, I love it.

If you want to give it a crack, the way I've set it up is to set F12 to start and stop recording, like ETA Prime. Then F11 to save the buffer recording. There is a caveat here. You need to start the replay buffer. I tried to automate this without much luck. Essentially I'd like the buffer to start and stop with the launching of a game. In the meantime either manually start it before playing a game by right clicking the tray icon and clicking "Start replay buffer", clicking "start replay buffer" in the control section of OBS, or run OBS with  --startreplaybuffer switch.

Attached is a video example of a funny Prince of Persia situation I found myself in. ?

Hope some of you find this useful/interesting.

 

2020-07-21 11_22_42-Window.png

2020-07-21 11_23_18-Window.png

2020-07-21 11_27_55-Window.png

Link to comment
Share on other sites

  • 3 weeks later...

I do this all the time with my collection using ShadowPlay, but it would be nice to use OBS due to the new integration and grouping by game. The only issue is that as you mentioned I haven't found anyone who's spoke of a way to have the recording loop run 100% automatically in the background like Shadow Play and the Windows gamebar recordings can.

In theory OBS with the flag you mentioned could be added as an additional app with "AutoRunBefore" set to 1, but that would be a massive pain and clunky. Hopefully in the future theres an option under the OBS integration to have it startup beforehand globally.

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

Just wanted to chime in here as there's a workaround to automatically start/stop Replay Buffer. You've probably already figured this out but posting just in case anyone else sees this. @invada @oblivioncth

1. Create a batch file with this code:
 

@ECHO OFF

CD "C:\Program Files\obs-studio\bin\64bit"

"obs64.exe" --startreplaybuffer --minimize-to-tray

2. In LaunchBox go to Settings->OBS Studio then in the Path use the above batch file instead of OBS Studio.

3. In the Emulator settings, go to Running AutoHotKey Script and use this code:
 

$Esc::
{
    Process, Close, obs64.exe
}

Now everytime you launch a game, it'll launch the batch file which launches OBS starting with Replay Buffer on. And when you exit a game with ESC it'll kill the OBS process.

Unfortunately, for PC games that don't use the ESC key to exit, you'd have to manually press ESC. In that case, I suggest not using the integrated OBS setting in LaunchBox, and instead use a batch script for your emulators to call OBS that way (so OBS only starts for emulators and not PC games). Then you would just use OBS for emulators and ShadowPlay for PC games.


Edit: For those wondering how I set mine up, I do not use the first method from above. I made a batch file "Emulator.bat" and point my emulators to it. The code for my batch file:
 

Spoiler

 


@ECHO OFF

::==================================================
:: Set File/Folder Paths
::==================================================

:: Set AutoHotkey path and script path
SET "ahk=path\to\AutoHotkey.ahk"
SET "ahk_emu=Emulator.ahk"

:: Set OBS Studio folder path
SET "obs=C:\Program Files\obs-studio\bin\64bit"
::==================================================

:: Get rom path, filename and extension
SET rompath=%1%
FOR %%F IN (%rompath%) DO SET rom=%%~nF
FOR %%F IN (%rompath%) DO SET ext=%%~xF

:: Get platform and remove double quotes
SET platform=%2%
SET platform=%platform:"=%

::==================================================
:: Set Emulator & ROM Paths
::==================================================

IF "%platform%" == "Game Boy Advance" (
    SET "emu=path\to\Visual Boy Advance.exe"
    SET "des=path\to\ROMs"
)

::==================================================
:: Start Programs
::==================================================

:: Start AutoHotkey
START "%ahk%" "%ahk_emu%" %platform%

:: Start OBS Studio
IF NOT "%platform%" == "Sega Genesis" (
    CD "%obs%"
    START "" "obs64.exe" --startreplaybuffer --minimize-to-tray
    TIMEOUT 2
)

::==================================================
:: Start Game
::==================================================

:: Start emulator and rom
START "%emu%" "%des%\%rom%\%rom%%ext%"

:: If error then exits
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

Then I made an "Emulator.ahk" AutoHotkey script with:
 


; Set platform
platform := %1%

; Exit Emulator
~$Esc::
    if (platform = "Game Boy" or platform = "Game Boy Color" or platform = "Game Boy Advance")
    {
        Send ^x
    }

    Process, Close, obs64.exe ; Exit OBS Studio
    ExitApp ; Exit AutoHotkey

The Emulator.bat calls Emulator.ahk and starts OBS Studio. Emulator.ahk exits OBS Studio when pressing Esc. Make sure to change the paths and customize it to your liking. For PC games, I use NVIDIA ShadowPlay instead for recording.

 

 

Edited by RedRaptor10
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...