Mezzanine Codec Options for PC Video Editors
In years past, it was often necessary to convert, or transcode, original HD camera video clips into another codec, known as an intermediate or mezzanine, prior to beginning any editing. These new clips had far less compression applied, and were therefore easier to decode for playback. Mezzanine codec file sizes fall in between those of the camera source clips and uncompressed video, hence the name.
Most newer PCs having decent specs, such as those with Intel Core i7 processors, should have no problem editing AVCHD and similar sources natively, without having to transcode. NLE programs like Adobe Premiere Pro CC 2014, Grass Valley EDIUS Pro 7, and Sony Vegas Pro 13 are optimized to edit practically any format natively. This saves both time and precious hard drive space, as mezzanine files are typically several times larger than the originals.
Since pre-edit transcoding is seldom necessary these days, the focus here will be mezzanine codecs for use during the editing and post-production processes.
Before jumping into the codec options, it’s important to understand the difference between containers and codecs – .avi is not a codec, and neither is .mov – rather, these are containers or wrappers that the codec lives inside of. A codec is a “coder/decoder” – the specific set of instructions that tell the computer exactly how to encode or decode a video clip.
The container might also be referred to as the format, as in Please submit the footage in a QuickTime format. Such a clip might have the .mov extension at the end, but the codec inside of that .mov file could be any number of things, such as uncompressed, Apple ProRes, PNG, or some variety of H.264 for instance.
You’ve probably at one time or another tried to play a video clip, only to get an error message about an “Unsupported Codec”. This means that the codec needed to play that clip type is not installed, and also that you would be unable to export video using that particular codec. Many codecs are pre-installed with Windows and others may come with your NLE software, and more will be available online for free, while some others may be purchased.
When exporting clips from any video application, there are really two kinds of exports to consider – mezzanine and delivery. A delivery codec would be used to create DVD and Blu-rays discs, or digital files for computer, online, or mobile device viewing. Delivery files are going to be highly compressed to keep the size down, and therefore are not good options for further editing or recompression. They can be re-edited as a last resort when no other source exists, but the results may be poor by the time you get done re-compressing them again. Think of a photocopy of a photocopy…the quality gets progressively worse.
In this article, we’ll be looking at several codecs for creating mezzanine files, which are not meant for final delivery – they’re much too large. Rather, a mezzanine codec is used as part of the editing and post-production workflow. These codecs are ideal for compositing work since they will hold up much better than camera codecs through multiple generations of compression.
Perhaps you’ve created a complex multi-layer sequence of video and graphics, and you wish to compile it all into a single video clip that can more easily be used as part of a larger production. Maybe you need to apply some additional video filters or other processing using a third-party application, or you want a master-quality copy of your production, from which any delivery format can later be exported. You may also have a need to share files with another editor for finishing work. Adobe After Effects comes to mind as the most common app that you’d need to export a high-quality mezzanine file from.
In these scenarios, you’ll want to use a codec that minimizes or even eliminates any quality loss, preserving details and color fidelity, and the file size will not matter as much as it might for delivery. The ultimate quality is usually obtained by using uncompressed video, but that creates such huge files that large, multi-drive disk arrays are needed to provide the throughput to play them smoothly. That is where mezzanine codecs come into play, providing high quality video without the uncompressed file size.
For Mac users, Apple ProRes is an excellent codec and also provides a great way to share material with other editors in the production workflow, Mac or PC. However, while PCs can play and edit ProRes, Apple does not supply the means to encode to ProRes on the PC platform (a couple of third-party software vendors are offering PC ProRes encoding now, but are apparently not sanctioned by Apple).
PC video apps will offer the option to export as “Uncompressed AVI”, but as mentioned earlier, this is not practical for many users due to massive file sizes and special hardware requirements. QuickTime Animation is another old stand-by, but again the files are just far too large to be practical (or necessary) for most users’ needs, beyond doing short segments. Fortunately, there are many free codecs that can be installed on PC computers to suit a variety of needs.
Consider your source material when thinking about how much data needs to be included in the mezzanine file. Keep in mind that a good mezzanine codec will act to preserve the quality of your original source video, but can never increase the quality – it can’t create something that was not there to begin with.
Many camera codecs like HDV and AVCHD use 4:2:0 color sampling and Inter-frame encoding, meaning that a lot of color info is discarded and only a few complete video frames are recorded each second – the rest of the frames have only partial data and get reconstructed by borrowing data from surrounding frames. This is what requires additional horsepower for playback – the decoder needs to look at several frames in order to recreate each single video frame before displaying it.
Mezzanine codecs are going to use more robust 4:2:2 color and Intra-frame encoding, intra meaning that each frame has all its data self-contained, with no need to borrow from its neighbors. This makes it easier to decode (play), and is why mezzanine codecs create larger files than the compressed camera codecs. A mezzanine might need a 100Mbps data rate or more to recreate a 25Mbps camera source clip.
That said, there is a point of overkill – a lossy HDV clip converted to a certain mezzanine at 220Mbps may look no better than encoding at 100 or 150Mbps. Higher-quality sources may benefit from higher-quality mezzanines to faithfully reproduce the source video, and that is something that each editor will need to determine based on their own needs and experience.
Here’s an overview of just some of the popular codecs available for PC editors.
Avid DNxHD is free and is similar to Apple ProRes in quality and file size. If you need to deliver to another editor using a Mac, this might be a good choice. Note that any QuickTime file played on a PC, including DNxHD, uses the “QT 32 Server”, a 32-bit app, creating a performance bottleneck when used with 64-bit PC editing software.
Avid DNxHD MXF is included with newer versions of Adobe Media Encoder and is not a QT codec, so avoids the performance issues of DNxHD (Mac editors may need to install an MXF-plugin to play .MXF files). I should note that all the listed codecs took roughly the same amount of time to export, except MXF – which was roughly twice as fast!
Lagarith is a free “mathematically lossless” codec for PC, providing quality nearly identical to uncompressed, but at more economical file sizes. Lagarith files will be larger than the other codecs listed, but still much smaller than uncompressed. This is a good choice for workflows where multi-generational compression is used.
Cineform has been popular for many years, and is now owned by GoPro. The Cineform Studio software can be downloaded for free, and that package installs the codecs. Studio offers batch-conversion of GoPro camera clips to either .avi or .mov files using the Cineform codec. Some editors experience poor playback of native GoPro clips, and in that case may transcode prior to editing. Other apps can export to Cineform for use as a mezzanine codec as well.
Grass Valley HQ codecs are included with EDIUS Pro software installations, and can also be downloaded for free; however, you will be required to create an online account prior to downloading.
Once logged in – http://www.grassvalley.com/support/downloads/products?product=&download=704
Newtek SpeedHQ codecs are included with the SpeedEdit 2.5 NLE software, free download for others.
Look under “Codecs and Utilities” at this link – http://newtek.com/support/documentation.html
Matrox MPEG-2 I-Frame HD codecs are part of the driver installation for Matrox MXO2 and VS4 hardware, and can also be downloaded free as VfW (Video for Windows) codecs.
If you have Avid, Grass Valley, Newtek or Matrox hardware or software already installed, then you should have the associated codec on your PC already – don’t attempt to install again!
For export examples, I’ll be referencing Adobe Media Encoder CC, but most video apps will offer similar export options. In the AME Export Settings panel, first comes the FORMAT, which will offer common container options such as QuickTime and AVI. Lagarith, Matrox, Grass Valley, Cineform and Newtek are all .avi codecs, while Avid DNxHD will fall under the QuickTime heading. If we then look under the VIDEO tab, we can choose a specific codec to work with inside that wrapper.
Unlike delivery codecs which may often have a different frame size, such as HD to DVD, mezzanine exports will match the source video specs regarding Frame Size, Frame Rate, Field Order, and Pixel Aspect Ratio – only the codec and data rate will be different. It’s important that you verify all these settings are correct, or you may get unexpected results.
Note that the Source and Output specs match the video codec settings in the Export settings above.
If you’re not sure what the settings ought to be, please reference the source clip. In Premiere, you can open the Sequence menu to see the current settings, assuming you’d set up the Sequence properly to match your clips in the first place. After Effects and Premiere have New Composition and New Sequence buttons respectively that you can drag a clip onto in order to set up the correct parameters to match the video source from the start, see following image.
Note that some of the codecs have additional settings available in a custom pop-up menu. In Adobe Media Encoder, it is the Codec Settings button that brings up the menu. For other apps, push buttons and explore – it doesn’t hurt to look around, as long as you’re not changing settings all willy-nilly. One additional setting you might encounter will be color space, such as RGB, Rec. 709, or YV12. It’s beyond the scope of this article to explain all of that – let’s just say that using the default is typically just fine, but you may want to research and learn more about colorspace for future needs.
How do these codecs compare to the source video, and to one another? I put together a one-minute sample timeline sequence using various 1080i source clips, and then exported that same segment once to each different codec. First, this allowed me to compare file sizes between the codecs by just comparing the exports in Windows Explorer.
While hard drives keep getting bigger and cheaper, let’s face it – you can never have enough storage, so file size does still matter. Big files might be fine for short sequences, but I just shot 6 dance recitals at nearly 3 hours each, using two cameras each, so that all really adds up through the production process when adding mezzanines and final export versions as well.
If you’d like to examine any video file to find the data rate, download and install the free MediaInfo software. Just be sure to uncheck the toolbar add-on during the install process! Once installed, you can right-click any video clip on your drive and select “MediaInfo” in the drop-down menu to see the specs of the clip, including the data rate and codec used.
For a quality comparison, I stacked the exported test clips above one another in Premiere, with the original source video at the bottom of the stack. In the Program monitor window, I recommend setting the view to 200% or 400% to blow-up the image to where you can actually see the pixels and compression artifacts clearly. Looking at a normal-size image, you’ll likely never see any difference at all between codecs.
By toggling tracks or “layers” on and off using the eyeball to the left of each video track, I was able to clearly compare the details between each codec and the original source, as well as comparing any codec to another. One thing to look for is whether areas of similar color retain individually colored pixels, or does the color get lumped together in “blocks” of the same color? Do details and fine shading get better or worse when switching back and forth? You’ll find that if you focus your eyes on one particular area of the preview, it’s easier to see these things than if you try to look at the entire preview window at once.
I’m not going to try and rate all the codecs on quality, as that is very subjective and results can vary depending on source footage, exact settings used, testing methods, and many other factors. I will say that as expected, Uncompressed matches the source exactly, and Lagarith lossless is almost pixel-perfect as well – as expected with the larger file sizes.
I should note that just because you may see a large number of pixels changing when toggling between clips, doesn’t mean that the resulting video won’t look good. Different codecs use different compression schemes, or different ways of representing the same data – but you won’t see the individual pixels when watching the finished video at normal size. That overall look may be all that matters for most users, in addition to how the codec handles multiple generations of encoding – does it stand up or fall apart?
If doing chroma-keying or other advanced compositing, then the more pixel-accurate reproductions may be more important to you, especially if you need to recompress a few times or more in the compositing workflow, since quality loss and changes to the image are cumulative.
Human nature will be to automatically go for “the best” codec, which short of uncompressed, would be Lagarith or a similar lossless option. But remember, the camera codec was likely VERY lossy to start with, and depending on the price level of your camera and the glass on it, your source video may not be as great as you think. Are you making a movie or network TV show, or a wedding video or stage event? These considerations will play a part.
I’ve been using different models of Matrox capture hardware for many years, so have just arbitrarily used the Matrox codec most of the time for my mezzanines and for creating “archive masters” and have been happy with the results. This is coming from HDV and AVCHD sources and not going to broadcast, mind you! For high-end applications, Matrox offers 8-bit and 10-bit uncompressed codecs, as do some of the other listed codecs. But again, we’re not here to discuss uncompressed – it’s a given that they will look good!
Besides Matrox, the other codec that I use often is Lagarith. I work with the “HD2SD” process using the VirtualDub and AviSynth utilities, and they like a codec with YV12 color. Lagarith can provide that, as well as lossless quality, so it’s a perfect fit for that situation.
An online search for codecs might turn up things such as “K-Lite codec pack” or other codec bundles – avoid them, as they can cause system issues and can’t always be uninstalled. The professional, brand-name codecs mentioned in this text are all safe to install and use with no known side effects from my years of experience.
Back to the codec options, some will offer different variations of the codec, such as 4:2:2, 4:4:4, 4:2:2:4, etc. with 4:2:2 being the most common option. These numbers represent the color info for the codec (web search “chroma subsampling” for more detailed explanations). The first number represents the brightness or luminance part of the signal, with “4” meaning all data is there, none is discarded.
The next two numbers refer to the chroma, or color, and any value less than 4 is said to be subsampled – some of the original color data being discarded to further compress the video. Human vision doesn’t notice the missing color much, but would definitely miss the brightness, which is why the first number is always 4. The luminance part of the signal has all the data to produce a complete black and white image, which includes all the detail, so none of that info can be discarded without being obvious to the viewer.
Most camcorders and DSLRs are recording 4:2:0 color these days, though some units offer 4:2:2, which is a higher quality. Assuming you are starting with a 4:2:0 source, converting to a 4:2:2 codec will allow for more precise color grading of your footage and will also better preserve the color of any graphics and titles added during editing, since those assets are starting with full color fidelity in the video software and were never at 4:2:0.
The fourth number, when present, means the codec includes an alpha channel, making parts of the video transparent. If such a clip is placed over another video clip in your NLE, the transparent parts will show though to the background clip. This can be useful for creating animated overlays, such as lower thirds or wipes or keys, and is available with some of the codecs discussed.
If you have a video of a person in front of a green screen, you can use the chroma key filter in your NLE to remove the green background, then export the resulting clip with alpha channel. The new clip can then be placed above any other clip in the NLE timeline as an overlay and the background will show through, without any need to add a keying effect – the transparency is built right into the clip.
Playing an alpha channel clip by itself, the transparent areas simply show up as black. Only when you place the alpha clip over another clip in the NLE can you see a new background. Matrox, Newtek, and Lagarith all offer alpha channel encoding options. If you use Digital Juice overlays, you can render direct to an alpha channel codec from the Juicer utility to create ready-to-use overlay clips that won’t need rendering in the NLE.
1 – Original Source Clip
2 – Clip exported with alpha (after key and crop applied – black area is transparent)
3 – What the alpha channel looks like (white opaque, black transparent)
4 – Alpha channel clip #2 superimposed over another video clip
Note that some of the codecs listed have different data rates, or quality settings, available to the user. The Matrox codec is user adjustable between 100-300Mbps. Avid offers several flavors such as 145, 175, or 220Mbps, while others may offer “Fine” or “Standard” modes – push buttons to find these options.
If you take away anything from reading this, let it be that you don’t necessarily need a fully “lossless” quality for most projects. Remember that codecs with high data rates can quickly fill your hard drive with massive files, so storage space is always a consideration when choosing a codec. Mezzanine codecs provide the right combination of quality, file size, and low-overhead playback, and I’m confident that one of the codecs covered will suit your particular needs.