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).

1 comment:

Svetlana Finelt said...

Thank you so much! Succinct and helpful:)