Alessandro Ros and GitHub
f991821a5f
webrtc: allow tuning WHEP timeouts ( #5027 ) ( #5479 )
...
add whepHandshakeTimeout, whepTrackGatherTimeout, whepSTUNGatherTimeout
2026-02-18 16:29:25 +01:00
Alessandro Ros and GitHub
ddaafd4ef3
rtmp: prevent legacy clients from reading multiple video/audio tracks ( #5478 )
2026-02-18 11:02:58 +01:00
Alessandro Ros and GitHub
cb69d64fac
deprecate unix+rtp ( #5318 ) ( #4999 ) ( #5351 ) ( #5470 )
...
Unix socket are stream-based connections, while RTP requires
packet-based connections. While packet-based Unix sockets exist
(unixgram), no client supports them. Consequently we are forced to
deprecate unix+rtp.
2026-02-15 13:02:18 +01:00
Alessandro Ros and GitHub
bbefa5bc8b
improve tests ( #5469 )
2026-02-15 12:50:26 +01:00
Alessandro Ros and GitHub
a0bbdd9655
replace YAML parser ( #5461 )
...
switch from the unmaintained gopkg.in/yaml to goccy/go-yaml
2026-02-12 15:51:14 +01:00
Alessandro Ros and GitHub
9793f90453
make config file YAML 1.2 compliant ( #5345 ) ( #5456 )
2026-02-12 15:46:06 +01:00
Alessandro Ros and GitHub
832cc05f39
api: add conns to RTSP Sessions ( #5454 )
...
this allows to find connections associated with a RTSP session.
2026-02-12 15:45:34 +01:00
Alessandro Ros and GitHub
c250e34075
support X-Forwarded-Proto in playback server ( #4970 ) ( #5445 )
...
allow reverse proxies to change the schema of URLs returned by the
server through the X-Forwarded-Proto header.
2026-02-11 21:47:02 +01:00
Alessandro Ros and GitHub
f907e19b08
hls: in client, support storing and sending cookies ( #5444 )
2026-02-10 15:17:15 +01:00
4a559338ae
improve JSON error message ( #5412 ) ( #5433 )
...
Co-authored-by: Zaphkiel <duambi123@gmail.com >
2026-02-07 19:52:27 +01:00
Alessandro Ros and GitHub
2c93262635
update documentation ( #5418 )
2026-02-07 19:41:43 +01:00
Alessandro Ros and GitHub
325d00dfb8
move go <-> api check in linters ( #5425 )
2026-02-06 16:12:57 +01:00
Alessandro Ros and GitHub
ae21240c76
add additional checks on always-available streams ( #5408 )
...
make sure that published streams match MPEG-4 audio, G711 and LPCM
parameters declared in configuration or used by the offline file.
2026-02-06 16:06:24 +01:00
Alessandro Ros and GitHub
4f859fb40b
add authHTTPFingerprint ( #5413 ) ( #5422 )
2026-02-05 16:51:29 +01:00
Alessandro Ros and GitHub
4dc09e1d51
set default udpMaxPayloadSize to an IPv6 compatible value ( #4882 ) ( #5402 )
...
When using IPv6, there are 20 bytes less available for UDP payload,
which has been adjusted accordingly.
2026-02-05 16:32:02 +01:00
Alessandro Ros and GitHub
a0745e1220
emit structured logs with nanosecond precision ( #4924 ) ( #5404 )
2026-02-05 16:31:23 +01:00
Alessandro Ros and GitHub
74eaa11d3a
rtsp: add rtspUDPSourcePortRange param ( #5363 ) ( #5397 )
2026-01-31 16:21:53 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
69fdd18d86
docs: update ( #5308 )
2026-01-28 11:52:42 +01:00
Alessandro Ros and GitHub
8a4f2f5f3f
simplify configuration definitions ( #5376 )
2026-01-25 20:24:41 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
46b4293e35
api: improve openapi definition ( #5380 )
...
add uint64, uint, uuid, move WebRTCICEServer into dedicated schema
2026-01-25 19:35:43 +01:00
Alessandro Ros and GitHub
1a53e40bdc
switch to reflect.Pointer ( #5377 )
2026-01-25 13:51:49 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
40cb857dd9
prevent setting empty usernames with environment variables ( #5373 )
2026-01-24 19:44:17 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
f4f795a2a6
simplify configuration parsing ( #5372 )
...
work around golang/go#21092 globally
2026-01-24 19:33:47 +01:00
Alessandro Ros and GitHub
e2ac32177b
prevent several configuration errors ( #5368 )
2026-01-22 19:35:44 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
3998ceb88f
webrtc: print incoming data channel messages ( #5357 )
2026-01-20 16:18:13 +01:00
Alessandro Ros and GitHub
02fe2e2b42
tests: fix race condition ( #5354 )
2026-01-17 23:21:34 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
2109ade5b4
improve readability of issues with config ( #5353 )
2026-01-16 13:20:07 +01:00
Alessandro Ros and GitHub
e4c60e1e62
tests: fix race condition ( #5338 )
2026-01-12 21:46:48 +01:00
Alessandro Ros and GitHub
bac9060368
link Github Actions badges to the main branch ( #5337 )
2026-01-12 20:27:38 +01:00
Alessandro Ros and GitHub
eba3b828a6
print last processing error ( #5323 )
2026-01-06 21:48:36 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
1d9b2ff7ea
tests: fix race condition ( #5316 )
2026-01-04 16:27:12 +01:00
Alessandro Ros and GitHub
9cb64d98ac
print OS and Arch in first log line ( #5315 )
2026-01-01 22:59:39 +01:00
Alessandro Ros and GitHub
0a01bf4ec8
rpi: advertise support for Raspberry Pi OS Trixie ( #5312 )
2026-01-01 22:58:47 +01:00
Alessandro Ros and GitHub
099a1829dd
move away from balenalib Docker images ( #5313 )
2026-01-01 22:52:39 +01:00
Alessandro Ros and GitHub
a148f5a546
simplify code ( #5314 )
2026-01-01 22:47:59 +01:00
Alessandro Ros and GitHub
b9adbc3e09
remove redundant check ( #5311 )
2026-01-01 22:47:03 +01:00
Alessandro Ros and GitHub
19d3a9c80d
remove redundant code ( #5310 )
2026-01-01 20:51:40 +01:00
Alessandro Ros and GitHub
b2af5defd0
tests: fix race condition ( #5309 )
2026-01-01 20:00:27 +01:00
Alessandro Ros and GitHub
5c67b2f08b
tests: fix race condition ( #5301 )
2025-12-28 16:36:54 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
ea4c4f1fbb
disable syslog logging on macOS ( #5005 ) ( #5295 )
2025-12-27 13:59:33 +01:00
Alessandro Ros and GitHub
20e7f1db75
docs: improve ( #5277 )
2025-12-27 13:55:13 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
1704fba5e9
rtsp: avoid setupping back channels ( #5074 ) ( #5289 )
2025-12-24 20:44:56 +01:00
Alessandro Ros and GitHub
55f93eddde
rtsp: call rtsp.ToStream before advertising the stream ( #5288 )
2025-12-24 20:37:01 +01:00
Alessandro Ros and GitHub
9e82b5233d
fix 1-minute offset when recording a H264 WebRTC track ( #5275 ) ( #5278 )
2025-12-19 13:32:14 +01:00
Alessandro Ros and GitHub
834b079b78
rtsp: fix crash when setupping tracks between stream changes ( #5253 ) ( #5257 )
2025-12-07 11:38:52 +01:00
Alessandro Ros and GitHub
fc8012d3c7
bump mediacommon ( #5258 )
2025-12-07 11:38:37 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
a0a75dfab6
fix panic when changing log file to a nonexisting directory ( #5132 ) ( #5249 )
2025-12-06 22:51:25 +01:00
Alessandro Ros and GitHub
8d3c4074d8
api: split implementation into multiple files ( #5251 )
2025-12-06 22:50:06 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
8505e8d83f
docs: update ( #5152 )
2025-11-18 04:07:03 +01:00
Alessandro Ros and GitHub
3f599d236f
rtp: reorder packets before ingestion ( #5194 )
2025-11-14 17:19:48 +01:00
Alessandro Ros and GitHub
2d02ca0df7
webrtc: use rtpReceiver and rtpSender to count packets ( #5193 )
2025-11-14 17:10:50 +01:00
Alessandro Ros and GitHub
d02fb4ed8e
move constant ( #5190 )
2025-11-12 18:09:53 +01:00
Alessandro Ros and GitHub
ff187b6d8a
update golangci-lint configuration ( #5182 )
2025-11-11 23:57:52 +01:00
Alessandro Ros and GitHub
ac1d4360b2
tests: fix race condition ( #5187 )
2025-11-11 21:12:01 +01:00
Alessandro Ros and GitHub
8858bf1db9
simplify code with ptrOf ( #5179 )
2025-11-11 12:01:03 +01:00
Alessandro Ros and GitHub
5be9b0eb97
rename variable ( #5173 )
2025-11-09 22:19:17 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
3ae5262510
docs: update ( #5125 )
2025-10-29 10:51:02 +01:00
Alessandro Ros and GitHub
2859590544
update workflows ( #5131 )
2025-10-26 16:46:42 +01:00
Alessandro Ros and GitHub
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 Ros and GitHub
9e0f033192
docs: update ( #5115 )
2025-10-21 19:03:02 +02:00
Alessandro Ros and GitHub
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 Ros and GitHub
54cc8365f1
Revert fe3adf9 ( #5107 )
2025-10-17 15:27:30 +02:00
Alessandro Ros and GitHub
fe3adf9b78
lock discussions automatically ( #5106 )
2025-10-17 15:18:28 +02:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
a9d84103d0
prevent estimated absolute timestamp from drifting too much ( #5080 )
2025-10-12 17:53:22 +02:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
7ecbe736c6
docs: update ( #5061 )
2025-10-05 18:07:39 +02:00
Alessandro Ros and GitHub
6415285427
hls: improve web page performance ( #5062 )
...
load hls.js in parallel with the page.
2025-10-05 18:00:14 +02:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
2690ef8e71
api: add /info endpoint ( #945 ) ( #5045 )
2025-09-30 10:39:27 +02:00
Alessandro Ros and GitHub
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 Ros and GitHub
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 Ros and GitHub
ada39d22cd
on Windows, do not look for configuration in linux paths ( #5036 )
2025-09-27 13:36:04 +02:00
Alessandro Ros and GitHub
8e6cc4fab4
docs: mention mandatory /whep suffix ( #4585 ) ( #5037 )
2025-09-27 13:35:29 +02:00
Alessandro Ros and GitHub
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 Ros and GitHub
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