go-rtmp

Production-ready RTMP server in pure Go.
Zero external dependencies.

🚀 Quick Start ⭐ GitHub 📖 Documentation


What Can go-rtmp Do?#

OBS / FFmpeg (Publisher)
        │
        ▼ RTMP
┌─────────────────────────────────┐
│         go-rtmp server          │
│                                 │
│  ┌───────────┐  ┌───────────┐  │
│  │  Record   │  │  Relay    │  │
│  │  to FLV   │  │  to CDN   │  │
│  └───────────┘  └───────────┘  │
│                                 │
│  ┌───────────┐  ┌───────────┐  │
│  │  Auth     │  │  Hooks    │  │
│  │  Tokens   │  │  Webhooks │  │
│  └───────────┘  └───────────┘  │
└────────┬──────────┬─────────────┘
         │          │
    ┌────▼───┐ ┌───▼────┐
    │ ffplay │ │  VLC   │ ... (unlimited subscribers)
    └────────┘ └────────┘

Stream from any RTMP client → go-rtmp → multiple viewers + recording + relay#


Feature Highlights#

FeatureDescription
📡Live StreamingAccept streams from OBS, FFmpeg, or any RTMP client
👥Multi-SubscriberUnlimited concurrent viewers with independent connections
🎬Enhanced RTMPH.265, AV1, VP9 via E-RTMP v2 — works with FFmpeg 6.1+ and OBS 29.1+
💾FLV RecordingAutomatic recording of all codecs to FLV
Late-JoinSequence header caching — subscribers see video instantly
🔄Multi-RelayForward to YouTube, Twitch, or any RTMP server
🔐AuthenticationToken-based auth with 4 pluggable backends
🔔Event HooksWebhooks, shell scripts, stdio on every lifecycle event
📊MetricsLive expvar counters via HTTP endpoint
🛡️Zombie DetectionTCP deadlines kill stale connections automatically
📦Zero DependenciesStandard library only — no vendor lock-in

Quick Example#

# Build
go build -o rtmp-server ./cmd/rtmp-server

# Run with recording
./rtmp-server -listen :1935 -record-all true

# Publish (another terminal)
ffmpeg -re -i video.mp4 -c copy -f flv rtmp://localhost:1935/live/test

# Watch (another terminal)
ffplay rtmp://localhost:1935/live/test

That’s it. No config files, no databases, no containers. Just build and run.

→ Full Quick Start Guide


Documentation#

SectionDescription
Quick StartUp and running in 5 minutes
InstallationDownload binaries or build from source
User GuideRecording, relay, auth, hooks, metrics
CLI ReferenceEvery command-line flag explained
Developer GuideArchitecture, protocol, testing, contributing
ChangelogRelease history