# MediaMTX

Single-binary media server for SRT, WebRTC, RTSP, RTMP, HLS, and MoQ, configured by one YAML file and a Control API.

A zero-dependency Go media router that publishes, reads, proxies, records, and plays back live streams across protocols. Every setting is in mediamtx.yml and hot-reloads; the same settings and all sessions are exposed through an HTTP Control API with an OpenAPI spec in the repo.

Alternative to: Wowza

- Capabilities: adaptable, operable
- Vertical: video-streaming
- Shape: product
- Form factor: api
- Execution model: deterministic
- Provenance: human-written (recorded, never ranked)
- Repo: https://github.com/bluenviron/mediamtx (MIT), 20007 stars, last commit 2026-09-02
- Last activity: 2026-09-02
- Page: apps/bluenviron--mediamtx.html
- JSON: apps/bluenviron--mediamtx.json

## Use it when

- I need to take an SRT or RTMP feed from a camera or OBS and hand it out as WebRTC and HLS from one box
- I want an agent to add camera paths, start recordings, and kick sessions over HTTP

## Gotchas

- Control API is off by default and binds to localhost only; set api: yes and secure it before exposing
- No transcoding: MediaMTX routes and remuxes; use ffmpeg hooks if you need to change codecs
- Thin product surface by design; the value is the protocol matrix, not a UI

## Editions

- Free: Free, open source
  - binary: https://github.com/bluenviron/mediamtx/releases
  - container: https://hub.docker.com/r/bluenviron/mediamtx
  - source: https://github.com/bluenviron/mediamtx

## Adaptable: make it yours

Effort: config-only (2 things to edit)

Everything is in mediamtx.yml: protocol addresses, auth, recording, playback, hooks, and per-path settings under pathDefaults and paths. Set api: yes to enable the Control API. Any key can also be overridden with an MTX_-prefixed environment variable. No code changes needed for normal use.

- Env vars: MTX_&lt;PARAMNAME> (env override of any mediamtx.yml key, for example MTX_RTSPADDRESS)
- Config files: mediamtx.yml
- Prompt files: none
- Accounts you'll need: none

## Operable: what an agent can drive

Operability: official. Interface: api at https://mediamtx.org/docs/features/control-api (published by the builder, local).

### Reach (complete coverage)

- Publish streams to the server: reachable. api/openapi.yaml: /v3/config/paths/add/{name}; publishers connect over any protocol
- Read streams in another protocol: reachable. README: automatic conversion; paths served on every enabled protocol
- Serve several streams on separate paths: reachable. api/openapi.yaml: /v3/config/paths/list, /v3/paths/list
- Reload configuration without dropping clients: reachable. api/openapi.yaml: /v3/config/global/patch, /v3/config/pathdefaults/patch
- Record streams to disk: reachable. path config record keys through /v3/config/paths/patch; /v3/recordings/list
- Play back recordings: reachable. mediamtx.yml playback server; api/playback.openapi.yaml
- Authenticate users (internal, HTTP, JWT): reachable. authMethod, authInternalUsers, authHTTPAddress, authJWTJWKS keys settable through /v3/config/global/patch
- Forward and proxy streams to other servers: reachable. api/openapi.yaml: /v3/paths/forward/list; source key in path config
- Kick sessions and inspect connections: reachable. api/openapi.yaml: /v3/rtspsessions/kick/{id}, /v3/webrtcsessions/kick/{id}, /v3/srtconns/list
- Run hooks on connect, publish, read: reachable. runOnConnect, runOnInit, runOnReady keys in mediamtx.yml, patchable over the API

## Code stack

- Languages: Go
- Frameworks: none
- Package manager: go modules
- Database: none
- Hosting target: Linux, Windows, macOS, Docker, Raspberry Pi

## Evidence and confidence

- formFactor: README: single executable server, no dependency or interpreter (confidence 0.9)
- executionModel: no model at runtime (confidence 0.99)
- operability: api/openapi.yaml in the repo; Control API page at mediamtx.org published by the Builder (confidence 0.95)
- effort: mediamtx.yml at repo root lists every key; README: hot reload (confidence 0.95)
- editions: MIT LICENSE; releases and Docker Hub (confidence 0.99)
- active: GitHub pushedAt 2026-09-02; release v1.20.1 2026-08-18
- reach:  (confidence 0.9)

## Open questions

- Confirm the MTX_ environment variable convention from the mediamtx.org configuration page; it was not fetched this pass (the mediamtx.yml comments only show MTX_CONN_* hook variables)

## Sources

- https://mediamtx.org (sourcing:video-streaming:curated)
- https://github.com/bluenviron/mediamtx#control-api (sourcing:video-streaming:curated)
- https://github.com/bluenviron/mediamtx/blob/main/api/openapi.yaml (analysis)
