Step-by-Step Guide to Compressing Your Videos for the Internet: Optimizing Your QuickTime Movies by Perry Kroll

Share this post

Reference: StudentFilmmakers Magazine, December 2007. Step-by-Step Guide to Compressing Your Videos for the Internet: Optimizing Your QuickTime Movies by Perry Kroll. Pages 36 – 43.

Introduction
In the increasingly digital age of independent film, your presence on the internet can make or break you. If your film can’t be seen online, or you don’t have an online trailer, you are virtually non-existent. Everyone wants a link to your movie, to send to friends, to decide if it’s worth hiring you, and to see what you’re made of. And, no one wants to squint at tiny, blurry online videos anymore. The adoring public wants gloriously sharp, slick videos the size of Spider-Man 3 plot holes, which stream right away with crystal-clear stereo sound.

Bummer, right? The good news is: Anyone can do this! All you need to do is follow the mildly nerdy instructions here.

Compressing video for the internet is one of those things that everyone talks about and no one knows how to do. Here, we will make some basic assumptions. The guidelines refer only to QuickTime video compression. QuickTime is Apple’s cross-platform (Mac/Win) industry-standard video format, and is generally regarded as being leaps and bounds ahead of RealPlayer and Windows Media.

You’ll need access to a high quality original video file and a program capable of exporting to QuickTime. Three options are discussed in detail:

• QuickTime Pro (Mac/Win) — the upgrade to the free QuickTime Player software. These instructions should also work in virtually any program which offers a QuickTime export option, as the options presented will be the same.

• Final Cut Pro’s Compressor (Mac) — included with Final Cut Studio.

• Sorenson Squeeze (Mac/Win)

Once you’ve settled on QuickTime, and chosen your program of choice to compress in, you still need to make a few more decisions.

• What compression codec are you going to use?

• Do you need to deinterlace your video first?

• What is your target file size and bit-rate?

All of these issues are tackled in the journey ahead. Fear not.

Choosing a Compression Codec

One of the biggest points of confusion faced by the unsuspecting filmmaker is the giant menu of funky-sounding video compression codecs offered by QuickTime. Luckily, there are only two really good choices: Sorenson 3 and H.264.

Sorenson 3 is older, and more widely compatible. H.264 is modern, efficient (files tend to be surprisingly small), slightly higher quality than ordinary Sorenson 3, and less widely supported. Only users with QuickTime 7 or later can view H.264 files.

If you have the Sorenson Squeeze program, by all means, use it to compress to Sorenson 3. It will look as good as video gets. It is magical. Other programs, however, don’t have access to Sorenson’s professional features, and if you don’t have Sorenson Squeeze, and you don’t mind limiting your movie to users with QuickTime 7 installed, you may want to consider H.264 for it’s slightly better video quality.

Overview

This how-to is divided into four parts:

• Deinterlacing: A critical but often overlooked step. Totally necessary for nice-looking footage.

• Compressing in QuickTime Pro: Simple and quick – read this section for important details even if you’re going to use a different program! This section goes over calculating bit rates and determining file dimensions.

• Compressing in Final Cut Pro’s Compressor: Still very simple, but with an extra dose of awesome. Do this if you can.

• Compressing in Sorenson Squeeze: The industry standard, delivers beautiful Apple Trailer quality files. If you’ve got this program, use it.

Deinterlacing

Interlacing is the horrifying system used by ancient television engineers to transmit more information through a limited bandwidth. While interlacing works just fine on a TV screen, it tends to look dreadful when viewed on a computer, which is why you need to deinterlace your files if they weren’t created with a progressive camera.

As you probably know, the image is broken down into alternating rows of pixels. If your video frame rate is 29.97 frames per second (which it usually is), then 59.94 fields per second will flash across the screen. Each field will contain only half of the picture: either the even number rows or the odd rows. The television screen draws one row, and then the other. When you combine interlacing with digital video, it leads to all kinds of nightmarish format conversion problems, makes ugly jaggies in the picture, and causes flickering. Interlacing is bad.

Interlacing can sometimes be apparent in QuickTime Player. Look for a frame like this one, where quick motion within the clip has revealed the interlacing lines.

To force the interlacing to show itself, you can set the view mode in Final Cut Pro to 100% zoom and disable Show Square Pixels. Now find a fast video movement in your clip, and look for horizontal lines. Still frames during camera pans are a dead give-away.

Progressive video is much better. Just like film, one image is displayed, and then another. There’s no complicated alternation of lines and no doubling of frame rates. It’s just a series of still images flashing past, exactly the way modern computer screens work.

If your original file came from a DV format (NTSC or PAL) or an HDV or HD format with a description like 1080i, 60i or 29.97 fps, chances are: it’s interlaced. If it’s a progressive format like 480p, 24p or 720p then you’re all set.

Ignore this stage of the process and allow yourself a short to medium-long moment of triumph.

If you’re like most of us, you need to deinterlace and rid yourself of those ugly interlacing lines.

A high-end compression package like Sorenson Squeeze of Final Cut Pro’s Compressor will usually offer to do this as part of the compression process, but it can sometimes be beneficial to do it yourself anyway, so that you ensure it’s done right. If you have Compressor, it is very easy to do it there.

Deinterlacing can be done in any decent editing package. Instructions here are for Final Cut Pro, with traditional DV-NTSC footage from a DV camcorder, but you should be able to find similar tools in any decent editing package.

Deinterlacing: Step 1

Here, a simple project has been assembled. The clips are edited together in the timeline of Sequence 1, and the movie is ready for deinterlacing and compression.

Make a new sequence (Apple+N). Edit the settings for the sequence by Ctrl+clicking it in the Browser and choosing Edit Settings.

You need the sequence settings to match the correct video preset for the footage you’re working with. (In this case, DV-NTSC). It will probably be set correctly by default, but if it isn’t, just click the Load Sequence Preset button in the lower-left corner and choose the correct preset.

(IMPORTANT: If you’re using a format like HDV or HD, you’ll need to make sure all the settings are correct for your particular “flavor” of video. This can take some researching online, but it’s important because every camera creates slightly different settings depending on which options were chosen during shooting.)

Before closing the Sequence Settings box, we need to change the settings to do two things: remove interlacing and alternating fields, and change to a codec which will allow this to happen.

Change the Field Dominance drop-down menu to None.

Select Photo – JPEG in the Compressor menu. (If you’ve got an HD original and you’re really, really picky about preserving video quality and have oodles of hard drive space, choose Animation instead, because Photo – JPEG technically reduces the file quality just a little bit. It’s called a lossy codec, as opposed to using a lossless codec.)

Click OK.

Deinterlacing: Step 3

Now, open your new sequence (Sequence 2), revealing an empty timeline. Select your original sequence (Sequence 1) in the browser, and drag it into the timeline of the second sequence. It will behave just like a video clip and appear as a single item, which invisibly contains all of your cuts and edits. This is called nesting a sequence. You’ve got one sequence inside another. Fancy.

Deinterlacing: Step 4

Select the Sequence 1 clip on the timeline in Sequence 2 and go to Effects > Video Filters > Video > De-Interlace. If you were at frame with motion, you’ll see those nasty lines vanish.

You’re all set!

If you’re going to compress through Final Cut Pro’s Compressor, you don’t need to export your video—just choose your new sequence when you export to Compressor. If you’re compressing with Sorenson Squeeze or QuickTime Pro, or any other application outside of Final Cut Pro, you need to export to a file.

Choose File > Export > QuickTime Movie and then make sure Current Settings and Audio and Video are selected.

Save the file. This may take a little while, as Final Cut Pro will have to render the deinterlacing filter.

Your file is now ready to be compressed.

Compressing in QuickTime Pro

Compressing through QuickTime Pro is one of the simplest methods, although Sorenson Squeeze and Compressor can provide higher quality and more sophisticated options. If you have either, you should use them; but it is still important to read this section, as it explains how to calculate bit rates and determine file dimensions.

QuickTime Pro upgrades your copy of QuickTime Player for Mac or Windows to QuickTime Pro, unlocking the extra features necessary to compress video, as well as play movies full-screen, and all kinds of other geeky things.

If you have an editing program like Final Cut Pro, iMovie, Avid, Adobe Premiere, etc., the QuickTime export settings box will have the same options as QuickTime Pro, and you can follow these steps there instead.

If your video needs deinterlacing, do it first.

Open your video file in QuickTime Pro. Choose File > Export.

Select Movie to QuickTime Movie in the Export dropdown menu, and then click Options.

QuickTime Pro: Step 2

The Movie Settings box will appear. We’ll go through all of these options.

Under Video, click Settings.

Choose either Sorenson 3 or H.264 from the Compression Type drop-down menu at the top of the box. As a reminder, H.264 requires a brand new QuickTime 7 installation for your fans to play it.

Choose Current for the Frame Rate.

For Keyframes select Automatic.

Set Quality to the highest level. It might be locked at High with H.264 compression. This is fine.

If you’re using H.264, leave Frame Reordering turned on and select Best quality (Multi-pass), which makes the codec double-check its work and optimize wherever it can.

Stay in this box for the next step.

QuickTime Pro: Step 3, Calculating Your Data Rate

Now you need to select a data rate for kilobits per second, so break out the calculator or a smart friend. This looks scary, but it’s not, and it’s vitally important.

The quick formula is:

(Target size in megabytes x 8192) / length in seconds – 200 = desired kilobits per second.

For the sake of morbid curiosity, I’ll walk you through the steps of the calculation.

Figure out how big you want the compressed file to be. This could be anywhere from 30 megabytes to several hundred. Let’s say we’re going for 100mb. Multiply this number by 1024 to get kilobytes and multiply again by 8 to get kilobits.

In this case, you’re looking at the number 819200. Divide it by the length of your movie in seconds. For this example, I’m going to say the movie is five minutes, or 300 seconds, long.

Our new number is 2730.66. Subtract 200 to make up for the audio track, and other miscellaneous problems that the compressor may have to deal with.

2530 kilobits per second is our answer for this scenario! For the record, to make your movie stream quickly on broadband internet, you want this number to be somewhere in the 800-2600 range.

Plug that number into the Restrict To box under Data Rate. Turn on Streaming under Optimize For if you have the choice.

Click OK to return to the previous screen.

QuickTime Pro: Step 4, File Dimensions

From the Movie Settings screen, click Size.

Choose Custom from the Dimensions menu.

Enter the file dimensions you’re aiming for. A table below shows three sizes for the most common aspect ratios. If you’re using a larger size, you may need a bigger target file size to make sure it looks good.

Small                 Medium                 Large
4:3 Standard                      320 x 240            480 x 360            640 x 480
16:9 Widescreen                320 x 180            480 x 270            640 x 360
(no bars)

Click OK to return to the previous screen.

QuickTime Pro: Step 5

Under Sound click Settings.

Choose AAC under Format.

If you have stereo sound you’d like to preserve, choose Stereo (L R) for Channels. Otherwise, Mono will do.

Rate should be 44.100 khz.

Quality is always nice at Better or Best.

Target Bit Rate is usually just fine at 160.

(Nerdy note: Remember, we’ve only left 200 kilobits per second to spare after calculating our video data rate, and it’s a good idea to leave some left over after sound is used as well, for random errors in the compression. If you want higher quality audio, you’ll need to subtract more than 200 kilobits per second from the video rate in the previous step.)

Click OK to return to the previous screen.

QuickTime Pro: Step 6

This is very important! Make sure that Prepare for Internet Streaming is checked and Fast Start is chosen. If you don’t do this, the movie will need to download entirely before it begins to play.

You’re all done! Click OK and then Save and wait while your movie compresses.

When it’s done, open it in QuickTime Player, make sure it looks good, and go to Window > Show Movie Info. There, you can check to make sure the Data Size is lower than your target size. You win!

Compressing with Final Cut Pro’s Compressor

There are certain things for which you may need to refer to the QuickTime Pro compression guide earlier in this article. Particularly, information on calculating your bit-rate, and handling the Video Settings and Sound Settings screens.

FCP Compressor: Step 1

Make sure the sequence you want to compress is open in Final Cut Pro and the timeline is selected. Go to File > Export > Using Compressor.

Compressor will load and display four windows. Find the Batch window, and look for the row with your project’s name in it.

Click on the menu under the Setting column where it says Click the pop-up.

Choose Web Streaming (QuickTime 7 compatible) > H.264 800Kbps Streaming.

We’ll adjust those settings in a moment.

FCP Compressor: Step 2

The Inspector offers you an overview of your compression settings. Go to the second tab.

Click Video Settings and you will find yourself dropped into the familiar old Video Settings box from QuickTime Pro.

The same rules apply, so jump back to that part of the article for the details. Also, use the calculation rules from the same section to determine your data rate.

When you’re done, click Sound Settings and refer to the earlier portion of the article for the details on how to set this box as well.

Important: Streaming should be set to Fast Start.

FCP Compressor: Step 3

Jump to the third tab of the Inspector window.

Set Frame Controls to Custom.

Resize Filter should be on Best.

Output Fields must be set to Progressive to eliminate interlacing. Deinterlace won’t be necessary if you’ve already done it, but if you haven’t, set this to Best as well. Hey, magic!

FCP Compressor: Step 4

Click the second-to-last tab. These are the Geometry settings, and this is where you will choose the dimensions of your compressed video.

Choose Custom for Frame Size.

Refer to the chart earlier in this article, under QuickTime Pro compression, for common sizes.

You can also set Constrain to the aspect ratio of your film (likely either 4:3 or 16:9 for widescreen without black bars) and then enter only one of the dimensions. Compressor will calculate the other.

FCP Compressor: Step 5

You’re all ready!

Click Submit in the Batch window, and watch as invisible demons guide your computer through the complex chain of weird commands necessary to begin the compression process. Oh yeah!

Compressing in Sorenson Squeeze

Sorenson Squeeze does something incredible called Variable Bit Rate Multi-pass encoding. What this means is that the file is encoded once, using only as much information per frame as is necessary, and then the compression engine goes back over it again, tidying up all the weird bits, so that the final result is darn near perfect. It’s survival of the fittest for video, and your video turns into a hungry python. Which is exactly what you want.

Sorenson Squeeze: Step 1

Import your file into Sorenson Squeeze by dragging it into the large canvas area.

Find the QuickTime section in the list under Format & Compression Settings to the left.

Choose any of the presets contained within (Lg_prog works fine) and click Apply. We’re going to be modifying everything, so it doesn’t matter which preset you choose.

Expand the triangle arrows under your movie’s title until you see the items MP3 and SV3 Pro or similar. Double click SV3 Pro.

Sorenson Squeeze: Step 2

This magical box will appear. Stay calm. It’s not as bad as it looks.

I’m going to walk you through every setting. Make sure you follow this precisely, because there’s a lot of information here.

Stream Type: Streaming (Hinted)

You can check Constrain File Size if you want, and enter a maximum file size in kilobytes (megabytes multiplied by 1024), or you can do the old calculation trick from the QuickTime Pro section of this article, and use a data rate like usual. Whichever you feel more comfortable with.

Under Audio:

Codec: Fraunhofer MP3.

Data Rate: 160 kbps.

Sample Size: 16

Sample Rate: 44100

Channels: Stereo, unless you don’t need it.

Under Video:

Codec: Sorenson Video 3 Pro

Method: Sorenson 2-Pass VBR

Data Rate: You can either use the data-rate calculation techniques in the QuickTime Pro compression guide above, or ignore this and enter a maximum file size in kilobytes as described just before.

Frame Size: Uncheck Maintain Aspect Ratio and use the chart in the QuickTime Pro compression guide above to calculate your video dimensions.

Frame Rate should be whatever your original file is. Most likely 29.97 or 23.976.

Bidirectional Frames: Allow

Minimum Quality: 100

Drop Frames to Maintain Data Rate should be checked.

Quick Compress should be turned off.

Auto Key Frame on Scene Change should be turned on and set to 100.

Image Smoothing and Streaming should be turned on. Leave the settings for streaming (1425 bytes and 5.00 sec) at their defaults.

Phew! That’s it! Click OK.

From the main screen, click Squeeze It!

You’re done! Your perfect compressed video will be dumped next to your original, with a weird file name.

Screenshots: Stills from the award-winning films Banana Road and Fluorescent Justice (starring Steven Olender with the light bulb) by Perry Kroll. Perry Kroll is a filmmaker, Mac nerd and web designer working in New York City and Boston. He is the Lead Developer for the indie film network Take 24:7 and one of the founding partners at Top Right Corner, LLC. Viste website: www.take247.com and www.perrykroll.com

Leave a Reply

×