Wednesday, February 19, 2025

Simple Replay built into OBS

This uses everything built right into OBS, no scripts.  

1 button to set an OUT point
2nd button goes back X seconds from OUT point and replaying at speed you set

1>    
Settings -> OUTPUT -> 
"Output Mode" -> Advanced


2>
Enable Replay Buffer.  Set for 10 seconds


3>
SETTINGS -> ADVANCED -> Recording

READ THIS CAREFULLY.  This is a spot that trips up configuration

By default, the settings "Filename Formatting" is set as:  %CCYY-%MM-%DD %hh-%mm-%ss

Replace with the word "Recording"


Click on "APPLY"

Please note.  If you record your stream, it will not timestamp that recording as default in the filename.  It will now just add a (X) after the name for each recoding.  This is necessary for the replay.

4>
HOTKEYS -> REPLAY BUFFER -> SAVE REPLAY

Set it for F9



Click Apply
Click "OK"

6>
Select "START REPLAY BUFFER"

    IF you get this pop up, just select YES


7>
Press your hotkey, "F9".  

The lower left of the OBS should give an indication if and where the recording is saved. 

8>
Create a new scene, I called mine "Instant Replay".  
This is the scene that is triggered to view the replay during a show.

9>
Set up a Media Source
I called mine "ReplayScene"


10>
Select browse and go to the location your replay is saved 




Select the file "Replay Recording" and click "OK"

11>  Make the following changes:

Disable "LOOP"
Enable "Restart playback when the source becomes active"
Disable "Show nothing when playback ends" (this is a personal preference.  with this disabled, and you come to the end of the 10 seconds, the video will pause automatically.   If enabled, a black screen appears.

-This is very important-
Enable "Close file when inactive" (if enabled it can lock the recording file out)

Speed = Whatever you like.  I set mine to 70%. This means the playback will be slower, playing 70% of a normal rate being 100%.


12>
Click on OK


15>
SETTINGS - HOTKEYS

Find the scene name you created, in our example it was called "Instant Replay"

Mine is set to F12



17>
Now, remember, this replay records the PROGRAM output.  So setup whatever video you want to replay, if its showing up on your program out window, that is what is recorded.

For the purposes of this demo, I've created a scene with a video that i used to test.



Now lets test it out!

OBS replay is going to record whatever is on your PROGRAM window.

So, make sure you have some video in that window that is moving so that you have a reference.
Make sure that your replay buffer is recording.

Now wait 10 seconds so that the replay buffer is full.

Press "F9"  - This sets an OUTpoint

NOW, press "F12" - This says "go back to the beginning of the replay"

Now make your "InstantReplay" scene live in program.  It should start playing automatically.

(To make the last step happen simultaneously (as in rewind replay and go live) make F12 a CUT as well in your hotkeys and it will do it all at once)



You should now see the 10 seconds that was saved playback, at 70% speed. 

When its done it will freeze, and you cut back to whatever camera you want.


One additional step.  When you are running a replay, it will play back the sound that was live as well.  So, turn down/mute your Audio Media Source during a replay.  Else you will hear program audio replay...sometimes at a really slow sounding speed.









Monday, February 3, 2025

Websockets using OBSCommand

Send commands to Websockets using OBScommander

So I'm using my goto program

obs-websocket - Remote-control OBS Studio using WebSockets | OBS Forums

Which generates the codes via a batch file in windows.

I got this solution running in 10 minutes

Situation:

Covering a sports event with OBS and need a clean feed (no graphics) sent to stadium LED wall but also a broadcast feed that has all my graphics.

To address this, the OBS switcher sends its output (no graphics) to the LED wall and also to a second OBS computer that does the overlays and also streams the video.

BUT

to add a bit of complexity, I want the score/clock graphics to be removed automatically when I key up an instant replay, so that stream viewers don't see that during replay.


1: So what I did was activate websockets on the graphics OBS, set a password.  I used "Password20"


2.  I setup two scenes
    
    One is called "Game" and this is the normal game.  Which contains the HDMI input from the switcher and the graphics overlay

The second one is called "Replay" which doesn't have any graphics, just the HDMI input


Now I installed 
obs-websocket - Remote-control OBS Studio using WebSockets | OBS Forums

(at time of writing it was version 5.0.1)

I also installed had to install the .Net 3.1 runtime for 
Download .NET Core 3.1 Runtime

There were a couple to select form Run console apps

Once that was installed I created 2 .BAT files in the directory that I extracted websockets remote control directory.  In my case, I put it in C:\OBSCommand_1.6.3


Using notepad I created 2 files.  

graphic-off.bat   contains this:

OBSCommand.exe /server=IPofGraphicsOBS:4455 /password="Password20" /scene="Replay"

graphic-on.bat   contains this:

OBSCommand.exe /server=IPofGraphicsOBS:4455 /password="Password20" /scene="Game"



4.
Now on my OBS instance running as a switcher, I installed 
Advanced Scene Switcher

This program does a bunch of tasks with OBS, but one of the ones I really like is that it can be used to detect when I trigger the instant replay scene, and send an approriate command to the graphics computer to turn the graphics on or off.

Once you install it, go into that OBS instance and we'll configure it.  On my switcher I have 2 camera inputs and a Replay input from our instant replay machine.


I started up Advanced Scene Switcher to make it active


On the Macro tab I created a new macro and this is what the configuration is:

The first macro, when it detects that the "Instant Replay" scene is live, will run the "graphics-off.bat" file, which will tell the graphics computer to switch to the scene with no graphics.




Then created a second one, this time we select "IF NOT" in the first section.
This says "if the active output is NOT instant replay, send a command to turn the graphics back on."



Now you can toggle back and forth between your scenes and graphics will turn on  and off.



Friday, January 31, 2025

Send commands to another OBS via Websockets

Why is there such poorly written non sensical information on how this thing works with its command structure.  Not that this document is any better, but I'll put what I know to make this work.

What I need is to use Advanced Scene Switcher to detect specific scenes are active, then send a command from one OBS, to another OBS computer using Websockets to deploy specific graphics.

For relevance of this description OBS 1 is the switcher and is sending video to OBS 2, the graphics machine.

I'm using Advanced Scene Switcher to monitor and detect for specific scenes to be active and then send web sockets to the other OBS when it detects it as active. 

Steps:

Make Websockets is active in your Second OBS.  Set a password and check the enable box.



In first OBS, create a macro in Advance Scene Switcher.

In this example, when first obs activates the "Replay" scene, Avance Scene Switcher detects this and will send a command to the second OBS machine to change to a scene on it caled "Replay" on that system.

This is what it looks like


This is the code that I used above if you want to copy / paste it.

You can change the word "Replay" in the code example to be one of your scenes on your SECOND obs. The request ID can be anything.  Its needed, but a debug purposes.

{
"op": 6,
"d": {
"requestType": "SetCurrentProgramScene",
"requestId": "12345",
"requestData": {
"sceneName": "Replay"
}
}
}

You can see that its sending the command to the Graphics Computer and in the icon when you add this feature you need to setup a connection.  This is what mine looks like.


Assuming you have activated the Websockets server in OBS on your second computer that will receive this commands, you should see "Connected and authenticated" displayed when you test the connection.


Monday, January 20, 2025

IIS upload file size

 "The page was not displayed because the request entity is too large"

Having an issue with uploading larger files to your IIS site?  There are a few posts about modifying the webapps/manager/web-info/web.xml in tomcat etc.


But this fixed my issue

Launch IIS Manager

Double click on your "Default Web Site" in the connections window and then double click on "Request Filtering"

on the right side select "Edit Feature Settings"

Then in "Request limits" set the byte count for the max size you want to upload in the 
"maximum allowed content length"