Repository navigation
librtmp2-server 0.8.1
Changed
- Dependency bump:
librtmp20.17.2 -> 0.17.3. That release is documentation
and CI only, with no public signature, ABI or runtime behaviour change, so
nothing in this server behaves differently; the bump picks up the completed
rustdoc (every public item documented, every example runnable) and the
corrected documentation of thelibrtmp2contracts this server relies on:Conn::handle_commandignores an AMF0 payload whose command name cannot be
read, so a peer sending an extension command cannot break an ingested
session.Conn::inject_relay_framerequires an app name and a resolvable relay route
key, andConn::relay_route_keyprefers a pinnedrelay_keyover the
app/stream fallback.session::stream::publish_begin/play_beginonly set the role flag; the
stream name comes from thesession::publish/session::playwrappers.- The E-RTMP wire details the relay and init-cache code depends on: multitrack
descriptors are two AMF0 values,fourCcListis a UI32 count plus
UI16-length entries, andcapsExis two UI32 masks with an implied version.
- The minimum supported
librtmp2is now 0.17.3, so the documented contracts
above are guaranteed rather than assumed.
Full Changelog: v0.8.0...v0.8.1
Benchmarks
Measured automatically for this release on a CI runner; the machine is described below. Raw data: bench-results-v0.8.1.json.
- Measured: 2026-11-23 02:04:31 UTC ·
efb9a33· crate version 0.8.1 · workflow run - Built on: librtmp2 0.17.3
- CPU: Intel(R) Xeon(R) 6975P-C · 4 vCPUs
- RAM: 15.3 GiB
- System: Linux 7.0.0-1016-aws x86_64 · rustc 1.100.0 · GitHub-hosted ubuntu26 (image 20261116.88.1)
- Noise: shared CI VM — CPU model, neighbouring load and the runner image change between runs, so treat absolute numbers as indicative.
- Comparable vs release v0.8.0: ❌ different hardware (AMD EPYC 9V74 80-Core Processor, 4 vCPUs vs Intel(R) Xeon(R) 6975P-C, 4 vCPUs): only large changes (> 25 %) mean anything
http_api
| Benchmark | Time | Throughput | vs release v0.8.0 |
|---|---|---|---|
http_api/create_stream |
160.71 µs | — | ⚪ −24.0 % |
http_api/health |
89.72 µs | — | ⚪ −19.6 % |
http_api/list_streams |
8.0 ms | — | ⚪ −4.5 % |
🟢 faster · 🔴 slower · ⚪ within the noise band (5–25 % depending on how comparable the two environments are, plus both runs' Criterion confidence intervals). Lower time is better.
Cross-server sweep
Same RTMP client and ffmpeg source for every server, one server at a time: load viewers 500 1000 2000, publisher ffmpeg 1280x720@30 H.264 2.5 Mbps + AAC 128 kbps. One sweep per run, no repetitions — the shared runner makes single values noisy, so compare servers within this run rather than across runs.
Servers: librtmp2-server 0.8.1 (librtmp2 0.17.3) · MediaMTX v1.21.4 · nginx-rtmp nginx 1.31.8 (nginx-rtmp-module @ 6c7719d)
librtmp2-server vs the baselines
| Metric | Now | vs release v0.8.0 |
|---|---|---|
| publish handshakes/s | 14,375 | 🟢 +52.2 % |
| publish handshake avg (ms) | 1.53 | 🟢 −40.7 % |
| publish handshake p95 (ms) | 2.96 | 🟢 −32.7 % |
| play handshakes/s | 12,030 | 🟢 +63.8 % |
| play handshake avg (ms) | 1.77 | 🟢 −39.2 % |
| play handshake p95 (ms) | 3.75 | 🟢 −32.4 % |
| join, 1 viewer: avg (ms) | 0.50 | ⚪ +4.2 % |
| join, 1 viewer: p95 (ms) | 0.50 | ⚪ +4.2 % |
| join, 25 viewers: avg (ms) | 1.70 | ⚪ −9.1 % |
| join, 25 viewers: p95 (ms) | 2.29 | ⚪ −10.5 % |
| join, 100 viewers: avg (ms) | 3.14 | ⚪ −1.9 % |
| join, 100 viewers: p95 (ms) | 6.22 | ⚪ +8.7 % |
| load, 500 viewers: join avg (ms) | 24.52 | 🟢 −27.6 % |
| load, 500 viewers: join p95 (ms) | 47.26 | ⚪ −20.9 % |
| load, 500 viewers: frames/viewer | 73.68 | ⚪ +0.0 % |
| load, 500 viewers: CPU (% of one core) | 21.70 | 🟢 −25.4 % |
| load, 500 viewers: peak RSS (MiB) | 24.20 | ⚪ +0.0 % |
| load, 1000 viewers: join avg (ms) | 22.58 | ⚪ −1.8 % |
| load, 1000 viewers: join p95 (ms) | 54.30 | ⚪ +3.5 % |
| load, 1000 viewers: frames/viewer | 73.66 | ⚪ +0.0 % |
| load, 1000 viewers: CPU (% of one core) | 44.80 | ⚪ −22.6 % |
| load, 1000 viewers: peak RSS (MiB) | 33.40 | ⚪ −0.6 % |
| load, 2000 viewers: join avg (ms) | 70.78 | ⚪ +24.2 % |
| load, 2000 viewers: join p95 (ms) | 165.9 | ⚪ −5.4 % |
| load, 2000 viewers: frames/viewer | 73.64 | ⚪ +0.0 % |
| load, 2000 viewers: CPU (% of one core) | 89.00 | ⚪ −23.5 % |
| load, 2000 viewers: peak RSS (MiB) | 55.20 | ⚪ +2.6 % |
Handshake latency
| Server | publish /s | avg ms | p95 | p99 | play /s | avg ms | p95 | p99 |
|---|---|---|---|---|---|---|---|---|
| librtmp2-server | 14,375 | 1.53 | 2.96 | 3.25 | 12,030 | 1.77 | 3.75 | 4.23 |
| MediaMTX | 11,153 | 2.22 | 4.20 | 4.79 | 7,398 | 3.22 | 8.46 | 9.20 |
| nginx-rtmp | 713.2 | 41.67 | 43.31 | 43.44 | 359.6 | 82.70 | 84.28 | 84.45 |
Join latency (avg / p95 ms)
| Server | 1 viewer | 25 viewers | 100 viewers |
|---|---|---|---|
| librtmp2-server | 0.50 / 0.50 | 1.70 / 2.29 | 3.14 / 6.22 |
| MediaMTX | 0.66 / 0.66 | 2.02 / 2.85 | 6.05 / 10.66 |
| nginx-rtmp | 81.64 / 81.64 | 82.87 / 83.45 | 83.70 / 85.72 |
Many viewers on one stream
| Viewers | Server | join avg / p95 ms | CPU % (one core) | peak RSS MiB | frames/viewer |
|---|---|---|---|---|---|
| 500 | librtmp2-server | 24.52 / 47.26 | 21.70 | 24.20 | 73.68 |
| 500 | MediaMTX | 18.37 / 37.14 | 59.50 | 102.0 | 73.60 |
| 500 | nginx-rtmp | 89.01 / 98.04 | 22.70 | 21.40 | 73.56 |
| 1000 | librtmp2-server | 22.58 / 54.30 | 44.80 | 33.40 | 73.66 |
| 1000 | MediaMTX | 56.92 / 78.75 | 123.6 | 143.1 | 73.60 |
| 1000 | nginx-rtmp | 95.66 / 104.5 | 49.20 | 27.40 | 73.57 |
| 2000 | librtmp2-server | 70.78 / 165.9 | 89.00 | 55.20 | 73.64 |
| 2000 | MediaMTX | 145.6 / 253.8 | 199.8 | 315.1 | 73.90 |
| 2000 | nginx-rtmp | 125.2 / 184.6 | 79.90 | 39.40 | 54.31 |
A competitor delivering fewer frames per viewer than the others was overloaded at that step (the delivered rate, not just latency, is the result).