Restreamer (datarhei/core)
The FFmpeg process supervisor that owns live RTSP/RTMP → HLS/RTMP transcoding.
R2-D2 runs one datarhei/core container — "Restreamer" — at a fixed in-cluster URL. Restreamer owns only live FFmpeg processes: RTSP/RTMP inputs, transcode, HLS/RTMP outputs. Everything else (feed metadata, layouts, panels, groups, magic URLs, audit) is the dashboard's job and lives in TrailBase.
Where it sits
| In-cluster URL | RESTREAMER_API_URL (typically http://r2d2-restreamer.innovationhub.vpn:8080) |
| Chart / values | restreamer/ in the parent repo |
| Persistent storage | Longhorn PVC (for the process database + segment cache) |
| Upstream API | /api/v3/process (and friends) |
What Restreamer owns
| Resource | Mutable via | Persistence |
|---|---|---|
| Process configs (input + output FFmpeg command) | PUT /api/v3/process/{id} | datarhei's own DB |
| Live process state (running / stopped / errored) | POST /api/v3/process/{id}/command | runtime only |
| HLS playlists | (served at /<id>/index.m3u8) | regenerated from live |
| RTMP outputs | (egress URLs configured per process) | runtime |
What the dashboard owns about Restreamer
| Per-feed alias / platform / tags / notes | TrailBase restreamer_feed_meta |
| Panels (layout + bindings + name) | TrailBase restreamer_panels |
| Groups (panels + name) | TrailBase restreamer_groups |
| Public tokens (magic URLs) | TrailBase + per-panel/group row |
| Audit log | data/restreamer-audit.jsonl |
The read-before-write rule
Every mutation reads the current process config, diffs in-memory, then PUTs the merged result. Without this, two operators editing overlapping fields (e.g. bitrate and codec) corrupt the running process mid-flight. There is no Restreamer- side optimistic-locking primitive; the read-then-merge dance is the safety net.
KLV passthrough mod (in-flight upstream change)
datarhei/core's current .ts output strips the KLV PID (private MPEG-TS PID
carrying MISB ST 0601 telemetry). The
low-latency player needs KLV preserved.
The KLV-passthrough mod adds a configuration to preserve every PID including KLV
without re-encoding. Until it ships, the wasm engine reads video only and the HUD
shows — for telemetry fields.
Operator quick-reference
| Symptom | First place to look |
|---|---|
| A feed shows degraded in HoloVids but the camera is up | curl $RESTREAMER_API_URL/api/v3/process/<id> — is the FFmpeg process running? |
| Bulk import says "ok" but feeds don't show up | Check data/restreamer-audit.jsonl for per-item errors |
| All feeds dark | The Restreamer container itself — kubectl logs on the pod |
| HLS plays in browser but tile blank | Open browser devtools, watch the .m3u8 request — usually a CORS / origin mismatch |
See the QA Runbook for the full ffprobe / GStreamer diagnostic recipes.
What Restreamer is not
- Not a media library. It doesn't archive segments — that's not its job, and ReductStore handles snapshot history separately.
- Not auth-aware. Restreamer's API is exposed only inside the cluster; the dashboard is the auth boundary.
- Not high-availability. Single replica; a Restreamer outage means no live video until it's back.
See also
- Restreaming — the plane that owns this
- hls.js — the default player engine
- Low-latency player — opt-in sub-second engine that needs the KLV mod
- QA Runbook — diagnostic recipes