In the previous column, Video for the Internet - Part One, we discussed some of the theory and methodology behind hosting video content. However, what is truly at the heart of the matter is the size of your video files. If you can master a way to reduce your video clips to a reasonable file size without comprising too much quality, everything else will fall into place. If you do not, your experience with serving up video is bound to be a miserable one.
As you may recall from the previous column, our main discussion of video size was based upon the amount of data required per second to stream the video file. Most popular DV codecs require 2.6MB/sec to maintain 30fps full-screen video at full resolution. This data rate is a great fit for the internal computing environment of a G4 but if you want to send that data stream over the internet, that 2.6MB/sec is going to have to be reduced to 1/26th of it’s current size to something in the neighborhood of 100Kbps/sec.
The first consideration when compressing your video is the actual physical frame size you plan on working with. Your source video will most likely be standard NTSC video size, 720x486 pixels. Bringing the size down to 360x240 will not only reduce the file size by a theoretical ¼ (one half of the height + one half the width) but it also does it without a reduction in image quality. A 360x240 frame size is still a generous canvas to view video so the size reduction is, in most cases, a no-brainer. Going the next full step down take you to 180x120, the dimensions of which are commonly complained of being “postage stamp” sized. If this is what is required for your network then you do what you need to do, but I would recommend trying to save file size with one of the following methods instead.
Image Quality and Codecs
The DV codec provides a wonderful image, the digital equivalent of a Betacam or similar format. However, this is not the codec you want to use for video streaming because it is simply too “fat”. There is a dizzying array of codecs to choose from but if you are preparing video for the Internet, you can safely narrow the choices down to three codecs; Motion JPEG-B, Sorenson and H.263. Although there are plenty of other compression codecs written by independent developers, beware using them. Your objective is to make your video available to as many people as possible. If you use a codec that is not supported by one of the major players (Real, Windows Media Player, Quicktime) then your video is, for all intents and purposes, unviewable.
These three codecs can be divided into two groups, lossy and loss-less. A loss-less codec sacrifices nothing in terms of image quality but doesn’t reach near the efficiency of a lossy codec. Motion JPEG-B falls in the loss-less category while Sorenson and H.263 fall into the lossy. Motion JPEG-B and its predecessor, Motion JPEG-A, are better than nothing but won’t deliver a dramatic reduction in file size. These codecs are best used for DVD production or extremely high-quality video streaming.
Most video compression applications will require either Sorenson (or its
newer variant, Sorenson-3) or H.263. Both codecs provide stunning
reductions in file size while maintaining acceptable losses in image
quality. Making a decision about which codec to use will depend on your
individual project and the best course of action that I can recommend is
trial and error. With high-action footage, I personally had the best luck
with H.263 but that’s not to say that you will have better luck with
Sorenson for your project.
To further add to the utility of both these codecs, they are scalable in
terms of loss so you can fine-tune the balance between size and quality.
Keep in mind that there will be a “sweet spot” when scaling your video.
Image quality loss will be barely noticeable up until a certain point
(35-40% compression, usually) and then it will degrade rather quickly after being pushed past this sweet spot.
Although this method will not be the most effective, it is another important way to accomplish your objective of reducing file size without losing image quality. NTSC video runs at approximately 30fps but the full frame rate is not necessarily required for smooth, full motion video. How far you care to reduce that frame rate is the question.
Bringing the frame rate of the video down to 25fps (PAL) or 24fps (film)
shouldn’t cause any noticeable loss. 18-20 fps is a pretty safe bet, even
for most applications. Going down below that is possible but watch your
footage very closely, especially during scenes that have side-to-side motion across the screen. If you’ve ever seen the jerkiness of motion in old silent movie, you’ll know what you’re in for if you take this reduction too far.
Again, as with choosing a codec, trial and error is the best method to
determine what will work best for your project. For example, fast action
sequences will suffer from frame rate reduction, “talking head” interviews
Most of the techniques described in this column can be accomplished from inside your favorite non-linear editing platform. Specialized tools like
Media Cleaner will certainly aid you in your video compression but I would recommend running test trials with your non-linear system before working with third-party tools.
It is also strongly recommended that you actually attempt to view your own video files not on your local machine but over the Internet connection you are planning to use, with the type of machine and player you believe your audience will be using. I guarantee that the results will vary and will require adjustments on your end.