Commit Graph
100 Commits
Author SHA1 Message Date
Alessandro RosandGitHub 92f9ee7b78 deprecate fallback (#5388)
The fallback feature worked with RTSP only and did not allow readers to
resume the original stream. It has been replaced by alwaysAvailable.
2026-01-31 15:29:24 +01:00
Alessandro RosandGitHub 115dab1533 api: add available, availableTime, online, onlineTime properties (#5391)
these replace ready and readyTime and allow to monitor the new
"always-available" feature.
2026-01-31 14:54:10 +01:00
Alessandro RosandGitHub a56408db19 add always available streams (#5335)
When the publisher or source of a stream is offline, the server can be
configured to fill gaps in the stream with a video that is played on
repeat until a publisher comes back online. This allows readers to stay
connected regardless of the state of the stream. The offline video and
any future online stream are concatenated without decoding or
re-encoding packets, using the original codec.
2026-01-31 14:44:58 +01:00
Alessandro RosandGitHub 06c7cc3d7f fix race condition when closing HTTP servers (#5390)
when a HTTP server is closed, open connections are now immediately
closed and open routines are waited before the server is considered
closed.
2026-01-31 14:09:10 +01:00
Alessandro RosandGitHub 69fdd18d86 docs: update (#5308) 2026-01-28 11:52:42 +01:00
Alessandro RosandGitHub 8a4f2f5f3f simplify configuration definitions (#5376) 2026-01-25 20:24:41 +01:00
Alessandro RosandGitHub a4561a8339 prevent setting slices to null (#5375)
In Golang, slices can be set to nil, while in most other languages they
cannot. This causes compatibility issues, especially because the
OpenAPI definition of the API does not allow slices to be nil. This
prevents slices from being set to nil through JSON/YAML, and
also sets default slices to an empty list instead of nil.
2026-01-25 19:49:39 +01:00
Alessandro RosandGitHub 46b4293e35 api: improve openapi definition (#5380)
add uint64, uint, uuid, move WebRTCICEServer into dedicated schema
2026-01-25 19:35:43 +01:00
Alessandro RosandGitHub 1a53e40bdc switch to reflect.Pointer (#5377) 2026-01-25 13:51:49 +01:00
Alessandro RosandGitHub 719ca2ae39 fix panic with environment variables (#5374)
this happened when loading deprecated slices of structs with
environment variables.
2026-01-25 10:27:36 +01:00
Alessandro RosandGitHub 40cb857dd9 prevent setting empty usernames with environment variables (#5373) 2026-01-24 19:44:17 +01:00
Alessandro RosandGitHub 0d95459f7b fix overriding default user with environment variables (#5371)
MTX_AUTHINTERNALUSERS_0_USER and MTX_AUTHINTERNALUSERS_0_PASS are now working even when the configuration file is present.
2026-01-24 19:38:59 +01:00
Alessandro RosandGitHub f4f795a2a6 simplify configuration parsing (#5372)
work around golang/go#21092 globally
2026-01-24 19:33:47 +01:00
Alessandro RosandGitHub e2ac32177b prevent several configuration errors (#5368) 2026-01-22 19:35:44 +01:00
Alessandro RosandGitHub a9bc4f90c2 rtsp: fix log labels of RTSPS listeners (#5367)
use "TCP/RTSPS", "UDP/SRTP", "UDP/SRTCP" to refer to secure listeners
2026-01-22 19:13:54 +01:00
Alessandro RosandGitHub 3998ceb88f webrtc: print incoming data channel messages (#5357) 2026-01-20 16:18:13 +01:00
Alessandro RosandGitHub 02fe2e2b42 tests: fix race condition (#5354) 2026-01-17 23:21:34 +01:00
Alessandro RosandGitHub 653d10fb75 use the same filtering process for every codec (#5324)
this allows to apply features that were previously implemented for
single codecs (like RTP packet resizing), to any codec, and simplifies
future development.
2026-01-16 14:03:13 +01:00
Alessandro RosandGitHub 2109ade5b4 improve readability of issues with config (#5353) 2026-01-16 13:20:07 +01:00
Alessandro RosandGitHub e4c60e1e62 tests: fix race condition (#5338) 2026-01-12 21:46:48 +01:00
Alessandro RosandGitHub bac9060368 link Github Actions badges to the main branch (#5337) 2026-01-12 20:27:38 +01:00
Alessandro RosandGitHub eba3b828a6 print last processing error (#5323) 2026-01-06 21:48:36 +01:00
Alessandro RosandGitHub cd34de8770 print last decode error (#5319)
decode errors are still grouped together, but the last one is now
printed.
2026-01-05 15:28:24 +01:00
Alessandro RosandGitHub 1d9b2ff7ea tests: fix race condition (#5316) 2026-01-04 16:27:12 +01:00
Alessandro RosandGitHub 9cb64d98ac print OS and Arch in first log line (#5315) 2026-01-01 22:59:39 +01:00
Alessandro RosandGitHub 0a01bf4ec8 rpi: advertise support for Raspberry Pi OS Trixie (#5312) 2026-01-01 22:58:47 +01:00
Alessandro RosandGitHub 099a1829dd move away from balenalib Docker images (#5313) 2026-01-01 22:52:39 +01:00
Alessandro RosandGitHub a148f5a546 simplify code (#5314) 2026-01-01 22:47:59 +01:00
Alessandro RosandGitHub b9adbc3e09 remove redundant check (#5311) 2026-01-01 22:47:03 +01:00
Alessandro RosandGitHub 19d3a9c80d remove redundant code (#5310) 2026-01-01 20:51:40 +01:00
Alessandro RosandGitHub b2af5defd0 tests: fix race condition (#5309) 2026-01-01 20:00:27 +01:00
Alessandro RosandGitHub 5c67b2f08b tests: fix race condition (#5301) 2025-12-28 16:36:54 +01:00
Alessandro RosandGitHub 3692b2448a set syslog priority and do not write level and date to syslog (#4923) (#5296)
When writing log entries to syslog, pass the level (WARN, INFO, etc)
directly to syslog. Avoid writing level and date. This provides a
better integration and allows to use syslog search tools.
2025-12-27 14:06:26 +01:00
Alessandro RosandGitHub ea4c4f1fbb disable syslog logging on macOS (#5005) (#5295) 2025-12-27 13:59:33 +01:00
Alessandro RosandGitHub 20e7f1db75 docs: improve (#5277) 2025-12-27 13:55:13 +01:00
Alessandro RosandGitHub cd2aed3fa3 srt: fix broken connections in case of high latency (#3756) (#5282)
When listening and accepting an incoming connection request, the
response might be received by the peer with some delay due to latency.
This causes the peer to send a second connection request, that is not
detected as duplicate because the first connection request has already
been removed from the map that is used to check for duplicates
(connReqs), so it is treated as a brand new connection request,
breaking the first connection.

This patch fixes the issue by introducing another map (connByPeer) that
is used to check whether a connection request is associated to an
already-accepted connection.
2025-12-24 20:51:01 +01:00
Alessandro RosandGitHub 1704fba5e9 rtsp: avoid setupping back channels (#5074) (#5289) 2025-12-24 20:44:56 +01:00
Alessandro RosandGitHub 55f93eddde rtsp: call rtsp.ToStream before advertising the stream (#5288) 2025-12-24 20:37:01 +01:00
Alessandro RosandGitHub 9e82b5233d fix 1-minute offset when recording a H264 WebRTC track (#5275) (#5278) 2025-12-19 13:32:14 +01:00
Alessandro RosandGitHub 834b079b78 rtsp: fix crash when setupping tracks between stream changes (#5253) (#5257) 2025-12-07 11:38:52 +01:00
Alessandro RosandGitHub fc8012d3c7 bump mediacommon (#5258) 2025-12-07 11:38:37 +01:00
Alessandro RosandGitHub 3de05c1330 api: always reply with JSON in case of success or failure (#5252)
Reply with "status": "ok" in case of success, and with "status":
"error" in case of error. This makes the API more accessible and user
friendly.
2025-12-07 10:37:55 +01:00
Alessandro RosandGitHub a0a75dfab6 fix panic when changing log file to a nonexisting directory (#5132) (#5249) 2025-12-06 22:51:25 +01:00
Alessandro RosandGitHub 8d3c4074d8 api: split implementation into multiple files (#5251) 2025-12-06 22:50:06 +01:00
Alessandro RosandGitHub 0139105583 playback: fix crash (#5240) (#5250)
when requesting a recording with the mp4 format, if there are two
tracks and the second track has no sample, the server crashed. This
fixes the issue.
2025-12-06 22:45:50 +01:00
Alessandro RosandGitHub fb9027a334 recorder: reset when absolute time drifts from stream time (#4778) (#5239)
the server now detects when system time changes too much and restarts
recordings when that happens.
2025-12-02 18:10:23 +01:00
Alessandro RosandGitHub 9c5930464f playback: support concatenating segments with long gaps (#5172)
Thanks to the new mtxi MP4 box, it's possible to check whether two
segments are consecutive without involving dates or timestamps.

When the new mtxi box is present in both segments, do not check if
the end of the first segment corresponds to the start of the
second segment.
2025-12-01 21:27:08 +01:00
Alessandro RosandGitHub 8505e8d83f docs: update (#5152) 2025-11-18 04:07:03 +01:00
Alessandro RosandGitHub 3f599d236f rtp: reorder packets before ingestion (#5194) 2025-11-14 17:19:48 +01:00
Alessandro RosandGitHub 2d02ca0df7 webrtc: use rtpReceiver and rtpSender to count packets (#5193) 2025-11-14 17:10:50 +01:00
Alessandro RosandGitHub d02fb4ed8e move constant (#5190) 2025-11-12 18:09:53 +01:00
Alessandro RosandGitHub ff187b6d8a update golangci-lint configuration (#5182) 2025-11-11 23:57:52 +01:00
Alessandro RosandGitHub ac1d4360b2 tests: fix race condition (#5187) 2025-11-11 21:12:01 +01:00
Alessandro RosandGitHub 8858bf1db9 simplify code with ptrOf (#5179) 2025-11-11 12:01:03 +01:00
Alessandro RosandGitHub 5be9b0eb97 rename variable (#5173) 2025-11-09 22:19:17 +01:00
Alessandro RosandGitHub 1ef5db5b3c extend udpReadBufferSize to WebRTC UDP sockets (#5130)
this allows to decrease packet losses without touching system parameters.
2025-10-29 11:45:15 +01:00
Alessandro RosandGitHub adc4a6ceb6 add udpReadBufferSize parameter (#5129)
this allows to set a global UDP read buffer, applied to every UDP socket.
2025-10-29 11:28:22 +01:00
Alessandro RosandGitHub 3ae5262510 docs: update (#5125) 2025-10-29 10:51:02 +01:00
Alessandro RosandGitHub 2859590544 update workflows (#5131) 2025-10-26 16:46:42 +01:00
Alessandro RosandGitHub c42642ac3c recorder: prevent FMP4 durations from overflowing (#4711) (#5126)
The timestamp difference between two samples was put inside an unsigned
integer, and, when negative, caused an overflow.
2025-10-26 15:52:13 +01:00
Alessandro RosandGitHub 9e0f033192 docs: update (#5115) 2025-10-21 19:03:02 +02:00
Alessandro RosandGitHub d209454693 rtmp: fix freeze when reading source (#5117)
Tracks were read without deadlines, freezing the server if they are not
present. This patch also allows to close the server immediately during
track reading.
2025-10-21 18:04:18 +02:00
Alessandro RosandGitHub 54cc8365f1 Revert fe3adf9 (#5107) 2025-10-17 15:27:30 +02:00
Alessandro RosandGitHub fe3adf9b78 lock discussions automatically (#5106) 2025-10-17 15:18:28 +02:00
Alessandro RosandGitHub f126a7e7d6 playback: improve segment merging algorithm (#5084)
* merge segments only if they belong to the same stream and are
consecutive. * compute DTS without using NTP timestamp, increasing
robustness against NTP fluctuations.
2025-10-13 17:00:21 +02:00
Alessandro RosandGitHub 7bca38badb add self-upgrader (#3501) (#5035)
this allows to upgrade MediaMTX to latest version by running

./mediamtx --upgrade
2025-10-13 13:06:47 +02:00
Alessandro RosandGitHub 02e2b9d640 recorder: write additional infos inside segments (#5083)
write stream ID, segment number, DTS, NTP in a dedicated box. This
allows to improve the merge algorithm in the playback server.
2025-10-13 12:34:44 +02:00
Alessandro RosandGitHub ccaccc51b4 replace incoming absolute timestamps of any source (#5081)
Absolute timestamps are used to generate recording segments, so users
should not be able to change them, unless explicitly allowed.

Parameter useAbsoluteTimestamp allowed to re-enable absolute timestamps
with RTSP and WebRTC, now it is extended to all protocols.
2025-10-13 12:23:51 +02:00
Alessandro RosandGitHub 75420552b9 recorder: reset fMP4 sequence number during segment switch (#5082)
It's useless to make sequence numbers unique across the entire stream.
2025-10-12 17:59:28 +02:00
Alessandro RosandGitHub a9d84103d0 prevent estimated absolute timestamp from drifting too much (#5080) 2025-10-12 17:53:22 +02:00
Alessandro RosandGitHub 0cdae40fe3 estimate absolute timestamp more precisely (#5078)
When the absolute timestamp of incoming frames was not available, it
was filled with the current timestamp, which is influenced by latency
over time.

This mechanism is replaced by an algorithm that detects when latency is
the lowest, stores the current timestamp and uses it as reference
throughout the rest of the stream.
2025-10-12 11:02:14 +02:00
Alessandro RosandGitHub f5f03562d3 rewrite Unit definition (#5079)
Stream units now share the same struct, with a specialized payload.
2025-10-11 12:18:51 +02:00
Alessandro RosandGitHub 7ecbe736c6 docs: update (#5061) 2025-10-05 18:07:39 +02:00
Alessandro RosandGitHub 6415285427 hls: improve web page performance (#5062)
load hls.js in parallel with the page.
2025-10-05 18:00:14 +02:00
Alessandro RosandGitHub 7634370818 add read and write timeouts in HTTP servers (#5056)
this prevents zombie connections from piling up.
2025-10-04 10:01:21 +02:00
Alessandro RosandGitHub 691d7290fb webrtc: fix packet corruption when reading G711 (#5048)
when a reader is reading a G711 track, stream units are modified
globally, affecting every other reader. This fixes the issue.
2025-09-30 10:42:24 +02:00
Alessandro RosandGitHub 2690ef8e71 api: add /info endpoint (#945) (#5045) 2025-09-30 10:39:27 +02:00
Alessandro RosandGitHub 2024783eec webrtc: fix clippy audio when reading Opus (#3878) (#5047)
Opus timestamp is now recomputed from scratch.
2025-09-30 10:35:56 +02:00
Alessandro RosandGitHub cd80814009 do not include recorder and HLS muxer in sent bytes (#4380) (#5039)
in API (/paths/list, /paths/get) and metrics (paths_bytes_sent), the
amount of sent bytes was increased even in case of writes to the
recorder and HLS muxer, which are not generating network traffic. This
fixes the issue.
2025-09-29 09:28:04 +02:00
Alessandro RosandGitHub ada39d22cd on Windows, do not look for configuration in linux paths (#5036) 2025-09-27 13:36:04 +02:00
Alessandro RosandGitHub 8e6cc4fab4 docs: mention mandatory /whep suffix (#4585) (#5037) 2025-09-27 13:35:29 +02:00
Alessandro RosandGitHub d6e6954a12 api: fix crash in rtspsessions/list and /rtspsessions/get (#5030) (#5031)
sometimes sessions have an empty associated path, and this caused a
crash.
2025-09-25 10:57:03 +02:00
Alessandro RosandGitHub 6b57c5187b webrtc: add authentication parameters to publisher.js and reader.js (#5026)
add user, pass and token configuration parameters.
2025-09-24 18:28:53 +02:00
Alessandro RosandGitHub 5203a0f04b docs: add leading zeros to usage pages (#5025) 2025-09-23 10:31:36 +02:00
Alessandro RosandGitHub e1f5d06612 allow changing record parameters without disconnecting readers (#4663) (#5018) 2025-09-23 10:31:05 +02:00
Alessandro RosandGitHub f987695d9d rtsp: log authentication failure reason (#4641) (#5017) 2025-09-23 10:18:13 +02:00
Alessandro RosandGitHub 5240bcb8ff log authentication errors of API, metrics, pprof (#4641) (#5015) 2025-09-23 09:51:22 +02:00
Alessandro RosandGitHub e05246d5ae docs: explain how to decrease JWT length in Keycloak (#5012)
this prevents errors when passing JWT with FFmpeg and GStreamer.
2025-09-23 09:46:00 +02:00
Alessandro RosandGitHub 400af1a267 docs: update (#5003) 2025-09-22 10:08:06 +02:00
Alessandro RosandGitHub 85f57b90db stop accepting JWTs from query parameters unless allowed in conf (#5010)
This is the first step into removing support for JWTs in
query parameters, which is a security flaw.
2025-09-22 10:04:51 +02:00
Alessandro RosandGitHub 68b4c20627 fix reading JWT when it is passed through the password field (#5009)
Usernames and passwords must be requested explicitly to clients, but
they were not requested when JWT is meant to be passed as password.
This fixes the issue.
2025-09-22 10:00:33 +02:00
Alessandro RosandGitHub b517631b8f fix authentication failure reason not being displayed (#5007) 2025-09-22 09:48:51 +02:00
Alessandro RosandGitHub 868fd43108 update issue / discussion templates (#5006) 2025-09-21 16:33:57 +02:00
Alessandro RosandGitHub 0ede14d1a1 docs: update (#4995) 2025-09-18 19:09:11 +02:00
Alessandro RosandGitHub 0b635617c7 docs: update (#4994) 2025-09-18 18:41:51 +02:00
Alessandro RosandGitHub f81c50ee68 rtsp: support reading streams tunneled with HTTP or WebSocket (#4986) 2025-09-17 22:31:20 +02:00
Alessandro RosandGitHub 558d1c3818 api: add tunnel and profile to RTSP conns and sessions (#4985) 2025-09-17 22:18:21 +02:00
Alessandro RosandGitHub e3b8af8933 switch to gortsplib/v5 (#4978) 2025-09-16 13:10:34 +02:00
Alessandro RosandGitHub 35aceaa4a9 send server name (SNI) when opening TLS connections (#4973) 2025-09-15 19:38:36 +02:00
Alessandro RosandGitHub 22aad7bbd0 docs: improve pprof page (#4969) 2025-09-13 12:10:24 +02:00