obs-websocket-el
obs-websocket-el copied to clipboard
Control Open Broadcast Studio from Emacs - temporary repo
- obs-websocket-el
Totally bubblegum-and-string at the moment.
You'll need [[https://obsproject.com/][Open Broadcaster Software]] and the [[https://obsproject.com/forum/resources/obs-websocket-remote-control-obs-studio-from-websockets.466/][obs-websocket]] plugin for it. Set it up in =Tools > WebSockets Server Settings=. Set a password there.
You will also need [[https://elpa.gnu.org/packages/websocket.html][websocket]], which is available from GNU ELPA. You can install it with =M-x package-install RET websocket RET=.
You will probably be able to use =M-x obs-websocket-connect= to connect to your OBS server. I have no idea if it will work for anyone but me, though. Good luck!
You can use =(setq obs-websocket-password "yourpasswordhere")= in your Emacs configuration file so that it won't prompt you for the password.
Here's my config. It uses use-package and hydra.
#+begin_src emacs-lisp
(use-package websocket)
(defun my/twitch-message (text)
(interactive "MText: ")
(with-current-buffer
(get-buffer-create "Twitch message")
(erase-buffer)
(insert text)
(goto-char (point-min))))
(use-package obs-websocket
:config
(defhydra my/obs-websocket (:exit t)
"Control Open Broadcast Studio"
("c" (obs-websocket-connect) "Connect")
("d" (obs-websocket-send "SetCurrentScene" :scene-name "Desktop") "Desktop")
("e" (obs-websocket-send "SetCurrentScene" :scene-name "Emacs") "Emacs")
("i" (obs-websocket-send "SetCurrentScene" :scene-name "Intermission") "Intermission")
("v" (browse-url "https://twitch.tv/sachachua"))
("m" my/twitch-message "Message")
("t" my/twitch-message "Message")
("
Better installation instructions will eventually be written by someone, if anyone wants to actually maintain this.
Protocol reference: https://github.com/Palakis/obs-websocket/blob/4.x-current/docs/generated/protocol.md
My e-mail address is [[[email protected]]], although I tend to reply slowly.