Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MJPEG decoding errors closes the track #421

Open
EmrysMyrddin opened this issue Jul 29, 2022 · 1 comment
Open

MJPEG decoding errors closes the track #421

EmrysMyrddin opened this issue Jul 29, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@EmrysMyrddin
Copy link
Contributor

EmrysMyrddin commented Jul 29, 2022

When an error occurs while decoding MJPEG frames (malformed frame, missing some header bytes...), it is very likely that it's a temporary error.

Perhaps we can error some decoding errors ? Or at least allow a given number of decoding error in a row before deciding to close the track ? With a video, it's probably ok to skip one broken frame sometime.

Related code :

func decodeMJPEG(frame []byte, width, height int) (image.Image, func(), error) {
img, err := jpeg.Decode(bytes.NewReader(frame))
return img, func() {}, err
}

@EmrysMyrddin
Copy link
Contributor Author

@at-wat Do you have on opinion on this ? Should I do a PR ?

@EmrysMyrddin EmrysMyrddin added the enhancement New feature or request label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant