English | 日本語
A versatile WebRTC plugin for OBS Studio that provides Universal WebRTC Input & Output.
While perfect for OBS-to-OBS relay, it also enables you to receive streams from browsers, mobile devices, and other WHIP clients directly into OBS as a source.
This plugin supports both SFU Relay (WHIP/WHEP) for stability and Direct P2P for low latency.
Best for: Internet streaming, receiving from multiple sources (Browsers, Mobiles), and complex networks.
(Compatible with any WHIP/WHEP compliant SFU like LiveKit, SRS, Janus)
graph LR
Source[OBS / Browser / Mobile] -- WHIP --> SFU[SFU Server (e.g. LiveKit)]
SFU -- WHEP --> Receiver[OBS (This Plugin)]
SFU -- WHEP --> Browser[Browser Viewer]
Best for: Local Area Networks (LAN) or 1-on-1 direct connections.
graph LR
Peer[OBS / Browser Peer] -- P2P / Direct --> Receiver[OBS (This Plugin)]
- Receive video/audio from other OBS instances.
- Receive streams from web browsers (via WebRTC).
- Receive from mobile apps or any WHIP-compatible publisher.
- SFU Relay Support: Stable connections through WHIP/WHEP compliant servers (LiveKit tested).
- Direct P2P: Ultra-low latency direct connections.
- Output: Send OBS Program output via WebRTC.
- Source: Add a “WebRTC Link Source” to receive streams.
- Automatic reconnection
- Hardware accelerated encoding/decoding (NVENC/AMF/QuickSync)
Current Release (v0.1.0):
Note: Pre-built Windows installer is planned for future releases. For now, please follow the build instructions in BUILD.md.
- Add Source
- Click
+in the Sources panel - Select
WebRTC Link Source - Name your source (e.g., "Remote Feed")
- Click
Screenshot will be added in a future release
-
Configure Connection Mode
Choose between SFU (recommended) or P2P mode based on your use case.
Receiver (Your OBS):
- Add
WebRTC Link Source - Mode:
SFU (WHEP) - URL:
https://your-sfu-endpoint/whep - Token: subscriber token
Screenshot will be added in a future release
Sender:
- OBS: select WebRTC Output
- Browser/Mobile: publish via WHIP or LiveKit SDK
Sender:
- Choose "P2P Host"
- Copy the Session ID
Receiver:
- Add
WebRTC Link Source - Select
P2P Client - Paste Session ID
Screenshot will be added in a future release
For detailed, step-by-step guides covering common use cases:
- Usage Examples Guide - Comprehensive examples including:
- OBS-to-OBS relay via LiveKit
- Browser to OBS (guest input)
- Direct P2P connections
- Mobile device as wireless camera
- Audio-only mode for podcasts
- Troubleshooting tips
For LiveKit server setup, see LiveKit Setup Guide.
For easy local testing with LiveKit SFU, you can use the included Docker environment:
1. Navigate to the docker directory:
cd docker/livekit2. Copy the example environment file:
cp .env.example .env3. Generate API credentials:
# Generate API Key
openssl rand -base64 32
# Generate API Secret
openssl rand -base64 324. Edit .env and set your credentials:
LIVEKIT_API_KEY=your-generated-api-key
LIVEKIT_API_SECRET=your-generated-api-secret5. Start LiveKit:
docker-compose up -dOnce running, LiveKit will be available at:
- WebRTC API:
http://localhost:7880 - WHIP Endpoint:
http://localhost:7880/whip - WHEP Endpoint:
http://localhost:7880/whep
To connect to LiveKit, you need to generate access tokens. You can use the LiveKit CLI or generate tokens programmatically.
Using LiveKit CLI:
# Install LiveKit CLI
go install github.com/livekit/livekit-cli/cmd/livekit-cli@latest
# Generate a publisher token (for WHIP)
livekit-cli create-token \
--api-key <LIVEKIT_API_KEY> \
--api-secret <LIVEKIT_API_SECRET> \
--join --room my-room --identity publisher \
--valid-for 24h
# Generate a subscriber token (for WHEP)
livekit-cli create-token \
--api-key <LIVEKIT_API_KEY> \
--api-secret <LIVEKIT_API_SECRET> \
--join --room my-room --identity subscriber \
--valid-for 24hdocker-compose downTo remove all data:
docker-compose down -vBefore building the plugin, ensure you have the following requirements:
Required Tools:
- CMake: 3.20 or later (Download)
- Git: For cloning the repository and managing submodules
- C++17 Compatible Compiler:
- Windows: Visual Studio 2019 or later (MSVC 14.2+)
- Linux: GCC 9+ or Clang 10+
- macOS: Xcode 12+ (Apple Clang 12+)
Required Libraries:
- OBS Studio SDK: Version 30.x or later
- You need the compiled OBS Studio with development headers
- See Getting OBS Studio below
Optional (Included as Submodules):
- libdatachannel - WebRTC implementation
- nlohmann-json - JSON library for C++
- Google Test - For unit tests
- Google Benchmark - For performance benchmarks
You have several options to obtain OBS Studio development files:
Windows:
- Download the latest OBS Studio installer from obsproject.com
- Install OBS Studio to the default location (e.g.,
C:\Program Files\obs-studio) - The include files are typically located at:
- Headers:
C:\Program Files\obs-studio\include - Libraries:
C:\Program Files\obs-studio\bin\64bit
- Headers:
macOS:
- Download the OBS Studio DMG from obsproject.com
- Extract the app and locate the development headers inside the bundle
- Alternatively, install via Homebrew:
brew install obs
Linux: Install OBS Studio development packages:
# Ubuntu/Debian
sudo apt install obs-studio libobs-dev
# Fedora
sudo dnf install obs-studio obs-studio-devel
# Arch Linux
sudo pacman -S obs-studioIf you need a specific version or want to contribute to OBS itself:
-
Clone the OBS Studio repository:
git clone --recursive https://github.com/obsproject/obs-studio.git cd obs-studio -
Follow the build instructions for your platform:
-
After building, note the paths to:
- Include directory:
<obs-build-dir>/include - Library directory:
<obs-build-dir>/build/libobsor<obs-build-dir>/build/Release/bin/64bit
- Include directory:
1. Clone the repository with submodules:
git clone --recursive https://github.com/m96-chan/OBS-WebRTC-Link.git
cd OBS-WebRTC-LinkIf you already cloned without --recursive, initialize submodules:
git submodule update --init --recursive2. Configure with CMake:
Open a command prompt or PowerShell and run:
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 ^
-DOBS_INCLUDE_SEARCH_PATH="C:/Program Files/obs-studio/include" ^
-DOBS_LIB_SEARCH_PATH="C:/Program Files/obs-studio/bin/64bit"Replace "Visual Studio 17 2022" with your installed version:
- Visual Studio 2022:
"Visual Studio 17 2022" - Visual Studio 2019:
"Visual Studio 16 2019"
3. Build:
cmake --build . --config ReleaseOr open obs-webrtc-link.sln in Visual Studio and build from the IDE.
4. Install:
cmake --install . --config ReleaseThis will install the plugin to:
- Plugin:
C:\Program Files\obs-studio\obs-plugins\64bit\ - Data:
C:\Program Files\obs-studio\data\obs-plugins\obs-webrtc-link\
Note: You may need administrator privileges to install to Program Files.
1. Clone the repository with submodules:
git clone --recursive https://github.com/m96-chan/OBS-WebRTC-Link.git
cd OBS-WebRTC-Link
git submodule update --init --recursive2. Install dependencies:
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install OBS Studio and dependencies
brew install obs cmake3. Configure with CMake:
For command-line build:
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DOBS_INCLUDE_SEARCH_PATH="/opt/homebrew/include" \
-DOBS_LIB_SEARCH_PATH="/opt/homebrew/lib"For Xcode:
mkdir build && cd build
cmake .. -G Xcode \
-DOBS_INCLUDE_SEARCH_PATH="/opt/homebrew/include" \
-DOBS_LIB_SEARCH_PATH="/opt/homebrew/lib"4. Build:
Command-line:
cmake --build . --config ReleaseOr open the generated Xcode project and build from the IDE.
5. Install:
sudo cmake --install . --config ReleaseThis will install the plugin to:
- Plugin:
/Library/Application Support/obs-studio/plugins/obs-webrtc-link.so - Data:
/Library/Application Support/obs-studio/plugins/obs-webrtc-link/data/
1. Install dependencies:
Ubuntu/Debian:
sudo apt update
sudo apt install build-essential cmake git \
libobs-dev obs-studio \
libssl-dev pkg-configFedora:
sudo dnf install gcc-c++ cmake git \
obs-studio-devel \
openssl-develArch Linux:
sudo pacman -S base-devel cmake git obs-studio openssl2. Clone the repository with submodules:
git clone --recursive https://github.com/m96-chan/OBS-WebRTC-Link.git
cd OBS-WebRTC-Link
git submodule update --init --recursive3. Configure with CMake:
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DOBS_INCLUDE_SEARCH_PATH="/usr/include" \
-DOBS_LIB_SEARCH_PATH="/usr/lib"4. Build:
cmake --build . -j$(nproc)The -j$(nproc) flag uses all available CPU cores for faster compilation.
5. Install:
sudo cmake --install .This will install the plugin to:
- Plugin:
/usr/lib/obs-plugins/obs-webrtc-link.so - Data:
/usr/share/obs/obs-plugins/obs-webrtc-link/
The following CMake options are available to customize the build:
| Option | Default | Description |
|---|---|---|
OBS_INCLUDE_SEARCH_PATH |
- | Path to OBS Studio include directory (required) |
OBS_LIB_SEARCH_PATH |
- | Path to OBS Studio library directory (required) |
BUILD_LIBDATACHANNEL |
ON |
Build libdatachannel from source (submodule) |
LIBDATACHANNEL_DIR |
- | Custom path to libdatachannel installation |
BUILD_TESTING |
ON |
Build unit tests (requires Google Test) |
BUILD_BENCHMARKS |
ON |
Build performance benchmarks (requires Google Benchmark) |
BUILD_TESTS_ONLY |
OFF |
Build only tests without OBS plugin (useful for CI) |
Example: Build without tests and benchmarks:
cmake .. \
-DOBS_INCLUDE_SEARCH_PATH="/path/to/obs/include" \
-DOBS_LIB_SEARCH_PATH="/path/to/obs/lib" \
-DBUILD_TESTING=OFF \
-DBUILD_BENCHMARKS=OFFExample: Use system-installed libdatachannel:
cmake .. \
-DOBS_INCLUDE_SEARCH_PATH="/path/to/obs/include" \
-DOBS_LIB_SEARCH_PATH="/path/to/obs/lib" \
-DBUILD_LIBDATACHANNEL=OFFIf you want to build and run tests without installing OBS Studio:
mkdir build && cd build
cmake .. -DBUILD_TESTS_ONLY=ON
cmake --build . --config Release
ctest --output-on-failureThis is useful for continuous integration (CI) environments.
Included as Git Submodules (Automatically Built):
- libdatachannel: WebRTC implementation
- nlohmann-json: JSON library for C++
- Google Test: Unit testing framework
- Google Benchmark: Performance benchmarking
The project automatically builds these dependencies from submodules. To update them:
git submodule update --remoteUsing System Libraries (Advanced):
If you have libraries installed system-wide and want to use them instead:
cmake .. \
-DBUILD_LIBDATACHANNEL=OFF \
-DOBS_INCLUDE_SEARCH_PATH="/path/to/obs/include" \
-DOBS_LIB_SEARCH_PATH="/path/to/obs/lib"The project includes custom CMake Find modules that automatically locate system libraries. See cmake/README.md for details.
- Open Visual Studio
- Select File → Open → CMake and choose the root
CMakeLists.txt - Visual Studio will automatically configure the project
- Edit CMake settings in
CMakeSettings.jsonto specify OBS paths:{ "configurations": [ { "name": "x64-Release", "generator": "Ninja", "configurationType": "Release", "buildRoot": "${projectDir}\\build", "cmakeCommandArgs": "-DOBS_INCLUDE_SEARCH_PATH=\"C:/Program Files/obs-studio/include\" -DOBS_LIB_SEARCH_PATH=\"C:/Program Files/obs-studio/bin/64bit\"" } ] } - Build the project using Build → Build All
- Generate Xcode project:
mkdir build && cd build cmake .. -G Xcode \ -DOBS_INCLUDE_SEARCH_PATH="/opt/homebrew/include" \ -DOBS_LIB_SEARCH_PATH="/opt/homebrew/lib"
- Open
obs-webrtc-link.xcodeprojin Xcode - Select the target and build configuration (Debug/Release)
- Build using Product → Build (⌘B)
- Open CLion and select Open → Choose the project root directory
- CLion will automatically detect
CMakeLists.txt - Configure CMake options in Settings → Build, Execution, Deployment → CMake:
- Add CMake options:
-DOBS_INCLUDE_SEARCH_PATH=/path/to/obs/include -DOBS_LIB_SEARCH_PATH=/path/to/obs/lib
- Add CMake options:
- Build the project using Build → Build Project
- Install the CMake Tools extension
- Open the project folder in VS Code
- Create or edit
.vscode/settings.json:{ "cmake.configureArgs": [ "-DOBS_INCLUDE_SEARCH_PATH=/path/to/obs/include", "-DOBS_LIB_SEARCH_PATH=/path/to/obs/lib" ] } - Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) and run CMake: Configure
- Build using CMake: Build or press F7
Error: "Could not find OBS Studio"
- Solution: Ensure
OBS_INCLUDE_SEARCH_PATHandOBS_LIB_SEARCH_PATHare correctly set - Verify that OBS Studio is installed and the paths contain
obs-module.handobs.lib/libobs.so
Error: "Submodule not found"
- Solution: Initialize submodules:
git submodule update --init --recursive
Error: "Qt not found" (Windows)
- Solution: Qt is optional for UI components. The plugin will build without Qt, but without UI features.
- To enable Qt, install Qt 5.15+ or Qt 6.x and ensure it's in your PATH, or disable UI:
cmake .. -DQT_FOUND=OFF
Error: "CMake version too old"
- Solution: Update CMake to version 3.20 or later
- Download from cmake.org
Error: "Compiler not found" (Windows)
- Solution: Install Visual Studio 2019 or later with C++ development tools
- Ensure you open "Developer Command Prompt for VS" or run
vcvarsall.bat
Error: "libobs.so not found" (Linux)
- Solution: Install OBS Studio development package:
sudo apt install libobs-dev # Ubuntu/Debian sudo dnf install obs-studio-devel # Fedora
Error: "Permission denied" during install
- Solution: Use
sudoon Linux/macOS:sudo cmake --install . --config Release - On Windows, run Command Prompt as Administrator
Debug Build (for development):
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build . --config DebugDebug builds include:
- Debug symbols for debugging
- No optimizations
- Slower performance but easier to debug
Release Build (for production):
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config ReleaseRelease builds include:
- Full compiler optimizations
- Smaller binary size
- Better performance
Important: Match your build configuration with OBS Studio's configuration. If OBS was built in Release mode, build the plugin in Release mode as well to avoid potential issues.
After building with BUILD_TESTING=ON:
cd build
ctest --output-on-failure --verboseOr run specific tests:
./tests/unit/sample_test
./tests/unit/peer_connection_testAfter building with BUILD_BENCHMARKS=ON:
cd build
./tests/benchmarks/whip_connection_benchmarkAfter installation, verify the plugin is loaded:
- Launch OBS Studio
- Go to Tools → Scripts or check the log file
- Look for "obs-webrtc-link" in the loaded plugins list
- Add a WebRTC Link Source to verify the plugin is working
If you encounter issues:
- Check the Issues page
- Review OBS Plugin Development Guide
- Ask questions in the Discussions section
Licensed under GPLv2.
See LICENSE for full details.
OBSでWebRTC映像を送受信するための汎用プラグインです。
OBS同士のリレーはもちろん、ブラウザ・スマホ・他の配信アプリからの映像をOBSソースとして受信できます。
- ブラウザやスマホからの映像をOBSへ取り込み可能
- LiveKitなどのSFUと接続し、安定した遠隔映像受信が可能
- SFUリレー(推奨):サーバー経由で安定接続
- Direct P2P:LAN向け直接接続
- OBSリレー:自宅↔スタジオ間の伝送
- ゲスト参加:ブラウザ経由で映像を送信
- スマホカメラ:WebRTCを使ったワイヤレスカメラ化
ローカルでのテストを簡単に行うため、LiveKit SFUのDocker環境を用意しています。
1. dockerディレクトリに移動:
cd docker/livekit2. 環境変数ファイルをコピー:
cp .env.example .env3. API認証情報を生成:
# API Keyを生成
openssl rand -base64 32
# API Secretを生成
openssl rand -base64 324. .env ファイルを編集して認証情報を設定:
LIVEKIT_API_KEY=生成したAPIキー
LIVEKIT_API_SECRET=生成したAPIシークレット5. LiveKitを起動:
docker-compose up -d起動後、以下のエンドポイントが利用可能になります:
- WebRTC API:
http://localhost:7880 - WHIP エンドポイント:
http://localhost:7880/whip - WHEP エンドポイント:
http://localhost:7880/whep
LiveKitに接続するには、アクセストークンが必要です。LiveKit CLIを使用するか、プログラムで生成できます。
LiveKit CLIを使用:
# LiveKit CLIをインストール
go install github.com/livekit/livekit-cli/cmd/livekit-cli@latest
# パブリッシャートークンを生成(WHIP用)
livekit-cli create-token \
--api-key <LIVEKIT_API_KEY> \
--api-secret <LIVEKIT_API_SECRET> \
--join --room my-room --identity publisher \
--valid-for 24h
# サブスクライバートークンを生成(WHEP用)
livekit-cli create-token \
--api-key <LIVEKIT_API_KEY> \
--api-secret <LIVEKIT_API_SECRET> \
--join --room my-room --identity subscriber \
--valid-for 24hdocker-compose downすべてのデータを削除する場合:
docker-compose down -v