Clip-It is a lightweight automation tool that enables a computer running OBS Studio to save a replay buffer clip upon receiving a specific MQTT message. This facilitates seamless integration between OBS and external systems, such as game servers, smart home devices, or custom hardware, allowing for automated clip recording without manual intervention.
- OBS Studio: Ensure OBS is running with the replay buffer enabled.
- MQTT Broker: Clip-It connects to a specified MQTT broker and listens for a predefined topic.
- Triggering a Clip: When a message is published to the designated topic, Clip-It sends a command to OBS to save the current replay buffer, capturing recent content.
This setup is ideal for scenarios like:
- Automatically recording gameplay highlights triggered by in-game events.
- Integrating with IoT devices to capture moments based on physical actions.
- Coordinating with other software systems to record specific events.
Clip-It/
├── Clip-It-Listener # Contains platformio project for Esp32 that acts as an alexa device
├── scripts/
│ ├── ClipIt.ps1 # Allows OBS to run initiate ClipIt
├── src/
│ ├── OBS.py # Handles communication with OBS via WebSocket
│ ├── mqtt_handler.py # Manages MQTT connections and message handling
│ └── main.pyw # Entry point to start the Clip-It service
├── requirements.txt # Python dependencies
└── README.md # Project documentation
-
Clone the Repository:
git clone https://github.com/HansChaudry/Clip-It.git cd Clip-It -
Set Up a Virtual Environment (Optional but Recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure OBS:
- Enable the Replay Buffer in OBS settings.
- Start the Replay Buffer.
-
Set Up OBS WebSocket:
- Install the obs-websocket plugin if not already included.
- Note the WebSocket server port and authentication settings.
-
Configure MQTT Settings:
- Update
config.pywith your MQTT broker details and the topic to subscribe to.
- Update
-
Run Clip-It:
python src/main.py
Clip-It will now listen for MQTT messages on the specified topic and trigger OBS to save the replay buffer when a message is received.
To test the setup, publish a message to the configured MQTT topic using a tool like mosquitto_pub:
mosquitto_pub -h your_broker_address -t your/topic -m "trigger"Upon receiving this message, OBS should save the current replay buffer as configured.
This project is licensed under the MIT License. See the LICENSE file for details.