Resource icon

Non-OBS Script obs-pseudo-buffer 1.0

This is a set of scripts I came up with to mimic the nvidia shadowplay functionality using obs-studio for Linux as a workaround until saving the replay buffer is implemented.

Requirement: 'xdotool' is required for virtual keypresses. Look for it in your Linux distro's repository.

To use obs-pseudo-buffer, first run obs to set it up. In the output settings, the output file path should be the tmp directory (e.g. /tmp/obs). Once obs is configured and confirmed working, use ./obs-pseudo-buffer.sh to control it.

In ./obs-config.sh:
TMPDIR should be set to whatever output file path was set up in obs.
SAVEDIR should be set to the desired location for videos to be permanently saved.
BUF should be set to the amount of time (in minutes) to keep videos in TMPDIR before removing them.
SLEEP should be set to the max length of each video.
START should be set to the key configured to start recordings.
STOP should be set to the key configured to stop recordings.​


Usage: ./obs-pseudo-buffer.sh {start|save|stop|help}
start Starts obs-studio and begins the replay buffer.
save Saves the replay buffer to the configured directory.
stop Stops the replay buffer and obs-studio.
help Displays help for obs-pseudo-buffer.​

I like to set up a menu item to start obs-pseudo-buffer and then use a key (e.g. F8) to save the videos. To do this in openbox, first edit $HOME/.config/openbox/menu.xml and paste the following (correct the path to match your actual path):
Code:
<menu id="obs-menu" label="Open Broadcaster Software">
  <item label="Start">
    <action name="Execute">
      <command>$HOME/scripts/obs-pseudo-buffer/obs-pseudo-buffer.sh start</command>
    </action>
  </item>
  <item label="Stop">
    <action name="Execute">
      <command>$HOME/scripts/obs-pseudo-buffer/obs-pseudo-buffer.sh stop</command>
    </action>
  </item>
  <separator />
  <item label="Save">
    <action name="Execute">
      <command>$HOME/scripts/obs-pseudo-buffer/obs-pseudo-buffer.sh save</command>
    </action>
  </item>
</menu>

To save the videos by pressing a key, the command '/path/to/obs-pseudo-buffer.sh save' needs to be bound to a keypress event from within your window manager. In openbox, this is done by editing $HOME/.config/openbox/rc.xml and inserting the following inside the <keyboard> section (replacing the path to the script with your path):
Code:
  <keybind key="F8">
    <action name="Execute">
      <command>$HOME/scripts/obs-pseudo-buffer/obs-pseudo-buffer.sh save</command>
    </action>
  </keybind>
Author
Daniel Myers
Downloads
1,824
Views
1,824
First release
Last update
Rating
0.00 star(s) 0 ratings
Top