What are the specifications for Motion JPEG?
I have searched google like crazy and cannot find the file format specification for mjpeg.
What does the title look like? Am I just adding a jpegs series after the header?
I know this is usually in a .avi container, is it in a standardized format for the codecs it might have?
The goal is to do this in actionscript 3, but other languages would be good for porting. I've tried looking at ffmpeg and mplayer, but c isn't my strong point (yet).
Any suggestions would be appreciated!
a source to share
There is no official standard .
In practice, in its simplest form, mjpeg is simply a concatenation of jpeg files, one after the other in the same file.
ffmpeg supports this with switches -f mjpeg
or -vcodec mjpeg
.
JPEG decoders that decode multiple images must remember and use the same jpeg tables for subsequent images if those images cannot provide replacement. The jpeg standard describes this as "shorthand jpeg streams" and libjpeg supports this.
Thus, mjpeg can contain a full jpeg image, and then subsequent SOI..EOI blocks, which do not indicate those headers that duplicate the previous frame.
a source to share
Apparently there is no single specification. From wikipedia :
Criticisms
Unlike video formats specified in international standards such as MPEG-2 and the format specified in a still image JPEG coding standard, there is no document that defines one precise format that is universally recognized as a complete "Motion JPEG" specification for use in all contexts. causes compatibility problems files from different manufacturers.
a source to share
There is no single official specification. But some company made their own spec:
QuickTime Format Specification ( https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html )
Motion JPEG format, QuickTime M-JPEG Specification ( http://staticky.com/dl/ftp.apple.com/developer/Development_Kits/QuickTime/Programming_Stuff/Documentation/QuickTime-JPEGSpec.pdf )
Microsoft OpenDML AVI File Extensions ( http://www.morgan-multimedia.com/download/odmlff2.pdf )
a source to share
In Motion JPEG, each video frame or interlaced field in a digital video sequence is compressed separately as a JPEG image. Thus, the specification of each frame (eg quality factor) is stored in the header. in other words, your problem boils down to this: "How do you read the title of a frame in a video?"
Perhaps you can use Phil Sallee's JPEG Toolbax. Note that it has a function to read / write a jpeg image, and some to display DCT matrices, quality factor, Huffman coding tables, etc.
If you find how to use this feature in a video and / or how to read the MJPEG video specification, please share with us
a source to share
After many days of searching the web, I could not find complete documentation or a binary example of a file protocol.
For the most informative resource I have found so far, see http://www.digitalpreservation.gov/formats/fdd/fdd000127.shtml (Motion JPEG 2000 file format - with many "Useful links" at the end including " Review of Motion JPEG2000 ", which at least somehow suits the answer).
You'll find Apple's MOV PDF abounding, which apparently covers Motion JPEG but would take weeks to decode. I can only suggest to others that the above URL is a good starting point for further research.
a source to share
This document can be found elsewhere on the web, although I don't know which one is the authoritative source: http://www.cajunbot.com/wiki/images/7/71/USB_Video_Payload_MJPEG_1.1.pdf
a source to share