Skip to content

Commit

Permalink
Fix mjpeg type 0 check
Browse files Browse the repository at this point in the history
Type 0 corresponds to YUV 4:2:2. Since this header is passed directly to the JPEG header, no additional changes are necessary for support. See the type field here: https://datatracker.ietf.org/doc/html/rfc2435#section-4.1

I have a stream producing YUV 4:2:2 mjpeg over RTSP and have confirmed manually that piping this through ffmpeg as a jpeg decoder results in correct decoding.
  • Loading branch information
kevmo314 authored Aug 24, 2024
1 parent 7df898a commit 27b5822
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/format/rtpmjpeg/header_jpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != 0 && h.Type != 1 {
return 0, fmt.Errorf("type %d is not supported", h.Type)
}

Expand Down

0 comments on commit 27b5822

Please sign in to comment.