Modern, open-source RTMP and Enhanced RTMP protocol stack for streaming applications.
OpenRTMP provides a complete, production-ready implementation of RTMP (Real-Time Messaging Protocol) and its modern evolution, Enhanced RTMP (E-RTMP v1/v2). It's designed for developers and organizations building streaming solutions, media servers, broadcast tools, and OBS/FFmpeg integrations.
The project is split into focused, reusable components:
- librtmp2 — Core protocol library (Rust, FFI-compatible)
- librtmp2-server — Ready-to-run media server (Rust)
- librtmp2-server-panel — Web management panel
- .github — Organization documentation and CI/CD
Note:
librtmp2andlibrtmp2-serverare both Rust today, and separate codebases —librtmp2-serverdepends on thelibrtmp2crate to drive its RTMP/RTMPS listener. See Architecture below.
📦 librtmp2
A Rust library implementing the complete RTMP protocol stack — a 1:1 port of the original C librtmp2. Pure protocol logic with no media server, HTTP, or authentication policy built-in. Exposes both an idiomatic Rust API and an FFI-compatible extern "C" API (built as cdylib/staticlib/lib).
Key Features:
- ✅ Legacy RTMP handshake, chunking, and commands
- ✅ E-RTMP v1: ExVideo, FourCC codecs (HEVC, AV1, VP9), HDR metadata
- ✅ E-RTMP v2: Capability negotiation, reconnect, multitrack, ModEx
- ✅ AMF0/AMF3 encoding and decoding
- ✅ RTMPS (RTMP over TLS) via the optional
tlsCargo feature (OpenSSL), enabled by default - ✅
extern "C"FFI layer for consumption from C, Go, Python, PHP, and others - ✅ Callback-based architecture for full control
Perfect for:
- Building custom RTMP servers
- OBS/FFmpeg plugins
- Broadcast tooling
- Protocol research and education
A media server written in Rust (axum + rusqlite) that owns everything around the RTMP protocol — config, persistence, HTTP/REST API, CLI, logging, and stream key generation.
Key Features:
- 💾 SQLite-backed persistence (streams, publishers, players, stats)
- 🔐 Key-based access control (
publish_key,play_key,stats_key) - 📊 JSON and Nginx-compatible XML stats endpoints
- 🔌 REST API for stream management (Bearer token auth)
- 🐳 Docker-ready with Alpine base
- 🔌 RTMP/E-RTMP wire protocol powered by the
librtmp2crate, wired into the server's listener — seesrc/server.rs
Perfect for:
- Private streaming infrastructure
- Stream key/stats/API tooling around an RTMP deployment
- Contributors interested in extending the
librtmp2integration
A lightweight Flask web panel for managing librtmp2-server. Create streams, monitor stats, and manage keys — all from a browser.
Key Features:
- 🌐 Web-based stream management (create, delete, monitor)
- 📊 Live stream statistics (bitrate, codec, viewership)
- 🔐 Key-based publish and play URL generation
- 🔒 CSRF protection, rate limiting, encrypted key storage
- 🐳 Docker-ready deployment
- 🔐 Bearer token authentication for API coordination
- 🍞 Bootstrap dark theme
Perfect for:
- Stream operators managing live events
- Production stream monitoring
- Multi-user stream management
- Integrating librtmp2-server into custom tooling
librtmp2 and librtmp2-server are both Rust, independent codebases — librtmp2-server depends on the librtmp2 crate to drive its RTMP/RTMPS listener.
┌─────────────────────┐
│ OBS / FFmpeg / App │
└──────────┬───────────┘
│
▼
┌──────────────────┐ ┌─────────────────────────┐
│ librtmp2 (Rust) │─────▶│ librtmp2-server (Rust) │
├──────────────────┤ ├─────────────────────────┤
│ Handshake │ │ HTTP API (axum) │
│ Chunking │ │ SQLite persistence │
│ AMF 0/3 │ │ Stream keys / stats │
│ Commands │ │ RTMP/RTMPS listener │
│ E-RTMP v1/v2 │ │ (via librtmp2 crate) │
│ RTMPS (TLS) │ └─────────────────────────┘
│ extern "C" FFI │
└──────────────────┘
▲
│
Embed directly into your own
server / relay / plugin (Rust or FFI)
git clone https://github.com/OpenRTMP/librtmp2.git
cd librtmp2
cargo build --release
cargo testSee the librtmp2 repository for crate docs and the extern "C" FFI surface in src/lib.rs.
git clone https://github.com/OpenRTMP/librtmp2-server.git
cd librtmp2-server
cargo build --release
./target/release/librtmp2-server -c config.example.envSee librtmp2-server README for configuration and deployment. RTMP/RTMPS ingest runs via the embedded librtmp2 crate — see the Architecture section above.
git clone https://github.com/OpenRTMP/librtmp2-server-panel.git
cd librtmp2-server-panel
cp .env.example .env # Edit with your settings
docker compose up -d # Access at http://localhost:8000See librtmp2-server-panel README for configuration.
| Use Case | Solution |
|---|---|
| OBS/FFmpeg Plugin | Use librtmp2 (Rust, FFI-compatible) to add RTMP ingest support from any language |
| Private RTMP Relay | Build on librtmp2 directly, or run librtmp2-server, which embeds it |
| Stream Key / Stats / API Tooling | Use librtmp2-server for its HTTP API, SQLite persistence, and key management |
| Broadcast Tool | Use librtmp2 for protocol handling, focus on your unique logic |
| Protocol Research | Study the reference implementation in librtmp2 |
- librtmp2 source — Module layout (
amf,chunk,ertmp,flv,handshake,message,server,session,transport) - librtmp2 FFI surface —
extern "C"exports for non-Rust consumers - librtmp2-server Project Structure — Rust module layout
- librtmp2-server Deployment — Docker deployment
Both librtmp2 and librtmp2-server are Rust crates built with a stable Rust toolchain.
# librtmp2
cargo build --release
cargo test
# librtmp2-server
cargo build --release
cargo testlibrtmp2's tls Cargo feature (OpenSSL-backed RTMPS) is enabled by default; build without it via cargo build --no-default-features. SQLite for librtmp2-server is vendored via rusqlite's bundled feature — no system SQLite3 needed.
We welcome bug reports, feature requests, and pull requests. Please open an issue first to discuss significant changes.
- Fork the repository you want to contribute to
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes and run tests:
cargo test - Commit with clear messages
- Push to your fork and open a pull request
- Follow existing idiomatic Rust style for the repository you're contributing to
- Add unit tests for new functionality
- Ensure all tests pass:
cargo test
- Parser safety is paramount — all network-provided lengths are bounds-checked
- No buffer overflows, integer overflows, or invalid memory access
- See
SECURITY.mdfor responsible disclosure
All OpenRTMP projects are licensed under the MIT License — free to use, modify, and distribute, including for commercial purposes. See individual repositories for the LICENSE file.
- Issues: Report bugs and feature requests on the relevant GitHub repository
- Discussions: Use GitHub Discussions for questions and design conversations
- Security: See
SECURITY.mdin each repository for vulnerability reporting
- RTMPS (RTMP over TLS) support
- End-to-end test suites for more edge cases
- Performance benchmarks and optimization
- Wire the
librtmp2crate into the server listener (live ingest/playback) - RTMPS listener
- Load balancing and clustering
- FFmpeg RTMP Module — Audio/video transcoding
- OBS Studio — Open Broadcaster Software
- RTMP Spec — Original Adobe specification
- RTMP Forum — Enhanced RTMP specifications
OpenRTMP is maintained by the community and inspired by the needs of modern streaming infrastructure. Built on years of RTMP protocol experience and battle-tested in production.
Made with ❤️ for the open-source streaming community.