Encoding Video
ENCODING VIDEO FILES
Here's where
things start to get a little complicated. Let's review the
parameters that you need to consider when encoding video for
the web:
Broadband or
Dialup - Since
broadband connections download at about 10 times the speed of
dialup, you may have to create two versions of the same
video.
Movie (frame)
size - broadband
is generally 320x240 pixels up to 640x480. Dialup is generally
160x120 up to 320x240. Unless you are working with a
wide-screen format, the ratio should be 4 x 3. The larger the
frame size, the larger the resulting file.
Codec
- how much and how well the movie is compressed. There
are frequent new or updated Codecs. The question is whether you
want your viewers to go through the hassle of downloading a
codec to watch your video.
Frame
rate - A normal
video is 30 frames per second (fps). Desktop videos can use 5 -
10 fps, head shots 10 - 15 fps and full motion video 15 - 30
fps. The frame rate should be divisible into the original frame
rate (30 fps can be lowered to 15, 10, 7.5 or 5 fps)
Streaming
rate in kilobits
per second (kbps) - for video you want to stream at the lowest
common denominator while still maintaining decent quality.
Dial-up users on a 28.8K are pretty much out of luck. 56K
modems can view small videos of generally poor quality at 37
kbps, or slightly higher when using a buffer (see below). A
safe range for broadband is 300 - 500 kbps.
CBR or
VBR? Your other
option is whether to use a Constant Bitrate (CBR) or Variable
Bitrate (VBR). With CBR the rate stays the same and the picture
quality varies and it's the opposite for VBR, which actually
produces an average
bitrate with
higher motion at a higher bitrate and slower motion at a slower
bitrate.
Interlacing. If you have imported video from a
video camera it will normally be interlaced for viewing on a TV
(NTSC for N. America or PAL for Europe). For web viewing you
should deinterlace the
video.
There are two more parameters
that we can add to this list. The first is the
keyframe
rate. In between
keyframes the video stream just sends the difference, or
'delta' from the keyframe. So, slower action can get by with
less frequent keyframes (usually specified as a keyframe every
so many seconds or frames) and faster action video needs more
frequent keyframes, creating larger file sizes.
The second is the size of
the buffer. By buffering you allow a certain portion of
the file to be downloaded before playing. That way if the
receive rate is slower than your streaming rate there won't be
any interruption if the buffer is large enough. I go into more
detail in the video below.
What I do in the video
is give you very good guidelines to achieve the desired result.
You may still have to do some experimenting but the trial and
error process will be greatly reduced, since I have spent weeks
"trialing and erroring" to come up with these
guidelines.
Tip: If you
are on broadband, a handy tool for testing your streaming video
or your whole site at dial-up speeds is a program called Sloppy
available from http://www.dallaway.com/sloppy/
DOWNLOADABLE VIDEO FILES
Consider adding
a downloadable .wmv and/or .mov file to your site to allow
dial-up users the option of downloading a higher quality or
broadband quality video rather than streaming a poor-quality
video to them.
To allow the downloading of a
Flash video with its controller you will have to Zip the .swf
file with the controller files plus an html
interface.
|