1.0.0 • Published 6 months ago

stream-deck-obs-buttons v1.0.0

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
6 months ago

Linux Stream Deck Dynamic OBS Recording and Streaming Buttons

This project combines OBS's websocket interface with streamdeck-linux-gui to drive a buttons whose images change with the recording and streaming states & which toggles the appropriate state when pushed.

Stream Deck Demo Video

Use

(This program relies on a new feature in streamdeck-linux-gui, a control system via Unix socket called streamdeckc. At the time of this writing it is not included in the distribution packages & to use it one must install from source.)

To have the program monitor OBS and control states (with logging), run:

npx stream-deck-obs-buttons watch -v

Running it with the --help flag will publish a list of available options:

Commands:
  stream-deck-obs-buttons watch    Watch for changes in status.
  stream-deck-obs-buttons rstart   Start OBS recording.
  stream-deck-obs-buttons rstop    Stop OBS recording.
  stream-deck-obs-buttons rtoggle  Toggle OBS recording.
  stream-deck-obs-buttons sstart   Start OBS streaming.
  stream-deck-obs-buttons sstop    Stop OBS streaming.
  stream-deck-obs-buttons stoggle  Toggle OBS streaming.

Options:
      --version                 Show version number                    [boolean]
  -o, --recording-on-icon       Icon to use when recording.
    [string] [default: "~/tip/program/stream-deck-obs-buttons/recording-on.gif"]
  -f, --recording-off-icon      Icon to use when recording is stopped.
   [string] [default: "~/tip/program/stream-deck-obs-buttons/recording-off.gif"]
  -e, --recording-error-icon    Icon to use when something goes wrong.
      [string] [default: "~/tip/program/stream-deck-obs-buttons/error-icon.gif"]
  -p, --recording-button-page   Which page to put the recording button on.
                                                           [number] [default: 5]
  -i, --recording-button-index  Recording button position. [number] [default: 9]
  -O, --streaming-on-icon       Icon to use when streaming.
    [string] [default: "~/tip/program/stream-deck-obs-buttons/streaming-on.svg"]
  -F, --streaming-off-icon      Icon to use when streaming is stopped.
   [string] [default: "~/tip/program/stream-deck-obs-buttons/streaming-off.svg"]
  -E, --streaming-error-icon    Icon to use when something goes wrong.
      [string] [default: "~/tip/program/stream-deck-obs-buttons/error-icon.gif"]
  -P, --streaming-button-page   Which page to put the streaming button on.
                                                           [number] [default: 5]
  -I, --streaming-button-index  Streaming button position.[number] [default: 10]
  -r, --error-icon              Backup icon to use when something goes wrong.
      [string] [default: "~/tip/program/stream-deck-obs-buttons/error-icon.gif"]
  -c, --config                  Location of a JSON5 config file.
            [string] [default: "~/.config/stream-deck-obs-buttons/config.json5"]
  -v, --verbose                 Print more information.
                                                      [boolean] [default: false]
  -w, --very-verbose            Print even more information.
                                                      [boolean] [default: false]
  -h, --help                    Show help                              [boolean]

(By default, the page where buttons are inserted is whatever page is currently open in the UI.)

Configuration

The program will optionally load a configuration from the path specified by --config or ~/.config/stream-deck-obs-buttons/config.json5. (JSON5 is like JSON, but with looser parsing rules similar to those of JavaScript objects.)

The JSON5 document can contain the flags from the --help section except camel cased rather than dashed. For example:

{
  recordingButtonIndex: 12, // indexed from 1
  recordingButtonPage: 3,
  errorIcon: '~/.config/stream-deck-obs-buttons/error-icon.gif',
}

System Service

To have the program run as a system service, first put the service definition in the correct place:

cp stream-deck-obs-buttons.service ~/.config/systemd/user/

It can then be started with:

systemctl start --user stream-deck-obs-buttons

To have it start automatically, use:

systemctl enable --user stream-deck-obs-buttons
1.0.0

6 months ago

0.11.0

6 months ago

0.10.0

6 months ago

0.9.0

6 months ago

0.8.0

6 months ago