diff --git a/pkg/gb28181/ps.go b/pkg/gb28181/ps.go index 522bf371..aeb15080 100644 --- a/pkg/gb28181/ps.go +++ b/pkg/gb28181/ps.go @@ -32,6 +32,7 @@ const ( StreamTypeH265 = 0x24 StreamTypeAAC = 0x0f StreamTypeG711A = 0x90 //PCMA + StreamTypeG711U = 0x91 //PCMU StreamTypeG7221 = 0x92 StreamTypeG7231 = 0x93 StreamTypeG729 = 0x99 diff --git a/pkg/gb28181/unpack.go b/pkg/gb28181/unpack.go index 39d9714e..750c27b9 100644 --- a/pkg/gb28181/unpack.go +++ b/pkg/gb28181/unpack.go @@ -11,6 +11,7 @@ package gb28181 import ( "bytes" "encoding/hex" + "github.com/q191201771/lal/pkg/base" "github.com/q191201771/lal/pkg/h2645" "github.com/q191201771/lal/pkg/rtprtcp" @@ -321,6 +322,10 @@ func (p *PsUnpacker) parsePsm(rb []byte, index int) int { switch p.audioStreamType { case StreamTypeAAC: p.audioPayloadType = base.AvPacketPtAac + case StreamTypeG711A: + p.audioPayloadType = base.AvPacketPtG711A + case StreamTypeG711U: + p.audioPayloadType = base.AvPacketPtG711U default: p.audioPayloadType = base.AvPacketPtUnknown } @@ -375,7 +380,7 @@ func (p *PsUnpacker) parseAvStream(code int, rtpts uint32, rb []byte, index int) if code == psPackStartCodeAudioStream { // 注意,处理音频的逻辑和处理视频的类似,参考处理视频的注释 - if p.audioStreamType == StreamTypeAAC { + if p.audioStreamType == StreamTypeAAC || p.audioStreamType == StreamTypeG711A || p.audioStreamType == StreamTypeG711U { //nazalog.Debugf("audio code=%d, length=%d, ptsDtsFlag=%d, phdl=%d, pts=%d, dts=%d,type=%d", code, length, ptsDtsFlag, phdl, pts, dts, p.audioStreamType) if pts == -1 { if p.preAudioPts == -1 {