Resource icon

Free Command line tool for obs-websocket plugin (Windows) 1.6.3

FSC

Member
The response format is a json string

For performance reasons I would use dos commands, to start e new Powershell still takes more time than command line

Example:

0 to 100 if it was 0
Code:
FOR /F "tokens=* delims=" %%A IN ('OBSCommand.exe "/command=GetSourceFilterInfo,sourceName=QueueGroup,filterName=Fade" ^| FINDSTR /I "opacity.:.0" ') DO (OBSCommand.exe "/fadeopacity=QueueGroup,Fade,0,100")

100 to 0 if it was 100
Code:
FOR /F "tokens=* delims=" %%A IN ('OBSCommand.exe "/command=GetSourceFilterInfo,sourceName=QueueGroup,filterName=Fade" ^| FINDSTR /I "opacity.:.100" ') DO (OBSCommand.exe "/fadeopacity=QueueGroup,Fade,100,0")
 

kutibotond

Member
Thanks, this works but it's incomplete because I think I didn't explain my full intention. So I'm using a command to trigger the source fade. Now if multiple commands ask for the source fade in, then it won't fade in multiple times, that's great. There is one more thing. If midway trough the fade out the fade in gets triggered again, it should stop fading in and turn back from the current opacity number to fade in. So I think the if would look something like:

if the current opacity is not 100
then continue fade in from current opacity number (may not be 0 in case it's midway trough fading out)

fade out after 10 seconds (from 100 to 0)
 

FSC

Member
Thanks, this works but it's incomplete because I think I didn't explain my full intention. So I'm using a command to trigger the source fade. Now if multiple commands ask for the source fade in, then it won't fade in multiple times, that's great. There is one more thing. If midway trough the fade out the fade in gets triggered again, it should stop fading in and turn back from the current opacity number to fade in. So I think the if would look something like:

if the current opacity is not 100
then continue fade in from current opacity number (may not be 0 in case it's midway trough fading out)

fade out after 10 seconds (from 100 to 0)

Version 1.5.1 should help with that, you can put -1 in startopacity or endopacity to fade from/to current value

You might insert a command at the start in your batch file to kill any OBSCommand.exe task before you start a new one to prevent 2 or more tasks fighting with each other like
taskkill /F /IM OBSCommand.exe
 

kutibotond

Member
I've added a "black and white" filter to a source, which has an "amount" slider. How can I make it fade like with the opacity ?
 

kutibotond

Member
I've added several /fadeopacity commands in a row, and it turns out that the first one needs to complete the fade before the second one can start, when my intention was to make the two groups fade in at the same time. I seemed logical since the rest of the commands run in the same time when written one after another except if there is /delay in between. I know this command runs in time but still it would be a nice update to be able to make them run in the same time. Since these two groups need to be at different layers and need to have different filters of their own, I can't combine them.
 

FSC

Member
I've added several /fadeopacity commands in a row, and it turns out that the first one needs to complete the fade before the second one can start, when my intention was to make the two groups fade in at the same time. I seemed logical since the rest of the commands run in the same time when written one after another except if there is /delay in between. I know this command runs in time but still it would be a nice update to be able to make them run in the same time. Since these two groups need to be at different layers and need to have different filters of their own, I can't combine them.

you can try to use "start" to run them asynchronously


I've added a "black and white" filter to a source, which has an "amount" slider. How can I make it fade like with the opacity ?

The fadeopacity command only works with sliders that have the name "opacity", I would have to implement that to support other sliders
 

kutibotond

Member
I've tested the async method and got this : "Error: Exception of type 'OBSWebsocketDotNet.AuthFailureException' was thrown."
 

NecroTheif

New Member
Is there a way to send an array for command? (i.e. for the ReorderSceneItems command it would be something like below)

Code:
OBSCommand /command=ReorderSceneItems,items=["Item1", "Item3", "Item2"]


But that gives me athe following errors:
Code:
Error with command "ReorderSceneItems,items=[Item1,": Missing a = in Name=Type
Error with command "ReorderSceneItems,items=[Item1,": Index was outside the bounds of the array.
Ok
 

FSC

Member
I've tested the async method and got this : "Error: Exception of type 'OBSWebsocketDotNet.AuthFailureException' was thrown."

Check latest version!

Is there a way to send an array for command? (i.e. for the ReorderSceneItems command it would be something like below)

Code:
OBSCommand /command=ReorderSceneItems,items=["Item1", "Item3", "Item2"]


But that gives me athe following errors:
Code:
Error with command "ReorderSceneItems,items=[Item1,": Missing a = in Name=Type
Error with command "ReorderSceneItems,items=[Item1,": Index was outside the bounds of the array.
Ok

Added new command "sendjson", you can now do this with 1.5.2 like this:
Code:
OBSCommand.exe /sendjson="ReorderSceneItems={'scene': 'MyScene', 'items': [{'name': 'Image'}, {'name': 'Gamecapture'}]}"
 

Whosns

New Member
Hey FSC,

is OBSCommand.exe a free application of you? Also for using it in a company/commercial use?
I couldn't find any licence or usage terms..
Im only using it to control OBS-Studio with an small C# WPF which i am coding for an exam.
 

FSC

Member
Hey FSC,

is OBSCommand.exe a free application of you? Also for using it in a company/commercial use?
I couldn't find any licence or usage terms..
Im only using it to control OBS-Studio with an small C# WPF which i am coding for an exam.

Yes OBSCommand is free for private and commercial use. Enjoy!
 

Marvin1099

New Member
i have a problem
/pauserecording
does not work
/startrecording
works
is the " /pauserecording " command wrong?
same btw with /resumerecording
 

FSC

Member
i have a problem
/pauserecording
does not work
/startrecording
works
is the " /pauserecording " command wrong?
same btw with /resumerecording
only /startrecording is a "built-in" command, for the other commands you have to use the /command feature:

/command=PauseRecording

/command=ResumeRecording
 

BoomSoMuch

New Member
I'm trying to toggle my filters. Not sure what I'm doing wrong here. Sorry if it's in the documentation. I tried!!

/command=SetSourceFilterVisiblity,sourceName="Main Scene"/TestSource,filterName=testfilter,filterEnabled=False
 

FSC

Member
I'm trying to toggle my filters. Not sure what I'm doing wrong here. Sorry if it's in the documentation. I tried!!

/command=SetSourceFilterVisiblity,sourceName="Main Scene"/TestSource,filterName=testfilter,filterEnabled=False

typo?

SetSourceFilterVisibility
 

BoomSoMuch

New Member
I was hoping that would be it, but no luck. Here is a cut and paste of my last test.

/command=SetSourceFilterVisibility,sourceName="LDV-Main"/"LDV Logo",filterName=Scroll,filterEnabled=False
 
Top