Commit Graph
176 Commits
Author SHA1 Message Date
Alessandro RosandGitHub ddaafd4ef3 rtmp: prevent legacy clients from reading multiple video/audio tracks (#5478) 2026-02-18 11:02:58 +01:00
Alessandro RosandGitHub bbefa5bc8b improve tests (#5469) 2026-02-15 12:50:26 +01:00
bluenviron-botandGitHub ea6977d918 bump golangci-lint to 2.9.0 (#5459) 2026-02-12 15:18:02 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>aler9
88a15c7654 build(deps): bump github.com/bluenviron/gortmplib from 0.2.0 to 0.2.1 (#5394)
* build(deps): bump github.com/bluenviron/gortmplib from 0.2.0 to 0.2.1

Bumps [github.com/bluenviron/gortmplib](https://github.com/bluenviron/gortmplib) from 0.2.0 to 0.2.1.
- [Commits](https://github.com/bluenviron/gortmplib/compare/v0.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/gortmplib
  dependency-version: 0.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* additional changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-01-31 15:57:00 +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
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>aler9
aa6dc4ea9f build(deps): bump github.com/pion/webrtc/v4 from 4.2.1 to 4.2.3 (#5341)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-01-20 18:21:05 +01:00
8901ac4e9c webrtc: support reading KLV tracks (#4722)
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-01-16 23:40:21 +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 e4c60e1e62 tests: fix race condition (#5338) 2026-01-12 21:46:48 +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
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
62effa79ef build(deps): bump github.com/bluenviron/gortmplib from 0.1.2 to 0.2.0 (#5300)
Bumps [github.com/bluenviron/gortmplib](https://github.com/bluenviron/gortmplib) from 0.1.2 to 0.2.0.
- [Commits](https://github.com/bluenviron/gortmplib/compare/v0.1.2...v0.2.0)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/gortmplib
  dependency-version: 0.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-28 17:29:27 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f843df4ab8 build(deps): bump github.com/bluenviron/mediacommon/v2 (#5297)
Bumps [github.com/bluenviron/mediacommon/v2](https://github.com/bluenviron/mediacommon) from 2.5.3 to 2.6.0.
- [Commits](https://github.com/bluenviron/mediacommon/compare/v2.5.3...v2.6.0)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/mediacommon/v2
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-28 15:44:36 +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
ade0cddeb3 support multiple CORS origins (#5150)
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2025-11-21 02:00:46 +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 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 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 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 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 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
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
253df883c2 build(deps): bump github.com/bluenviron/mediacommon/v2 (#4990)
Bumps [github.com/bluenviron/mediacommon/v2](https://github.com/bluenviron/mediacommon) from 2.4.2 to 2.4.3.
- [Commits](https://github.com/bluenviron/mediacommon/compare/v2.4.2...v2.4.3)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/mediacommon/v2
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-18 13:10:42 +02:00
Alessandro RosandGitHub e3b8af8933 switch to gortsplib/v5 (#4978) 2025-09-16 13:10:34 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ebd9eb6665 build(deps): bump github.com/bluenviron/mediacommon/v2 (#4975)
Bumps [github.com/bluenviron/mediacommon/v2](https://github.com/bluenviron/mediacommon) from 2.4.2-0.20250909112826-017d0bbe41db to 2.4.2.
- [Commits](https://github.com/bluenviron/mediacommon/commits/v2.4.2)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/mediacommon/v2
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 22:56:28 +02:00
Alessandro RosandGitHub 35aceaa4a9 send server name (SNI) when opening TLS connections (#4973) 2025-09-15 19:38:36 +02:00
Alessandro RosandGitHub 1b8897d30d rtmp: move implementation to gortmplib (#4968) 2025-09-13 11:50:36 +02:00
Alessandro RosandGitHub 57021467e9 rename formatprocessor into codecprocessor (#4962) 2025-09-12 10:24:11 +02:00
Alessandro RosandGitHub 9318107779 rtmp: support additional enhanced RTMP features (#4168) (#4321) (#4954)
* support reading AV1, VP9, H265, Opus, AC-3, G711, LPCM
* support reading multiple video or audio tracks at once
2025-09-11 23:18:46 +02:00
Alessandro RosandGitHub e0f4748839 modernize code (#4947) 2025-09-07 16:08:47 +02:00
cb16f68432 rtmp: improve control message compatibility with non-standard cameras (#4909)
* feat: improve RTMP control message compatibility with non-standard cameras

- Add flexible chunk stream ID validation for control messages
- Support common non-standard chunk stream IDs (2,3,4,5,6) used by various cameras
- Maintain backward compatibility with standard RTMP clients
- Fix connection issues with PTZ cameras using chunk stream ID 4

This resolves compatibility issues with IP cameras that don't strictly follow
RTMP spec while maintaining full support for standard RTMP implementations.
Previously, cameras using non-standard chunk stream IDs would fail with
'unexpected chunk stream ID' errors. Now MediaMTX provides nginx-rtmp level
compatibility with real-world camera implementations."

* add tests

* entirely remove control chunk stream ID validation

---------

Co-authored-by: Hyesung.Kim <hyesung.kim@xcath.com>
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2025-09-03 15:11:32 +02:00
Pooyan KhanjankhaniandGitHub 3c8d78194c refactor: remove duplicated http middleware (#4894) 2025-08-24 12:37:56 +02:00
alex9longandGitHub 262ce82d58 refactor: use the built-in max/min to simplify the code (#4867)
Signed-off-by: alex9long <alex9long@outlook.com>
2025-08-14 10:32:24 +02:00
Alessandro RosandGitHub c80220eb7c webrtc: solve domains in webrtcAdditionalHosts on server-side (#4817) (#4866) 2025-08-12 15:49:38 +02:00
Alessandro RosandGitHub b627128d0f remove context from webrtc.PeerConnection arguments (#4854)
contexts are useless since there's already PeerConnection.Close().
2025-08-12 15:19:59 +02:00
Alessandro RosandGitHub 5ae934887d remove custom forks of pion/webrtc and pion/ice (#4861)
this fixes IPv6 reliability issues and allows to receive upstream
updates in a more linear way.
2025-08-12 14:30:08 +02:00
Alessandro RosandGitHub afff90f00e restore Windows compatibility (#4860) 2025-08-12 13:00:45 +02:00
Alessandro RosandGitHub 03623799f5 use slices.Contains when possible (#4859) 2025-08-12 12:28:20 +02:00
Alessandro RosandGitHub 6d4dfff959 webrtc: fix clock rate of outgoing RTCP receiver reports (#4852) 2025-08-11 13:59:10 +02:00
Alessandro RosandGitHub 462fb2bd0f allow setting UDP read buffer size (#3308) (#4846)
new parameters: rtspUDPReadBufferSize, rtpUDPReadBufferSize, mpegtsUDPReadBufferSize
2025-08-11 12:21:00 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9e073cd34f build(deps): bump github.com/bluenviron/gortsplib/v4 (#4850)
Bumps [github.com/bluenviron/gortsplib/v4](https://github.com/bluenviron/gortsplib) from 4.16.0 to 4.16.1.
- [Commits](https://github.com/bluenviron/gortsplib/compare/v4.16.0...v4.16.1)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/gortsplib/v4
  dependency-version: 4.16.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-11 11:05:29 +02:00
6ffa07e8e8 Add support for HTTP over unix sockets (#4241)
This adds support for using unix scheme in xxxAddress config options.
For example `hlsAddress: "unix://hls.sock"`.

---------

Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2025-08-03 12:30:26 +02:00
Alessandro RosandGitHub eeb6ac3824 webrtc: re-enable ipv6 (#3227) (#4816) 2025-08-02 23:32:48 +02:00
Alessandro RosandGitHub 548cdbeb8f webrtc: fix crash introduced in #4795 (#4814) 2025-08-02 12:58:45 +02:00