Guide · Open source
How to use MediaMTX: install, publish and read streams
Updated · written with AI from the project's own documentation and checked against our catalogue data
MediaMTX is a free, open-source live media server and proxy that accepts video and audio streams over many protocols and passes them on in other formats. This guide explains what it does, how to get it running, and how to publish and read streams with it. It is written for readers who are comfortable with basic streaming ideas but are new to this tool.
Quick start
- 1Get the software. Download MediaMTX from the install page at mediamtx.org/docs/kickoff/install, or clone the repository from GitHub.
- 2Start the server. Run the single MediaMTX executable on the machine that will relay your streams.
- 3Point a source at a path. Configure your camera, encoder or tool such as FFmpeg or OBS Studio to publish to the server on a named path.
- 4Open the stream in a viewer. Connect a player or browser to the same path using a protocol it supports, such as WebRTC, HLS or RTSP.
- 5Add recording if needed. Enable recording to disk in fMP4 or MPEG-TS format for streams you want to keep.
- 6Secure and monitor. Set up authentication and use the Control API or metrics to watch the server.
What MediaMTX does
MediaMTX is described as a ready-to-use, zero-dependency live media server and media proxy. It lets you publish, read, proxy, record and play back real-time video and audio streams. The project calls itself a media router that moves streams from one end to the other.
Streams are automatically converted from one protocol to another, so a camera that publishes over RTSP can be read by a browser over WebRTC or HLS.
- Supported protocols include Media-over-QUIC, SRT, WebRTC, RTSP, RTMP, HLS, MPEG-TS and RTP.
- It can serve several streams at once in separate paths.
- It is a single executable with no dependencies or interpreter, and runs on Linux, Windows and macOS.
Install MediaMTX
The source lists the install method as a download of the application, and no prerequisites are listed. Official install instructions are on the project's documentation site at mediamtx.org/docs/kickoff/install.
The README also shows a command to clone the source repository from GitHub. Cloning gives you the source code; the project's install page covers obtaining the executable.
git clone https://github.com/bluenviron/mediamtxPublish a stream to the server
To publish, a source client such as FFmpeg, GStreamer, OBS Studio or a Raspberry Pi camera sends its stream to MediaMTX. Each stream is published to a path, and the path name is how viewers find it later.
Publishing is documented on the project's publish and read page at mediamtx.org/docs/features/publish-and-read.
- Sources include FFmpeg, GStreamer, OBS Studio, Python, Golang, Unity and web browsers.
- Use one path per stream so several cameras or sources can run at the same time.
Read a stream from the server
Viewers connect to the same path using a protocol their player supports. Browsers can read over WebRTC or HLS, while VLC, FFmpeg and GStreamer can read over RTSP, SRT and other supported protocols.
Because conversion is automatic, you publish once and let viewers pick the format they can play.
- Browser viewing is typically done over WebRTC or HLS.
- Desktop players such as VLC are listed as supported readers.
Use recording, always-available streams and hooks
MediaMTX can record streams to disk in fMP4 or MPEG-TS format and play them back later. Always-available streams keep a path active even when the publisher is offline.
Hooks run external commands when clients connect, disconnect, read or publish. Authentication can use internal, HTTP or JWT methods, and the Control API and Prometheus-compatible metrics help you monitor the server.
- Record to disk: fMP4 or MPEG-TS.
- Authentication: internal, HTTP or JWT.
- Monitoring: Control API and Prometheus-compatible metrics.
- Hot reload: change configuration without disconnecting existing clients.
Limits to know before you start
MediaMTX is designed for routing and proxying, not editing. The README does not describe transcoding or video editing features, so plan a separate tool for those jobs.
Because it is self-hosted, you run and secure the server yourself. Setup assumes you are comfortable with network ports, configuration files and streaming protocols.
What people use it for
- Routing IP camera streams to viewers in a browser or media player.
- Sending one stream to several protocols or destinations.
- Running a local test server for RTSP, RTMP or WebRTC streams during development.
- Recording live streams to disk in fMP4 or MPEG-TS for later playback.
Frequently asked questions
Is MediaMTX free?
MediaMTX is released under the MIT licence, according to the project summary. You can use, modify and distribute it under the terms of that licence.
What are the requirements to install MediaMTX?
The source does not list any prerequisites. It is described as a single executable with no dependencies or interpreter, and it is compatible with Linux, Windows and macOS.
How do I install MediaMTX?
The install method is a download of the application. The official install instructions are at mediamtx.org/docs/kickoff/install, and the README also shows how to clone the repository from GitHub.
Can MediaMTX convert RTSP to WebRTC or HLS?
Yes. The project states that streams are automatically converted from one protocol to another, and it lists WebRTC and HLS among its supported protocols.
What are good alternatives to MediaMTX?
Projects commonly compared with MediaMTX include Janus, Ant Media Server, SRS and Jitsi-style media servers. Choose based on the protocols and features you need.
Is MediaMTX suitable for video editing?
No. The README describes it as a router and proxy rather than an editing or transcoding pipeline, so use a separate tool for editing.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
MediaMTX suits people who route camera or encoder streams to viewers, need a local test server, or want to record live streams to disk, and who are comfortable running a self-hosted server. If you want a hosted service with no server to manage, need video editing or transcoding, or have no interest in ports and configuration files, pick a different tool.
Install options & downloads