explaingit

bluenviron/mediamtx

Analysis updated 2026-06-21

18,752GoAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

MediaMTX is a self-hosted media server written in Go that routes live video and audio streams between protocols, a camera can publish RTSP while viewers simultaneously receive HLS, WebRTC, and RTMP from the same stream.

Mindmap

mindmap
  root((mediamtx))
    What it does
      Stream routing
      Protocol conversion
      Stream recording
    Protocols
      RTSP and RTMP
      HLS and WebRTC
      SRT and RTP
    Use Cases
      IP camera server
      Live event streaming
      Stream recording
    Features
      Authentication
      Prometheus metrics
      Docker deploy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Receive an RTSP stream from an IP camera and re-broadcast it as HLS for web viewers and WebRTC for low-latency monitoring at the same time.

USE CASE 2

Set up a self-hosted live streaming server for a Raspberry Pi camera, drone, or home lab without a cloud media platform.

USE CASE 3

Record live streams automatically to disk in fMP4 format and serve them back as on-demand playback from the same server.

USE CASE 4

Re-stream a camera feed to YouTube or Twitch via RTMP while also making it available locally over WebRTC.

What is it built with?

GoDockerFFmpegWebRTCRTSPHLS

How does it compare?

bluenviron/mediamtxlivekit/livekitgolangci/golangci-lint
Stars18,75218,65818,938
LanguageGoGoGo
Setup difficultymoderatemoderateeasy
Complexity3/54/52/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Ships as a single binary with no external dependencies, a Docker image is available for the quickest start.

In plain English

MediaMTX is a ready-to-use media server and media proxy for routing live video and audio streams. Think of it as a traffic router for video: you send a stream in using one protocol and other viewers can receive it using a completely different protocol. For example, a camera might publish an RTSP stream, and MediaMTX can simultaneously serve that same stream as HLS to a web browser, WebRTC for low-latency viewing, and RTMP to re-stream to YouTube, all at once without any additional configuration. It supports publishing and reading streams via SRT, WebRTC, RTSP, RTMP, HLS, MPEG-TS, and RTP. Sources can include FFmpeg, GStreamer, OBS Studio, Raspberry Pi cameras, web browsers, and custom code in Python or Go. It also records streams to disk in fMP4 or MPEG-TS format, plays back recorded content, proxies requests to other servers, supports user authentication via internal credentials, HTTP, or JWT tokens, and exposes metrics in Prometheus format for monitoring. You would use MediaMTX if you need to set up a self-hosted live streaming server, for IP cameras, drones, live events, or a home lab, without needing a complex media platform. It ships as a single binary with no external dependencies, runs on Linux, Windows, and macOS, and can be deployed as a Docker container. It is written in Go.

Copy-paste prompts

Prompt 1
I have an IP camera publishing RTSP and want MediaMTX to re-serve it as HLS for a web page. Show me the minimal mediamtx.yml configuration.
Prompt 2
How do I run MediaMTX in Docker to accept an RTMP stream from OBS Studio and make it available to WebRTC viewers?
Prompt 3
I want MediaMTX to automatically record my IP camera stream to disk as fMP4 files. What configuration do I add to mediamtx.yml?
Prompt 4
Help me add JWT token authentication to MediaMTX so only authorized clients can publish or receive streams.
Prompt 5
How do I monitor active stream health and viewer counts in MediaMTX using its Prometheus metrics endpoint?

Frequently asked questions

What is mediamtx?

MediaMTX is a self-hosted media server written in Go that routes live video and audio streams between protocols, a camera can publish RTSP while viewers simultaneously receive HLS, WebRTC, and RTMP from the same stream.

What language is mediamtx written in?

Mainly Go. The stack also includes Go, Docker, FFmpeg.

How hard is mediamtx to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is mediamtx for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub bluenviron on gitmyhub

Verify against the repo before relying on details.