diff --git a/pkg/iso/atoms.go b/pkg/iso/atoms.go index 3e7c0657..919e6c22 100644 --- a/pkg/iso/atoms.go +++ b/pkg/iso/atoms.go @@ -250,7 +250,7 @@ func (m *Movie) WriteAudioTrack(id uint32, codec string, timescale uint32, chann m.EndAtom() // TRAK } -func (m *Movie) WriteMovieFragment(seq, tid, duration, size, flags uint32, time uint64) { +func (m *Movie) WriteMovieFragment(seq, tid, duration, size uint32, time uint64) { m.StartAtom(Moof) m.StartAtom(MoofMfhd) @@ -276,10 +276,10 @@ func (m *Movie) WriteMovieFragment(seq, tid, duration, size, flags uint32, time TfhdDefaultSampleFlags | TfhdDefaultBaseIsMoof, ) - m.WriteUint32(tid) // track id - m.WriteUint32(duration) // default sample duration - m.WriteUint32(size) // default sample size - m.WriteUint32(flags) // default sample flags + m.WriteUint32(tid) // track id + m.WriteUint32(duration) // default sample duration + m.WriteUint32(size) // default sample size + m.WriteUint32(0x2000000) // default sample flags m.EndAtom() m.StartAtom(MoofTrafTfdt) diff --git a/pkg/mp4/muxer.go b/pkg/mp4/muxer.go index a2f5df07..2d944b0e 100644 --- a/pkg/mp4/muxer.go +++ b/pkg/mp4/muxer.go @@ -13,7 +13,6 @@ import ( type Muxer struct { fragIndex uint32 - flags []uint32 dts []uint64 pts []uint32 } @@ -78,8 +77,6 @@ func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error) { codecData.AVCDecoderConfRecordBytes(), ) - m.flags = append(m.flags, 0x1010000) - case streamer.CodecH265: vps, sps, pps := h265.GetParameterSet(codec.FmtpLine) if sps == nil { @@ -100,8 +97,6 @@ func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error) { codecData.AVCDecoderConfRecordBytes(), ) - m.flags = append(m.flags, 0x1010000) - case streamer.CodecAAC: s := streamer.Between(codec.FmtpLine, "config=", ";") b, err := hex.DecodeString(s) @@ -113,14 +108,10 @@ func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error) { uint32(i+1), codec.Name, codec.ClockRate, codec.Channels, b, ) - m.flags = append(m.flags, 0x2000000) - case streamer.CodecOpus: mv.WriteAudioTrack( uint32(i+1), codec.Name, codec.ClockRate, codec.Channels, nil, ) - - m.flags = append(m.flags, 0x2000000) } m.pts = append(m.pts, 0) @@ -166,8 +157,7 @@ func (m *Muxer) Marshal(trackID byte, packet *rtp.Packet) []byte { mv := iso.NewMovie(1024 + len(packet.Payload)) mv.WriteMovieFragment( m.fragIndex, uint32(trackID+1), duration, - uint32(len(packet.Payload)), - m.flags[trackID], time, + uint32(len(packet.Payload)), time, ) mv.WriteData(packet.Payload)