diff --git a/internal/hls/muxer.go b/internal/hls/muxer.go index 80973152..4827243c 100644 --- a/internal/hls/muxer.go +++ b/internal/hls/muxer.go @@ -1,7 +1,6 @@ package hls import ( - "fmt" "io" "time" @@ -23,12 +22,6 @@ func NewMuxer( videoTrack *gortsplib.TrackH264, audioTrack *gortsplib.TrackAAC, ) (*Muxer, error) { - if videoTrack != nil { - if videoTrack.SPS() == nil || videoTrack.PPS() == nil { - return nil, fmt.Errorf("invalid H264 track: SPS or PPS not provided into the SDP") - } - } - primaryPlaylist := newMuxerPrimaryPlaylist(videoTrack, audioTrack) streamPlaylist := newMuxerStreamPlaylist(hlsSegmentCount) diff --git a/internal/hls/muxer_ts_generator.go b/internal/hls/muxer_ts_generator.go index a67af983..46db3057 100644 --- a/internal/hls/muxer_ts_generator.go +++ b/internal/hls/muxer_ts_generator.go @@ -119,21 +119,6 @@ func (m *muxerTSGenerator) writeH264(pts time.Duration, nalus [][]byte) error { {byte(h264.NALUTypeAccessUnitDelimiter), 240}, } - for _, nalu := range nalus { - typ := h264.NALUType(nalu[0] & 0x1F) - switch typ { - case h264.NALUTypeSPS, h264.NALUTypePPS, h264.NALUTypeAccessUnitDelimiter: - // remove existing SPS, PPS, AUD - continue - - case h264.NALUTypeIDR: - // add SPS and PPS before every IDR - filteredNALUs = append(filteredNALUs, m.videoTrack.SPS(), m.videoTrack.PPS()) - } - - filteredNALUs = append(filteredNALUs, nalu) - } - enc, err := h264.EncodeAnnexB(filteredNALUs) if err != nil { if m.currentSegment.buf.Len() > 0 {