Skip to content

Adds Nvidia Shadowplay-like functionality to OBS Replay Buffer

Notifications You must be signed in to change notification settings

myssto/OBSReplayBufferXtender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OBSReplayBufferXtender

This is an OBS Python script that automatically renames video files generated by the Replay Buffer based on the window in focus when they are created using the win32api. Attempts to emulate the file naming conventions of Nvidia Shadowplay as closely as possible! This can be combined with OBSNotifier to create an experience that closely resembles Nvidia Shadowplay.

fig1

At this time this script has only been tested on Windows 10 with Python 3.11.4, and OBS Version 29.1.3

Installation

Requirements

Installation

Download the latest release of ReplayBufferXtender, and move ReplayBufferXtender.py to {obs_install}\data\obs-plugins\frontend-tools\scripts

Verify that pywin32 and psutil are installed. If they are not, this script will fail to load. Open any terminal and use python -m pip freeze | grep -E "pywin32|psutil". If the output of this is nothing or just one of the two, use python -m pip install --user pywin32 psutil. Once finished, run the previous command again to verify installation. If you are still having issues, verify that Python is installed correctly and added to Path.

If you have never installed a python script with OBS, follow their Getting Started With OBS Scripting guide, under the "Scripts management window" section. You will need to point OBS to the path of your Python install directory via the scripts menu. If you do not know where your Python install is located, open any terminal and use python -c "import sys; print(sys.path)", which will print the current python executable paths.

Finally, open OBS, navigate to Tools > Scripts, click the + button, and select ReplayBufferXtender.py. The script is initialized upon adding, so you can now configure the settings and use as you wish!

Options

Base Save Path

Defaulted to nothing, this path option must be a directory. By default, OBS will save videos generated by the Replay Buffer to the path specified at Settings > Output > Recording > Recording Path. Specifying a path to this option will override this for Replay Buffer videos only, effectively allowing you to create a custom path for clips but keep regular recordings sepperate.

Prepend Window Name

Defaulted to true. By default, OBS names videos generated by the Replay Buffer with the format Replay {date} {timestamp}.{ext}. Toggling this setting on will replace the "Replay" text with the name of the subdirectory it will be placed into, which is the name of the window in focus. This is a default behavior of Nvidia Shadowplay

Use Windowsapps for Unknown Programs

Defaulted to true. By default, in the event that the script cannot find a window in focus (for example if you invoke the Replay Buffer while focused on the Desktop), the script will place the replay file into {save_path}\Windowsapps. If toggled off, the script will instead leave the file in the base save path and not move it into a subdirectory. This is a default behavior of Nvidia Shadowplay.

Behavior

Platform Support

Due to the obvious constraint created by using the win32api, this script currently only supports Windows platforms. In the future this may change, but for now I have no plans to adjust the implementation to be cross-platform.

Hotkey Based

This script will move video files immediately upon creation. This means that saving with the Replay Buffer from the OBS Client using the Save Replay Buffer button will likely always be placed into {base_save_path}\OBS\. This script is intended to be used with a hotkey set to Save Replay Buffer. It is worth noting that the script will use the name of the window in focus when the video file is created, not when the hotkey is pressed. If your Replay Buffer file size is large, you may notice inconsistencies when using the hotkey, and then immediately shifting window focus (i.e. Alt + Tab).

Questions

If you need any support installing or troubleshooting this script, or have a feature request, please feel free to open an issue here, or message me on Discord @myssto. All I ask is that you firstly use common sense problem solving, and check the OBS Script Log to determine any obvious issues first. If you do reach out, please provide any relevant information like OBS version, Python version, your script settings, any errors in the script log, etc. Simply asking "Help, {x} won't work!" will be ignored.

About

Adds Nvidia Shadowplay-like functionality to OBS Replay Buffer

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages