GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - StartAutomating/obs-powershell: Script OBS with PowerShell

BranchesTags
Open more actions menu

Latest commit

 

History

7,738 Commits
7,738 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
Assets
Assets
 
 
Build
Build
 
 
Commands
Commands
 
 
Effects
Effects
 
 
Formatting
Formatting
 
 
Shaders
Shaders
 
 
Types
Types
 
 
docs
docs
 
 
en-us
en-us
 
 
.gitmodules
.gitmodules
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README.ps1.md
README.ps1.md
 
 
allcommands.ps1
allcommands.ps1
 
 
obs-powershell-Help.xml
obs-powershell-Help.xml
 
 
obs-powershell.format.ps1xml
obs-powershell.format.ps1xml
 
 
obs-powershell.ps.psd1
obs-powershell.ps.psd1
 
 
obs-powershell.ps.psm1
obs-powershell.ps.psm1
 
 
obs-powershell.psd1
obs-powershell.psd1
 
 
obs-powershell.psm1
obs-powershell.psm1
 
 
obs-powershell.tests.ps1
obs-powershell.tests.ps1
 
 
obs-powershell.types.ps1xml
obs-powershell.types.ps1xml
 
 

Repository files navigation

obs-powershell is a PowerShell module that lets you script Open Broadcast Studio.

Getting Started

Installing and importing

obs-powershell is available on the PowerShell gallery, so you can use these two simple lines to install / import

Install-Module obs-powershell -Scope CurrentUser -Force
Import-Module obs-powershell -PassThru -Force

Getting Connected

Before you can use obs-powershell, you'll need to Connect-OBS.

You should only need to do this once: obs-powershell will cache this information.

You can find your WebSocketToken in obs studio in Tools -> WebSocket Server Settings -> Show Connect Info.

Copy the Server Password and set it into a variable, $myToken

Connect-OBS -WebSocketToken $myToken

After you've done this once, obs-powershell will attempt to connect every time the module is loaded.

A Quick Example

Once you're connected, check out this nifty short sample of what you can do:

# Show-OBS lets you show all sorts of things.
# It will return a scene item.
$Stars = Show-OBS -Uri "https://pssvg.start-automating.com/Examples/Stars.svg"
Start-Sleep -Milliseconds 50
# We can .Hide/.Disable scene items
$Stars.Hide()
Start-Sleep -Milliseconds 50
# We can .Show/.Enable scene items
$Stars.Show()
Start-Sleep -Milliseconds 50
# We can make an item small
$Stars.Scale(0.1)
Start-Sleep -Milliseconds 50
# We can fit it to the screen
$stars.FitToScreen()
Start-Sleep -Milliseconds 50
# and we can make it big again, with an animation
$Stars.Scale("1%","100%","00:00:01")
Start-Sleep -Seconds 1

# We can do even more broad animations, like moving things across the screen.
$Stars.Animate(@{
    X = "-25%"
    Y = "50%"
    Scale = "20%"
}, @{
    X = "125%"
    Y = "50%"
    Scale = "50%"
    Rotation = 180
}, "00:00:05")
Start-Sleep -Seconds 1

# To see what any object can do in obs-powershell, run Get-Member.
$stars | Get-Member

OBS-PowerShell Effects

obs-powershell gives you the ability to store and create effects that run over time.

For instance, we can FadeIn our stars

# Start the FadeIn effect on 'Stars.svg'
$Stars | Start-OBSEffect -EffectName "FadeIn"
Start-sleep -seconds 1

# Start the FadeOut effect on 'Stars.svg'
$Stars | Start-OBSEffect -EffectName "FadeOut"
Start-sleep -seconds 1

# Start the Colorloop effect on 'Stars.svg'
$Stars | Start-OBSEffect -EffectName "ColorLoop"
Start-sleep -seconds 1

# You can get all loaded effects with Get-OBSEffect
Get-OBSEffect

Examples

Getting all scenes

Get-OBSScene

Getting all inputs

Get-OBSInput

Getting OBS Stats

Get-OBSStats

Getting all kinds of available inputs

Get-OBSInputKind

Getting all monitors

Get-OBSMonitor

Getting Recording Status

Get-OBSRecordStatus

Starting Recording

Start-Recording # an alias to Start-OBSRecord 

Stopping Recording

Stop-Recording # an alias to Stop-OBSRecord

Start Recording, Wait 5 seconds, Stop Recording, and Play the Recording.

Start-OBSRecord

Start-Sleep -Seconds 5

Stop-OBSRecord |
    Invoke-Item

Enabling all sources in all scenes

Get-OBSScene |
    Select-Object -ExpandProperty Scene
    Get-OBSSceneItem |
    Set-OBSSceneItemEnabled -sceneItemEnabled

Disabling all sources in all scenes

Get-OBSScene |
    Select-Object -ExpandProperty Scene
    Get-OBSSceneItem |
    Set-OBSSceneItemEnabled -sceneItemEnabled:$false

How it Works

obs-powershell communicates with OBS with the obs websocket.

obs-powershell has a command for every websocket request.

Because the obs-websocket cleanly documents it's protocol, most commands in obs-powershell are automatically generated with PipeScript.

  • Full List Of Commands
  • Full list of websocket commands

Depdendencies

To use obs-powershell, you'll need OBS and PowerShell Core. You can run both of these on any operating system.

Specific Command Requirements

Some commands in obs-powershell will not work unless you have additional software installed.

Commands Dependency
Add/Set-OBSVLCSource VLC
Add/Set-OBS3DFilter 3D Effect
Add/Set-OBSShaderFilter obs-shaderfilter 2.0+
Add/Set/Get-OBSWaveformSource waveform source

About

Script OBS with PowerShell

obs-powershell.start-automating.com

Topics

obsobs-studioobs-websocketopenbroadcasteropenbroadcastersoftwarepowershellpowershell-modulewebsocketwebsocket-client

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

88 stars

Watchers

4 watching

Forks

3 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.