Thursday, May 11, 2023

Controlling OBS using PowerPoint

Controlling OBS using PowerPoint with VBA code

This is a document in progress, mostly for me to remember how I did this, I'll update as I go.

This document explains how I make PowerPoint control OBS scenes.  It goes with this video

So in our church, we use PowerPoint, as slides are advanced for the service, to send commands to OBS to move the cameras (PTZoptics) and change the different scenes in OBS to reflect the scene we want.

In our building, we use 2 different computers, one for PowerPoint, one for OBS.

1> The first part was to install OBSwebsocket plugin into the OBS computer.  Pretty straight forward install, activate it and setup a password. 


WebSocket allows OBS to listen on port 4444 for commands from other devices.

2> Install OBSwebsocket plugin onto the PowerPoint computer.  This basically allows the .exe component of obswebsocket to be present to send remote commands via .bat files 

3> Create a PowerPoint document, create a VBA macro and paste the following code into it.  Here's a googledrive link to the basic code VBA script

4> Create .BAT files on the powerpoint computer with syntax similar to the following:

OBSCommand.exe /server=OBSipADDRESS:4444 /password="YOURpassWORD" /scene="SCENEnameEXACT Spelling"

Save this file something like 001.bat.   You can test this right now by running the .bat, you should see OBS change to the secene in you have selected.

5> In your PowerPoint Document put in the first line of the presenter notes the following:

cmd-001-000

6> Start your presentation, then activate the macro.  

7> Go to that slide, you should see the slide change

Now add more .bat files with different scene.  For example 002.bat

In your PowerPoint you can put 2 commands per slide

cmd-001-002

When you run this above command, OBS should goto the scene in your 001.bat file, then about 2 seconds later, goto the scene in 002.bat file.


;tl;dr at the bottom.

OBSwebsocket plugin running on OBS and on the PowerPoint computer 

PowerPoint with this VBA script

Create a PowerPoint and put in the presenter notes this:  cmd-000-000

Replace the 000 with names of for matching .bat files in the path.

No comments:

Post a Comment

Feel free to leave a comment! If you have any information that you think should be included, please do so here and I'll get it added in.