|
Compressing to H264 using Quicktime Pro
Written By: Kyle Prohaska This tutorial is for encoding your movies to H264 format using Quicktime Pro. Quicktime is free but Quicktime Pro unlocks some features for you that are really useful. Anyone who is looking for a pain-free solution to encoding to H264 without spending a lot of money, Quicktime Pro is the best your gonna get unless you have some freeware program you love to use. Its $30 which might be a pain for some but most people can easily throw down 30 bucks for something like this. I'll write tutorials for some of those free ones but for now, this is how you do it in QT Pro. NOTE: H264 compression is very CPU intensive and will take some time to compress. People with systems that are Pentium III, AMD XP, etc. should be mindful of the time this will take. Step 1. Setting up the file. Open the file you want to encode. Keep in mind that your file has to be compatible with Quicktime and therefore can open in Quicktime or this tutorial is useless to you! If you have a format that won't open in Quicktime then you need to find a way to convert it to be that way, look in the tutorials section for more info on that. Anyways, open the file. A Good thing to check before you do anything is the frame rate of your source file. To do this choose Window > Show Movie Info. A box will appear that lists a lot of information about your footage. The number next to Movie FPS: is the frame rate of your footage. [This applies to those opening files in DV format] If you have a file encoded in NTSC DV, Quicktime has a setting that it opens the file in a kind of "Draft" format. To change this setting you need to click the Window tab and click on Show Movie Properties. A new box opens up and in the list of things that might appear you should have a track labeled Video Track. Select that track and the tabs towards the bottom should change accordingly. Choose the tab Visual Settings, and down in the lower right you'll see a check box next to High Quality. Make sure that box is checked and close the Properties window.
Method #1: You can see a tab on the outside of the Quicktime window in the lower right, clicking and dragging that allows you to dynamically resize your video. This might make it easier to just guess what size you want, and see what the video will look like at that size right away. Method #2: Choose the Window tab at the top of your video, choose Show Movie Properties. In this box you have the tracks listed that are layered inside the file you opened. The one you need to pay attention to is called Video Track. Highlight that track by clicking on it and the tabs below will change accordingly. Below click the Visual Settings tab and you'll see some options there. Actual Size - tells you the size of the original video The easiest way to resize the video is by choosing a width. Depending on how long your video is and how big of a file you want, this will determine your video size. A pixel width of 320 is normally great for the web but with more and more people with their own servers and better internet, you can increase this as you please. For this tutorial we will change the frame size to 320. Close the Properties window and you now have setup your files frame size. Method #3: Setting the frame size in the compression settings (will be touched upon later in the tutorial)
Now we are ready to compress the file into Quicktime .mov H264 format. Choose File > Export or CTRL+E. This opens the ever-wonderful save window. Find where you want to save the file and afterwards look towards the bottom of the window. You'll see an option called Export. Click in the are to the right of that to bring up the many file types QT can export to. For this tutorial we will be using the Quicktime Movie format so make sure you choose Movie to Quicktime Movie. Click on the Options button to the right and this will open the Movie settings. You have 3 areas given to you: Video: Where the video settings are.
VIDEO: Lets start with the video settings. Click the Settings button in the video area. This is where you'll be putting in the values that will compress your file. You'll see lots of options available and to somebody who is new to this it might be a bit daunting so I'll try to make it as painless as possible. At the top you'll see Compression Type. In this case we will be using the H264 codec so make sure that is chosen.
Below that you have 4 main areas you can change the settings in: Motion: Frame Rate & Keyframes. There are two ways to tell QT how to compress the footage and in what quality. Method #1: Using the slider in the Compression area you can tell QT how good you want the quality in a value up to 100. This isn't the most precise way to compress a file, especially if you want a certain file size but its a quick way to do things if you don't care, or if the file is small and you just need to get it compressed fast. 65% is a good median to be around if you want to use this option for most files. Quicktime handles that value pretty good. Keeping the Multi-pass setting checked is always a good idea, only touch this if you need a very fast compression job, or if your computer is older and having trouble compressing. NOTE: The slider will appear grey unless in the Data Rate section the Automatic setting is checked. Method #2: Using the Data rate is the best way to get a precise file size and quality. What bitrate to use is always a debated topic among folks. I've spent enough hours wasting my life compressing all sorts of sizes, formats, and at different bitrates to have a pretty dead on idea of what you'll want to use. This isn't exactly what you have to do but a good rule of thumb to use is 3MB per minute of footage. Figuring out a bitrate is tough and there is tons of calculators out there that can give you an idea but a good area to stay around is:
Again its all very subjective and you'll have to estimate the bitrate for yourself. One thing that it takes to become "good" at compression is practice and learning what bitrates yield what, what formats give you what at which bitrate, etc. It just takes time but to be safe, if your following this tutorial and your video output is 320 x something, then keeping the 300 - 450 range is good. One thing that can help you determine that is whats in your video? Lots of motion, trees, whip pans, jumpy footage, etc? That you need to consider. Ok to actually put in that value in the Data Rate area make sure the Restrict to: option is check and place your value inside. Optimized for: doesn't make that much of a difference but if you know you'll be using the file for a specific thing, choose the one that applies. Keep it at Download if your not sure. In the Motion area you have options for keyframes. Keyframes have a lot to do with the quality of your clip and most people overlook this. What happens is a keyframe is placed every so many frames (the amount you specify) then the frames inbetween are called Intermediate Frames. What happens is your codec will analyze the frame before and after the one currently processing and only store data for whats changed in the frame. This can benefit you if you have alot of static shots in your film so set your keyframe to where you think it should be. You can keep it at Automatic and QT will do it for you (puts a keyframe every 2 seconds), but I like putting in my own value. Click Restrict to: and put in the value of your choosing. For video at 30fps depending on the amount of motion in your clip, somewhere from 60-300 should be ok....and for 15fps anywhere from like 30-150. Click ok to accept your settings.
If you resized your video to a widescreen aspect like 320x180 or something like that you can letterbox your footage. For whatever size you chose, say its 320x180 like mine and I want to letterbox the footage, you put in the values accordingly. Choose the Custom option under Dimensions: and put in the width you specified earlier, and to letterbox make sure the width you put in is larger than the one given when you changed it early in the tutorial. So if I want 4:3 letterboxed footage of my 16:9 source ill need to set the size to 320x240 (notice this is a preset already). Letterboxing to 4:3 isn't a must, as long as the height value is bigger than the source, it'll letterbox the footage. The key to this is the checkmark called Preserve aspect ratio using: make sure this is set to Letterbox and your all set. Click Ok.
After all that your probably hoping compressing audio is easier....rest assured it is. Choose the Settings button in the audio area and a new box opens. AAC is the best codec to use for audio since H264 came out. It gives better quality at smaller bitrates than IMA 4:1 did. Stereo is always a good option for the Channels but its not required. For the Rate, this is a personal choice depending on whats in your audio just like for video. 32000khz is a great choice because it will cut down file size but keep all around quality at an acceptable level for music, voice, dialog, etc. If you want higher quality then go ahead with 41000khz but 48000 is almost NEVER necessary. For this tutorial going into the advanced settings isn't really needed I suppose so I'll leave that out. Quality can be set to normal, file size wont vary much between them. Your bitrate is what will make the difference. I find 96kbps to be ideal for almost everything. 128 is a standard for music but its way higher than I think you would need, but its up to you. You can even go down to 32kpbs or 64kbs if you want. If you need to cut file size then go right ahead and lower them, this is where I mean compression takes practice and maybe a try or two. 64 - 96 is your best bet though, it'll turn out just fine. Click Ok. INTERNET STREAMING:
Click Ok. Click Save and your video will start compressing. YOU'RE DONE! Depending on the length of the file and quality it will take some time to compress. Check the file size, if your in that 3MB range at least then you should be just fine (of coarse depending on if you chose 320 x something). If things turn out wacky, check your settings and try again. Extra Stuff: Its always good to export a piece of your file to see how the compression will turn out. To do that before you go and save your project you can Trim your file in QT Pro. Go to a place in the file and hit I on your keyboard thats your inpoint. Do the same for your output but hit O. Next choose Edit > Trim to Selection. Now you'll have only that segment to output and you can check the file size. I normally choose 1min of footage to output to check the 3MB guideline for my settings. After compression is done and you check just do Edit > Undo to get back to your original file. Happy Encoding! Any question or comments please contact the Author |