diff --git a/go.mod b/go.mod index 24fc2acf..b68e9811 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/asticode/go-astits v1.15.0 github.com/bluenviron/gohlslib/v2 v2.4.0 github.com/bluenviron/gortmplib v0.4.0 - github.com/bluenviron/gortsplib/v5 v5.5.3 + github.com/bluenviron/gortsplib/v5 v5.5.4 github.com/bluenviron/mediacommon/v2 v2.9.0 github.com/datarhei/gosrt v0.11.0 github.com/fsnotify/fsnotify v1.10.1 @@ -82,7 +82,7 @@ require ( github.com/pion/mdns/v2 v2.1.0 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/sctp v1.10.0 // indirect - github.com/pion/srtp/v3 v3.0.10 // indirect + github.com/pion/srtp/v3 v3.0.11 // indirect github.com/pion/stun/v3 v3.1.2 // indirect github.com/pion/turn/v5 v5.0.4 // indirect github.com/pjbgf/sha1cd v0.6.0 // indirect diff --git a/go.sum b/go.sum index 12a1a550..9ff1a384 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/bluenviron/gohlslib/v2 v2.4.0 h1:O0bmUvyOMVPuRx3givLqfGWUzOKicKwkSCIn github.com/bluenviron/gohlslib/v2 v2.4.0/go.mod h1:iqU6QJ5geVuCDpUeAbK/Si2RtDC3ocBTp8LnPHBkN6U= github.com/bluenviron/gortmplib v0.4.0 h1:ydwTrOUxFOJkKagzXON2IetEP2yVQwRByzClpapSODc= github.com/bluenviron/gortmplib v0.4.0/go.mod h1:6AAQoyC8vSHnw02fCW6Kjll93Hk1rEH4+S0uy5NFyDM= -github.com/bluenviron/gortsplib/v5 v5.5.3 h1:aKdP14cRP8CorUCw2K4Qn/Zrs4AXTbAKUENVqh3B3vM= -github.com/bluenviron/gortsplib/v5 v5.5.3/go.mod h1:e4abL49yJF5TR+1m9+0K+UuCSkyJn345Dt2XIJfu4Nc= +github.com/bluenviron/gortsplib/v5 v5.5.4 h1:ooXvRBGPmKHCK9yh90MooeZKZMmaZ63nfITCzTo/vS4= +github.com/bluenviron/gortsplib/v5 v5.5.4/go.mod h1:sT0KqICjZKSpHmx7R3xFRY1tfgP2iMe2bF3i3MxX/jE= github.com/bluenviron/mediacommon/v2 v2.9.0 h1:8gBeby10B/qD8ctnesKTHx3pgdsxiZcaQZe+RR6Djx4= github.com/bluenviron/mediacommon/v2 v2.9.0/go.mod h1:syqw4j2RmBCKZgUtGFtB/7gcnh1aaX8I3vd24+bgXWc= github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= @@ -183,8 +183,8 @@ github.com/pion/sctp v1.10.0 h1:qeoD6swF/2M5bYRcAGayqSbTKX3m4AW29CiQxG1+Pfg= github.com/pion/sctp v1.10.0/go.mod h1:N20Dq6LY+JvJDAh9VVh1JELngb2rQ8dPgds5yBWiPgw= github.com/pion/sdp/v3 v3.0.18 h1:l0bAXazKHpepazVdp+tPYnrsy9dfh7ZbT8DxesH5ZnI= github.com/pion/sdp/v3 v3.0.18/go.mod h1:ZREGo6A9ZygQ9XkqAj5xYCQtQpif0i6Pa81HOiAdqQ8= -github.com/pion/srtp/v3 v3.0.10 h1:tFirkpBb3XccP5VEXLi50GqXhv5SKPxqrdlhDCJlZrQ= -github.com/pion/srtp/v3 v3.0.10/go.mod h1:3mOTIB0cq9qlbn59V4ozvv9ClW/BSEbRp4cY0VtaR7M= +github.com/pion/srtp/v3 v3.0.11 h1:GiESUr54/K4UuPigfq/CvWUed80JenQAHXn0C2MQQIQ= +github.com/pion/srtp/v3 v3.0.11/go.mod h1:EeZOi/sd6glM1EXapg051gdNWO9yWT1YSsgQ4SlJkns= github.com/pion/stun/v3 v3.1.2 h1:86IhD8wFn6IDW4b1/0QzoQS+f5PeA8OHHRn8UZW5ErY= github.com/pion/stun/v3 v3.1.2/go.mod h1:H7gDic7nNwlUL05pbs6T1dtaBehh/KjupxfWw3ZI7cA= github.com/pion/transport/v3 v3.1.1 h1:Tr684+fnnKlhPceU+ICdrw6KKkTms+5qHMgw6bIkYOM= diff --git a/internal/protocols/rtmp/from_stream_test.go b/internal/protocols/rtmp/from_stream_test.go index ee39c1fc..9c9a3658 100644 --- a/internal/protocols/rtmp/from_stream_test.go +++ b/internal/protocols/rtmp/from_stream_test.go @@ -502,7 +502,7 @@ func TestFromStream(t *testing.T) { Formats: []format.Format{&format.H265{}}, }, { - Formats: []format.Format{&format.H264{}}, + Formats: []format.Format{&format.H264{PacketizationMode: 1}}, }, { Formats: []format.Format{&format.VP9{}}, @@ -869,7 +869,7 @@ func TestFromStreamSkipUnsupportedTracks(t *testing.T) { }, { Type: description.MediaTypeVideo, - Formats: []format.Format{&format.H264{}}, + Formats: []format.Format{&format.H264{PacketizationMode: 1}}, }, }} diff --git a/internal/protocols/webrtc/from_stream.go b/internal/protocols/webrtc/from_stream.go index 0fbc1ca8..a5fbc6af 100644 --- a/internal/protocols/webrtc/from_stream.go +++ b/internal/protocols/webrtc/from_stream.go @@ -271,8 +271,9 @@ func setupVideoTrack( } encoder := &rtph264.Encoder{ - PayloadType: 96, - PayloadMaxSize: webrtcPayloadMaxSize, + PayloadType: 96, + PayloadMaxSize: webrtcPayloadMaxSize, + PacketizationMode: 1, } err := encoder.Init() if err != nil { diff --git a/internal/protocols/webrtc/from_stream_test.go b/internal/protocols/webrtc/from_stream_test.go index 6a4fc911..7529cdff 100644 --- a/internal/protocols/webrtc/from_stream_test.go +++ b/internal/protocols/webrtc/from_stream_test.go @@ -37,7 +37,7 @@ func TestFromStreamSkipUnsupportedTracks(t *testing.T) { desc := &description.Session{Medias: []*description.Media{ { Type: description.MediaTypeVideo, - Formats: []format.Format{&format.H264{}}, + Formats: []format.Format{&format.H264{PacketizationMode: 1}}, }, { Type: description.MediaTypeVideo, diff --git a/internal/recorder/recorder_test.go b/internal/recorder/recorder_test.go index ed3015a4..efa6cd04 100644 --- a/internal/recorder/recorder_test.go +++ b/internal/recorder/recorder_test.go @@ -605,7 +605,7 @@ func TestRecorderSkipTracksPartial(t *testing.T) { desc := &description.Session{Medias: []*description.Media{ { Type: description.MediaTypeVideo, - Formats: []rtspformat.Format{&rtspformat.H264{}}, + Formats: []rtspformat.Format{&rtspformat.H264{PacketizationMode: 1}}, }, { Type: description.MediaTypeVideo, diff --git a/internal/staticsources/rpicamera/source.go b/internal/staticsources/rpicamera/source.go index c5b81017..3a97117c 100644 --- a/internal/staticsources/rpicamera/source.go +++ b/internal/staticsources/rpicamera/source.go @@ -171,8 +171,9 @@ func (s *Source) runPrimary(params defs.StaticSourceRunParams) error { } encH264 := &rtph264.Encoder{ - PayloadType: 96, - PayloadMaxSize: s.RTPMaxPayloadSize, + PayloadType: 96, + PayloadMaxSize: s.RTPMaxPayloadSize, + PacketizationMode: 1, } err := encH264.Init() if err != nil { diff --git a/internal/staticsources/rtp/source_test.go b/internal/staticsources/rtp/source_test.go index 998b3b7e..669feac9 100644 --- a/internal/staticsources/rtp/source_test.go +++ b/internal/staticsources/rtp/source_test.go @@ -122,7 +122,8 @@ func TestSourceUDP(t *testing.T) { defer conn.Close() //nolint:errcheck enc := &rtph264.Encoder{ - PayloadType: 96, + PayloadType: 96, + PacketizationMode: 1, } err = enc.Init() require.NoError(t, err) @@ -206,7 +207,8 @@ func TestSourceUnixSocket(t *testing.T) { defer conn.Close() enc := &rtph264.Encoder{ - PayloadType: 96, + PayloadType: 96, + PacketizationMode: 1, } err = enc.Init() require.NoError(t, err) diff --git a/internal/stream/stream_standard_test.go b/internal/stream/stream_standard_test.go index 0cfbb53e..3eb4386f 100644 --- a/internal/stream/stream_standard_test.go +++ b/internal/stream/stream_standard_test.go @@ -20,7 +20,7 @@ func TestStream(t *testing.T) { desc := &description.Session{Medias: []*description.Media{ { Type: description.MediaTypeVideo, - Formats: []format.Format{&format.H264{}}, + Formats: []format.Format{&format.H264{PacketizationMode: 1}}, }, { Type: description.MediaTypeVideo, @@ -73,7 +73,7 @@ func TestStreamSkipOutboundBytes(t *testing.T) { desc := &description.Session{Medias: []*description.Media{ { Type: description.MediaTypeVideo, - Formats: []format.Format{&format.H264{}}, + Formats: []format.Format{&format.H264{PacketizationMode: 1}}, }, { Type: description.MediaTypeVideo, @@ -129,6 +129,7 @@ func TestStreamResizeOversizedRTPPackets(t *testing.T) { { Type: description.MediaTypeVideo, Formats: []format.Format{&format.H264{ + PacketizationMode: 1, SPS: []byte{ // 1920x1080 baseline 0x67, 0x42, 0xc0, 0x28, 0xd9, 0x00, 0x78, 0x02, 0x27, 0xe5, 0x84, 0x00, 0x00, 0x03, 0x00, 0x04, @@ -250,8 +251,9 @@ func TestStreamUpdateFormatParams(t *testing.T) { pps := []byte{0x08, 0x07, 0x08, 0x09} formatH264 := &format.H264{ - SPS: []byte{0x67, 0x42, 0xc0, 0x28}, - PPS: []byte{0x08, 0x06}, + PacketizationMode: 1, + SPS: []byte{0x67, 0x42, 0xc0, 0x28}, + PPS: []byte{0x08, 0x06}, } desc = &description.Session{Medias: []*description.Media{{ @@ -502,7 +504,8 @@ var casesDecodeEncode = []struct { { name: "h264", format: &format.H264{ - PayloadTyp: 96, + PayloadTyp: 96, + PacketizationMode: 1, SPS: []byte{ 0x67, 0x42, 0xc0, 0x28, 0xd9, 0x00, 0x78, 0x02, 0x27, 0xe5, 0x84, 0x00, 0x00, 0x03, 0x00, 0x04,