H.264 is pretty much a standard for web use.Yet encoding one of these files can be confusing. In this article I’ll walk through the settings in Compressor and give you my personal recipe for getting the best results with a fairly small file size. But more importantly, I’ll touch on some of the more esoteric settings that get overlooked. Although I will keep things very simple in this article, as the subject matter can get quite complex and mathematical.
H.264 is probably the most common video encoding type you’ll find on the Internet today, especially with the popularity of HTML5. H.264 is not one single codec, it is a family of standards, that together are commonly recognized and readable by a wide range of hardware and software. It is made up a lot of complex variables. But for this article, know that H.264 only saves the data of each video frame for things that in that frame which are different from all the other video frames in that frame’s Group-Of-Picture. So how does it fill in all of the missing data between so many frames? With Profiles and Entropy Modes.
The H.264 standard defines Profiles; 21 well outlined sets of capabilities. These capabilities are defined in various ways for specific types, or classes of applications. These optimize compression and decompression settings to meet the needs for specific things such as video conferencing, or internet broadcast, local area network transmission, Blu Ray optical media, or formats such as interlace or progressive, various chroma sampling ratios, and on and on.
Compressor offers us the choice of 3 commonly used profiles for H.264. These are somewhat easy to differentiate between, if my explanation isn’t too technical.
The Baseline Profile targets video conferencing and mobile phone use, situations where super highly compressed data needs to be sent with a lot of lost data packets, which need to be corrected for very quickly, using few resources. It only supports CALVC entropy mode, explained later.
The Main Profile was created for standard definition TV transmission over analog lines. High definition H.264 encoding schemes came along about 2004, since Main Profile has lower transmission overhead.
The High Profile was developed for Blu-Ray and high definition television broadcasting. It is a digital format, not transmitted over analog cable, but over digital cable systems.
I use Baseline for things with little movement (a talking head). I use High when I need the best quality I can get, sacrificing file size, and download/buffering time during playback.
An Entropy Mode is hard to define easily, but I’ll give it a shot. The first bits of data that go into an encoder/decoder piece of hardware/software process are the Entropy coded signals. Thus, H.264 is entropy coding based. Basically, it compensates for the parts of H.264 compression that rely on the missing parts of data in each video frame, literally guessing what will happen next. Of the three entropy modes, there are two available to us in Compressor. The third, VLC, is not commonly used for our purposes.
CABAC stands for context-sensitive binary arithmetic coding. This method uses a more highly complex algorithm to maintain image quality, thus takes more computer power to process and decode than CAVLC. It will support single/multi-pass encoding.
CAVLC stands for context-adaptive variable-length coding. This uses an algorithm much less complex than CABAC. Yet it is more modern and more efficient than the earlier CABAC entropy design. It only supports multi-pass encoding.
Ben’s Recipe Note:
I always use CAVLC, since I like that it is more efficient and compatible across the board than CABAC. Unless I have a talking head, then CABAC single-pass is faster to export.
Profiles and Entropy Modes confuse a lot of editors. A very basic understanding of them will suffice in most situations. Transcoding is always a balancing act between speed and image quality. So for speed, go with a Baseline Profile using single-pass encoding. For quality, go with a High Profile and CAVLC Entropy Mode, using multi-pass encoding. It really does boil down to something as simple as a recipe. Of course, there are situations where more advanced and complex encoding decisions must be made, but I’ll leave that up to the high end transcoding professionals.