About this project
rtmp-rs is an asynchronous RTMP server and client library written in Rust and built on top of the Tokio runtime. It allows developers to ingest live streams from encoders like OBS or FFmpeg, relay them to viewers, pull streams from external servers, or publish to RTMPS endpoints like YouTube and Twitch.
The library supports both legacy RTMP (H.264 and AAC) and Enhanced RTMP v2, enabling modern codecs such as HEVC, AV1, VP9, VP8, Opus, FLAC, AC-3, and E-AC-3. It is designed to handle real-world encoder quirks gracefully, including empty app names and timestamp regressions.
Key features include:
- GOP Caching: Delivers a keyframe immediately to late-joining viewers.
- Backpressure Handling: Drops video frames for slow subscribers while maintaining continuous audio.
- Zero-Copy Sharing: Media payloads are passed as bytes::Bytes to share frames among subscribers without copying.
- RTMPS Support: Secure RTMP over TLS using rustls and webpki-roots.
- Extensible Callbacks: The RtmpHandler trait provides customizable hooks for authentication, metadata parsing, and per-frame processing.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.