pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
521 stars 120 forks source link

MJPEG decoding errors closes the track #421

Open EmrysMyrddin opened 1 year ago

EmrysMyrddin commented 1 year ago

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 : https://github.com/pion/mediadevices/blob/10769b702e431f999257d2cf9d4565569f2ef30e/pkg/frame/compressed.go#L9-L12

EmrysMyrddin commented 1 year ago

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