What is the specifications for Motion JPEG?

There isn’t an official standard.

In practice, in its simplest form, an mjpeg is just a concatenation of jpeg files, one after the other in the same file.

ffmpeg supports this using the -f mjpeg or -vcodec mjpeg switches.

JPEG decoders that decode multiple images should remember and use the same jpeg tables for subsequent images if those images fail to provide replacements. The jpeg standard describes this as ‘abbreviated jpeg streams’, and libjpeg supports this.

So an mjpeg might contain a full jpeg image, and then subsequent SOI..EOI blocks that do not specify those headers that are duplicates to the previous frame.

Leave a Comment