Blazing-fast, single-process MJPEG streaming over UDP Capture, convert, packetize, and broadcast live video from any V4L2 or libcamera-compatible device — all in real time.
⚠️ Heads up: This version is a total dumpster fire - doesn’t work at all. But you’ve still got 99% (.99?) of the units up and running. Will fix in the next version hopefully, with more optimisations. ¯\(ツ)/¯
✨ Modular pipeline – Four cleanly separated stages:
Driver→FrameForger→TurboSnap→PacketPulse. All interconnected with blazing-fast, lock-free SPSC queues ("RingMaster").
🌀 Zero-copy MJPEG – If your camera provides MJPEG natively, it bypasses encoding for ultra-low latency streaming.
🏎️ SIMD-accelerated JPEG encoding – For non-MJPEG formats, TurboSnap leverages TurboJPEG (with SIMD) to squeeze every CPU cycle.
🧵 Single-process, multi-threaded – Max efficiency. All four stages live harmoniously inside one process.
⚙️ Configurable defaults – Autodetects best camera format. Binds to 0.0.0.0:5004 if nothing is provided.
📚 Well-documented – Javadoc-style inline comments and intuitive naming for seamless exploration.
┌─────────┐ ┌─────────────┐ ┌───────────┐ ┌────────────┐
│ Driver │ ──▶ │ FrameForger │ ──▶ │ TurboSnap │ ──▶ │ PacketPulse│
└─────────┘ └─────────────┘ └───────────┘ └────────────┘
\____________________ RingMaster _________________/
Modularity meets concurrency. Each stage is dedicated, concurrent, and connected via a lock-free ring buffer.
-
Input Pixel Formats (priority order):
- 🟢 MJPEG (preferable: skips re-encoding)
- 🟡 YUV420
- 🟠 YUV422
- 🔵 RGB24
-
Output:
- RTP/MJPEG over UDP
-
Codec Support:
- ✅ MJPEG
- ⛔ No H.264/H.265/AV1 — planned for future versions
-
Linux machine with:
- ✅ V4L2 or LibCamera-compatible device
-
🧰 Build tools:
- C++17 compiler (GCC ≥ 9, Clang ≥ 11)
- TurboJPEG development libraries
-
🍴 Fork this repo
-
🔧 Create your feature branch: git checkout -b feature/
-
💬 Commit your changes: git commit -m "Add cool new thing"
-
🚀 Push to your branch: git push origin feature/
-
📬 Open a pull request
Contributions, ideas, bug reports, and improvements are welcome!
This project is licensed under the MIT License.
Do what you want
⚠️ This thing's half-baked and totally experimental.
Tinker with it if you want, or just scrap it and build something way cooler using whatever you can learn/take from here. Up to you—no pressure (and no guarantees ¯\(ツ)/¯).