Skip to content

Vaibhav-20022002/LinuxCAM-RTP-Streamer

Repository files navigation

🎥 C++ RTP/MJPEG Streamer

Build Status License Language Platform

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.


⚠️ Project Status

⚠️ 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. ¯\(ツ)/¯


🌟 Features

Modular pipeline – Four cleanly separated stages:

  • DriverFrameForgerTurboSnapPacketPulse. 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.


🏗 Architecture Overview

┌─────────┐      ┌─────────────┐      ┌───────────┐      ┌────────────┐
│ Driver  │ ──▶  │ FrameForger │ ──▶  │ TurboSnap │ ──▶  │ PacketPulse│
└─────────┘      └─────────────┘      └───────────┘      └────────────┘
         \____________________ RingMaster _________________/

Modularity meets concurrency. Each stage is dedicated, concurrent, and connected via a lock-free ring buffer.


🎞 Supported Formats

  • 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

🛠 Prerequisites

  • Linux machine with:

    • ✅ V4L2 or LibCamera-compatible device
  • 🧰 Build tools:

    • C++17 compiler (GCC ≥ 9, Clang ≥ 11)
    • TurboJPEG development libraries

🤝 Contributing

  1. 🍴 Fork this repo

  2. 🔧 Create your feature branch: git checkout -b feature/

  3. 💬 Commit your changes: git commit -m "Add cool new thing"

  4. 🚀 Push to your branch: git push origin feature/

  5. 📬 Open a pull request

Contributions, ideas, bug reports, and improvements are welcome!


📄 License

This project is licensed under the MIT License.

Do what you want


💬 Final Note

⚠️ 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 ¯\(ツ)/¯).

About

RTP/MJPEG Linux Streamer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published