mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-27 12:02:20 +08:00
Update publisher.go
ffmpeg rtsp pcma 推流
This commit is contained in:
17
publisher.go
17
publisher.go
@@ -80,6 +80,23 @@ func (p *RTSPPublisher) SetTracks() error {
|
|||||||
p.AudioTrack = at
|
p.AudioTrack = at
|
||||||
}
|
}
|
||||||
p.Tracks[track] = p.AudioTrack
|
p.Tracks[track] = p.AudioTrack
|
||||||
|
default:
|
||||||
|
rtpMap, _ := forma.Marshal()
|
||||||
|
rtpMap = strings.ToLower(rtpMap)
|
||||||
|
if strings.Contains(rtpMap, "pcm") {
|
||||||
|
isMulaw := false
|
||||||
|
if strings.Contains(rtpMap, "pcmu") {
|
||||||
|
isMulaw = true
|
||||||
|
}
|
||||||
|
at := p.AudioTrack
|
||||||
|
if at == nil {
|
||||||
|
at := NewG711(p.Stream, !isMulaw, f.PayloadType(), uint32(f.ClockRate()))
|
||||||
|
p.AudioTrack = at
|
||||||
|
}
|
||||||
|
p.Tracks[track] = p.AudioTrack
|
||||||
|
} else {
|
||||||
|
p.Error("unknown format", zap.Any("format", f.String()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user