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.

Friday, October 12, 2007

Transcoding vs. file format conversion

When I wrote the software to transcode digital movies, I made a distinction between the term "transcode" and file format conversion. To me, they are two different things; let me see if I can explain.

When you look at popular movie file formats like Quicktime or Windows Media Video, you see two things:

  1. A file format that describes how the movie is laid out; how many audio tracks, the size of the images in the movie, encoding information, all kinds of stuff;
  2. The data itself: frames of compressed or uncompressed images and digitized audio.
When I first created the Movie Conversion Tools product, it was to take movies created by Parallax Graphics video capture cards. Parallax had its own movie file format (this was in the days before Quicktime and Windows had well-established movie file formats, if you can believe that). The Parallax products had hardware to quickly compress images into JPEG format, so the movies were a series of individual JPEG images, not MPEG files. (I'll write later on the difference between motion-JPEG and MPEG). So to convert Parallax movies into something that could be played by a Mac or PC that could only deal with Quicktime or Windows Media, I had to deal with potentially two problems. The harder one was the transcoding.

To convert from a Parallax movie to an AVI movie file, I had to:

  1. Change the file format: Parallax has one way of describing the contents of the audio and video data (think of the file format as a table of contents; different file formats have different ways of describing what's inside the file, but they all have the same basic information);
  2. Sometimes, change each individual image from one image format (e.g., JPEG) to another (e.g., YVU9). This last part is the transcoding part: it takes the actual image content and re-codes it into something else. Sometimes during this process, the image quality will be changed because if you're re-coding into a lossy compression format, you'll lose some image quality. (but that's another topic)
I don't consider file format conversion "transcoding" because you're not really changing the nature of what's in the movie file itself; it's just knowing how to say "There is one minute of video content in this movie at 30 frames per second, and 2 channels of audio at 44.1KHz" in two different ways. The transcoding is when you have to pull out the audio/video data itself and possibly re-encode it into something different.

File format conversion alone doesn't always get you all the way there. For example, you can take a valid Parallax movie file, convert it into a valid AVI file that any AVI player should be able to parse, and yet the AVI file would not be playable. Why? Because the PC playing the AVI file may not have a JPEG decoder, so doesn't know how to display each image ("frame") in the movie file. It can tell you exactly how long the movie file is, and how many bytes are in each frame of the movie; it just doesn't have the capability of playing back the movie. The movie was not transcoded into a format that the player could play.

That's how I distinguish between transcoding and file format conversion. One converts the movie's wrapper (file format conversion), the other converts the movie's content (transcoding).

Tuesday, October 9, 2007

Welcome to the Transcode Blog

I was talking to a friend of mine recently about a business I started some years ago, called Transcode. He suggested that it might be a good idea to create a blog about the company and the work I've done over the years with multimedia computing; I thought that was a good idea, so I've created this blog.

My intent is to spend my time here writing about various aspects of multimedia computing and things related to transcoding media. Who knows where it will go, but where I want it to start is as an informal history of, the company Transcode.

I'd love to hear from you; comment on the blog if you've got something to say about media, transcoding, anything like that.

Welcome. Let's see where this blog takes us.

Powered by ScribeFire.