Skip to content

Commit b73333b

Browse files
committed
rtmp: move implementation to gortmplib
1 parent e8b746b commit b73333b

File tree

164 files changed

+61
-13218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+61
-13218
lines changed

docs/4-other/4-specifications.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
| ------------------------------------------------------------------------------------------------------------- | -------------- |
55
| [RTSP / RTP / RTCP specifications](https://github.com/bluenviron/gortsplib#specifications) | RTSP |
66
| [HLS specifications](https://github.com/bluenviron/gohlslib#specifications) | HLS |
7-
| [Action Message Format - AMF 0](https://veovera.org/docs/legacy/amf0-file-format-spec.pdf) | RTMP |
8-
| [FLV](https://veovera.org/docs/legacy/video-file-format-v10-1-spec.pdf) | RTMP |
9-
| [RTMP](https://veovera.org/docs/legacy/rtmp-v1-0-spec.pdf) | RTMP |
10-
| [Enhanced RTMP v2](https://veovera.org/docs/enhanced/enhanced-rtmp-v2.pdf) | RTMP |
7+
| [RTMP specifications](https://github.com/bluenviron/gortmplib#specifications) | RTMP |
118
| [WebRTC: Real-Time Communication in Browsers](https://www.w3.org/TR/webrtc/) | WebRTC |
129
| [RFC8835, Transports for WebRTC](https://datatracker.ietf.org/doc/html/rfc8835) | WebRTC |
1310
| [RFC7742, WebRTC Video Processing and Codec Requirements](https://datatracker.ietf.org/doc/html/rfc7742) | WebRTC |

docs/4-other/5-related-projects.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- [gortsplib (RTSP library used internally)](https://github.com/bluenviron/gortsplib)
44
- [gohlslib (HLS library used internally)](https://github.com/bluenviron/gohlslib)
5+
- [gortmplib (RTMP library used internally)](https://github.com/bluenviron/gortmplib)
56
- [mediacommon (codecs and formats library used internally)](https://github.com/bluenviron/mediacommon)
67
- [mediamtx-rpicamera (Raspberry Pi Camera component)](https://github.com/bluenviron/mediamtx-rpicamera)
78
- [datarhei/gosrt (SRT library used internally)](https://github.com/datarhei/gosrt)

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/alecthomas/kong v1.12.1
1111
github.com/asticode/go-astits v1.13.0
1212
github.com/bluenviron/gohlslib/v2 v2.2.2
13+
github.com/bluenviron/gortmplib v0.0.0-20250913091209-a6c8a2607676
1314
github.com/bluenviron/gortsplib/v4 v4.16.2
1415
github.com/bluenviron/mediacommon/v2 v2.4.2-0.20250909112826-017d0bbe41db
1516
github.com/datarhei/gosrt v0.9.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ github.com/benburkert/openpgp v0.0.0-20160410205803-c2471f86866c h1:8XZeJrs4+ZYh
3333
github.com/benburkert/openpgp v0.0.0-20160410205803-c2471f86866c/go.mod h1:x1vxHcL/9AVzuk5HOloOEPrtJY0MaalYr78afXZ+pWI=
3434
github.com/bluenviron/gohlslib/v2 v2.2.2 h1:Q86VloPjwONKF8pu6jSEh9ENm4UzdMl5SzYvtjneL5k=
3535
github.com/bluenviron/gohlslib/v2 v2.2.2/go.mod h1:3Lby/VMDD/cN0B3uJPd3bEEiJZ34LqXs71FEvN/fq2k=
36+
github.com/bluenviron/gortmplib v0.0.0-20250913091209-a6c8a2607676 h1:1DI36xUoNSR0jkGjbe03NMbG4Ee+5uni/SXgnfqcprY=
37+
github.com/bluenviron/gortmplib v0.0.0-20250913091209-a6c8a2607676/go.mod h1:FyreWlRZNHSzCG7TkVT66+9n31w1uUBFgWg0G86YCfk=
3638
github.com/bluenviron/gortsplib/v4 v4.16.2 h1:10HaMsorjW13gscLp3R7Oj41ck2i1EHIUYCNWD2wpkI=
3739
github.com/bluenviron/gortsplib/v4 v4.16.2/go.mod h1:Vm07yUMys9XKnuZJLfTT8zluAN2n9ZOtz40Xb8RKh+8=
3840
github.com/bluenviron/mediacommon/v2 v2.4.2-0.20250909112826-017d0bbe41db h1:yBxx462HsYC14/vKr5BF/Hlpso6WmyHzjwoE/W0td5s=

internal/core/api_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"testing"
1515
"time"
1616

17+
"github.com/bluenviron/gortmplib"
1718
"github.com/bluenviron/gortsplib/v4"
1819
"github.com/bluenviron/gortsplib/v4/pkg/description"
1920
"github.com/bluenviron/gortsplib/v4/pkg/format"
@@ -24,7 +25,6 @@ import (
2425
pwebrtc "github.com/pion/webrtc/v4"
2526
"github.com/stretchr/testify/require"
2627

27-
"github.com/bluenviron/mediamtx/internal/protocols/rtmp"
2828
"github.com/bluenviron/mediamtx/internal/protocols/webrtc"
2929
"github.com/bluenviron/mediamtx/internal/protocols/whip"
3030
"github.com/bluenviron/mediamtx/internal/test"
@@ -432,7 +432,7 @@ func TestAPIProtocolListGet(t *testing.T) {
432432
u, err = url.Parse(rawURL)
433433
require.NoError(t, err)
434434

435-
conn := &rtmp.Client{
435+
conn := &gortmplib.Client{
436436
URL: u,
437437
TLSConfig: &tls.Config{InsecureSkipVerify: true},
438438
Publish: true,
@@ -441,7 +441,7 @@ func TestAPIProtocolListGet(t *testing.T) {
441441
require.NoError(t, err)
442442
defer conn.Close()
443443

444-
w := &rtmp.Writer{
444+
w := &gortmplib.Writer{
445445
Conn: conn,
446446
Tracks: []format.Format{test.FormatH264},
447447
}
@@ -1026,15 +1026,15 @@ func TestAPIProtocolKick(t *testing.T) {
10261026
u, err = url.Parse("rtmp://localhost:1935/mypath")
10271027
require.NoError(t, err)
10281028

1029-
conn := &rtmp.Client{
1029+
conn := &gortmplib.Client{
10301030
URL: u,
10311031
Publish: true,
10321032
}
10331033
err = conn.Initialize(context.Background())
10341034
require.NoError(t, err)
10351035
defer conn.Close()
10361036

1037-
w := &rtmp.Writer{
1037+
w := &gortmplib.Writer{
10381038
Conn: conn,
10391039
Tracks: []format.Format{test.FormatH264},
10401040
}

internal/core/metrics_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"testing"
1313
"time"
1414

15+
"github.com/bluenviron/gortmplib"
1516
"github.com/bluenviron/gortsplib/v4"
1617
"github.com/bluenviron/gortsplib/v4/pkg/description"
1718
"github.com/bluenviron/gortsplib/v4/pkg/format"
@@ -21,7 +22,6 @@ import (
2122
pwebrtc "github.com/pion/webrtc/v4"
2223
"github.com/stretchr/testify/require"
2324

24-
"github.com/bluenviron/mediamtx/internal/protocols/rtmp"
2525
"github.com/bluenviron/mediamtx/internal/protocols/webrtc"
2626
"github.com/bluenviron/mediamtx/internal/protocols/whip"
2727
"github.com/bluenviron/mediamtx/internal/test"
@@ -209,15 +209,15 @@ webrtc_sessions_rtcp_packets_sent 0
209209
u, err2 := url.Parse("rtmp://localhost:1935/rtmp_path")
210210
require.NoError(t, err2)
211211

212-
conn := &rtmp.Client{
212+
conn := &gortmplib.Client{
213213
URL: u,
214214
Publish: true,
215215
}
216216
err2 = conn.Initialize(context.Background())
217217
require.NoError(t, err2)
218218
defer conn.Close()
219219

220-
w := &rtmp.Writer{
220+
w := &gortmplib.Writer{
221221
Conn: conn,
222222
Tracks: []format.Format{test.FormatH264},
223223
}
@@ -236,7 +236,7 @@ webrtc_sessions_rtcp_packets_sent 0
236236
u, err2 := url.Parse("rtmps://localhost:1936/rtmps_path")
237237
require.NoError(t, err2)
238238

239-
conn := &rtmp.Client{
239+
conn := &gortmplib.Client{
240240
URL: u,
241241
TLSConfig: &tls.Config{InsecureSkipVerify: true},
242242
Publish: true,
@@ -245,7 +245,7 @@ webrtc_sessions_rtcp_packets_sent 0
245245
require.NoError(t, err2)
246246
defer conn.Close()
247247

248-
w := &rtmp.Writer{
248+
w := &gortmplib.Writer{
249249
Conn: conn,
250250
Tracks: []format.Format{test.FormatH264},
251251
}

internal/core/path_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"testing"
1515
"time"
1616

17+
"github.com/bluenviron/gortmplib"
1718
"github.com/bluenviron/gortsplib/v4"
1819
"github.com/bluenviron/gortsplib/v4/pkg/base"
1920
"github.com/bluenviron/gortsplib/v4/pkg/description"
@@ -24,7 +25,6 @@ import (
2425
"github.com/stretchr/testify/require"
2526

2627
"github.com/bluenviron/mediamtx/internal/defs"
27-
"github.com/bluenviron/mediamtx/internal/protocols/rtmp"
2828
"github.com/bluenviron/mediamtx/internal/protocols/whip"
2929
"github.com/bluenviron/mediamtx/internal/test"
3030
)
@@ -216,7 +216,7 @@ func TestPathRunOnConnect(t *testing.T) {
216216
u, err = url.Parse("rtmp://127.0.0.1:1935/test")
217217
require.NoError(t, err)
218218

219-
conn := &rtmp.Client{
219+
conn := &gortmplib.Client{
220220
URL: u,
221221
Publish: true,
222222
}
@@ -231,7 +231,7 @@ func TestPathRunOnConnect(t *testing.T) {
231231
u, err = url.Parse("rtmps://127.0.0.1:1936/test")
232232
require.NoError(t, err)
233233

234-
conn := &rtmp.Client{
234+
conn := &gortmplib.Client{
235235
URL: u,
236236
Publish: true,
237237
TLSConfig: &tls.Config{InsecureSkipVerify: true},
@@ -458,15 +458,15 @@ func TestPathRunOnRead(t *testing.T) {
458458
u, err = url.Parse("rtmp://127.0.0.1:1935/test?query=value")
459459
require.NoError(t, err)
460460

461-
conn := &rtmp.Client{
461+
conn := &gortmplib.Client{
462462
URL: u,
463463
Publish: false,
464464
}
465465
err = conn.Initialize(context.Background())
466466
require.NoError(t, err)
467467
defer conn.Close()
468468

469-
r := &rtmp.Reader{
469+
r := &gortmplib.Reader{
470470
Conn: conn,
471471
}
472472
err = r.Initialize()
@@ -477,7 +477,7 @@ func TestPathRunOnRead(t *testing.T) {
477477
u, err = url.Parse("rtmps://127.0.0.1:1936/test?query=value")
478478
require.NoError(t, err)
479479

480-
conn := &rtmp.Client{
480+
conn := &gortmplib.Client{
481481
URL: u,
482482
Publish: false,
483483
TLSConfig: &tls.Config{InsecureSkipVerify: true},
@@ -503,7 +503,7 @@ func TestPathRunOnRead(t *testing.T) {
503503
}
504504
}()
505505

506-
r := &rtmp.Reader{
506+
r := &gortmplib.Reader{
507507
Conn: conn,
508508
}
509509
err = r.Initialize()

0 commit comments

Comments
 (0)