diff --git a/pkg/format/rtpmjpeg/encoder.go b/pkg/format/rtpmjpeg/encoder.go index 75ed46f6..49328451 100644 --- a/pkg/format/rtpmjpeg/encoder.go +++ b/pkg/format/rtpmjpeg/encoder.go @@ -187,7 +187,7 @@ outer: return nil, fmt.Errorf("SOF not found") } - if sof.Type != 1 { + if sof.Type > 63 { return nil, fmt.Errorf("JPEG type %d is not supported", sof.Type) } diff --git a/pkg/format/rtpmjpeg/header_jpeg.go b/pkg/format/rtpmjpeg/header_jpeg.go index 426b743b..37711144 100644 --- a/pkg/format/rtpmjpeg/header_jpeg.go +++ b/pkg/format/rtpmjpeg/header_jpeg.go @@ -22,7 +22,7 @@ func (h *headerJPEG) unmarshal(byts []byte) (int, error) { h.FragmentOffset = uint32(byts[1])<<16 | uint32(byts[2])<<8 | uint32(byts[3]) h.Type = byts[4] - if h.Type != 1 { + if h.Type > 63 { return 0, fmt.Errorf("type %d is not supported", h.Type) }