1

I'm working with FFMpeg for decoding Mjpeg streams. Recently I've bumped into access violation exceptions from FFMpeg, after investigating, I found that due to network packet drops, I'm passing to the FFMpeg a frame that might have "gaps" in it. The FFMpeg probably crash since it jumps to a marker payload which doesn't exist in the frame's memory.

Any idea where I can find a mjpeg structure validator? Is there any way to configure FFMpeg to perform such validations by itself?

Thanks.

2 Answers 2

1

I would be inclined to use Gstreamer here instead of ffmpeg and set "max-errors" property in jpegdec plugin to -1.

gst-launch -v souphttpsrc location="http://[ip]:[port]/[dir]/xxx.cgi" do-timestamp=true is_live=true ! multipartdemux ! jpegdec max-errors=-1 ! ffmpegcolorspace ! autovideosink.

This takes care of the corrupt jpeg frames and continues the stream.

Sign up to request clarification or add additional context in comments.

Comments

0

Didn't really found an answer to the question. Apparently, ffmpeg doesn't handle corrupted frames very well. Decided to try a different 3rd party decoder instead of ffmpeg. For now, at least for Jpeg, it works faster and much more robust.

1 Comment

Which decoder did you end up using?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.