mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-26 19:51:14 +08:00
fix: use engine's aac format
This commit is contained in:
@@ -72,6 +72,7 @@ func (p *RTSPPublisher) SetTracks() error {
|
|||||||
conf = f.StreamMuxConfig.Programs[0].Layers[0].AudioSpecificConfig
|
conf = f.StreamMuxConfig.Programs[0].Layers[0].AudioSpecificConfig
|
||||||
}
|
}
|
||||||
at := p.CreateAudioTrack(codec.CodecID_AAC, byte(f.PayloadType()), uint32(conf.SampleRate)).(*AAC)
|
at := p.CreateAudioTrack(codec.CodecID_AAC, byte(f.PayloadType()), uint32(conf.SampleRate)).(*AAC)
|
||||||
|
at.AACFormat = f
|
||||||
at.AACDecoder.LATM = f.LATM
|
at.AACDecoder.LATM = f.LATM
|
||||||
at.AACDecoder.IndexDeltaLength = f.IndexDeltaLength
|
at.AACDecoder.IndexDeltaLength = f.IndexDeltaLength
|
||||||
at.AACDecoder.IndexLength = f.IndexLength
|
at.AACDecoder.IndexLength = f.IndexLength
|
||||||
|
@@ -69,9 +69,9 @@ func (s *RTSPSubscriber) OnEvent(event any) {
|
|||||||
}
|
}
|
||||||
switch v.CodecID {
|
switch v.CodecID {
|
||||||
case codec.CodecID_AAC:
|
case codec.CodecID_AAC:
|
||||||
s.audioTrack = &description.Media{
|
f := v.AACFormat
|
||||||
Type: description.MediaTypeAudio,
|
if f == nil {
|
||||||
Formats: []format.Format{&format.MPEG4Audio{
|
f = &format.MPEG4Audio{
|
||||||
PayloadTyp: v.PayloadType,
|
PayloadTyp: v.PayloadType,
|
||||||
Config: &mpeg4audio.Config{
|
Config: &mpeg4audio.Config{
|
||||||
Type: mpeg4audio.ObjectTypeAACLC,
|
Type: mpeg4audio.ObjectTypeAACLC,
|
||||||
@@ -81,7 +81,11 @@ func (s *RTSPSubscriber) OnEvent(event any) {
|
|||||||
SizeLength: v.AACDecoder.SizeLength,
|
SizeLength: v.AACDecoder.SizeLength,
|
||||||
IndexLength: v.AACDecoder.IndexLength,
|
IndexLength: v.AACDecoder.IndexLength,
|
||||||
IndexDeltaLength: v.AACDecoder.IndexDeltaLength,
|
IndexDeltaLength: v.AACDecoder.IndexDeltaLength,
|
||||||
}},
|
}
|
||||||
|
}
|
||||||
|
s.audioTrack = &description.Media{
|
||||||
|
Type: description.MediaTypeAudio,
|
||||||
|
Formats: []format.Format{f},
|
||||||
}
|
}
|
||||||
case codec.CodecID_PCMA:
|
case codec.CodecID_PCMA:
|
||||||
s.audioTrack = &description.Media{
|
s.audioTrack = &description.Media{
|
||||||
|
Reference in New Issue
Block a user