fix rtmp -> rtsp audio conversion (#932)

This commit is contained in:
aler9
2022-05-13 16:59:52 +02:00
parent 7ecd52808a
commit 13fb24da39
4 changed files with 4 additions and 4 deletions

View File

@@ -115,7 +115,7 @@ func (s *hlsSource) runInner() bool {
if audioTrack != nil { if audioTrack != nil {
audioTrackID = len(tracks) audioTrackID = len(tracks)
audioEnc = &rtpaac.Encoder{ audioEnc = &rtpaac.Encoder{
PayloadType: 97, PayloadType: 96,
SampleRate: audioTrack.ClockRate(), SampleRate: audioTrack.ClockRate(),
SizeLength: 13, SizeLength: 13,
IndexLength: 3, IndexLength: 3,

View File

@@ -460,7 +460,7 @@ func (c *rtmpConn) runPublish(ctx context.Context) error {
var aacEncoder *rtpaac.Encoder var aacEncoder *rtpaac.Encoder
if audioTrack != nil { if audioTrack != nil {
aacEncoder = &rtpaac.Encoder{ aacEncoder = &rtpaac.Encoder{
PayloadType: 97, PayloadType: 96,
SampleRate: audioTrack.ClockRate(), SampleRate: audioTrack.ClockRate(),
SizeLength: 13, SizeLength: 13,
IndexLength: 3, IndexLength: 3,

View File

@@ -144,7 +144,7 @@ func (s *rtmpSource) runInner() bool {
var aacEncoder *rtpaac.Encoder var aacEncoder *rtpaac.Encoder
if audioTrack != nil { if audioTrack != nil {
aacEncoder = &rtpaac.Encoder{ aacEncoder = &rtpaac.Encoder{
PayloadType: 97, PayloadType: 96,
SampleRate: audioTrack.ClockRate(), SampleRate: audioTrack.ClockRate(),
SizeLength: 13, SizeLength: 13,
IndexLength: 3, IndexLength: 3,

View File

@@ -78,7 +78,7 @@ func (p *clientAudioProcessor) doProcess(
if !p.trackInitialized { if !p.trackInitialized {
p.trackInitialized = true 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 { if err != nil {
return err return err
} }