MiBeeNvr

module
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MIT

README ยถ

MiBee NVR

MiBee NVR logo

GitHub Release CI Go Svelte SQLite Docker ARM

Turn any low-power ARM device into a professional NVR in 60 seconds.
Single binary, zero dependencies, no cloud required. Runs on low-power ARM devices with a 512MB memory budget.

ไธญๆ–‡ โ€” English

Quick Start

curl -fsSL https://raw.githubusercontent.com/Mi-Bee-Studio/MiBeeNvr/main/install.sh | sudo bash

Downloads the binary, creates a system user (nvr), generates a config, installs a systemd service, and starts it. Data directory: /var/lib/mibee-nvr.

Option 1: Pre-built Binary

Download the latest binary from GitHub Releases:

# AMD64 (most PCs/servers)
wget https://github.com/Mi-Bee-Studio/MiBeeNvr/releases/latest/download/mibee-nvr-amd64
chmod +x mibee-nvr-amd64

# ARM64 (Raspberry Pi 4/5, etc.)
wget https://github.com/Mi-Bee-Studio/MiBeeNvr/releases/latest/download/mibee-nvr-arm64
chmod +x mibee-nvr-arm64

# ARMv7 (Raspberry Pi 2/3, etc.)
wget https://github.com/Mi-Bee-Studio/MiBeeNvr/releases/latest/download/mibee-nvr-armv7
chmod +x mibee-nvr-armv7

Initialize config and start:

./mibee-nvr-amd64 init --password yourpassword
./mibee-nvr-amd64 -config mibee-nvr.yaml

Open http://localhost:9090 to access the Web UI.

Option 2: Docker
docker compose --project-directory . -f deploy/docker/docker-compose.yml up -d

Open http://localhost:9090 to access the Web UI.

To store recordings on an external drive, edit the volume mount in docker-compose.yml:

    volumes:
      - /mnt/external/nvr:/data    # โ† change to your host path
    environment:
      - NVR_DATA_DIR=/data          # must match the volume mount
Option 3: Build from Source
git clone https://github.com/Mi-Bee-Studio/MiBeeNvr.git
cd MiBeeNvr
make build
./mibee-nvr init --password yourpassword
./mibee-nvr -config mibee-nvr.yaml

For detailed setup, see Getting Started.

Why MiBee NVR?

  • Single Binary: Zero dependencies, embedded Svelte 5 SPA, CGO_ENABLED=0
  • Low-Power ARM Ready: Runs on 1GB RAM with a 512MB memory budget (validated on Raspberry Pi 3B as the minimum baseline)
  • Multi-Protocol Streaming: HLS, WebRTC, HTTP-FLV, RTMP, SRT, WebSocket
  • No Cloud Required: Self-hosted, no subscriptions, no vendor lock-in
  • Modern Web UI: Dark/light themes, i18n support, responsive design
  • ONVIF Support: Auto-discovery, PTZ control, stream URI management
  • Plug-and-Play Auto-Discover: ONVIF cameras joining the LAN are enrolled automatically in the background (Hikvision-NVR-style) โ€” no manual scan. Unauthenticated devices start recording immediately; authenticated ones are added as pending activation until you supply credentials
  • IP Self-Healing: ONVIF cameras that change IP (Wi-Fi roaming across APs) are auto-relocated by serial number and reconnected โ€” unicast probing works across routed subnets
  • Smart Integrations: MQTT triggers, WebDAV, FTP, FFmpeg transcoding

Screenshots

Login
Login page with dark/light theme toggle and authentication

Dashboard
Dashboard with live camera feeds, recording status, and system metrics

Settings
Settings panel for camera configuration and system management

Features

๐Ÿ“ท Camera Support
  • RTSP (H.264/H.265/MJPEG) streaming
  • HTTP JPEG snapshot streaming
  • ONVIF discovery & management with PTZ control
  • Xiaomi CS2 + legacy TUTK (7 models) cloud camera support
  • SRT/RTMP push-in cameras (cross-network ingest โ€” receive streams from remote publishers)
  • Native Go push-out relay (forward any camera to remote RTMP/RTSP targets; FFmpeg optional for compatibility)
๐Ÿ“บ Streaming & Live View
  • HLS on-demand streaming with LL-HLS support
  • WebRTC WHEP for sub-second latency viewing
  • HTTP-FLV for browser-friendly streaming
  • RTMP ingest server for push/pull workflows
  • SRT low-latency transport receiver
  • WebSocket real-time binary frame streaming
๐Ÿ’พ Recording & Storage
  • Automatic MP4 segment generation
  • Multi-camera concurrent recording
  • Per-camera retention policies
  • Audio capture (AAC + G.711 + Opus)
  • Segment merging with configurable policies
  • Periodic timelapse recording
๐Ÿ”ง Management
  • Modern Svelte 5 web UI with dark/light themes
  • REST API for automation
  • BasicAuth with bcrypt password hashing
  • Prometheus metrics integration
  • Atomic configuration with validation
๐Ÿค– Smart Features
  • Browser-side AI detection (ONNX Runtime Web, WebGPU-accelerated) โ€” no backend inference
  • Audio recording and live preview playback (G.711 ฮผ-law/A-law + Opus)
  • Multi-layer camera health monitoring
  • Auto-remediation for connection issues
  • SSE-based real-time event system
  • Quality scoring and alerting
๐Ÿ”Œ Integrations
  • MQTT trigger-based recording
  • WebDAV server for file access
  • FTP server for remote uploads
  • FFmpeg hardware transcoding
  • Event-driven architecture

Supported Protocols

Protocol Direction Status Notes
RTSP Camera โ†’ NVR โœ… Done H.264/H.265/MJPEG support
HTTP JPEG Camera โ†’ NVR โœ… Done Snapshot streaming
HLS NVR โ†’ Browser โœ… Done On-demand streaming
WebRTC NVR โ†’ Browser โœ… Done WHEP sub-second latency
HTTP-FLV NVR โ†’ Browser โœ… Done Browser-friendly streaming
RTMP (ingest) Camera โ†’ NVR โœ… Done Push-in: receive streams from remote publishers
SRT (ingest) Camera โ†’ NVR โœ… Done Push-in: low-latency transport
RTMP (relay) NVR โ†’ External โœ… Done Push-out: native Go relay to remote targets
RTSP (relay) NVR โ†’ External โœ… Done Push-out: native Go relay to remote targets
ONVIF Camera โ†” NVR โœ… Done Discovery, PTZ, stream URI
Xiaomi (CS2 + TUTK) Camera โ†’ NVR โœ… Done CS2 P2P + legacy TUTK (7 models), cloud auth

Use Cases

๐Ÿ  Home Security

Monitor your property with multiple cameras. Motion-triggered recording, smartphone alerts, and easy remote viewing from anywhere.

๐Ÿช Small Business

Affordable security system for shops, offices, and warehouses. Multi-camera support with individual retention policies.

๐Ÿ”ง DIY/Tinkering

Perfect for homelab enthusiasts. Self-hosted, no subscriptions, works with any RTSP camera and integrates with smart home systems.

Documentation

Document Description
Getting Started Installation, first camera setup
Upgrade Guide Breaking changes & migration steps between versions
ๅ‡็บงๆŒ‡ๅ— ็‰ˆๆœฌ้—ด็š„็ ดๅๆ€งๅ˜ๆ›ดไธŽ่ฟ็งปๆญฅ้ชค
Configuration Full config reference
API Reference REST API documentation
MediaMTX Guide MediaMTX integration for CSI cameras
Deployment systemd, reverse proxy, cross-compile, and per-platform NAS guides (unRAID / fnOS / iStoreOS / Synology / QNAP / ๆž็ฉบ้—ด)
Auto-update (Docker) Manual + optional Watchtower auto-updates and rollback
Xiaomi Setup Xiaomi cloud camera integration
ONVIF Guide ONVIF camera setup, PTZ control, troubleshooting
Camera Guide Camera setup, protocols, troubleshooting
FTP Integration FTP file access setup
MQTT Integration MQTT smart home integration
WebDAV Integration WebDAV file access setup
Troubleshooting Common issues and solutions
Transcoding FFmpeg transcoding setup
Prometheus Metrics Complete Prometheus metric reference with types, labels, and examples
Relay Guide RTMP live platform relay configuration and troubleshooting
่ฝฌๅ‘ๆŒ‡ๅ— RTMP ็›ดๆ’ญๅนณๅฐ่ฝฌๅ‘้…็ฝฎๅ’Œๆ•…้šœๆŽ’้™ค
Remote Access External/4G access via Tailscale, Cloudflare Tunnel, and WebRTC ICE/STUN/TURN config
่ฟœ็จ‹่ฎฟ้—ฎ ๅค–็ฝ‘/4G ่ฎฟ้—ฎ:Tailscaleใ€Cloudflare Tunnel ๅŠ WebRTC ICE/STUN/TURN ้…็ฝฎ

Build & Deploy

# Build for current architecture
make build

# Cross-compile for ARM64 (Raspberry Pi)
make cross

# Run tests
make test

# Build Docker images
make docker-build       # Multi-stage build
make docker-build-arm64 # Cross-compile arm64 (no QEMU)
make docker-build-all   # All architectures

Docker deployment:

docker compose --project-directory . -f deploy/docker/docker-compose.yml up -d

Images published to ghcr.io/mi-bee-studio/mibeenvr with tags: latest, v1.2.3, sha-abc1234

Project Structure

cmd/mibee-nvr/       # CLI entry point + app lifecycle
internal/            # Core packages (39 Go modules)
web/                # Svelte 5 SPA frontend
deploy/             # systemd services, Caddyfile
docs/               # Bilingual documentation (EN/ZH)
tests/              # Integration tests
e2e-tests/         # Playwright E2E tests

For full project details, see the architecture overview.

Contributing

  1. Run make lint before submitting (golangci-lint v2; run make lint-install first)
  2. Add tests for new features
  3. Write clear commit messages

License

MIT License ยฉ Mi&Bee Studio

Directories ยถ

Path Synopsis
cmd
mibee-nvr command
internal
ai
api
autodiscover
Package autodiscover implements background ONVIF device discovery and automatic camera enrollment โ€” the "plug-and-play" experience where a camera appears in the NVR the moment it joins the network, with no manual scan.
Package autodiscover implements background ONVIF device discovery and automatic camera enrollment โ€” the "plug-and-play" experience where a camera appears in the NVR the moment it joins the network, with no manual scan.
avi
Package avi implements a pure-Go AVI RIFF muxer and demuxer.
Package avi implements a pure-Go AVI RIFF muxer and demuxer.
backoff
Package backoff provides shared retry-backoff helpers used across the NVR (camera recorders, stream relay targets, ingest reconnects).
Package backoff provides shared retry-backoff helpers used across the NVR (camera recorders, stream relay targets, ingest reconnects).
flv
ftp
health
Package health implements the camera health monitoring system.
Package health implements the camera health monitoring system.
hls
livetranscode
Package livetranscode provides pure-Go utilities for live transcoding of video streams.
Package livetranscode provides pure-Go utilities for live transcoding of video streams.
mediaprobe
Package mediaprobe provides pure-Go media file metadata probing.
Package mediaprobe provides pure-Go media file metadata probing.
middleware/remotelog
Package remotelog implements an slog.Handler that batches and ships logs to VictoriaLogs (or any JSON-lines ingestion endpoint).
Package remotelog implements an slog.Handler that batches and ships logs to VictoriaLogs (or any JSON-lines ingestion endpoint).
model/nalutil
Package nalutil provides shared NALU (Network Abstraction Layer Unit) detection utilities for H.264 and H.265 video streams.
Package nalutil provides shared NALU (Network Abstraction Layer Unit) detection utilities for H.264 and H.265 video streams.
mp4util
Package mp4util holds shared helpers for constructing MP4 decoder configuration records (avcC / hvcC) used by the timelapse, merge, and muxer packages.
Package mp4util holds shared helpers for constructing MP4 decoder configuration records (avcC / hvcC) used by the timelapse, merge, and muxer packages.
rediscovery
Package rediscovery implements IP self-healing for cameras whose address changes at runtime (e.g.
Package rediscovery implements IP self-healing for cameras whose address changes at runtime (e.g.
srt
timelapse
Shared MP4 box-skeleton + frame I/O for the H.264 and H.265 Go mergers.
Shared MP4 box-skeleton + frame I/O for the H.264 and H.265 Go mergers.
transcoding
Package transcoding provides hardware-aware video transcoding for stored recordings.
Package transcoding provides hardware-aware video transcoding for stored recordings.
ui
update
Package update implements the in-app "new version available" SENSING layer.
Package update implements the in-app "new version available" SENSING layer.
xiaomi
Package xiaomi implements Xiaomi camera support for MiBee NVR, including CS2 P2P transport, MISS protocol, cloud authentication, and HLS live streaming via model.HLSProvider.
Package xiaomi implements Xiaomi camera support for MiBee NVR, including CS2 P2P transport, MISS protocol, cloud authentication, and HLS live streaming via model.HLSProvider.
pkg
app
Package app provides the root application orchestrator for MiBee NVR.
Package app provides the root application orchestrator for MiBee NVR.
camera
Package camera exposes the camera Manager interface for external (out-of-module) consumers, primarily the commercial P2P module that needs to enumerate cameras, read status, and subscribe to media frames for WebRTC tracks.
Package camera exposes the camera Manager interface for external (out-of-module) consumers, primarily the commercial P2P module that needs to enumerate cameras, read status, and subscribe to media frames for WebRTC tracks.
eventbus
Package eventbus exposes the pub/sub event Bus interface for external (out-of-module) consumers, primarily the commercial P2P module that needs to receive motion detection, camera status, and storage events to push to mobile apps.
Package eventbus exposes the pub/sub event Bus interface for external (out-of-module) consumers, primarily the commercial P2P module that needs to receive motion detection, camera status, and storage events to push to mobile apps.
streamhub
Package streamhub exposes the frame distribution Hub interface for external (out-of-module) consumers, primarily the commercial P2P module that needs to subscribe to camera frames for WebRTC tracks.
Package streamhub exposes the frame distribution Hub interface for external (out-of-module) consumers, primarily the commercial P2P module that needs to subscribe to camera frames for WebRTC tracks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL