Skip to content

Commit e50e929

Browse files
committed
Fix empty SPS for mp4 format
1 parent d0c87e0 commit e50e929

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/mp4/muxer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error) {
4646
case streamer.CodecH264:
4747
sps, pps := h264.GetParameterSet(codec.FmtpLine)
4848
if sps == nil {
49-
return nil, fmt.Errorf("empty SPS: %#v", codec)
49+
// some dummy SPS and PPS not a problem
50+
sps = []byte{0x67, 0x42, 0x00, 0x0a, 0xf8, 0x41, 0xa2}
51+
pps = []byte{0x68, 0xce, 0x38, 0x80}
5052
}
5153

52-
// TODO: remove
5354
codecData, err := h264parser.NewCodecDataFromSPSAndPPS(sps, pps)
5455
if err != nil {
5556
return nil, err

0 commit comments

Comments
 (0)