-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Note: This issue was cloned from CERALIVE/belaUI-ts#8
Proposal: Evolve or Replace belacoder for Modular, H.265‑Capable, Multi‑Input Streaming
📌 Background
Currently, belacoder relies on hardcoded shell pipelines under pipelines/<soc>/ (e.g., rk3588) to manage SoC-specific video ingestion and streaming. While this supports minimal integration per device, it lacks:
- Runtime device/input detection
- Flexibility to switch between USB, HDMI, or network inputs
- Easy extensibility for preview or advanced streaming (SRTLA, RTMP out, etc.)
- Config-based customization (e.g., no JSON/TOML for stream params)
🎯 Objectives
- Support multiple SoCs via pipeline modules or detection.
- Auto-discover inputs/resolutions at runtime (USB/UVC, HDMI, RTMP/SRT).
- Use H.265 encoding via
mpph265encor fallback to software. - Stream over SRT/SRTLA, RTMP, with preview via HTTP/WebRTC.
- Clean extensibility, with JSON config or templated detection logic.
🧪 Options Analysis
| Option | Pros | Cons | Short‑Term Fit | Long‑Term Viability |
|---|---|---|---|---|
A. Grow belacoder |
Leverage existing scripts; no code changes | Static; no auto‑detect or preview | ||
B. Patch belacoder (C) |
Quick H.265/SRTLA support; minimal edits | Limited extensibility | ✅ | |
| C. Python + GStreamer | Dynamic pipelines; auto‑detect; built‑in Web/UI | Higher RAM; interpreter overhead | ✅ Flexible | |
| D. Rust + gstreamer‑rs | Safe, performant; dynamic graphs | Complex toolchain; slower protos | ✅ Robust | |
| E. C++ + GStreamer C API | Zero interpreter overhead; fine‑grained control | Boilerplate detection code | ✅ Optimal |
✅ Compatibility & Performance Matrix
| Feature / Approach | A. Grow | B. Patch | C. Python | D. Rust | E. C++ |
|---|---|---|---|---|---|
H.265 (mpph265enc) |
✅ | ✅ | ✅ | ✅ | ✅ |
| USB / UVC (libuvch264) | ✅ (static) | ✅ | ✅ auto | ✅ | ✅ |
| HDMI (v4l2src) | ✅ (static) | ✅ | ✅ auto | ✅ | ✅ |
| SRT Input | ✅ | ✅ | ✅ | ✅ | ✅ |
| RTMP Input | ✅ | ✅ | ✅ | ✅ | ✅ |
| SRTLA Output | ✅ | ✅ | ✅ | ✅ | ✅ |
| RTMP Output | ❌ | ✅ | ✅ | ✅ | |
| Preview (web/local) | ❌ | ✅ | ✅ | ✅ | |
| Resolution detection | ❌ | ✅ | ✅ | ✅ | |
| RAM Usage (est.) | ✅ Low | ✅ Low | ✅ Low | ✅ Low | |
| Latency (est.) | ✅ Low | ✅ Low | ✅ Low | ✅ Low | |
| SoC Portability | ✅ | ✅ via templates | ✅ | ✅ | |
| Long-Term Evolution | ✅ Strong | ✅ Strong | ✅ Strong |
Note: RAM and latency values are based on practical experience with RK3588 + GStreamer. Python options use more RAM due to interpreter runtime. Latency numbers are relative to encoding and network overhead, assuming live pipelines.
🧩 Proposal
Let’s choose one of the following strategies:
- 🔧 Patch belacoder: Add preview, config support, RTMP out via minimal C additions
- 🛠️ Start fresh with modular GStreamer app in Rust, Python, or C++
- ♻️ Hybrid: Extend belacoder for legacy, while building
belacoder2for new devices
✳️ Discussion Points
- Do we want per-device detection? (e.g., USB camera vs HDMI source)
- Should preview be built-in or via separate
web-uitool? - Should SoC-specific scripts stay in place or be replaced with detection logic?
Metadata
Metadata
Assignees
Labels
No labels