motionbox

Motionbox Blog

January 17, 2007

Compressing Video for the Web

Once you've gotten a video off your camera and onto your computer, what do you do with it?  Upload it to Motionbox and share it with all your friends, of course!  But how can you make sure it will look (almost) as good online as it does on your desktop?

If you have a program with pre-sets already made for you, it’s probably best to just use them. Windows MovieMaker offers lots of presets; “Video for Broadband 340kbps” is best for good quality and fast upload.  For Mac users, iMovie exports video to Quicktime, for which the setting of “CD-ROM” is best.

But if you are editing with professional programs, or if you just want to get fancy, read on!

The major problem with getting your video on the web is this:

Big files = More upload time

When you upload to a video site, the file is re-encoded into Flash, for fast playback.  So the major task is to get the file as small as possible, but still lookin’ great. 

We have outlined the process in 5 major steps.

Step 1:  Video Format (Codec)

    Format, or codec, is the means by which the video compresses.  It’s like choosing the type of pencil that you use to draw a picture.  For Windows Media, you’ll want to use Version 9, which is the most widely accepted.  For Quicktime, the two best codecs are Sorenson 3 and H.264.  Sometimes videos looks better with one, sometimes with the other.  You might want to experiment to see which one suits you best.

Step 2:  Frame Rate

    Movies are made up of individual pictures, or “frames.” Frame rate is the number of frames per second in which the movie displays (also known as “fps”).  The fewer frames, the smaller the file size.

    Anything less than 12fps will look too stuttery.  15fps is just about good enough for no one to notice.  For heavy motion, try 18fps.  If you’re a purist, keep it at 30fps, the original frame rate for video.

Step 3:  Quality (or “Data rate”)

    The higher the quality, the larger the file size.  Pick somewhere between 60 – 85%, Medium to Medium/High.  Anything more is usually unnecessary, because your video quality will reduce in quality when it is encoded to Flash.

    When you adjust the quality, you are actually adjusting the data rate (also called bitrate).  Some codecs give you the ability to control the data rate.  You may have to experiment, but what works well is usually somewhere between 250k/sec – 500k/sec. 

Step 4:  Image Size

    Reducing the size of the image will contribute to more file size efficiency.  Like almost every video site, when we encode your file for viewing on Motionbox, we reduce its size.  For us, it’s 400 x 300 pixels, and using a larger image than this won’t improve quality.

Step 5:  Audio

    There are lots of audio formats to use, and they all work pretty well.  We recommend MPEG-4, using the AAC codec.  Choose a sampling rate of 22.050 kHz, which will give you radio quality sound: it will sound good on pro speakers and tinny ones alike, or if you’re picky, CD quality is available with 44.100 kHz.


  Below is a video, comparing the quality of three different data rates.  (The final movie was exported at a very high rate to avoid further quality loss.)  400k looks great, but notice how the detail is lost in the greens at 200k.  100k is just plain lousy.




Audio and video encoding is complicated, but once you find the settings you like, you usually don’t need to go through the decision process again: just pop in your usual settings and encode!

Below is a summary of our recommended settings. If you're a Mac user, you might want to check out rooVid, a program that lets you streamline this process by creating custom presets.  And for everybody, please feel free to comment to this post, and pass on any of your own encoding wisdom!

Video:

Codec:  Quicktime H.264, or Quicktime Sorenson 3
Framerate:  15 FPS (frames per second)
Datarate: 250 - 500 kbit/sec
Size:  400x300

Audio:

Format:       MPEG-4 with AAC (although most any will do)
Channels:    mono
Sampling Rate:          22.050 kHz
Render Settings:   Best

Comments

Post a comment

In an effort to cut down on spam, comments are moderated and will not appear until approved.

Comments:

 Add Motionbox RSS Feed