Plugin Overview
Monibuca V6 adopts a fully plugin-based architecture. All protocol access, utility functions, and device integration are provided as independent plugin crates. The engine core only handles stream management, configuration, and HTTP services, while specific functionality is assembled from plugins as needed.
Plugin List
Section titled “Plugin List”V6 provides 26 plugins + 1 built-in service (Room), organized into five categories.
Protocol Plugins (8)
Section titled “Protocol Plugins (8)”| Plugin | Feature Flag | Description |
|---|---|---|
| RTMP | rtmp | RTMP publish/subscribe, with auth and GOP cache |
| RTSP | rtsp | RTSP publish/subscribe, TCP/UDP transport |
| HTTP-FLV | flv | HTTP-FLV streaming, WebSocket-FLV support |
| HLS | hls | HLS segmentation and playback, LL-HLS support |
| WebRTC | webrtc | WebRTC publish/subscribe, WHIP/WHEP standard |
| SRT | srt | SRT protocol, low-latency reliable transport |
| WebTransport | webtransport | QUIC-based WebTransport protocol support |
| GB28181 | gb28181 | GB/T 28181 device access and cascading |
Utility Plugins (11)
Section titled “Utility Plugins (11)”| Plugin | Feature Flag | Description |
|---|---|---|
| MP4 Recording | mp4 | MP4 recording and VOD playback |
| Snapshot Service | snap | Video stream snapshots and MJPEG output |
| Audio Transcoding | ffmpeg_transcode | FFmpeg-based audio/video transcoding |
| Log Rotation | logrotate | Automatic log file rotation and cleanup |
| Debug Tools | debug | Development and debugging utilities |
| SEI Injection | sei | H.264/H.265 SEI data injection |
| Scheduled Tasks | crontab | Scheduled pull streaming, recording, and other periodic tasks |
| Stream Mixing | mix | Merge multiple streams into a single output |
| Encryption | crypto | Media content encryption |
| Reporting | report | Runtime status and metrics reporting |
| Testing | test | Automated integration testing plugin |
Room Extension Plugins (4)
Section titled “Room Extension Plugins (4)”| Plugin | Feature Flag | Description | Documentation |
|---|---|---|---|
| Room Service | room | Room core service (engine built-in), manages room lifecycle, users, WebSocket, callbacks | Details |
| Live Room | live | Live room management: gift system, co-hosting, PK battles, bot viewers, data persistence | Details |
| Meeting Room | meeting | Video conferencing: agenda, timer, real-time transcription, AI summary, task extraction | Details |
| Customer Service | customer-service | 1v1 customer service calls: agent management, audio mixing, satisfaction rating | Details |
Device Plugins (3)
Section titled “Device Plugins (3)”| Plugin | Feature Flag | Description |
|---|---|---|
| ONVIF | onvif | ONVIF protocol device discovery and management |
| V4L2 | v4l2 | Linux Video4Linux2 camera capture |
| ALSA | alsa | Linux ALSA audio capture |
Other (1)
Section titled “Other (1)”| Plugin | Feature Flag | Description |
|---|---|---|
| HomeKit | homekit | Apple HomeKit camera integration |
Room System Quick Overview
Section titled “Room System Quick Overview”Monibuca V6’s room system is based on the built-in Room Service and three extension plugins:
┌─────────────────────────────────────────────┐│ Room Service (Engine Built-in) ││ • Room lifecycle management ││ • WebSocket connection management ││ • User join/leave/heartbeat ││ • RoomApi trait and callback system │└─────────────────────────────────────────────┘ ↓ RoomApi trait ↓┌──────────────────────────────────┬──────────────────────────────────┬──────────────────────────────────┐│ Live Plugin (Live Room) │ Meeting Plugin (Meeting Room) │ CustomerService Plugin ││ • Gift system & Combo │ • Agenda management │ • 1v1 sessions (max_users: 2) ││ • Co-hosting (Link-Mic) │ • Timer │ • Session assignment/transfer ││ • PK battles │ • Real-time transcription (ASR) │ • Audio mixing ││ • Bot viewers │ • AI summary & task extraction │ • Satisfaction rating ││ • Data persistence │ • Lobby (waiting room) │ • HTTP API ││ • 100+ viewers │ • 50+ participants │ • 1000+ concurrent sessions │└──────────────────────────────────┴──────────────────────────────────┴──────────────────────────────────┘Scenario Mapping:
- Live streaming scenario → Live plugin + WebRTC publish
- Meeting scenario → Meeting plugin + lobby + recording
- Customer service scenario → CustomerService plugin + HTTP API
See Room System Documentation for details.
Enabling Plugins
Section titled “Enabling Plugins”Monibuca controls plugin compilation and loading through Cargo feature flags. Specify the desired plugins in the [features] section of Cargo.toml:
[dependencies]monibuca = { version = "6.0", features = ["rtmp", "rtsp", "flv", "hls", "mp4"] }Common Feature Combinations
Section titled “Common Feature Combinations”# Enable all plugins (default, without rsmpeg)features = ["all-plugins"]
# Enable all plugins (with rsmpeg FFmpeg library bindings)features = ["all-plugins-rsmpeg"]
# Minimal protocol setfeatures = ["rtmp", "flv", "hls"]
# Live streaming scenario (needs Room service)features = ["rtmp", "flv", "hls", "webrtc", "mp4", "snap", "live", "room"]
# Meeting scenario (needs Room service)features = ["webrtc", "meeting", "room"]
# Customer service scenario (needs Room service)features = ["webrtc", "customer-service", "room"]
# Surveillance scenariofeatures = ["rtsp", "gb28181", "onvif", "mp4", "snap"]Enabling Individual Plugins
Section titled “Enabling Individual Plugins”Each plugin corresponds to a feature flag of the same name (except transcoding, which uses ffmpeg_transcode):
features = ["rtmp"] # Enable RTMP pluginfeatures = ["snap"] # Enable snapshot pluginfeatures = ["ffmpeg_transcode"] # Enable transcoding pluginfeatures = ["gb28181"] # Enable GB28181 pluginSome plugins have implicit dependencies:
srt— also pulls in thesrt-tokiosystem dependencyonvif— automatically enablesrtsptest— automatically enablesrtmp,rtsp,flv,hls,webrtcmjpeg— automatically enablessnaplive,meeting,customer-service— automatically enableroom
Plugin Loading Modes
Section titled “Plugin Loading Modes”Monibuca V6 supports three plugin loading modes:
Static Compilation (Default)
Section titled “Static Compilation (Default)”features = ["static-plugins", "rtmp", "flv"]All enabled plugins are statically linked into the engine binary at compile time. Recommended for production environments, offering the best performance and minimal runtime overhead.
Dynamic Loading
Section titled “Dynamic Loading”features = ["dynamic-plugins"]Plugins are compiled as standalone .so / .dylib / .dll dynamic libraries, loaded by the engine at runtime. Suitable for scenarios requiring hot-swappable plugins or on-demand loading.
Dynamic plugins are placed in the directory configured by plugins_dir:
plugins_dir: "./plugins"WASM Plugins (Experimental)
Section titled “WASM Plugins (Experimental)”WASM plugins run in a WebAssembly sandbox, providing better isolation. This mode is still under development.
Plugin Lifecycle
Section titled “Plugin Lifecycle”All plugins follow a unified lifecycle management:
Created → Initialized → Running → Stopped ↓ Disabled- Created — Plugin instance is created
- Initialized —
init()is called, loading configuration and injecting dependencies - Running —
start()is called, the plugin begins serving - Stopped —
stop()is called, graceful shutdown - Disabled —
enable: falsein configuration, startup is skipped
The engine manages the initialization order, dependency injection, and graceful shutdown of all plugins through the PluginManager.