Monday, October 29, 2007

Motion-JPEG vs. MPEG

There has been a lot of work in image compression and motion compression formats over the years. At the time Parallax Graphics was still around, high-quality movies were often recorded in what was commonly referred to as "Motion-JPEG". If you've done any study about digital movie formats, you may be asking yourself "Why such a goofy name? Why not just call it MPEG? After all, that's pretty much what you mean, isn't it?" Well sure: pretty much, but not exactly. And it has to do a lot with the hardware that was available at the time to do real-time encoding of video signals.

First, a bit of terminology. In movie and video terms, you'll often see the unit of measurement "frames per second"; films are shot at 24 frames per second (abbreviated as "fps"), video in North America is shot at 30 fps, and video shot in Europe is generally shot at 25 fps. Film is just a series of still photographs shot really quickly -- 24 still images per second -- and each still photograph in a film is called a "frame". Same with video.

Motion-JPEG movies are movies that consist of a series of individual JPEG images. If you're recording video at 30 fps, each individual frame can be extracted and decompressed separately. In essence, Motion-JPEG is a way of saying "This movie consists of a bunch of individual JPEG still images." It's nothing more than that; it's not as if JPEG and Motion-JPEG images are decoded differently. They're all just JPEG images.


MPEG, however, is more sophisticated. It uses some of the same principles as JPEG encoding, but MPEG adds another layer of compression: MPEG compression looks at an image and its neighbors to see if there are similarities across time that can be compressed away. Think about this: if you're watching a courtroom drama on TV, there are plenty of shots of the judge talking, or somebody on the witness stand. Their heads may be moving, maybe even their arms, but not much else. The background remains motionless, so doesn't really change from one frame to the next. MPEG recognizes this and stores only the changes from one frame to another.

MPEG and Motion-JPEG turn out to be pretty different things. If you ever look at movie compression software or video capture products and see that they create Motion-JPEG files, you know you can do better nowadays. But you should also know that the Motion-JPEG movies can be pretty easily transcoded into MPEG movies.


Powered by ScribeFire.

No comments: