Resource icon

OBS Studio How to setup instant replay in OBS Studio

Videophile

Elgato
LtRoyalShrimp submitted a new resource:

How to setup instant replay in OBS Studio - This guide will show you how to create an instant replay feature.

Thanks to the hard work of volunteers on OBS Studio, it now includes the powerful functionality of scripting. More on that here.

This has enabled a very cool feature: Instant Replays.

This guide will go over how to setup an instant replay and get it working with your Stream Deck.


Requirements:
OBS Studio Update 21.xx.xx

---

1. Open the OBS Studio settings, go to output, and check the box "Enable Replay Buffer"
Set...

Read more about this resource...
 

Dregu

New Member
This is awesome, but sometimes you need non-instant replays, e.g. saving a bunch of hilights and showing them after the round is ended.

So I just added these features! I haven't tested this much, but there are now three hotkeys (Instant replay, Add replay to playlist, Clear playlist) and you need to add a vlc source in a separate scene if you want to use the playlist function. Instant replays can also be added to the playlist for later, and the playlist can be cleared automatically after shown. The instant replay media source is also cleared after shown, so it won't play again when changing scenes.

Download the updated script from github.
 

ikmyer

New Member
I set this up but when I hit "Ctrl+Shift+R" it does save the current replay but in the video source it plays the previously made replay.
Anyone else having this issue?
 

Dregu

New Member
I set this up but when I hit "Ctrl+Shift+R" it does save the current replay but in the video source it plays the previously made replay.
Anyone else having this issue?
Yes sometimes, and I think the code needs to be changed to wait for "get_last_replay" to actually change from the current value and not accept just any value thats != nil. I'll try implementing this in my gist sometime.

EDIT: My version works like I described now. No more old replays because obs took too long to save the file. It also starts instant replays a bit quicker, because I made the timer 100ms instead of 1000ms.
 
Last edited:

Dobrowney

New Member
Dregu could this be setup to pull High-Quality Highlights for say something like Youtube Highlight Videos or something like that. Also how far back does it rewind on the Recording .. Like If I hit that key for the replay would it record out the last min before the key was hit. Been looking for a option to pull highlights without having to go though vods and vods of videos.
 

DeejayQuest

New Member
Yes sometimes, and I think the code needs to be changed to wait for "get_last_replay" to actually change from the current value and not accept just any value thats != nil. I'll try implementing this in my gist sometime.

EDIT: My version works like I described now. No more old replays because obs took too long to save the file. It also starts instant replays a bit quicker, because I made the timer 100ms instead of 1000ms.

Hey Dregu, I got your version of the script working, and have it setup so that it runs in a different scene, triggered by the same hotkey combo as the instant replay. It works well, except that I can't get the file to loop. It plays once and then freezes. Any ideas? Thanks!
 

I3ordo

Member
so does this mean, we can have multiple replay files as the script looks for the alphabetically the latest file that contains "replay" or any other name you gave for the "suffix"?
 

nbtc971

New Member
Dregu's script doesn't appear to work any longer and is causing OBS to report a crash when you close the program. Just a heads up.
 

I3ordo

Member
I was wondering about that... the crashes were bareable as they were at the end but
today this happened:
1538428840925.png
this is my collection of scenes and components but there are dublicates everywhere..


tried to clean them but they dont disappear.

here is the log file..

ıt s too bad , i was just getting used to the "add to replay list" and other functionalities...
https://obsproject.com/logs/DVatdpB974WADnnN
 

Attachments

  • 1538428889406.png
    1538428889406.png
    53.5 KB · Views: 137

I3ordo

Member
when script is disabled, it crashes again but not anymore.

I Hope dregu fixes it, because i got used to it, i was using it in conjunction with the instant replay function.

heck i am still gonna use it , the crashes matter alot when you make a dublicat of your scene collections. If you are not adding scenes or subtracting them, you can enable it and bare with the crashes...
 

I3ordo

Member
Hey @Dregu , is there any chance of you looking back the script and fix the problem? I just need the add to replaylist feature which quite lacking in OBS
 

Ghastly

New Member
LtRoyalShrimp submitted a new resource:

How to setup instant replay in OBS Studio - This guide will show you how to create an instant replay feature.



Read more about this resource...
Is there a way for instant replay to work when I'm not streaming? I followed the instructions and everything works fin and the file is saved. But the problem is it just starts to stream on my Twitch when all I wanna do is capture an instant replay not stream... Is there a way I can not stream and still save replays???
 

vasqued2

New Member
@I3ordo, I've got the fix for the crashes when exiting and can take out the code prevents the VNC playlist from looping, but I haven't been able to recreate the duplicate scenes. If you can consistently recreate it, tell me the steps and I'll see what I can do.

To stop the crashes, go to line 326:

Change it from
obs.source_list_release(sources)
To
obs.source_list_release(msources)

And then add a new line
obs.source_list_release(vsources)

To enable looping, seach for this line (it appears 3 times)
obs.obs_data_set_bool(settings, "loop", false)
and change all 3 to
-- obs.obs_data_set_bool(settings, "loop", false)
 

Daniel Piazza

New Member
Scusate, c'è un modo di avere il replay in più scene? nel senso io devo fare delle dirette per partite di tennis e mi servirebbe un replay diverso dalla telecamera principale e quindi in un'altra scena. sapete come fare? OVVIAMENTE SENZA STREAM DECK
 

Watto_1

New Member
Is there an update to get this to work I have watched and read how to do it but it will not place the next file
 

BamaBreeze

New Member
I can't seem to get this to work with multiple cameras.

I'm running a Pinewood Derby and each heat will have a cam at the starting line, switch to trackside, and finally switch to the finish line. Would love for the replay to capture the entire sequence.

Am I doing it wrong, or can the code be tweaked to accomplish this?
 

hypnos97

New Member
I set this up but when I hit "Ctrl+Shift+R" it does save the current replay but in the video source it plays the previously made replay.
 
Top