SizeLength、IndexLength、IndexDeltaLength

This commit is contained in:
dexter
2023-03-03 22:06:38 +08:00
parent beda2dd9e0
commit ea5ea6f48a
3 changed files with 5 additions and 4 deletions

View File

@@ -127,7 +127,6 @@ func (p *RTSPPusher) Connect() error {
func (p *RTSPPusher) Push() (err error) {
var u *url.URL
u, err = url.Parse(p.RemoteURL)
defer p.Stop()
// startTime := time.Now()
// for len(p.tracks) < 2 {
// if time.Sleep(time.Second); time.Since(startTime) > time.Second*10 {

View File

@@ -51,6 +51,8 @@ func (p *RTSPPublisher) SetTracks() error {
case *format.MPEG4Audio:
at := NewAAC(p.Stream, f.PayloadType(), uint32(f.Config.SampleRate))
p.Tracks[track] = at
at.IndexDeltaLength = f.IndexDeltaLength
at.IndexLength = f.IndexLength
at.SizeLength = f.SizeLength
if f.Config.Type == mpeg4audio.ObjectTypeAACLC {
at.Mode = 1

View File

@@ -63,9 +63,9 @@ func (s *RTSPSubscriber) OnEvent(event any) {
SampleRate: int(v.SampleRate),
ChannelCount: int(v.Channels),
},
SizeLength: 13,
IndexLength: 3,
IndexDeltaLength: 3,
SizeLength: v.SizeLength,
IndexLength: v.IndexLength,
IndexDeltaLength: v.IndexDeltaLength,
}},
}
s.audioTrack = audio