mediamtx

bluenvironMIT活跃维护

开箱即用的实时音视频流媒体服务器和代理,支持 RTSP、RTMP、WebRTC、SRT、LL-HLS 等协议,可读取、推流、代理、录制和回放直播流。

Ready-to-use Media-over-QUIC / SRT / WebRTC / RTSP / RTMP / LL-HLS / MPEG-TS / RTP live media server and media proxy that allows to read, publish, proxy, record and playback real-time video and audio streams.

v1.21.3发布于 2026-10-25 11:06 UTC20,660star +19 / 7 天2,453fork同步于 2026-11-10 17:24 UTC

怎么上手

由 README 提炼,执行前请确认
docker run --rm -it -p 8554:8554 -p 1935:1935 bluenviron/mediamtx
硬件要求按 README 说明

README 未说明具体硬件要求,仅说明兼容 Linux、Windows 和 macOS,且为无需依赖或解释器的单个可执行文件。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

零依赖单文件实时流媒体服务器与代理,把各种协议的音视频流统一路由转发

开箱即用的实时音视频流媒体服务器和代理,支持 RTSP、RTMP、WebRTC、SRT、LL-HLS 等协议,可读取、推流、代理、录制和回放直播流。

核心能力

  • 支持 Media-over-QUIC、SRT、WebRTC、RTSP、RTMP、HLS、MPEG-TS、RTP 发布与读取
  • 流在不同协议间自动转换,无需额外转码工具
  • 按路径同时承载多路流,配置热重载不断开现有客户端
  • 可将流录制为 fMP4 或 MPEG-TS 并从磁盘回放
  • 提供 Control API、Prometheus 指标与连接/读写钩子

容易踩的坑

README 未列出具体端口映射与配置细节,实际使用前需查阅官方文档确认各协议默认端口;录制与回放功能需在配置中显式启用。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.21.3
  1. v1.21.3最新正式版2026-10-25 · 2026-10-25 11:06 UTC

    Fixes and improvements

    General

    • http: restore support for HTTP2 requests (https://github.com/bluenviron/mediamtx/issues/6320) The server was not advertising the HTTP2 protocol in TLS ALPN anymore. Fix this.
    • forward: match destinations by configuration when reloading (https://github.com/bluenviron/mediamtx/issues/6299) ReloadConf compared the old and new destination lists by position, so removing a destination from the middle of the list shifted all the following ones, which were therefore considered changed and restarted (dropping and re-establishing their connections). Match destinations by their configuration instead: adding, removing or reordering destinations only starts or stops the affected ones, and the others keep running. The position reported by the API and used in logs is updated for the destinations that are kept.
    • avoid forward destination overlapping (https://github.com/bluenviron/mediamtx/issues/6324) When the configuration changes and forward destinations are changed, create new forward destinations only after closing existing ones, avoiding double publishers.
    • http: log outbound requests (https://github.com/bluenviron/mediamtx/issues/6325) log outbound HTTP requests with logLevel debug, in the same way as HTTP inbound requests are already logged.
    • fix race condition during logger recreation (https://github.com/bluenviron/mediamtx/issues/6206) (https://github.com/bluenviron/mediamtx/issues/6326) The logger can be dynamically recreated (for instance, this happens when changing the logLevel), but some components always need it, in particular hooks, which are not shut down unless the entire server is shutting down. Fix this issue by safely reloading the logger configuration without destroying it.
    • document link-local IPv6 zone encoding (https://github.com/bluenviron/mediamtx/issues/6327)
    • recorder: fix different time zones in record segment name (https://github.com/bluenviron/mediamtx/issues/5451) (https://github.com/bluenviron/mediamtx/issues/6333) Absolute timestamps of frames can have different time zones, in particular, timestamps from HLS sources arrive with their original time zone. When an absolute timestamp is not available, gohlslib uses time.Now(), which has the local time zone, resulting in streams with timestamps with different time zones. Timestamps are used in names of record segments, but they were not normalized and were written with their original time zone, causing confusion and errors in particular when the '%z' placeholder is not used. Fix the issue by normalizing every incoming date to the local time zone before using it as name of a segment.
    • add timezone to default recordPath and warn when not present (https://github.com/bluenviron/mediamtx/issues/6334) recordPath without %z causes segments to be overwritten or placed at wrong time during daylight saving time switches.
    • rtmp, recorder, stream: treat H264 recovery point SEI as random access (https://github.com/bluenviron/mediamtx/issues/6349) Streams without IDR frames use I slices with a recovery point SEI as random access points. The RTMP reader output and the fMP4 recorder only accepted IDR, and the unit remuxer only prepended SPS and PPS on IDR, so the DTS extractor never received an SPS. Use h264.IsRandomAccess, as the MPEG-TS outputs already do.
    • mpegts, rtmp: stop silently skipping H264 units without IDR and without non-IDR (https://github.com/bluenviron/mediamtx/issues/6354)
    • recorder: fix height of VP9 tracks in fMP4 recordings (https://github.com/bluenviron/mediamtx/issues/6359) The fMP4 recorder took the height of a VP9 track from the width in the key frame header, so the init segment declared a square size, for example 1920x1920 instead of 1920x804. Use the height instead.
    • docs: suggest to run MediaMTX in a writable folder (https://github.com/bluenviron/mediamtx/issues/6369) * when running in Docker, use /etc/mediamtx * when running in host Linux, use /usr/local/etc/mediamtx
    • recorder: fix times
  2. v1.21.22026-10-08 · 2026-10-08 21:42 UTC
    查看更新说明

    Fixes and improvements

    General

    • fix dropping UDP packets during connection close (https://github.com/bluenviron/mediamtx/issues/6278) UDP packets were dropped in case of errors regardless of their size. Now they are dropped only if they are empty and there's an error.
    • docs: fix youtube rtmps URL (https://github.com/bluenviron/mediamtx/issues/6286) The rtmps URL for Youtube was wrong. The fingerprint is not required anymore.
    • prevent free access to playback server in case of legacy credentials (https://github.com/bluenviron/mediamtx/issues/6311) When legacy credentials are in use (readUser, readPass, publishUser, publishPass), access to the playback server is granted to anyone. Prevent this by granting access only to users using readUser, readPass.
    • auth: skip JWKS fetch when no JWT is provided (https://github.com/bluenviron/mediamtx/issues/6274) authenticateJWT fetched the JWKS before checking whether the request carried a token at all. Every anonymous request, such as the first unauthenticatedRTSP DESCRIBE or HLS request that precedes a 401, caused an outbound request to the JWKS server while holding the manager's write lock. An unauthenticated client could therefore make the server contact the identity provider at will and, while that endpoint was slow or unreachable, stall JWT authentication for everybody. Return "JWT not provided" before touching the JWKS. Also check the JWKS response status code. A non-2xx reply was fed straight to the JSON decoder, so an error page surfaced as a confusing parse error,and an error reply that happened to hold valid JSON was cached as the key set for an hour. Reject it with the status code, as authenticateHTTP already does. Behavior for requests that carry a token against a healthy JWKS server is unchanged.
    • rewindablereader: fix possible OOM (https://github.com/bluenviron/mediacommon/issues/383) empty datagram packets might cause the allocation of unnecessary entries. Fix that.
    • h264: revert https://github.com/bluenviron/mediacommon/issues/142 (https://github.com/bluenviron/mediacommon/issues/384) supporting standalone SEI units should not be necessary anymore since these are filtered out at the root (https://github.com/bluenviron/gortsplib/pull/1184). In case of any issue that should arise after this change, open a bug report and we'll adjust things accordingly.
    • h264: support SEI recovery point in DTS extractor (https://github.com/bluenviron/mediacommon/issues/341) Treat a SEI recovery point message (payload type 6) as a random access point, similarly to a CRA in H265, so the DTS extractor can (re)initialize its state from the first coded frame that follows the recovery point.

    API

    Media-Over-QUIC

  3. v1.21.12026-09-20 · 2026-09-20 16:07 UTC
    查看更新说明

    Fixes and improvements

    General

    RTSP

    RTMP

    HLS

    WebRTC

  4. v1.21.02026-09-05 · 2026-09-05 21:29 UTC
    查看更新说明

    New major features

    Media-over-QUIC

    API

    Fixes and improvements

    General

  5. v1.20.12026-08-18 · 2026-08-18 12:05 UTC
    查看更新说明

    Fixes and improvements

    General

    API

    Media-Over-QUIC

    RTSP

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Website Test Lint CodeCov Release Docker Hub

    MediaMTX is a ready-to-use and zero-dependency live media server and media proxy that allows to publish, read, proxy, record and playback real-time video and audio streams. It has been conceived as a "media router" that routes media streams from one end to the other, with a focus on efficiency and portability.

    InstallDocumentation
    • Publish streams to the server with Media-over-QUIC, SRT, WebRTC, RTSP, RTMP, HLS, MPEG-TS, RTP, using FFmpeg, GStreamer, OBS Studio, Python , Golang, Unity, Web browsers, Raspberry Pi Cameras and more.
    • Read streams from the server with Media-over-QUIC, SRT, WebRTC, RTSP, RTMP, HLS, using FFmpeg, GStreamer, VLC, OBS Studio, Python , Golang, Unity, Web browsers and more.
    • Streams are automatically converted from a protocol to another
    • Serve several streams at once in separate paths
    • Reload the configuration without disconnecting existing clients (hot reloading)
    • Serve always-available streams even when the publisher is offline
    • Record streams to disk in fMP4 or MPEG-TS format
    • Playback recorded streams from disk
    • Authenticate users with internal, HTTP or JWT authentication
    • Forward streams to other servers
    • Proxy requests to other servers
    • Control the server through the Control API
    • Extract metrics from the server in a Prometheus-compatible format
    • Monitor performance to investigate CPU and RAM consumption
    • Run hooks (external commands) when clients connect, disconnect, read or publish streams
    • Compatible with Linux, Windows and macOS, does not require any dependency or interpreter, it's a single executable
    • ...and many others.