High-Performance Video Infrastructure & AI Media Pipeline
RTSP Ingest • Lock-Free In-Memory Demuxing • HLS • WebRTC (WHEP) • fMP4 Archive • gRPC AI Streaming
Read this in other languages: English, Русский.
RUSEON Core is an open-source video infrastructure engine built in Go for IP camera fleets, edge compute appliances, and computer vision pipelines. It ingests H.264 and H.265 video streams over RTSP (TCP/UDP) and multiplexes them directly in memory into HLS (fMP4/TS), WebRTC (WHEP), local fMP4 storage archives, and gRPC frame streams without performing server-side video transcoding.
By eliminating video decoding and re-encoding on the server, RUSEON Core operates with predictable CPU utilization and low-overhead playlist generation, serving as a unified bridge between CCTV camera hardware, web clients, and AI inference models.
Traditional media servers either focus strictly on live video rebroadcasting or require CPU-heavy server-side transcoding pipelines. RUSEON Core approaches video as continuous structured data:
posix_fadvise(FADV_DONTNEED) and sliding-window sync_file_range), preventing continuous video recording writes from evicting the OS Page Cache and causing I/O stalls.SyncWrites = true), coupled with startup archive recovery routines (RecoverCrashedFiles)./livez and /readyz probes reflecting actual subsystem readiness, and structured JSON telemetry./stream/ws/:id) for client-side hardware-accelerated Canvas rendering of H.264 and H.265 streams.StreamFrames) and client-streaming RPCs for AI metadata ingestion (PushMetadata).In RUSEON Core, inbound RTSP packets pass through demuxing and enter an isolated in-memory RingBuffer. Independent workers pull from the buffer concurrently to serve connected protocols and storage targets.
flowchart TD
CAM["IP Cameras / RTSP Sources<br/>(H.264 / H.265)"] -->|RTSP TCP/UDP| INGEST["RTSP Ingest Engine<br/>(gortsplib)"]
INGEST --> NALU["NALU Parser & Demuxer"]
NALU --> RING["Lock-Free RingBuffer<br/>(Per-Stream Memory Cache)"]
RING --> HLS["HLS Engine<br/>fMP4 / TS Packaging"]
RING --> WEBRTC["WebRTC Engine<br/>Pion WHEP / H.264 RTP Track"]
RING --> WS["WebSocket Engine<br/>Binary NALU Stream"]
RING --> RECORDER["fMP4 Archiver<br/>PageCache-Aware Streaming I/O"]
RING --> GRPC["gRPC Server<br/>Frame Extraction (StreamFrames)"]
HLS --> CLIENT_HLS["HLS Players & Browsers"]
WEBRTC --> CLIENT_RTC["Low-Latency WebRTC Viewers"]
WS --> CLIENT_WS["WebCodecs / Canvas Players"]
RECORDER --> DISK["Local Archive Storage<br/>(MP4 Segments)"]
GRPC <--> AI_WORKER["Computer Vision Workers<br/>(Frame Ingest & Metadata Push)"]
AI_WORKER --> BUS["Metadata Broadcaster"]
BUS --> WEBRTC
BUS --> HLS
BUS --> MQTT_WH["MQTT & Webhook Dispatcher"]
For complete technical specifications, see Architecture & System Design.
The following baseline metrics reflect an uninterrupted 8-hour continuous soak test executing under high concurrency on a 12-core host.
| Subsystem | Metric | Measured Value | Operational Characteristics |
|---|---|---|---|
| Ingest Throughput | Total Video FPS | 18,180.4 FPS (1,342.9 Mbps) | 600 concurrent cameras @ 30 FPS, 0 dropped frames (523.6M frames processed) |
| HLS Delivery | Delivered Segments | 501.9 MB/s (17,625,404 segments) | 1,800 active viewers, 15.1 TB transferred (p50: 3.59 ms, p95: 211.2 ms) |
| REST API Engine | Request Throughput | 459.9 RPS (13,244,819 requests) | 10 workers, 100% OK (0 errors, p50: 0.59 ms, p95: 8.52 ms, p99: 28.74 ms) |
| WebRTC (WHEP) | RTP Packet Stream | 2,439,152 packets (2.83 GB transferred) | 240 concurrent peer connections, 0 session errors (p50: 390.3 ms handshake) |
| gRPC AI Stream | Frame & Meta Delivery | 18,180.4 FPS / 1,993.2 RPS | 20 AI workers, 523.6M frames streamed (p50: 28.45 ms delivery latency) |
| EventBus | Webhook Dispatch | 11,042,761 events | 0 dropped events observed during this benchmark |
| System Memory | Process Footprint | 707 MB RSS (95 MB Heap Alloc) | 348 active goroutines at teardown (deterministic worker cleanup) |
| Garbage Collection | Runtime Pause | 1.03 ms avg pause (7.69 ms peak) | 154,969 GC cycles across 8 hours under 500+ MB/s network throughput |
num_cpu: 12, x86_64 architecture).real_disk: false) to isolate and measure CPU, RAM, network throughput, and transmuxing performance independently of physical disk array I/O limits.cmd/loadtest) and the RUSEON Core server ran co-located on the same 12-core host over loopback (127.0.0.1), actively competing for OS scheduler slices, memory bandwidth, and kernel networking stack throughout the benchmark.👉 Read the Full Benchmark Report & Raw Datasets
Launch RUSEON Core in a container with persistent storage volumes (available on Docker Hub and GitHub Container Registry):
# From Docker Hub:
docker run -d \
--name ruseon-core \
-p 8080:8080 \
-p 8555:8555/udp \
-p 50051:50051 \
-v ruseon_data:/app/data \
-v ruseon_recordings:/app/recordings \
rusegal/ruseon-core:latest
# Or from GitHub Container Registry (GHCR):
# docker run -d ... ghcr.io/rusegal/ruseon-core:latest
On first startup, RUSEON Core automatically initializes the database, generates a secure initial administrator password, and logs it to stdout:
docker logs ruseon-core | grep "INITIAL ADMIN PASSWORD"
Navigate to http://localhost:8080 in your browser. Log in with:
adminYou can add and manage camera streams dynamically without restarting the server:
# 1. Obtain JWT access token
TOKEN=$(curl -s -X POST http://localhost:8080/api/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"YOUR_ADMIN_PASSWORD"}' | jq -r .token)
# 2. Register RTSP camera stream
curl -X POST http://localhost:8080/api/cameras \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "cam-front-door",
"url": "rtsp://camera.local:554/live/ch0",
"record": true,
"retention_days": 7
}'
amd64 / arm64), Kernel $\ge$ 5.4 recommended for optimal sync_file_range and fadvise I/O.8080/tcp — HTTP REST API, HLS streaming, WHEP signaling, WebCodecs WebSocket, Web UI, Metrics.8555/udp — WebRTC Pion UDP media multiplexer (configured via server.webrtc.listen_port; when unset, Pion allocates dynamic UDP ports for ICE candidates).50051/tcp — gRPC AI streaming interface (configured via server.grpc.port).When deploying RUSEON Core in production environments, ensure the following best practices:
/app/data to a persistent, durable volume (stores BadgerDB state). Mount /app/recordings to a high-capacity filesystem configured for sequential video writes.server.webrtc.nat_1_to_1_ips with your public or load-balancer IP address, and ensure UDP port 8555 is reachable without symmetric NAT alterations.config.yaml. Secure Context (https://) is required by modern web browsers to initialize WebRTC streams.For full configuration reference and deployment guidelines, see the Deployment Guide.
RUSEON Core exposes standard operational endpoints for monitoring and orchestration:
GET /livez): Verifies that the internal HTTP engine is active and responsive.GET /readyz): Executes real-time health checks against the BadgerDB state store, storage volume writability, and stream manager initialization. Returns 503 Service Unavailable if core components fail.GET /metrics): Exports standard runtime telemetry, stream bitrates, active viewer sessions, dropped packet counts, and storage I/O stats.GET /debug/pprof/*): Standard Go execution profiling (gated behind server.pprof_port configuration).?token=) contain a stream_id claim and are strictly prevented from accessing management REST API endpoints.Admin, Operator, Viewer, Service) via middleware.golangci-lint and automated SAST scans via gosec.For vulnerability disclosure instructions, see SECURITY.md.
| Protocol / Component | Ingest / Source Support | Output / Client Support | Notes |
|---|---|---|---|
| RTSP | H.264, H.265 (TCP / UDP) | — | Client connection concurrency throttled |
| HLS | — | fMP4, MPEG-TS | H.264 / H.265 passthrough; client/browser codec support applies |
| WebRTC (WHEP) | — | H.264 (webrtc.MimeTypeH264) | Sub-second live delivery via Pion WebRTC |
| WebSocket | — | Binary NALU stream | WebCodecs / client-side canvas player (H.264 & H.265) |
| Archive Storage | — | Fragmented MP4 (fMP4) | Local filesystem with POSIX cache management |
| AI Integration | PushMetadata (gRPC) | StreamFrames (gRPC) | Server-streaming video frames & client-streaming metadata |
| Telemetry & Events | — | MQTT v3.1.1 / v5.0, Webhooks | Bounded async queues with circuit breaker |
| State Storage | — | BadgerDB v4 | Pure Go LSM-tree with WAL (SyncWrites = true) |
The official documentation is maintained at docs.ruseon.tech:
BlobStore, StateStore) provide abstraction boundaries for future distributed backends.See Known Limitations for further technical considerations.
RUSEON Core Community Edition is an open-source project available under the MIT License.
The architecture defines interfaces (such as BlobStore and StateStore) designed to accommodate additional storage, authentication, and high-availability backends. Commercial extensions and enterprise deployments are developed separately.
For commercial inquiries, custom deployments, and enterprise support: [email protected]
We welcome community contributions. To get started:
dev branch).go test -v -race ./...
golangci-lint run ./...
RUSEON Core (Community Edition) is licensed under the MIT License.
Content type
Image
Digest
sha256:77e4ebfd1…
Size
50.7 MB
Last updated
25 days ago
docker pull rusegal/ruseon-core