# Instant Replay



## adocilesloth (Oct 22, 2017)

adocilesloth submitted a new resource:

Instant Replay - Plugin to facilitate Instant Replays in live streams

*Instant Replay OBS Studio*
This plugin is designed to provide the ability to add Instant Replays into a live stream.
It's effectively a combination of the "Automatic Scene Switching" and "Per Scene Volume" (from OBS Classic) plugins to allow instant replays in live streams.

It's designed to work along side a Stinger Transition, but it will function with cuts or fades or what have you.

*An example:*





*Settings (Tools -> Instant Replay Settings):*





Fill out the settings as desired.

Enable - Enables/disable the plugins
Write Pause (s) - Pause to allow OBS to write the replay file. OBS can't instantly write a file. ~10 seconds should be okay. Find something that works for you
Transition Pause (ms) - Length of the transition in milliseconds. If the stinger is at 30fps, multiply the number of frames by 33. If the stinger is at 60fps, multiply the number of frames by 16.
Replay Length (s) - Length of the replay in seconds. OBS does not always write as much replay as you tell it to so this may need to be a second or two shorter than the buffer length.
Replay Scene - Scene to switch to that has the replay source.
Mute Desktop Audio - Mute the Desktop Audio channels when replay is playing.
Mute Mic/Aux - Mute the Mic/Aux channels when replay is playing.

Hotkey (Settings -> Hotkeys):



Find the "Instant Replay" hotkey (highlighted above in red). Set it *TO THE SAME KEY* as you have "Save Replay" (highlighted in orange).

*Setting up the replay source:*
Set your Recording to a constant name (so remove all the % stuff). Makes it easy to point your replay source to a file that will exist. Point your Media Source to what your replay will be saved as.

*Installation
+WINDOWS*
Windows is built and working for both 32bit and 64bit

Drag and drop obs-studio folder into C:\Program Files
(or wher ever you have obs-studio installed)
Merge all files down and you should be good to go.

*+LINUX*
Dependancies:
OBS (duh)
Qt5 dev

Clone the git repo:

```
git clone https://github.com/adocilesloth/InstantReplay.git
```
 
cd to where you downloaded the source

Check the environment PATHS in Makefile
- Make sure they match your OBS and Qt5 installations and fix if necessary.
  (OBS_API_INCLUDE will not need updating as the files are in the git repo)

Then run:

```
make
make install
make clean (optional: if you want to remove the temporary .o and .so files)
```

*+MAC*
Uh, sould work. Probably. Maybe. Don't have a MAC to test with.
So...
You can try the LINUX instructions.
Let me know if you get it to work!

As ever, if you want to see how bad my coding is, source code is available on GitHub

Read more about this resource...


----------



## Shaky Scrub (Oct 27, 2017)

I seem to be having issues with this. When my scene transitions to the Replay scene, the replay media source is paused or frozen. It doesn't show it playing. I tried the Stringer transition but I get the same result. Any ideas what i'm missing here?


----------



## adocilesloth (Oct 27, 2017)

Shaky Scrub said:


> I seem to be having issues with this. When my scene transitions to the Replay scene, the replay media source is paused or frozen. It doesn't show it playing. I tried the Stringer transition but I get the same result. Any ideas what i'm missing here?


Is your Media Source set to "Restart Playback when source becomes active"?
Might also help to have it set to "Close file when inactive" to prevent overwrite issues.


----------



## VonGrimm (Oct 29, 2017)

adocilesloth said:


> Is your Media Source set to "Restart Playback when source becomes active"?
> Might also help to have it set to "Close file when inactive" to prevent overwrite issues.



I too am having this same issue. Tried applying those settings you suggested to the Media Source but to no avail. Refreshing the scene manually does not allow playback either. I have to refresh the source for playback to play the newest overwritten file. Obviously this is an OBS issue and not because of your plugin.


----------



## Methanoid (Nov 18, 2017)

Great addon, got it working with playback np, only issue i have is that when the replay is being played back my desktop sound gets muted during replay playback and resumes once the replay is complete (the recording is muted, the actual desktop volumes fine).  I currently have the replay's audio muted as i dont want overlapping sound.

Any ideas why the replay mutes my desktop sound?


----------



## adocilesloth (Nov 18, 2017)

Methanoid said:


> Any ideas why the replay mutes my desktop sound?


Yes. That is what the plugin is designed to do. Mute the desktop and mic when the replay plays so you hear the replay without overlapping sound. So it's doing what you are trying to do but the other way around.

I realise now that I didn't make this clear in the OP. I will fix it when I have time.


----------



## Methanoid (Nov 19, 2017)

can it be a toggle for either way, if the addon had a choice of your intended way and another for "mute playback audio" to audio that would be great esp as i prefer having my replay silent so my music and current game arent interrupted or repeated in the case of music.  now i just have to cure the issue of immense onscreen lag on the recordings onscreen playback even tho actual gameplay is perfect.  (Fixed lag by not using MP4 to encode)


----------



## StreamRoSS (Nov 22, 2017)

Why don't I have an item Save Replay?


----------



## Methanoid (Nov 22, 2017)

StreamRoSS said:


> Why don't I have an item Save Replay?



i get what you mean, i have 2 pc's, both are windows 8.1 x64, almost identical software setup, install paths are the same, only the cpu's are really different, one is an intel i7 4720HQ, the other is an intel i7 4770S, on the 4720HQ system the plugin shows up perfectly, on the 4770S the plugin does not register, im not sure why atm.

Also i kinda really hope for the option to have the replay vid be the muted audio and not the desktop audio to be a thing, ive been using this for gaming and things get confusing when the replay repeats the music and voice comms.


----------



## adocilesloth (Nov 22, 2017)

StreamRoSS said:


> Why don't I have an item Save Replay?


Make sure that the Replay Buffer is enabled: Settings -> Output -> Recording -> Enable Replay Buffer



Methanoid said:


> can it be a toggle for either way, if the addon had a choice of your intended way and another for "mute playback audio" to audio that would be great esp as i prefer having my replay silent so my music and current game arent interrupted or repeated in the case of music.  now i just have to cure the issue of immense onscreen lag on the recordings onscreen playback even tho actual gameplay is perfect.  (Fixed lag by not using MP4 to encode)





Methanoid said:


> Also i kinda really hope for the option to have the replay vid be the muted audio and not the desktop audio to be a thing, ive been using this for gaming and things get confusing when the replay repeats the music and voice comms.


If I get some time, I'll have a look.


----------



## Edde Dre (Nov 24, 2017)

Is there any future plans to allow it to capture a certain source instead of the entire Active Scene?


----------



## david-1984 (Nov 25, 2017)

I don't understand what it does more than the normal functionality. can you explain?


----------



## adocilesloth (Nov 25, 2017)

Edde Dre said:


> Is there any future plans to allow it to capture a certain source instead of the entire Active Scene?


The plugin doesn't capture anything, it just switches scenes and mutes/unmutes audio.



david-1984 said:


> I don't understand what it does more than the normal functionality. can you explain?


It's a quality of life thing more than an added functionality thing.

With this plugin, you press one button, it saves a replay, waits for the replay file to be written, switches to a scene with the replay as a source, mutes the desktop and mic audio, plays the replay then switches back and unmutes the desktop and mic.

Without out it, you'd have to save the replay, wait for a bit, press a hotkey to switch scenes, press a hotkey to mute the desktop and mic, wait and hope you have left it long enough to show the whole replay, press a hotkey to switch scenes back and press another hotkey to unmute the desktop and mic.

So the plugin is a kind of fire and forget plugin. You hit one button and it deals with all the scenes and audio settings so you can continue playing or what ever. Without it, you have to remember to press all the hotkeys at the right time while also doing what ever you were doing.


----------



## david-1984 (Nov 25, 2017)

oh ok! good job!


----------



## OGLordBlight (Dec 18, 2017)

Works great! Thanks for making this!


----------



## adocilesloth (Dec 19, 2017)

adocilesloth updated Instant Replay with a new update entry:

Choose what to mute



> This updates adds the ability to chose whether or not to mute the Desktop Audio and/or Mic/Aux channels. So it's no longer forced on you. The options are under Tools -> Instant Replay



Read the rest of this update entry...


----------



## david-1984 (Dec 21, 2017)

this is a very good tool but I think 1 important thing is missing.
you are forced to over wright all the replay. What about if you would want to avoid it?
you should tell the system to take the latest replay always and not a fixed name. would it be possible?


----------



## xip (Feb 7, 2018)

32bit shown, 64bit not shown

17:05:56.829: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/chrome_elf.dll' not found, loading of module failed
17:05:56.834: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
17:05:58.746: [AMF] <obs_module_load> AMF not supported (no AMD graphics)
17:05:58.747: Failed to initialize module 'enc-amf.dll'
17:05:58.772: LoadLibrary failed for '../../obs-plugins/64bit/InstantReplay.dll': (null) (126)
17:05:58.773: Module '../../obs-plugins/64bit/InstantReplay.dll' not loaded
17:05:58.815: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libcef.dll' not found, loading of module failed
17:05:58.816: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libEGL.dll' not found, loading of module failed
17:05:58.818: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libGLESv2.dll' not found, loading of module failed
17:05:58.819: Failed to load 'en-US' text for module: 'obs-browser.dll'
17:05:58.819: [browser_source: 'Version: 1.29.0']
17:05:58.826: LoadLibrary failed for 'nvEncodeAPI64.dll': (null) (126)
17:05:59.345: VLC found, VLC video source enabled
17:05:59.357: No blackmagic support
17:05:59.995: [Media Foundation encoder]: plugin is disabled for performance reasons on Windows versions prior to 8


----------



## sedris (Mar 11, 2018)

I have sime issues with your plugin after updating to OBS 21.0.1, it has worked before. First replay is played whole, but then it plays incorrect fragment of the buffer. Buffer is being overwritten correctly. Is plugin compatible with newer version?


----------



## adocilesloth (Mar 11, 2018)

It's working fine for me so as far as I know it's compatible with 21.0.1. Try increasing the time before your replay is played, it might be that the buffer isn't fully saved (I know you said it is, but worth checking).


----------



## sedris (Mar 11, 2018)

Thank you for your answer.
As I understand the replay should show me 10 second back ( with my settings) from the moment of pressing a button.
 
Meanwhile It shows me video from 15th to 5th second of the buffer, when 0 is time of pressing the button.
Do you have any idea how to make it work correctly? In my case it's important, I need to show exact moment of scoring a point on a replay.


----------



## adocilesloth (Mar 12, 2018)

Ah, this may be me being bad at explaining how this works.

This plugin doesn't actually do the replay buffer side of things, that's dealt with by the default OBS replay buffer. What this plugin does is the following:

Your button/hotkey is pressed (it should be the same as the one you use to save replays if you don't have the plugin enabled)
Nothing happens for "Write Pause" time.
The scene is switched to "Replay Scene". The desktop and mic are muted if the option is selected.
After "Replay length" - "Transition Pause" the scene is switched back to the original scene. The desktop and mic are unmuted if the option is selected.

Note, it never triggers the replay to be saved.

You have to set up the replay as you would normally. I can't remember exactly where it is (and I'm not at my PC to check) but it should be something like "Output - Recording". Possibly an "advanced" in there somewhere.

Hopefully that explains it better. If that wasn't your problem then I will have to think some more.

As to why it's saving the replay from after when you press the button, I have no idea. Perhaps you could post a screenshot of OBS when it's recording/streaming the way you have it when you are trying to do the instant replays (the main window and the replay buffer options window). Maybe that will show something.


----------



## sedris (Mar 17, 2018)

Hopefully this will  show you what I mean. 

https://we.tl/BCsXM69pW1 
There are six files in the link attached. Marked - 9, 10, 12, 13, 14, 16 seconds.

In each case, to save the replay, I pressed the key (in my case F4) at the moment when the seconds hand was at 12 o'clock.

In each case, however, the replay showed a different fragment of time back (see it in the videos). In my opinion, according to my settings, the replay should show 10 seconds back, and it was only in two cases (9_sec and 10_sec videos)

Is it possible to set it up so that the replay works the same way every time? So it showed the same number of seconds back from the moment of pressing the key? (for me F4)

I am also attaching my settings. Thank you for your help.


----------



## adocilesloth (Mar 17, 2018)

The plugin looks like it's doing what it is supposed to do and what you have it set up to do. As I said, it is not in control of the replay buffer, it just switches scenes. There is nothing I can do on my end to make sure the replay saves the same amount of time each time.

The only thing I can think of is how long you have the replay set to save. Is it set to 10sec under Settings -> Output -> Replay Buffer ?


----------



## The Scro MX (Mar 18, 2018)

Hello, I contact you because I currently have a problem.

I had installed the Front Plugin. But I had to reinstall my Computer due to a problem with the System.

Except that when I reinstall the plugin in Obs. In the Tools Sections, I'm no longer the Replay Window.

I am currently on the latest versions of OBS and I download the Plugin via the OBS site.

I did a Copy paste folder.

I rebooted the computer.

But nothing to make the window in OBS that its 32 or 64 bits did not apap.

what to do please because this is a major part of my stream.


----------



## adocilesloth (Mar 18, 2018)

The Scro MX said:


> Hello, I contact you because I currently have a problem.
> ...
> what to do please because this is a major part of my stream.



It sounds like you have the .dlls in the wrong folder.
Do you have a log file (don't need a stream or recording attempt)? It will show if the .dlls are in the right place.


----------



## The Scro MX (Mar 18, 2018)

Voici le fichier journal: https://gist.github.com/633fa8cbee1c255e0bb7c9e4110a20bb


----------



## adocilesloth (Mar 18, 2018)

Thanks. OBS is finding a .dll in the right place but it's not loading it. I'm not entirely sure why.

You could try re-downloading the plugin in case the download was an issue (but I doubt it).
There are some run time things that may be causing it (after a very quick google). You may need to install the  MSVC 2015 redistributable: https://www.microsoft.com/en-us/download/details.aspx?id=48145

I'll have a better look tomorrow evening if one of these doesn't work.


----------



## Quenaros (May 6, 2018)

I don't get how to catch the correct videofile. In the Media Source I have to specify the videofile I want to play. But every time I save the replay Buffer it is a generated file name with Date and Timestamp.

 So it is no fire and forget solution for me. I have to change the video file in the media source first. How do you guys handle this problem?


----------



## adocilesloth (May 6, 2018)

You need to remove all the time dependent stuff from the name of the recording like it says in the OP:



adocilesloth said:


> *Setting up the replay source:*
> Set your Recording to a constant name (so remove all the % stuff). Makes it easy to point your replay source to a file that will exist. Point your Media Source to what your replay will be saved as.


----------



## Quenaros (May 6, 2018)

Thanks found it. Didnt realize it ist in the advanced and not in the output settings


----------



## TheCyberQuake (May 15, 2018)

Started playing with this, and it's great.
Set the replay buffer to 10 seconds, set the delay to 3, and then changed the media play speed to 60%.
After that I just added a small intro vid to cover up the occasional beginning buffer glitch that this seems to have, and set the replay time in the plugin to 14 which also cuts a bit off the end.
Have it set to Close source file when inactive and Restart playback when source becomes active
Here's a small demo vid I made using the feature
https://youtu.be/u_bqgrydVXg


----------



## RandomVillain (Jun 19, 2018)

Do you have to stop and start recording between replays? I game stream for hours on end and never know when I need a replay so I just set it to record and it will replay the first one but if I try to do another replay later it just shows the same one from before.


----------



## adocilesloth (Jun 19, 2018)

RandomVillain said:


> Do you have to stop and start recording between replays? I game stream for hours on end and never know when I need a replay so I just set it to record and it will replay the first one but if I try to do another replay later it just shows the same one from before.


No. It should pick up the latest one. Try increasing the write pause and see if that helps.


----------



## kubo6472 (Jul 25, 2018)

Okay, maybe I am silly, but how to exactly set this up ? I created new scene with name replay and set up the hotkeys. The rest is unclear for me. Some media source... okay, what file to point that media source to ?


----------



## adocilesloth (Jul 28, 2018)

kubo6472 said:


> Okay, maybe I am silly, but how to exactly set this up ? I created new scene with name replay and set up the hotkeys. The rest is unclear for me. Some media source... okay, what file to point that media source to ?


You point it to the file made by the Replay Buffer. (Settings -> Advanced -> Recording).
For the name of the recording file, you will need to remove all the % signs or the name is not the same each time.


----------



## JS Creators (Jan 18, 2020)

adocilesloth said:


> The plugin doesn't capture anything, it just switches scenes and mutes/unmutes audio.
> 
> 
> It's a quality of life thing more than an added functionality thing.
> ...


Do u have a demo video on this?  if, yes then please share


----------



## adocilesloth (Jan 18, 2020)

JS Creators said:


> Do u have a demo video on this?  if, yes then please share


There is one in the OP


----------



## ded_12 (Oct 11, 2020)

Привет, отличный плагин. Можно ли сделать так, чтобы каждый повтор сохранялся в отдельном файле, чтобы потом можно было сделать отдельный ролик из интересных моментов?


----------



## Dreamcast88 (May 25, 2021)

Sorry dude, but this isn't working as expected. I attach a screenshot and text from the terminal.


----------



## adocilesloth (May 25, 2021)

Dreamcast88 said:


> Sorry dude, but this isn't working as expected. I attach a screenshot and text from the terminal.


You need to check the paths for QT_INCLUDE in the Makefile match the location in your system. It can't find one of the QT header fileswhen you run 'make':

```
InstantReplay_callout.h:3:10: fatal error: QtWidgets/QDialog: Нет такого файла или каталога
```

Probably also worth checking QT_LIB in the Makefile is correct too.


----------



## reznov0ps143 (Jan 6, 2022)

adocilesloth said:


> Is your Media Source set to "Restart Playback when source becomes active"?
> Might also help to have it set to "Close file when inactive" to prevent overwrite issues.


THANK YOU GOOD SIR! THIS HELPED ME!


----------



## Garbanian (Feb 5, 2022)

Okay so I cant seem to get this working correctly. I can get the replay video to save correctly and thats about it. The scenes never change (Replay is the name used for the scene, and for the the Replay Scene option in Instant Replay settings) I have to manually change scenes, play the file and change back. What could be wrong?


----------



## Garbanian (Feb 5, 2022)

Garbanian said:


> Okay so I cant seem to get this working correctly. I can get the replay video to save correctly and thats about it. The scenes never change (Replay is the name used for the scene, and for the the Replay Scene option in Instant Replay settings) I have to manually change scenes, play the file and change back. What could be wrong?




Okay, reinstall, reboot and all is well


----------



## DarkWolf80s (Sep 14, 2022)

Any chance this beautiful plug-in to get updated for OBS 28? Thanks in advance.


----------



## adocilesloth (Oct 5, 2022)

adocilesloth updated Instant Replay with a new update entry:

OBS 28 Compatability



> Updated builds for the OBS 28 update to fix conflicts with the QT version. Includes binaries for Windows and Ubuntu 22. For Ubuntu 22, drag and drop obs-studio folder into ~/.config Merge all files down and you should be good to go.



Read the rest of this update entry...


----------



## DarkWolf80s (Oct 6, 2022)

adocilesloth said:


> adocilesloth updated Instant Replay with a new update entry:
> 
> OBS 28 Compatability
> 
> ...


This is fantastic! OK in that case, whoever is responsible in updating this thing here should change it's status https://obsproject.com/kb/obs-studio-28-plugin-compatibility
because the status on that page hasn't changed at all in a long time. Unless, there is a different status page that is constantly updated with all the plug-ins for OBS and scripts.


----------



## Popup (Nov 10, 2022)

Hi!

I´m still running 27.2.4 and do not want to upgrade during the sports seson, is the version 1.1.0 in history the last version working with 27.x.x or where can I find the latest version supporting 27.x.x? I tried to find newer version on Github but could not find anything.

BR
Thomas


----------



## adocilesloth (Nov 11, 2022)

Popup said:


> Hi!
> 
> I´m still running 27.2.4 and do not want to upgrade during the sports seson, is the version 1.1.0 in history the last version working with 27.x.x or where can I find the latest version supporting 27.x.x? I tried to find newer version on Github but could not find anything.
> 
> ...


Yep, 1.1.0 is the latest version for pre-28 OBS versions.


----------

