Code Monkey home page Code Monkey logo

osc-for-obs's Introduction

OSC for OBS

Control and listen to OBS via OSC protocol

OSCforOBS copySmall

Setup

Requires: obs-websocket plugin v5.0 and above (This is included in OBS v28)

Screen Shot 2021-11-21 at 4 17 23 PM

-Make sure you place the application in a folder with permissions to read and write:

  • If on Mac: Place OSC for OBS in Applications folder
  • If on PC: Place OSC for OBS in a root folder such as C:/
  • Configure the input fields
  • Successfully "Connect"
  • The window will open a "DevTools" window
    • Make sure it's on the "Console" tab, not "Elements"
  • In the "Console" tab it will log IP and Port info, the number of available scenes, and a list of all scenes with numbers
    • This can be used as an index argument in your /scene OSC message
  • To save a config file with "Save As" please "Connect" first
  • When you close OSC for OBS it will save your configuration for when you open next
  • There is an option in 'File > Automatically Connect on Startup' that if enabled will automatically connect on opening OSC for OBS

Application OSC -> OSC for OBS

  • In your OSC Application (QLab for example) patch your targeted OSC to match the "OSC IN" inputs on OSC for OBS.
    • default is... IP: 127.0.0.1, Port: 3333
  • DO NOT Use UNDERSCORES in OBS. Only use them in your OSC Address. So, If your OBS Scene or Source name contains a SPACE, then in your OSC message replace the SPACE with an UNDERSCORE.
    • Example: if OBS Scene name is Scene 1, then your OSC address should use Scene_1.
      • Note: If OBS names contain UNDERSCORES this will not work.
  • OSC for OBS can be used for any application that transmits and/or receives unbundled OSC.
    • This was designed with QLab, so the example show file of all the OSC commands is available in Assets on the Github or in the downloaded folder: "Qlab OBSosc Examples.qlab4"
      • Note: Sending OSC Commands requires a paid version of Qlab.

OSC Command List:

Note: a space in the notated syntax indicates the separation between address and argument's

Example: /scene "Scene 1" would be...

address argument 1 argument 2 argument ect...
/scene Scene 1

- Trigger Scenes: -

by Name in Argument

/scene [scene name]

  • activate a scene by name in the OSC argument.
    • Example: /scene Wide will activate a scene named "Wide" in OBS.
    • Note: SPACES will work ok for this format, so /scene Webcam 1 is valid syntax
    • In QLab you can use quotations to wrap into a single argument: /scene "Webcam 1"

by Index as Scene

/scene [index number]

  • activate a scene with the index associated from the logged list.
    • Example: /scene 1 will activate the first scene in OBS.
    • Note: Floats will be rounded down.
      • Example: /scene 1.9 = /scene 1

by Name in Address

/scene/[scene_name]

  • activate a scene by name in the OSC address.
    • Example: /scene/Wide will activate a scene named "Wide" in OBS.
    • Note: If a scene name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" make OSC message: /scene/Webcam_1

by TouchOSC

/scene/[scene_name] Value 0 to 1

  • activates a scene with name in address and a value of 1 with TouchOSC
    • Example: /scene/Wide and a value of 0 to 1 will activate the scene "Wide" in OBS
    • Note: If a scene name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" make OSC message: /scene/Webcam_1
    • See "OBS -> Application" for feedback of active scenes

Next Scene

/go

  • activates the next scene in the list, if this is triggered on the last scene it will go to the first scene

Previous Scene

/back

  • activates the previous scene in the list, if this is triggered on the first scene it will go to the last scene

- Set Transition Type and Duration: -

/[type]/transition [duration]

  • sets the desired transition and duration(in milliseconds).
    • Example: /Cut/transition will change the current Scene Transition to "Cut". /Fade/transition 5000 will set the current Scene Transition to "Fade" with a "5000" millisecond duration (5 seconds).
      • Note: [type] must be identical to Transition Type name in OBS:
        • Fade, Cut, Stinger, Fade_to_Color, Luma_Wipe, Slide, Swipe, and Custom Transition Names. This also works with the Move plugin.
      • If you do not set a duration in the 1st argument it will keep the current duration and log what it is.

- Set Source Visibility On/Off: -

/[scene_name]/[source_name]/visible [0, off, false or 1, on, true]

  • turn on or off the source's visibility.
    • Example: /Webcam_1/Audio_Input_Capture/visible 0 will turn OFF "Audio Input Capture" source in OBS from scene "Webcam 1". Where as /Webcam_1/Text_1/visible 1 will turn it ON.
    • NOTE: If a scene name or source name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" and a source name of "Text 1" make OSC message the example from above.

- Set Filter Visibility On/Off: -

/[scene_name]/[source_name]/filterVisibility [0, off, false or 1, on, true]

  • turn on or off the source's filter visibility.
    • Example: /Video_Input/Color_Correction/filterVisibiltity 0 will turn OFF filter named "Color Correction" in OBS from source "Video Input". Where as /Video_Input/Color_Correction/filterVisibility 1 will turn it ON.
    • Note: If a filter name or source name contains a SPACE, replace with "_", so if OBS has a filter "Color Correction" and a source name of "Video Input" make OSC message the example from above.

- Set Text (for FreeType 2 ONLY): -

/[source_name]/setText [text content] [size(optional)] [font (optional)]

  • change text content, size, and font.
    • Note: Size and Font are optional
    • Note: This will not work with 'GDI+', so use 'FreeType 2' instead. On PC you can find it in 'Add > Depricated'
    • Example: /text_1/setText "Hello World." will change the text contents of source "text 1" to "Hello World."
    • Example 2: /text_1/setText "Hello World." 150 Arial will change the same as above and change the size to 150 pt and Font to 'Arial'

- Set Opacity: -

/[source_name]/[color_correction_filter_name]/opacity [0 thru 1]

  • adjust the Opacity of a source via the "Color Correction" filter in OBS of the current scene.
    • Example: /Text_1/Color_Correction/opacity 0.5 will make "Text 1" half transparent.
    • Note: If a source name or filter name contains a SPACE, replace with "_", so if OBS has a source "Text 1" and filter "Color Correction" make OSC message the example from above)

- Set "Color Correction" Filter Properties: -

Gamma

/[source_name]/[color_correction_filter_name]/gamma [-3 thru 3]

  • Adjust the Gamma of a source via the "Color Correction" filter in OBS of the current scene.
    • 0 is the default vaule
    • Example: /Text_1/Color_Correction/gamma 3 will make "Text 1" gamma at highest setting.
    • Note: If a source name or filter name contains a SPACE, replace with "_", so if OBS has a source "Text 1" and filter "Color Correction" make OSC message the example from above)

Contrast

/[source_name]/[color_correction_filter_name]/contrast [-2 thru 2]

  • Adjust the Contrast of a source via the "Color Correction" filter in OBS of the current scene.
    • 0 is the default vaule
    • Example: /Text_1/Color_Correction/contrast 2 will make "Text 1" contrast at highest setting.
    • Note: If a source name or filter name contains a SPACE, replace with "_", so if OBS has a source "Text 1" and filter "Color Correction" make OSC message the example from above)

Brightness

/[source_name]/[color_correction_filter_name]/brightness [-1 thru 1]

  • Adjust the Brightness of a source via the "Color Correction" filter in OBS of the current scene.
    • 0 is the default vaule
    • Example: /Text_1/Color_Correction/brightness 1 will make "Text 1" brightness at highest setting.
    • Note: If a source name or filter name contains a SPACE, replace with "_", so if OBS has a source "Text 1" and filter "Color Correction" make OSC message the example from above)

Saturation

/[source_name]/[color_correction_filter_name]/saturation [-1 thru 5]

  • Adjust the Contrast of a source via the "Color Correction" filter in OBS of the current scene.
    • 0 is the default vaule
    • Example: /Text_1/Color_Correction/contrast 5 will make "Text 1" saturation at highest setting.
    • Note: If a source name or filter name contains a SPACE, replace with "_", so if OBS has a source "Text 1" and filter "Color Correction" make OSC message the example from above)

Hue Shift

/[source_name]/[color_correction_filter_name]/hueShift [-180 thru 180]

  • Adjust the Contrast of a source via the "Color Correction" filter in OBS of the current scene.
    • 0 is the default vaule
    • Example: /Text_1/Color_Correction/contrast 180 will make "Text 1" hue shift at highest setting.
    • Note: If a source name or filter name contains a SPACE, replace with "_", so if OBS has a source "Text 1" and filter "Color Correction" make OSC message the example from above)

- Translate Source's Position: -

/[scene_name]/[source_name]/position [x] [y]

  • change sources position by x and y values. This also changes the alignment to center the bounding box to the x and y values.
    • Example: /Webcam_1/Text_1/position 0 0 this changes the source to center of the screen, as long as the alignment is cewnter. See "Qlab OSC Examples" file for how to automate positions.
    • Note: This is only tested for a "Canvas Size" of 1920x1080 in OBS. Also, If a scene name or source name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" and a source name of "Text 1" make OSC message the example from above.

- Translate Source's Scale: -

/[scene_name]/[source_name]/scale [float]

  • change the source's scale. 0 is nothing, 1 is original full size. Negative numbers will invert the source. Numbers larger than "1" will be larger than original size.
    • Example: /Webcam_1/Text_1/scale 2 this will make the size of the "Text 1" source double the size of original.
    • Note: See "Qlab OSC Examples" file for how to automate scale. Also, If a scene name or source name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" and a source name of "Text 1" make OSC message the example from above.)

- Translate Source's Rotation: -

/[scene_name]/[source_name]/rotate [float]

  • change the source's scale. 0 is nothing, 360 is full 360 rotation clockwise. Negative numbers will rotate counterclockwise. Numbers larger than "360" will be more roations.
    • Example: /Webcam_1/Text_1/rotate 90 this will make the rotation of the "Text 1" source 90º clockwise.
    • Note: See "Qlab OSC Examples" file for how to automate rotation. Also, If a scene name or source name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" and a source name of "Text 1" make OSC message the example from above.)

- Audio Controls: -

Mute

/[source_name]/mute

  • Mute the specified source

Unmute

/[source_name]/unmute

  • Unmute the specified source

Toggle Audio

/[source_name]/audioToggle [0 or 1]

  • Unmute and Mute the specified source by toggling

Volume

/[source_name]/volume [0 thru 1]

  • Adjust specified source's volume.
    • Example: /Audio_Input/volume 0.5 sets source "Audio_Input" audio to 50% volume

Monitor Off

/[source_name]/monitorOff

  • Sets source's audio monitor type to "Monitor Off"
    • Example: /Audio_Input/monitorOff sets audio source "Audio Input" to "Monitor Off".
    • Note: This does work, but you won't see a visual change on OBS unless you close "Advaced Audio" window and reopen.

Monitor Only

/[source_name]/monitorOnly

  • Sets source's audio monitor type to "Monitor Only"
    • Example: /Audio_Input/monitorOnly sets audio source "Audio Input" to "Monitor Only".
    • Note: This does work, but you won't see a visual change on OBS unless you close "Advaced Audio" window and reopen.

Monitor and Output

/[source_name]/monitorAndOutput

  • Sets source's audio monitor type to "Monitor and Output"
    • Example: /Audio_Input/monitorAndOutput sets audio source "Audio Input" to "Monitor and Output".
    • Note: This does work, but you won't see a visual change on OBS unless you close "Advaced Audio" window and reopen.

- Media Controls: -

Play

/[source_name]/mediaPlay

  • Play specified "Media Source"

Pause

/[source_name]/mediaPause

  • Pause specified "Media Source"

Restart

/[source_name]/mediaRestart

  • Restart specified "Media Source"

Stop

/[source_name]/mediaStop

  • Stop specified "Media Source"

Cursor

/[source_name]/mediaCursor [int]

  • Sets the cursor position of specified "Media Source"

- Browser Controls: -

/[browser_source]/refreshBrowser

  • Refresh specified Browser Source in OBS

- Projector Controls: -

/[type]/openProjector [display_number] [sceneorsource_name]

  • Opens type of projector to specified display
  • [type] options:
    • StudioProgram, Multiview, Preview, Scene, Source
  • [display_number] is an integer
    • Example: 0 would be your main screen and 1 would be your secondary monitor
    • Note: If you use -1 or empty(null), then this would make a windowed projector of specified [type]
  • [sceneorsource_name] is an optional for the 2nd argument. This can ONLY be used if using Scene or Source for [type]
    • This would be the name of a Source or Scene in OBS that would open a specified projector
  • Examples:
    • /StudioProgram/openProjector 1
      • This would open a Studio Program Feed on the secondary monitor
    • /Preview/openProjector
      • This would open a Preview Feed in a windowed projector
    • /Scene/openProjector 0 "Scene 1"
      • This would open a feed from "Scene 1" on the main monitor.
    • /Multiview/openProjector -1
      • This would open a Multiview Feed to a windowed projector

- Studio Mode: -

Set StudioMode

/setStudioMode [0 or 1]

  • if argument is 1 then Studio Mode enables, if 0 it disables in OBS

Enable

/enableStudioMode

  • enable Studio Mode in OBS

Disable

/disableStudioMode

  • disable Studio Mode in OBS

Toggle

/toggleStudioMode

  • toggle Studio Mode On/Off in OBS

- Trigger Preview Scenes: -

by Name in Argument

/previewScene [scene name]

  • activate a scene by name in the OSC argument.
    • Example: /previewScene Wide will activate a scene named "Wide" in the Preview in OBS.
    • In QLab you can use quotations to wrap into a single argument: /scene "Webcam 1"

by Name in Address

/previewScene/[scene_name]

  • activate a scene by name in the OSC address.
    • Example: /previewScene/Wide will activate a scene named "Wide" in the Preview in OBS.
    • Note: If a scene name contains a SPACE, replace with "_", so if OBS has a scene "Webcam 1" make OSC message: /previewScene/Webcam_1

Trigger Transition to Program

/studioTransition [type(optional)] [duration(optional)]

  • activate a Transition to Program
    • Example: /studioTransition "Fade" 5000 will activate a transition of the Preview to Program with a Fade of 5 seconds.

- Streaming and Recording: -

Set Recording

/setRecording [0 or 1]

  • start recording if argument is 1 and stop if 0

Start Recording

/startRecording

  • start recording in OBS

Stop Recording

/stopRecording

  • stop recording in OBS

Toggle Recording

/toggleRecording

  • toggle the start/stop recording button in OBS

Pause Recording

/pauseRecording

  • pause the recording in OBS

Resume Recording

/resumeRecording

  • resume recording in OBS

Set Streaming

/setStreaming [0 or 1]

  • start streaming if argument is 1 and stop if 0

Start Streaming

/startStreaming

  • start streaming in OBS

Stop Streaming

/stopStreaming

  • stop streaming in OBS

Toggle Streaming

/toggleStreaming

  • toggle the start/stop streaming button in OBS

Set VirtualCam

/setVirtualCam [0 or 1]

  • start VirtualCam if argument is 1 and stop if 0

Start VirtualCam

/startVirtualCam

  • start VirtualCam in OBS

Stop VirtualCam

/stopVirtualCam

  • stop VirtualCam in OBS

Toggle VirtualCam

/toggleVirtualCam

  • toggle the start/stop VirtualCam button in OBS

- Settings: -

Set Scene Collection

*/setSceneCollection [Scene Collection Name]

  • set the scene collection with the specified name

Set Profile

*/setProfile [Profile Name]

  • set the profile with the specified name

- NDI and Other Outputs -

List Outputs NAmes

/listOutputs

  • Logs a list of all available outputs
  • NOTE: Use names listed for argument in start and stop commands

Start Output

/startOutput [name]

  • Example: /startOutput "NDI Main Output"
    • This will enable the "NDI Main Output" output

Stop Output

/stopOutput [name]

  • Example: /stopOutput "NDI Main Output"
    • This will disable the "NDI Main Output" output

- Miscellaneous -

Renaming

/rename [current-name] [new-name]

  • rename scene or source
    • Example: /rename "Audio" "NewAudio" will change the source named "Audio" to "NewAudio"

Send Closed Captions

*/sendCC [text]

  • Send the text as embedded CEA-608 caption data
    • Example: /sendCC "Hello world." will send "Hello world." as an embedded closed caption

Set Recording File Name

*/recFileName [string]

  • sets the name of the file for when you record

Get Source Text (FreeType2) String Repeatedly

/[text source]/getTextFreetype [1]

  • Returns to the OSC Client:
    • /[text_source]/text [string]
  • NOTE: Disabling the loop is not yet implemented. Quit and reopen app to stop.
  • The loop returns every 500ms (half second)
  • ex. Possible use case would be for getting a text source that has a countdown script.

Get Source Text (GDI) String Repeatedly

/[text source]/getTextGDI [1]

  • Returns to the OSC Client:
    • /[text_source]/text [string]
  • NOTE: Disabling the loop is not yet implemented. Quit and reopen app to stop.
  • The loop returns every 500ms (half second)
  • ex. Possible use case would be for getting a text source that has a countdown script.

Set Active Scene Item Visibility by Index

-/[index]/activeSceneItemVisibility [0 or 1]

  • this uses the index of your sources to control the visibility of active scene.

Set Specific Scene Item Visibility by Index

-/[scene_name]/[index]/activeSceneItemVisibility [0 or 1]

  • this uses the index of your sources to control the visibility of a specific scene.

Take Screenshot

-/takeScreenshot

  • This saves a .png file of your current active scene and saves it to your Documents folder

Trigger Hotkey

-/[modifier]/[key]/hotkey

  • This triggers a hotkey from your settings. Not keyboard shortcuts.
  • modifier can be shift control and/or alt (order doesn't matter). key can be lowercase or uppercase.
  • ex. /controlshift/f/hotkey

Open External File / URL

Might ask to allow "OSC for OBS" access

  • /openExternal [string]
    • this command opens local applications, files, and/or websites with file or url path
    • ex. /openExternal "https://google.com"
    • opens google in default browser
    • ex. Mac /openExternal "file:/System/Applications/Stocks.app"
    • ex. PC /openExternal "file://c:/windows/system32/calc.exe"
    • opens 'Calculator' app
    • ex. Mac /openExternal "file:/Users/joeshea/Documents/texttest1.png"
    • opens 'texttest1.png' in default viewer (like Preview)

Simulate Keypress on Front/Active Window (BETA)

(Java Run Time)[https://www.java.com/en/download/manual.jsp] is required for this feature. After downloading and installing restart computer.

  • /keypress [string]
    • this command simulates a keypress on front window. (Use this syntax for keys)[https://github.com/garimpeiro-it/node-key-sender#list-of-key-codes]
    • ex. /keypress "space"
    • this simulates a space keypress on the active window
    • ex. /keypress "h,i"
    • this simulates a h and then an i key press to active window
    • ex. /keypress "control,s"
    • ex. this simulates a keycombo of Control + S to active window
  • Note: This feature can send multiple keypresses by using a comma ,, but using combinations of shift, control, and alt have been buggy. Please refer to (this repository for issues)[https://github.com/garimpeiro-it/node-key-sender]

**~ Editing Commands While Selected in OBS: ~**

Mainly used for TouchOSC

  • Layout file included in downloaded folder or in Assets on Github
  • Download and install TouchOSC Editor to open "Layout" and import to device
    • NodeOBS-ZoomOSC-Autocropper DEMO Video

Add Scene Item

/addSceneItem [scene_item]

  • This adds a specified "Scene Item" to the selected OBS Scene
    • Note: You can find a list of all your "Scene Items" by clicking on the toolbar:
      • Scripts > Log All Available Scene Items (Sources)

Change Transition Override Type

/transOverrideType/[type]

  • Set Transition Override Type for selected OBS Scene.
    • Note: [type] must be identical to Transition Override Type name in OBS:
    • Fade, Cut, Stinger, Fade_to_Color, Luma_Wipe, Slide, Swipe, and a Custom Named Transition. This also works with the Move plugin.
    • Example: /transOverrideType/Fade_to_Color will set the Transition Override of the selected Scene in OBS to "Fade to Color"

Change Transition Override Duration

/transOverrideDuration [duration]

  • Set Transition Override Duration for selected OBS Scene.
  • Note: Duration is in milliseconds (1000ms = 1sec)
  • Example: /transOverrideDuration 2500 will set the Transition Override duration for the selected Scene in OBS to 2.5 seconds.

Change Scale

/size [float]

  • Translate scale of selected OBS Source.
    • [float] can take a value with decimal.
      • Example: 0 is nothing, 0.5 is half the size, 1 is original full size. Negative numbers will invert the source. Numbers more than "1" will be larger than original size.

Change Position X and Y

/move [x] [y]

  • Translate X and Y position from selected OBS Source.

Change Position X

/movex [x]

  • Translate X position from selected OBS Source.

Change Position Y

/movey [y]

  • Translate Y position from selected OBS Source.

Change Alignment

/align [int]

  • Set alignment for selected source.
    • Example: /align 0 will center the selected OBS Source

    • [int] would be an integer value from this guide:

      5 4 6
      1 0 2
      9 8 10

Change Rotation

/spin [int]

  • Set rotation for selected source

Change Bounds to Fit to screen

/fitToScreen

  • Set bounds to Fit to Screen

Get Source Settings

/getSourceSettings

  • Logs source properties and settings
    • Mainly used for development and debugging

OBS -> Application:

  • Configure "OSC OUT" to target Application

  • When Enabled his allows OBS to send OSC to other applications when a scene is activated.

  • To use/enable this function, change the toggle button to ON Configure the prefix and suffix for how you want your OSC application to receive an OSC string from OBS

    • Example: In OBS when a Scene named "Wide Shot" is activated, Qlab recieves an OSC message "/cue/Wide_Shot/start")

TouchOSC Feedback:

When Checked this sends OSC messages back to TouchOSC for dynamic control.

  • OSC Out IP must be the IP of the device using TouchOSC
  • OSC Out Slider must be Enabled

Active Scene Feedback

Use the following setup for /scene command for a push button in TouchOSC Editor:

Screen Shot 2021-04-13 at 4 44 31 PM

  • make sure "Local Feedback" is checked

In OSC for OBS use the following setup:

Fader Volume Feedback

Use the following setup for /[source]/volume command for a fader in TouchOSC Editor:

Screen Shot 2021-04-19 at 8 33 29 PM

Muting/UnMuting Toggle Feedback

Use the following setup for /[source]/audioToggle command for a toggle button in TouchOSC Editor:

Screen Shot 2021-04-19 at 8 33 18 PM

Media Playback Feedback

Play

  • When a media is played in OBS the following OSC is sent /[source]/mediaPlay 1, /[source]/mediaPause 0, and /[source]/mediaStop 0

Pause

  • When a media is paused in OBS the following OSC is sent /[source]/mediaPause 1, /[source]/mediaPlay 0, and /[source]/mediaStop 0

Stop

  • When a media is stopped in OBS the following OSC is sent /[source]/mediaStop 1, /[source]/mediaPause 0, and /[source]/mediaPlay 0

Source Visibility

  • When a source visibility is changed in OBS the following OSC is sent /[scene]/[source]/visible [0 or 1]
    • (0 if off and 1 if on)

Transitions

Transition Type

  • When a transition is triggered in OBS the following OSC is sent /transitionType [type]

Transition Duration

  • When a transition is triggered in OBS the following OSC is sent /transitionDuration [int]

Stats Label Feedback

When Streaming/Recording:

  • /fps
    • Returns frames per second [int] fps
  • /streaming
    • Returns 1 if stream started, 0 if stopped
  • /recording
    • Returns 1 if recording started, 0 if stopped
  • /streamTime
    • Returns elapsed stream time HH:MM:SS
  • /cpuUsage
    • Returns cpu usage [int] cpu usage
  • /freeDiskSpace
    • Returns free disk space [int] free disk space
  • /averageFrameRate
    • Returns average frame rate [int] avg frame rate
  • /memoryUsage
    • Returns memory usage [int] memory usage
  • /kbpsEncoder
    • Returns encoder data [int] kbps

Screen Shot 2021-04-19 at 8 33 18 PM

Troubleshooting

OSC Tester

Screen Shot 2021-03-01 at 5 44 26 PM

  • File > OSC Tester

  • This window can help with testing OSC commands without leaving the app


Screen Shot 2021-03-01 at 5 44 26 PM

  • If you're getting this error on Mac after you close the app make sure you drag and drop OSC for OBS from Downloads to Applications

Editing The Code Yourself

OSC for OBS is an Electron application that is powered by HTML, CSS, Javascript, and Node.js. You can access and edit any of these files by doing the following:

Mac

  • Right-click on application > Show Package Contents > Contents > Resources > app > src.
    • 'index.js' is where majority of the code is located

PC

  • In the downloaded folder > Resources > app > src
    • 'index.js' is where majority of the code is located

Acknowledgement

This was inspired by ObSC

Support The Project ❤️

If OSC for OBS helped you, consider helping the project by making a one time donation via PayPal

Join the Discord Community

chat on Discord

osc-for-obs's People

Contributors

jshea2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osc-for-obs's Issues

backwards scene order

i am switching scenes by index with /scene i and it works great, except that the indexing seems to be backwards relative to what i see in OBS's scenes list. /scene 1 gives me the last scene, /scene 2 the second-to-last, etc. is there a way to change that?

OSC for OBS 3.1.3, OBS 28.1.2, Windows 10

strange behavior of strings

Hi, I don't know if it should be here or is actually an obs websockets issue, but I used the following code (hacked some of yours) because I want to use the streamFX plugin through OSC. If it works I can give you my code if you want it when finished.
I am not familiar much with javascript per se but thought I knew enough about programming languages to do this... Anyway. In the following piece of code, changing the x position works, but y and z don't. As I want to make the code versatile I'd like to use variables and not have to type out every single string. Do you have any idea why this wouldn't work? I get no error message. You see a few variations, but any variation gives the same result.

   //Triggers the Source Camera position (via Filter > 3D_Transform)
    else if ((msg[0].includes('macbookCamSkew')) && (msg[0].includes('Position'))){
        console.log(`OSC IN: ${msg[0]} ${msg[1]} ${msg[2]} ${msg[3]}`)
        var msgArray = msg[0].split("/")
        msgArray.shift()
        var x = msg[1]
        var y = msg[2]
        var z = msg[3]
	var filterType = 'Filter.Transform.'
	var actionX = filterType.concat(msgArray[3], '.X')
	var actionY = 'Filter.Transform.' + msgArray[3] + '.Y'
	var actionZ = filterType.concat(msgArray[3], '.Z')
        console.log(`filterprint: ${actionY}`)
        obs.send("SetSourceFilterSettings", {
           'sourceName': msgArray[0].split('_').join(' '),
           'filterName': msgArray[1].split('_').join(' '),
           'filterSettings': { 'Filter.Transform.Position.X' : x, actionY : y, actionZ : z }
        }).catch(() => {
            console.log("ERROR: Transform Command Syntax is Incorrect. Refer to Node OBSosc Github for Reference")
        })  
    }

Javascript Error

I am receiving a Javascript Error, see screenshot:
osc for obs javascript error

I just recently began using the plugin again after upgrading to the latest version of OBS: 29.1.3.

The message pops up without any particular cause / effect as far as I can tell.

Thanks!

Win10 Autostart Behaviour

Hi,
on Win10 OSC-for-OBS 2.7.1 doesn't load and connect automatically. It always starts with no settings. But when I go back to default values via file-menu then my default settings are correctly loaded. What am I doing wrong?

Additional Information: first I packed everything under C:\Programme (or "Program Files" in english) and got errors that OSC-for-OBS is not allowed to write the default-file. I then started the software as administrator, didn't get the error anymore but still no settings on startup. I then moved OSC-for-OBS to D:\ but still no settings on startup.

Thanks in advance
Marcus

visibility issue

Has there been any update to the manner in which visibility is triggered? My OSC trigger seems to be passing the correct command and it works fine for switching scenes. However visibility doesn't work.

Screen Shot 2021-01-07 at 1 58 42 AM

Any ideas?

Also position doesn't seem to make change with X Y parameters but just switches the source to center positioning.

Qlab to obs

Qlab to obs

Set Recording File Name
*/recFileName [string]

sets the name of the file for when you record

/recFileName "xx"

Dont happen nothing

Invalid Syntaxe

Hi,
I'm using Qlab and OBS.
When I press space in Qlab to send a information (close a source), it works 1 out 3 time.
The "OSC for OBS" window says it's a invalid syntax which is false. It's written correcty.
I don't change anything, I press space again and maybe obs will work

It's the app or the qlab

(I use the last version of obs (28.0.3 and osc to obs 3.1)

License?

I'd like to add on to this project but what is the license?

getting java script error

i'm getting a Javascript error as soon as i "connect" with obs:
A JavaScript error occurred in the main process:
Uncaught Exception:
Error: can't decode incoming message: invalid type tag in incoming OSC message, must start with comma
at Socket. (/Applications/OBSosc.app/Contents/Resources/app/node_modules/node-osc/dist/lib/Server.js:29:23)
at Socket.emit (events.js:315:20)
at UDP.onMessage [as onmessage] (dgram.js:910:8)

any idea if i did something wrong?
It is a great great super great app if it works, the osc syntax looks amazing to work with but i can't get past this error.

I'm even getting this error when no other OSC apps or OBS is running

/scene does not work

I have tried the following OSC calls from my TouchOSC surface to activate the scene 'CAMERA':
/scene CAMERA
/scene/CAMERA
/previewScene CAMERA
/previewScene/CAMERA
Further I tried to use different scene names with spaces in them to check if that works.
All of them did not work to activate my scene CAMERA at OBS.

Other calls like /go /back /toggleStudioMode do work as expected, so my setup in general is configured well.

Probably its an issue with the value range send alongside the OSC string.
However I haven't found any documentation regading those numbers and what is expected here to make those call work as expected.

OSC messages delay

Hi! I'm connecting OBS and QLab with OSC. In older versions, OSC messages were sent at the moment the OBS scene was changed, whatever the type of transition with the next scene was. Right now (updated version), the program send the OSC order when the transition is finished (for example, if there is a fade of 3 seconds, it sends the message after that 3 seconds, when in older versions sent it right away).

Is it possible to change that somehow???
Thanks in advance!

Default config clearing

I am using OSC-for-OBS and it keeps booting up with no config information.
I saw that there was a default.txt and defaultOriginal.txt
default.txt is an empty file.
When I add the proper config info it loads correctly the first time, but when I reload the application it clears that file again.
Is there a way to stop that from happening?
Thank you for a great program!

Transition preview to program OSC command would be nice

So there are great commands to trigger scenes and go to the next or 1 scene back and with what kind of transition and duration,
but there isn't really a OSC message to transit scenes from preview to program where studio mode is made for.

You probably wouldn't need it with Qlab very often but with touchOSC or OSCulator it's very nice.

"/gotoprogram" ? :D

[Feature request] Send stream status via OSC output

I'm using touchosc and I would be very pleased if it were possible to send stream status to OSC output. Eg. using toggle stream sending 0 or 1 or sending /startStreaming when the stream is on and /stopStreaming when it is off.

Thank you for your AWESOME work!!!! 👍 😄

Problem Installing on Windows 10

I am experiencing error issues when quitting OSC to OBS on Windows 10. There aren't any installation instructors for Windows, but here is how I have installed:

-- download to the downloads folder
-- drag the OSC-for-OBS-win32--ia32 folder to C: Program Files
-- launch OSC-for-OBS.exe

Everything seems to be working, however:
when I quit OSC to OBS I get this error message:

A Javascript error occurred in the main process
Uncaught exception:
Error: EPERM operation not permitted, open 'C\Program Files\OSC-for-OBS-win32--ia32\resources\app\src\default.txt

When I relaunch the applications all the settings are lost though I have saved a configuration file.

I suspect that the Program Files folder is not the right place for the application, but I have no idea where else to put it!?

Thanks for your help @jshea2

Randall

Media togglePlay

It would be really useful if there was a media command to toggle play (/togglePlay) like /toggleRecord.

oscmessage /[type]/transition [duration] not fully working ?

Hi,

Tried to make transition duration time work but without success

/Fade/transition 5000

Does not make a error, it can change the transition type but not transition time.

hacking in a function for SetCurrentSceneTransitionDuration in index.js solved my issue and could be useful for changing only the transition time

        //Set SetCurrentSceneTransitionDuration
    else if(msg[0].includes('/SetCurrentSceneTransitionDuration')){
        logEverywhere("SetCurrentSceneTransitionDuration")
        console.log(`OSC IN: ${msg}`)
        logEverywhere(`OSC IN: ${msg}`)
        var msgArray = msg[0].split("/")
        msgArray.shift()
        console.log("Messge array: " + msgArray)
        logEverywhere("Messge array: " + msgArray)
        return obs.call("GetCurrentProgramScene").then(data => {
        obs.call("SetCurrentSceneTransitionDuration", {
            'transitionDuration': msg[1]
        }).catch(() => {
            logEverywhere("ERROR: Invalid SetCurrentSceneTransitionDuration Type Syntax. See Help > API")
        })
    })
    }

system :
macos 12.6, OBS 28.03 OSC-for-OBS 3.1

Thanks for your software.

Problems to activate QLab cues from OBS after updating software

Hello @jshea2 and any other expert on this great software.

I've recently updated my system. Right now my software is:

  • OBS 28.1.2
  • QLab 5.0.6 (paid version)
  • OSC-for-OBS 3.1.2
  • Websocket 5.0.1 (comes with OBS 28.1.2, I have just checked the log)

It seams like the connection between OSC and OBS works, as I can see all my OBS scenes when I "Connect". Also, I have checked all the ports and configurations of all the programs, and everything looks good to me. I have changed the websocket port in OBS from the new 4455, to the 4444 from before, and I have deactivated the password.

The communication from QLab to OBS works flawlessly (go to a specific scene, or next scene for example), but the communication from OBS to QLab doesn't work at all (with my programming, some of the scenes in OBS trigger some cues in QLab). Before updating, I didn't experience any problems.

Is there anything that I'm missing? Something about websocket 5.0 maybe? I had installed websocket 4.9.0 and I haven't uninstalled it. With my old system I didn't have any issues, but I was forced to update everything...

Can you help me, please? I'm desperate, as this is a computer for a theater show and I need this to work asap.
Thanks in advance!

Captura de pantalla 2022-12-04 a las 17 22 50

Problem with Source Visibility in Windows 10

I have been testing source visibility and found that switching one source on and off works fine, with 0/1 or on/off. However when you try to switch a second source on, it gets very buggy, in which the command for source two turns the first source on and off. By manually turning everything off, it starts working agin until you try and control a second source.

Any thoughts?

T-Bar control

Any chance to have an OSC command set to control the OBS T-BAR? The latest OBS doc mentions the following:
Set the Transition Bar position (in Studio Mode). If you need to perform multiple successive T-Bar moves (e.g. : in an animation, or in response to a user moving a T-Bar control in your User Interface), set release to false and execute Release Transition Bar command later once the animation/interaction is over.

Name | Type | Description
Position | Float | Value must be between 0.0 and 1.0.
Release | Boolean | True or False

Where has the code gone?

Hey, I love your project. I've found it very useful and hacked it about to do various other things too. I came to the repo to fork it so I can give some of my modifications back to the community but all the code has been purged from the repo, how come?

It's a shame as this is a really great project!

Linux version

Hi,
since this is an electron app, would it be possible to provide a Linux binary ?
Thanks!

minor issue no OSC output feedback on scene's with spaces in name

As stated in the title the output is not working on scene's with spaces.

In the input field you have to translate spaces to underscore but in the output this doesn't happen from itself.
i don't mind using underscores in spaces in my OBS scene's but it would be nice to not have to think about this.

Way to reverse osc output string?

Right now, the osc output puts the scene name in the middle of the osc address. Is it possible to have it deliver the cue name as the osc data instead? That way, I could use Isadora to evaluate the osc data and do something based on the cue name.

Or any chance of getting an osc output source for obs?

Websocket 5.0 Compatiblity

Hey Joe, love how reliable this program is. I found it recently and have been using it but I updated my OBS to 28 and it default comes with websockets 5, whenever I open OSC-for-OBS it doesn't seem to connect properly but works again when I downgrade to 27. Any chance I get this to working with the new obs/websocket.

Thanks so much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.