diff --git a/pkg/mp4/muxer.go b/pkg/mp4/muxer.go index 177d8c62..c167c478 100644 --- a/pkg/mp4/muxer.go +++ b/pkg/mp4/muxer.go @@ -3,7 +3,6 @@ package mp4 import ( "encoding/binary" "encoding/hex" - "fmt" "github.com/AlexxIT/go2rtc/pkg/h264" "github.com/AlexxIT/go2rtc/pkg/h265" "github.com/AlexxIT/go2rtc/pkg/streamer" @@ -97,7 +96,10 @@ func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error) { case streamer.CodecH265: vps, sps, pps := h265.GetParameterSet(codec.FmtpLine) if sps == nil { - return nil, fmt.Errorf("empty SPS: %#v", codec) + // some dummy SPS and PPS not a problem + vps = []byte{0x40, 0x01, 0x0c, 0x01, 0xff, 0xff, 0x01, 0x40, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x99, 0xac, 0x09} + sps = []byte{0x42, 0x01, 0x01, 0x01, 0x40, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x99, 0xa0, 0x01, 0x40, 0x20, 0x05, 0xa1, 0xfe, 0x5a, 0xee, 0x46, 0xc1, 0xae, 0x55, 0x04} + pps = []byte{0x44, 0x01, 0xc0, 0x73, 0xc0, 0x4c, 0x90} } codecData, err := h265parser.NewCodecDataFromVPSAndSPSAndPPS(vps, sps, pps)