From 13fb24da393634b4cd27bd2467d2e69e70a82051 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Fri, 13 May 2022 16:59:52 +0200 Subject: [PATCH] fix rtmp -> rtsp audio conversion (#932) --- internal/core/hls_source.go | 2 +- internal/core/rtmp_conn.go | 2 +- internal/core/rtmp_source.go | 2 +- internal/hls/client_audio_processor.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/core/hls_source.go b/internal/core/hls_source.go index a4f4def9..679961b0 100644 --- a/internal/core/hls_source.go +++ b/internal/core/hls_source.go @@ -115,7 +115,7 @@ func (s *hlsSource) runInner() bool { if audioTrack != nil { audioTrackID = len(tracks) audioEnc = &rtpaac.Encoder{ - PayloadType: 97, + PayloadType: 96, SampleRate: audioTrack.ClockRate(), SizeLength: 13, IndexLength: 3, diff --git a/internal/core/rtmp_conn.go b/internal/core/rtmp_conn.go index 26cd3a6d..e646df02 100644 --- a/internal/core/rtmp_conn.go +++ b/internal/core/rtmp_conn.go @@ -460,7 +460,7 @@ func (c *rtmpConn) runPublish(ctx context.Context) error { var aacEncoder *rtpaac.Encoder if audioTrack != nil { aacEncoder = &rtpaac.Encoder{ - PayloadType: 97, + PayloadType: 96, SampleRate: audioTrack.ClockRate(), SizeLength: 13, IndexLength: 3, diff --git a/internal/core/rtmp_source.go b/internal/core/rtmp_source.go index 55ff268b..2110754d 100644 --- a/internal/core/rtmp_source.go +++ b/internal/core/rtmp_source.go @@ -144,7 +144,7 @@ func (s *rtmpSource) runInner() bool { var aacEncoder *rtpaac.Encoder if audioTrack != nil { aacEncoder = &rtpaac.Encoder{ - PayloadType: 97, + PayloadType: 96, SampleRate: audioTrack.ClockRate(), SizeLength: 13, IndexLength: 3, diff --git a/internal/hls/client_audio_processor.go b/internal/hls/client_audio_processor.go index a14f40b5..5884be74 100644 --- a/internal/hls/client_audio_processor.go +++ b/internal/hls/client_audio_processor.go @@ -78,7 +78,7 @@ func (p *clientAudioProcessor) doProcess( if !p.trackInitialized { p.trackInitialized = true - track, err := gortsplib.NewTrackAAC(97, pkt.Type, pkt.SampleRate, pkt.ChannelCount, nil, 13, 3, 3) + track, err := gortsplib.NewTrackAAC(96, pkt.Type, pkt.SampleRate, pkt.ChannelCount, nil, 13, 3, 3) if err != nil { return err }