Resource icon

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

lindenkron

Member
Wow, thanks for the quick turnaround on the audio issue!
Quick question about hotkeys.
It took a while, but we finally tracked down how to do modifier in OBSCommand. I've been unable to identify how to do 'multiple hotkeys' in OBSCommand
/command=TriggerHotkeyBySequence,keyModifiers=control=true,keyId="OBS_KEY_NUM0"
This triggers Ctrl + Num0. But doing something like Ctrl, Shift + Num0 seems to not be immediately obvious.

Is it possible?
Thanks,
-lindenkron
 

FSC

Member
Wow, thanks for the quick turnaround on the audio issue!
Quick question about hotkeys.
It took a while, but we finally tracked down how to do modifier in OBSCommand. I've been unable to identify how to do 'multiple hotkeys' in OBSCommand
/command=TriggerHotkeyBySequence,keyModifiers=control=true,keyId="OBS_KEY_NUM0"
This triggers Ctrl + Num0. But doing something like Ctrl, Shift + Num0 seems to not be immediately obvious.

Is it possible?
Thanks,
-lindenkron

I have not tested this, have you tried this?:
/command=TriggerHotkeyBySequence,keyModifiers=control=true,keyModifiers=shift=true,keyId="OBS_KEY_NUM0"

If this does not work, you probably need to use /sendjson
 

lindenkron

Member
I have not tested this, have you tried this?:
/command=TriggerHotkeyBySequence,keyModifiers=control=true,keyModifiers=shift=true,keyId="OBS_KEY_NUM0"

If this does not work, you probably need to use /sendjson
Yea, that was one of the first things I tried. I also attempted sendjson but couldn't get it to work with multiple hotkey modifiers either.

Sorry for the late reply, super stressful days atm.
 

FSC

Member
Hey,

just a question about the OpenProjector command is there also a possibility to close the projector?

Hi! Good question you should address to the obs-websocket plugin developer, I don't see a command for closing the projector in the documentation for the plugin either.

Yea, that was one of the first things I tried. I also attempted sendjson but couldn't get it to work with multiple hotkey modifiers either.

Sorry for the late reply, super stressful days atm.

try this:
obscommand /sendjson=TriggerHotkeyBySequence={'keyId':'OBS_KEY_NUM0','keyModifiers':{'control':true,'shift':true}}
 

FSC

Member
Awesome plugin! Hopefully you can add a Start and Stop command for the Virtual camera
That is a request for the obs-websocket plugin developer, I don't maintain that project.
But no need for that as commands for Virtual Camera control have been added in the recent obs-websocket plugin update, you should be able to run it with OBSCommand with the universal /command (or /sendjson) feature.
 

BenCappa

New Member
Is there anyway I can pass through a string with the equal sign (=) in it?
For example: /command=SetSourceSetting,sourceName="Browser Source",sourceSettings=url="https://www.google.com/search?q=query+goes+here"
As a result, the url is set to only "https://www.google.com/search?q" and it doesn't recognize the = as a part of the string. I've been trying escape characters such as ^ or \ before the = but nothing seems to work. What am I missing here?
 

FSC

Member
Is there anyway I can pass through a string with the equal sign (=) in it?
You are not missing anything but you found an edge case ;)
OBSCommand does not parse that case correctly in /command

As a workaround, you can use /sendjson:
/sendjson=SetSourceSettings={'sourceName':'Browser Source','sourceSettings':{'url':'https://www.google.com/search?q=query+goes+here'}}

Note you have a typo in your sample, it is SetSourceSettings, not SetSourceSetting
 

BenCappa

New Member
You are not missing anything but you found an edge case ;)
OBSCommand does not parse that case correctly in /command

As a workaround, you can use /sendjson:
/sendjson=SetSourceSettings={'sourceName':'Browser Source','sourceSettings':{'url':'https://www.google.com/search?q=query+goes+here'}}

Note you have a typo in your sample, it is SetSourceSettings, not SetSourceSetting
Thank you so much (and for catching the typo)! This will save me a lot of headache.
 

elliotpro

New Member
It seems like a great tool. Do you think it will work without mistakes with my website and what mistakes might happen if I use this plugin on my website ??
 

FSC

Member
Hello All
Plz, how can I play, stop, pause "VLC Video Source" via CMD
Hi, try this:

Play:
OBSCommand.exe /command=PlayPauseMedia,sourceName="VLC Video Source",playPause=false

Stop:
OBSCommand.exe /command=StopMedia,sourceName="VLC Video Source"

Pause:
OBSCommand.exe /command=PlayPauseMedia,sourceName="VLC Video Source",playPause=true

Restart (from the beginning of the video):
OBSCommand.exe /command=RestartMedia,sourceName="VLC Video Source"

Play next:
OBSCommand.exe /command=NextMedia,sourceName="VLC Video Source"

Play previous:
OBSCommand.exe /command=PreviousMedia,sourceName="VLC Video Source"

It seems like a great tool. Do you think it will work without mistakes with my website and what mistakes might happen if I use this plugin on my website ??
What do you mean work with your website??
This is not a plugin and it is not for websites, OBSCommand is a command-line tool for Windows to control the OBS plugin "obs-websocket"
 

PrecisionDave

New Member
Hi all, I've been trying like crazy to get the setsourcesettings command to work. I run in to problems both trying "standard" commands and sendjson.
e.g.
if I run this:
/command=SetStreamSettings,settings=key="i0k9HqWQ?token=longstringofrandomkeycharactersxxxf33be20ea001a2c"
I get a response that is a json struct, but importantly key is wrong.. the "=' in the key messess up the parsing and I get a key that is cut short:

{
"message-id": "iDctAw5P4OIQcXWf",
"settings": {
"bwtest": false,
"key": "i0k9HqWQ?token",
"server": "'rtmp://live-rtmp-pub.millicast.com:1935/v2/pub/'",
"use_auth": false
},
"status": "ok",
"type": "rtmp_custom"
}

If I try to send json:
/sendjson="SetStreamSettings={'settings': { 'key': 'i0k9HqWQ?oken=longstringofrandomkeycharactersxxxf33be20ea001a2c','use_auth':false,'server':'rtmp://live-rtmp-pub.mystreamingservice.com:1935/v2/pub/' },'type':'rmtp_custom'}"

I just get the response "OK", but nothing actually changes in the stream settings in obs

Any suggestions on what I should be doing differently?

Thanks very much,
Dave
 

PrecisionDave

New Member
Hi all, I've been trying like crazy to get the setsourcesettings command to work. I run in to problems both trying "standard" commands and sendjson.
e.g.
if I run this:
/command=SetStreamSettings,settings=key="i0k9HqWQ?token=longstringofrandomkeycharactersxxxf33be20ea001a2c"
I get a response that is a json struct, but importantly key is wrong.. the "=' in the key messess up the parsing and I get a key that is cut short:

{
"message-id": "iDctAw5P4OIQcXWf",
"settings": {
"bwtest": false,
"key": "i0k9HqWQ?token",
"server": "'rtmp://live-rtmp-pub.millicast.com:1935/v2/pub/'",
"use_auth": false
},
"status": "ok",
"type": "rtmp_custom"
}

If I try to send json:
/sendjson="SetStreamSettings={'settings': { 'key': 'i0k9HqWQ?oken=longstringofrandomkeycharactersxxxf33be20ea001a2c','use_auth':false,'server':'rtmp://live-rtmp-pub.mystreamingservice.com:1935/v2/pub/' },'type':'rmtp_custom'}"

I just get the response "OK", but nothing actually changes in the stream settings in obs

Any suggestions on what I should be doing differently?

Thanks very much,
Dave


ok -- UPDATE -- I downloaded the source, built in vs2019, updated the reference for the Newtonsoft json lib from v6 to v10 and now it works. Something was borked in the v6 parser. I suggest and update to the GitHub version (not sure how to do that myself)
 

FSC

Member
ok -- UPDATE -- I downloaded the source, built in vs2019, updated the reference for the Newtonsoft json lib from v6 to v10 and now it works. Something was borked in the v6 parser. I suggest and update to the GitHub version (not sure how to do that myself)

Hi, thanks for your feedback.

Are you sure it was the json lib, and not your typo "oken" instead of "token"?
 

PrecisionDave

New Member
Hi, thanks for your feedback.

Are you sure it was the json lib, and not your typo "oken" instead of "token"?
yes - the "oken" above was just a cut and paste error into the forum. You can see in the actual submission that anything after the equals sign was gone in that string"
 

PaulBM

New Member
I have been using OBSCommand and AutoHotKey to trigger hotkeys in OBS. Today I added the following Python script to OBS,


The script's hotkeys are appearing in OBS and work with a keypress. I can see and confirmed the names of the hotkeys in twitch.json.

For some reason OBSCommand errors with the following...
Error with command "TriggerHotkeyByName,hotkeyName=chat_hotkey_0": hotkey not found

I'm baffled, other lua script's hotkeys are being seen and triggered by OBSCommand, but not the hotkeys from the Python script.
 

PaulBM

New Member
The script's hotkeys are appearing in OBS and work with a keypress. I can see and confirmed the names of the hotkeys in twitch.json.

For some reason OBSCommand errors with the following...
Error with command "TriggerHotkeyByName,hotkeyName=chat_hotkey_0": hotkey not found

It seems to be obs-websocket that's not finding the hotkey.

22:45:17.454: [obs-websocket] Request >> '{
22:45:17.454: "request-type": "TriggerHotkeyByName",
22:45:17.454: "message-id": "nVRagEhcs1VDhnkQ",
22:45:17.454: "hotkeyName": "chat_hotkey_0"
22:45:17.454: }'
22:45:17.454: [obs-websocket] Response << '{"error":"hotkey not found","message-id":"nVRagEhcs1VDhnkQ","status":"error"}'
 
Top