From e50e9291504a578576a12a7ef99571b0a486d2d2 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Wed, 5 Oct 2022 15:35:30 +0300 Subject: [PATCH] Fix empty SPS for mp4 format --- pkg/mp4/muxer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/mp4/muxer.go b/pkg/mp4/muxer.go index 96a040d6..e4c9945b 100644 --- a/pkg/mp4/muxer.go +++ b/pkg/mp4/muxer.go @@ -46,10 +46,11 @@ func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error) { case streamer.CodecH264: sps, pps := h264.GetParameterSet(codec.FmtpLine) if sps == nil { - return nil, fmt.Errorf("empty SPS: %#v", codec) + // some dummy SPS and PPS not a problem + sps = []byte{0x67, 0x42, 0x00, 0x0a, 0xf8, 0x41, 0xa2} + pps = []byte{0x68, 0xce, 0x38, 0x80} } - // TODO: remove codecData, err := h264parser.NewCodecDataFromSPSAndPPS(sps, pps) if err != nil { return nil, err