Skip to content

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.

V6 provides 26 plugins + 1 built-in service (Room), organized into five categories.

PluginFeature FlagDescription
RTMPrtmpRTMP publish/subscribe, with auth and GOP cache
RTSPrtspRTSP publish/subscribe, TCP/UDP transport
HTTP-FLVflvHTTP-FLV streaming, WebSocket-FLV support
HLShlsHLS segmentation and playback, LL-HLS support
WebRTCwebrtcWebRTC publish/subscribe, WHIP/WHEP standard
SRTsrtSRT protocol, low-latency reliable transport
WebTransportwebtransportQUIC-based WebTransport protocol support
GB28181gb28181GB/T 28181 device access and cascading
PluginFeature FlagDescription
MP4 Recordingmp4MP4 recording and VOD playback
Snapshot ServicesnapVideo stream snapshots and MJPEG output
Audio Transcodingffmpeg_transcodeFFmpeg-based audio/video transcoding
Log RotationlogrotateAutomatic log file rotation and cleanup
Debug ToolsdebugDevelopment and debugging utilities
SEI InjectionseiH.264/H.265 SEI data injection
Scheduled TaskscrontabScheduled pull streaming, recording, and other periodic tasks
Stream MixingmixMerge multiple streams into a single output
EncryptioncryptoMedia content encryption
ReportingreportRuntime status and metrics reporting
TestingtestAutomated integration testing plugin
PluginFeature FlagDescriptionDocumentation
Room ServiceroomRoom core service (engine built-in), manages room lifecycle, users, WebSocket, callbacksDetails
Live RoomliveLive room management: gift system, co-hosting, PK battles, bot viewers, data persistenceDetails
Meeting RoommeetingVideo conferencing: agenda, timer, real-time transcription, AI summary, task extractionDetails
Customer Servicecustomer-service1v1 customer service calls: agent management, audio mixing, satisfaction ratingDetails
PluginFeature FlagDescription
ONVIFonvifONVIF protocol device discovery and management
V4L2v4l2Linux Video4Linux2 camera capture
ALSAalsaLinux ALSA audio capture
PluginFeature FlagDescription
HomeKithomekitApple HomeKit camera integration

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.


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"] }
# Enable all plugins (default, without rsmpeg)
features = ["all-plugins"]
# Enable all plugins (with rsmpeg FFmpeg library bindings)
features = ["all-plugins-rsmpeg"]
# Minimal protocol set
features = ["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 scenario
features = ["rtsp", "gb28181", "onvif", "mp4", "snap"]

Each plugin corresponds to a feature flag of the same name (except transcoding, which uses ffmpeg_transcode):

features = ["rtmp"] # Enable RTMP plugin
features = ["snap"] # Enable snapshot plugin
features = ["ffmpeg_transcode"] # Enable transcoding plugin
features = ["gb28181"] # Enable GB28181 plugin

Some plugins have implicit dependencies:

  • srt — also pulls in the srt-tokio system dependency
  • onvif — automatically enables rtsp
  • test — automatically enables rtmp, rtsp, flv, hls, webrtc
  • mjpeg — automatically enables snap
  • live, meeting, customer-service — automatically enable room

Monibuca V6 supports three plugin loading modes:

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.

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 run in a WebAssembly sandbox, providing better isolation. This mode is still under development.

All plugins follow a unified lifecycle management:

Created → Initialized → Running → Stopped
Disabled
  1. Created — Plugin instance is created
  2. Initializedinit() is called, loading configuration and injecting dependencies
  3. Runningstart() is called, the plugin begins serving
  4. Stoppedstop() is called, graceful shutdown
  5. Disabledenable: false in configuration, startup is skipped

The engine manages the initialization order, dependency injection, and graceful shutdown of all plugins through the PluginManager.