|
Desktop Video #2 - Compression Standards
Michael Flaminio
6.26.01
About
This is a multipart series looking at desktop video on Mac OS systems. These articles
are intended to be a foundation resource for those interested in working with video
on computers. Suggestions, corrections, questions and additions are always welcome.
Video Compression
In its simplest form, video compression takes a series video images and optimizes
them to contain the least amount of data possible. When video is compressed, data
is removed from the video image that is considered unneeded.
For example, lets say you're drawing a cartoon and in the background there are two
trees and a hill. To make the cartoon move, you'll need to animate objects by drawing
variations of movement. While the main object moves, your background of trees and
a hill do not. There's no need to continually redraw the background, so you can just
copy it from frame to frame.
Moving to video, lets say a background image doesn't change for 10 seconds. Here
again, there's no need to continually redraw an unchanging portion of the image.
So rather than including that portion 30 times per second, the portion may only need
to be rendered say 10 times per second. Over a period of 10 seconds, optimising that
portion of the image saved us from rendering it in 200 frames.
As a real-world example, think back to the last Steve Jobs keynote. Steve is usually
standing up on stage by himself talking with a background projector. Most of the
time nothing on the stage moves except for Steve. During these times, the Internet
video is compressed to only render Steve, while leaving the rest of the stage more
or less the same.
Other techniques are used, but this is the basis of video compression, which is optimizing
a video to include only what is needed. As a basis for video compression, keep in
mind that generally a full-uncompressed video measures 27 MB/sec.
Video Compression Standards
Digital video comes in many different forms, each with its own use. Video formats
can be split into three categories based on their output: TV, CD/Internet and streaming.
| Format |
Rate |
Notes |
Output |
| DV |
3.7 MB/sec |
Consumer video used for desktop video, camcorders. Good quality, low
processessing requirements |
TV |
| MPEG-2 |
400-1300 KB/sec |
DVD standard. High quality, high processessing requirements |
TV |
| Sorenson Video |
Variable |
Small File sizes w/ good quality and low processing requirements |
Net/CD |
| MPEG-4 |
Variable |
Small File sizes w/ good quality and low processing requirements.
Standard offers compatibility for multiple platforms |
Net/CD |
| RealVideo |
Variable |
Mostly used for live streaming. |
Net |
| Media Player |
Variable |
Microsoft's video format. Based on MPEG-4, but not fully compatible |
Net/CD |
Formats for TV, like DV and MPEG-2, have larger file sizes and processing requirements
that limit their use. Internet/CD-ROM formats are designed to offer good quality,
while also saving on file sizes. These movies are trimmed down from their full screen
size to that of a fraction to make playing managable. Streaming formats are designed
to be small enough so that a movie can be downloaded as it is playing. Usually streaming
compromises quality to ensure a complete video can be seen. By my definition, streaming
has the capacity to broadcast a live video feed. You can also transfer a saved or
"canned" movie using either a streaming or Internet/CD formats. Internet/CD
format will offer higher quality, but will typically require a fast data connection
and a period of pre-downloading before the movie can start playing.
I want to highlight a few of most commonly used video codecs. These are MPEG-2,
MPEG-4, Sorenson Video, and DV. These formats cover a wide range of uses we can use.
You're probably most interested in DV. DV has become a popular video standard for
consumers. DV is used in all digital video cameras and has become a primary method
of bringing video into desktop computers. DV is transferred from computers and cameras
via FireWire, or as it's officially known as IEEE 1394. FireWire is a high-speed
serial bus capable of transferring data up to 50 MB/sec. DV includes a video and
audio stream that is transmitted at about 3.7 MB/sec.
MPEG-2 is the standard format for DVD movies. DVD size can vary through the use of
variable bit rate (VBR) encoding. Unlike DV, MPEG-2 is capable of changing its compression
to accommodate the current video image. Generally speaking, MPEG-2 compression for
DVD runs between 400 KB/sec and 1.3 MB/sec. MPEG-2 can compress at higher and lower
rates, but from what I understand this is generally the norm. MPEG-2 offers higher
quality and smaller file sizes through use of intensive compression methods.
Sorenson Video was first introduced in QuickTime 3. When it came out, it was quite
a big deal. Sorenson Video manages to do three things at once, which is required
for movies over the Internet. Sorenson Video allow movies to have relatively good
quality with small file sizes and low processing requirements. Unlike MPEG-2, and
to a lesser extent DV, Sorenson doesn't require major horsepower to both play and
encode the video. For the most part Sorenson is exclusively used by Apple's QuickTime.
The format is ideal for Internet and CD-ROM use.
MPEG-4 has carried quite a bit of hype since it was first introduced. The format
promises to create a standard Internet video format, but I'm not too sure things
are going to pan out the way everyone had hoped. Like Sorenson Video, MPEG-4 offers
good quality at smaller file sizes, while also not requiring a significantly large
amount of processing power. MPEG-4's strength is in its transportability, meaning
video saved to MPEG-4 should be able to be viewed on any platform. MPEG-4 will become
available in the commng months.
Streaming
I'm not going to get into streaming formats because that a completely new can of
worms and would be best covered in its own article. There are numerous formats for
streaming content over the Internet. The essence of streaming is not to download,
but rather play video in real-time. To do this, some type of streaming server is
required, such as the QuickTime Streaming Server or one of RealNetworks' servers.
Streaming is similar to saved files, but instead the video can be compressed and
transmitted on the fly. Typically you wouldn't want to stream a video unless it's
live.
Playback vs. Encoding
Above I noted that MPEG-2 and DV have specific processing requirements. This is an
important area of video compression in that a computer needs to handle a lot of data
in order to both play and encode video.
When captured, video is encoded, and when played back it is decoded. The DV codec
works in real-time so that no special processing is required. Computers do not include
DV hardware codecs, but instead rely on software codecs. The software utilized the
computer's CPU to processes the data. A computer is capable of playing a DV movie
without much trouble in part because modern computers are fast enough, but also the
DV format is not too intensive.
Encoding a movie to DV can be a different story as a significant amount of rendering
will be required on the CPU's part. This is not true for DV camcorders and converters
as they have hardware DV codecs that manage to both encode and decode in real time.
For example, when recording a movie on a DV camcorder, the DV codec encodes the video
image in real-time to tape. When using a computer, a period of processing is required.
There are a couple DV compression cards available to help assist in DV encoding and
effects, but for average users these may not really be necessary.
MPEG-2 manages to achieve a lower data rate with higher quality than DV. This is
possible because of its high-powered encoding and decoding technology. The trick
with digital video always has been is to create something that can viewed without
extensive processing time. It wouldn't make much sense to bring home a DVD and need
to render it for 5 hours before you could watch it. Set top DVD players have MPEG-2
decoders built in to allow viewing of movies in real-time. Computers on the other
hand can now play DVD movies without a dedicated MPEG decoder. This is possible through
newer, faster CPU and graphics cards. Like DV and QuickTime, a computer still relies
heavily on the computer's graphics card and CPU for software decoding.
Encoding MPEG-2 is usually a very time consuming process. It's so intensive, expensive
MPEG-2 encoding hardware is available to allow for faster encoding times. On a pure
CPU level, MPEG-2 encoding can take seemingly forever. For example, a 90-minute DVD
could take 45 to 75 hours to encode. Apple's DVD Studio Pro combined with multi-processor
G4 PowerMacs can drastically cut this rendering time to around 10 hours, but still
that's a lot of sitting around.This lengthly encoding time is because of MPEG-2 intensive
compression.
The other Internet/CD-ROM compression formats offer much less CPU processing requirements.
As illustrated above, playback usually is significantly less complicated than encoding.
Any modern computer will be able to play any of the other supported movie formats
without much problem. Encoding can be more time consuming as this is a combination
a movie's specifications, compression settings and computer system
Next Time
Up next we'll look at how to best use each of these video formats, in addition to
looking at hardware requirements for TV vs. Internet/CD-ROM authoring.
|