RTMP live streaming in Rust


Not sure how many here would actually be interested, but for those who might I finally published my RTMP crate: https://crates.io/crates/rml_rtmp

RTMP is the main protocol that’s used for the creation and distribution of live video streams. For example, if you want to send live video to Youtube or Twitch, your encoder sends the video to their servers using the RTMP protocol. The purpose of this crate is to make it easy to implement RTMP clients and servers in your own applications.

To demonstrate this I created an RTMP server using mio. OBS or Ffmpeg can send video into it and VLC and mplayer clients can connect to watch the video feed live. It can also pull live video from external RTMP servers, as well as relay video out to other external RTMP servers.

I’m happy with the performance I’ve been able to get with it. According to benchmarks I’ve created I have average time to deserialize a 10KB video packet and distribute it to 2 subscribers to 24 microseconds (not counting network times). So for now there’s lots of budget for custom logic for smooth 60fps video.

I tried to do a pretty big documentation pass, so if anyone is interested and finds anything confusing let me know.

This is a stepping stone for my end goal, which is to create a live video streaming distribution server (like Wowza) that’s free, open source (and remains so), and high performance enough to run efficiently off a raspberry pi or other low end devices.