Code Monkey home page Code Monkey logo

obs-command-source's Introduction

Dummy Source to Execute Command

This plugin provides a dummy source to execute arbitrary commands when a scene is switched.

Current Features

  • Start a command at the following events.
    • Show (the source is shown in either preview or program)
    • Hide (the source is hidden so that no longer shown in neither preview nor program)
    • Activate (the source goes to the program)
    • Deactivate (the source goes from the program)
    • Show in preview (the source goes to the preview)
    • Hide from preview (the source goes from the preview)
  • Optionally, kill the created process at these conditions. This feature is not available for Windows as of now.
    • When hiding, kill the process created at shown.
    • When deactivating, kill the process created at activated.
    • When hiding from the preview, kill the process created at preview.

Possible Usage

  • Implementing custom tally lights.
  • Control PTZ cameras by switching the scene. You may combine with CURL to send some commands.
  • Start and stop a daemon program required for the scene.
  • Trigger other operations through websocket at the event. A helper script is available at tools/request-websocket.py.
    • Start or stop your streaming and recording.
  • Not limited to the above.

Caution

Since this plugin executes arbitrary commands, users need to consider security concerns. For example, when combining with obs-websocket plugin, a remote user could change property through the websocket interface so that the arbitrary commands can be executed.

Build

Linux

git clone https://github.com/norihiro/obs-command-source.git
cd obs-command-source
mkdir build && cd build
cmake \
	-DLIBOBS_INCLUDE_DIR="<path to the libobs sub-folder in obs-studio's source code>" \
	-DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install

macOS

git clone https://github.com/norihiro/obs-command-source.git
cd obs-command-source
mkdir build && cd build
cmake \
	-DLIBOBS_INCLUDE_DIR=<path to the libobs sub-folder in obs-studio's source code> \
	-DLIBOBS_LIB=<path to libobs.0.dylib> \
	-DOBS_FRONTEND_LIB=<path to libobs-frontend-api.dylib> \
	..
make -j4
# Copy obs-command-source.so to the obs-plugins folder

obs-command-source's People

Contributors

eribertomota avatar norihiro avatar

Stargazers

 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

obs-command-source's Issues

"Shown In Preview" command is not triggered when the source is inside a Group

Hello
In OBS, I am in "studio mode" with a scene containing (among others sources...) a Group, and inside that group, there is an obs-command-source named Execute command
In the properties of that source I have a command (an microsoft windows command MSG ... just for testing) in the field Shown in Preview.
But, when I click on the eye of the source to activate it in the preview, the command MSG... is not triggered

It works well when the obs-command-source is not in a group inside the scene so the problem is related to the fact that the source is inside a group

Command triggered by preview

This is a request on forum

umlang
This is very useful. Any way to distinguish between Preview and Program? Looking for a way to execute command when in Preview, and another on exit of Preview. Similar to Activate/Deactivate for Program. It looks like currently Show/Hide executes on either Preview/Program.

Sending Signal seems not working in 0.3.1

Dear @norihiro,

I added "xcalc" at "Activated" and I set "Send signal to the command at activated when deactivating". I am using "SIGTERM". The xcalc is shown after the transition from "Preview" to "Program". However, the process keeps alive when the transition is made again and the scene returns to Preview.

Thanks!

Please, drop rpath (I need this for Debian)

Hi @norihiro,

I finished the packaging of the obs-command-source for Debian. Lintian (the packaging checker tool) shows an Error and it is impeditive to send the package.

E: obs-command-source: custom-library-search-path RUNPATH /usr/lib [usr/lib/x86_64-linux-gnu/obs-plugins/command-source.so]

There is an explanation about this issue here[1].

[1] https://lintian.debian.org/tags/custom-library-search-path

Could you check this?

Just for curiosity, the packaging is available here[2].

[2] https://salsa.debian.org/eriberto/obs-command-source

Thanks in advance.

Building it on mac

Hi, I'm trying to do this, but I get this error and don't know what to do exactly:

I run the cmake, but get this error:

cmake /Users/mynameis/Downloads/obs-command-source-master
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBOBS_INCLUDE_DIR
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
used as include directory in directory /Users/mynameis/Downloads/obs-command-source-master
OBS_LIBRARIES
linked by target "command-source" in directory /Users/mynameis/Downloads/obs-command-source-master

-- Configuring incomplete, errors occurred!
See also "/Users/mynameis/Downloads/caca/CMakeFiles/CMakeOutput.log".

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.