I recommend H.264

I’m a fan, user and promoter of the H.264 (also known as the MPEG-4 Advanced Video Coding) codec. It’s an excellent standard which provides great quality at low(er) bitrates while supporting true High Definition resolutions such as 1080p (1920×1080).

It is the flagship format of Apple QuickTime and also used by large studios on many Blu-ray releases. Virtually all of the modern personal computers in use at this time support the format or are capable of supporting it:

  • Adobe Flash Player 9 is capable of playing H.264 content
  • the free QuickTime Player media software supports it
  • QuickTime Pro supports exporting to H.264, thus iMovie HD and other QuickTime-based products can use it
  • professional video editing software like Adobe Premiere Pro and Final Cut Pro support exporting to H.264
  • the open source FFmpeg project supports H.264
  • open source media players such as VLC Media Player and mplayer support H.264

Unfortunately, Microsoft does not support it at this time, favouring — instead — their own non-open VC-1 codec for HD content and Silverlight.

High Quality Internet Video Settings

H.264 is a great codec to use for streaming video, which is why Adobe Flash Player 9 supports it and YouTube has begun to use the MPEG-4/AVC standard for high quality content. I recommend the following settings for the MOV container, and the settings make use of AAC, which is part of the MPEG-2 and MPEG-4 standards and was designed as the successor to MP3.

(The following screenshots show the interface used by QuickTime Pro, which will be seen when exporting with expert settings in iMovie HD. I will show — in the future — how to do so with the free and open source MediaCoder.)

Internet Streaming Settings

Video and Sound should be checked. Click “Settings…” for each of them to customize according to the screenshots below. Since the output is to be streamable by a standard HTTP server like Apache, “Prepare for Internet Streaming” should be checked and “Fast Start” is fine.

If the native resolution of the source clip is small or if it’s the resolution you want to use, choose “Size…” and set “Current” as the dimensions. Otherwise, standard Internet videos are likely to be 640×480, 640×320 (widescreen), or possibly 720×480 4:3.

Internet Streaming H.264 Settings

As you can see, I recommend choosing an automatic key frame interval and disabling frame reordering (it could mess up the motion in some instances). I also recommend keeping the current frame rate for the full experience, but 24 fps (film) and 15 fps are good options that will reduce your file size and improve the streaming experience.

Restrict the bit rate to about 800 kbps, but the lowest you can go while preserving a high quality is probably about 500 kbps. (Remember that full 1080p Blu-ray bit rates using H.264 is in the 20 to 80 Mbps range.) If the bit rate is 800 kbps, the video will stream over below-typical connections (1.5 Mbps).

I strongly recommend multi-pass encoding as long as you have a recent multi-core processor; older computers and non-multi-core computers will benefit from using the single-pass encoding option, as it saves time and reduces processing.

I recommend using AAC with a sample rate of “Recommended” or “44.100 kHz”. Choose a “Normal” or “Better” quality, and choose a target bit rate of 128 kbps. This can be lowered to 96 kbps for movie files with sparse or simple audio, while orchestral music might deserve a 160 kbps bit rate. Anyhow, increasing the bit rate above 128 kbps won’t significantly impact the perceived quality (particularly given the poor speakers or headphones most people use).

High Quality Video Settings

If you want to use H.264 for high quality preserval of existing video at (often) smaller file sizes, I recommend the following video encoding settings. Don’t use these settings if you’re going to send the file over the Internet, because it will likely be too large.

High quality H.264 settings

As you can see, I recommend leaving the frame rate at the “current” frame rate of the source video, while the key frame interval is best left at automatic. The bit rate should also be automatic so that the compressor can optimize the result for quality. You can set the slider for quality between high and best (though best is close to lossless and thus results in huge files).

Once again, I recommend multi-pass if possible, but for a quicker encoding process, choose single-pass.

If you’re an audiophile, you might also like to set the audio bit rate at 320 kbps for AAC, or choose a lossless codec (for instance, Apple Lossless). Don’t use uncompressed audio because that gets HUGE.

Example

This isn’t a comparison. Just see how a 769 kbps (video + audio) H.264+AAC file at 15 fps looks — and it’s only about 17 megabytes. Or, the same video at 2.12 mbps (H.264+AAC) file at 24 fps and 720p high definition, with a file size of 47.4 MB.

Final Words

Choose H.264 when it comes to high quality video. Choose the MPEG-4 standards (AVC and AAC, and perhaps the MPEG-4 container) rather than closed formats. You’ll end up with great looking and great sounding multimedia clips, while being future-proof and maintaining compatibility.

Comments are closed.