Transcoding video for delivery, an overview and best practices

You are often required to transcode from one format to another. When shooting in consumer AVCHD or professional XDCAM you will need to transcode to a format your video editor (NLE) understands and can work with smoothly. But just as often you’ll need to transcode from your NLE’s format to another for optimised delivery. There are a couple of applications that are specifically developed for this task, and each has its own merits.

This story is available as ePUB, Kindle or PDF file, to read offline, and you’ll find an extra chapter on specialist transcoders and advice on transcoding hidden there as well.

Transcoding is changing the format of a clip from one to another. Video transcoding doesn’t decrease image quality, provided that you don’t transcode using lossy codecs in-between. The first rule of thumb therefore is to keep your footage in a lossless format as long as possible, and only transcode with a lossy codec at the end of the editing and/or approval process — when you’re ready to deliver.

The first thing we’ll need to know is the difference between a container, a wrapper and a codec. There’s a lot that is confusing. For example, MPEG-2 is a compression codec for digital video but it is also a container when audio is combined with it. The difference is in the file extension used. When files are contained inside a wrapper, it’s even more confusing. You can then see whether it’s MPEG-2 video with separate AIFF audio or MPEG-2 video stream with an AAC audio element combined, only by looking at the metadata.

AVCHD logo

So what are containers and wrappers, and how important are they are when encoding for delivery? Containers can hold many different types of elements or codecs. Because of this, one of the important functions of a container is to inform the playback device what type of codec is required to decode the elements within. Containers, therefore, are important in a transcoding workflow for delivery.

Wrappers on the other hand, have been developed to make is easier to exchange video files and the information associated with them between various systems such as your NLE, a video server and some digital VTRs. The metadata carries different information depending on where it is being used. Wrappers are less important for transcoding to an output format, and I will not cover them any further.

Transcoding applications

Codecs are extremely important for delivery. They are the elements within the containers that define how good or bad your video looks, how big the file is, how good the audio sounds, etc. There are many codecs and we can subdivide them in three general categories for our purpose:

– The camera codec, which usually is tied with a brand and sometimes really is a wrapper (e.g. AVC-Intra and Panasonic, or XDCAM and Sony)

– The codecs used natively by a NLE (e.g. ProRes 422 and 4444 tied to Apple’s Final Cut systems, or DNxHD and Avid’s Media Composer family)

– Codecs for delivery, such as VP8, Flash 8 video (VP6), H.264, and Windows Media Video 9.

The last category is the one we will concentrate on. The first question to ask is whether you can output to one of these delivery codecs right from your NLE, and if that is the best thing to do (what we call “best practice”). The short answer is: “it depends”.

If you are using Apple’s Final Cut , you’ll see an output option that directly uses QuickTime. QuickTime doesn’t offer much in terms of configuration and quality control, and therefore should be avoided. With Final Cut Pro 7, you’ll also have an extra app on your system that takes care of encoding for free. It’s the Compressor application and it can transcode to Apple’s NLE formats, H.264 based formats such as the ones you would use when encoding for Blu-Ray as well as YouTube. While Compressor isn’t bad, it’s only really excellent when transcoding into ProRes, Apple’s own codec.

It’s also not very fast, so if you need to transcode lots of clips, you’ll spend some time waiting. It can run in the background, but if you switch to another app Compressor may become unstable and it will become much slower yet. In short, there’s better software than Compressor. And if you’re a Final Cut Pro X user, you don’t get Compressor for free anymore anyway, so the “free included” argument doesn’t stick.

screenshot of compressor 4

There is currently one transcoding app that’s included for free with other software, and that’s Adobe’s Media Encoder. It comes in Adobe’s Production and Master Creative Suites, and is also included with the cloud equivalents of these.

Media Encoder CS6 has a lot going for it. For starters, it doesn’t stop at Adobe’s own codecs (which are limited to Flash video), but includes presets for XDCAM, AVC-Intra, and a whole bunch of others. It also has presets for online video and broadcast.

Media Encoder has a few tricks up its sleeve the others don’t know about. For example, you can import an After Effects composition in Media Composer and directly transcode it to a video output format. Of course the app is integrated with Adobe Premiere Pro, from which it will transcode sequences directly.

Media Encoder also allows you to create presets from existing ones. However, the level of customisation is more or less on par with Apple Compressor, which is good for most purposes, but not if you want to squeeze every last drop of quality out of your footage. For example, there’s only one filter in Media Encoder (Gaussian Blur), the H.264 configuration is fairly limited and x264 is nowhere to be found. x264 is the best H.264 codec for delivery to YouTube, Vimeo and online video in general so far. It’s open source and free for personal use but companies that wish to include it in their commercial offerings must pay a license fee.

Only Telestream and Sorenson Media support x264 and only after payment of an additional fee (Telestream Episode Pro/Engine) or included in the price of the app (Sorenson Squeeze 8.5 Pro).

Adobe Media Encoder is an especially good transcoding solution if you don’t need anything else but the presets. It even comes with one for Vimeo, which is the better quality sibling of YouTube.

Professional grade transcoding solutions

If you want complete freedom of choice and configuration and the best possible quality of transcoding, there are two professional grade transcoding applications that matter: Telestream’s Episode and Sorenson Media’s Squeeze. One major advantage of the professional transcoding solutions is that you needn’t worry about containers and wrappers if you don’t want to. The software will deal with this.

Both companies’ offerings exist in several editions, ranging from relatively inexpensive to several thousands of Pounds Sterling worth of transcoding power. Episode and Squeeze come with a large number of supported codecs in the three general categories listed above. Both applications also come with a complete set of filters you can apply in post-post-production. Both come with the ability to set up watched folders so that dropping a clip in such a folder immediately starts the encoding process.

They come with publishing capabilities so that you can set up an encoding workflow in such a way that at the end, the clip is automatically uploaded to an Internet based video service or to a streaming video server such as Akamai or Amazon S3. THey both have the ability to process files using all your processors and processor cores, speeding up the transcoding process to acceptable or even fast speeds.

Squeeze and Episode come with an impressive array of presets and an equally impressive number of parameters that you can configure per supported codec. And the number of codecs included with each is impressive too. In some cases, such as H.264, both apps come with two versions of this codec without you having to buy an add-on. With Squeeze Pro 8.5, you’ll even get the x264 codec thrown in (but at the premium price you pay for this version) for good measure.

screenshot of Squeeze 8.5

Sorenson Media’s Squeeze differs from Telestream’s Episode mainly in the interface department as well as in the main focus of the app. Telestream’s Episode is more targeted at users in the broadcast industry or those who need to transcode several clips a day. Squeeze can’t handle this well unless you buy the server edition, which is quite a bit more expensive than the desktop version.

Episode’s interface is easier for a continuous transcoding setup, and the Engine edition offers clustering. With one license for the Engine app you are allowed to populate other machines on the network with a demo version that will serve only to enable the licensed application performing offloading and load balancing of encoding jobs across these machines/processors.

screenshot of Episode

The downside of the power and completeness of both these transcoding apps is that you will need to learn about codecs and containers if you want to customise presets. “Read the Manual” is not just some free advice here; it’s a necessity. The number of configuration parameters is dazzling, and some parameters may go over your head unless you’re a video geek who handles video formats on a daily basis.

The main benefit is that you can create a preset that really gets you the quality you’re after. When encoding for Vimeo, you can set your parameters exactly as instructed by the Vimeo support pages, but within those settings, you still have a lot of leeway to improve the results. For example, Vimeo advises a bitrate of 5,000 kbps for high definition video. However, if you set your H.264 configuration to the Average Bitrate setting, you’ll need to work with a maximum bitrate setting of approx. 10,000 kbps to get the best results.

Needless to say you can fine-tune other parameters too, and if you don’t know what to expect visually from tuning a parameter, there’s nothing stopping you from experimenting until it looks just right or search for solutions via Google; often pros share their settings on forums. In fact, Sorenson even has a preset exchange where you can find the most exotic configurations saved as a preset you can import in your copy of Squeeze.

Specialist video converters

Elgato turbo.264 HD and Miro Video Converter are two examples of specialised transcoding solutions. The latter is software based, open source donationware, and allows you to encode only for mobile and digital publishing formats, including iPad, iPhone, Kindle Fire, etc.

The Elgato turbo.264 HD is a USB stick and software solution. The USB stick takes care of the processing power, while the software is the interface that communicates with the hardware. Both have their value, both are cheap, but neither allow for professional output. They’re OK for demo’ing a video, but I wouldn’t use them for client work. Especially the Elgato turbo.264 should be avoided as it is based on an older (and not the best) H.264 codec.

Best practices

These days, video delivery entails three possible channels: broadcast, a medium like Blu-Ray or DVD, and digital delivery such as Vimeo, Kindle Fire, iPad, etc.

When transcoding files that you didn’t create yourself, it’s important to note that many media file/container formats are actually wrappers. They contain video and/or audio data encoded with one of a number of codecs — each with their own format.

While many media files contain a single audio track, or a single video (with audio) track, some media file formats (QuickTime MOV format for example) contain multiple media tracks. Each track may have a different resolution, bandwidth, language, etc. Consequently, even though a file may be in a format supported by the transcoding app, the media contained inside the file may be encoded with a codec that is not supported, leading to an error during transcoding.

Except for broadcast, which I’m not going to discuss here, the two other channels I mentioned share common traits. Delivering footage to the Blu-Ray format may use the same video codec as delivery to Vimeo (H.264), although for Blu-Ray delivery you can also use SMPTE 421M (VC-1; also found in Microsoft Silverlight) or MPEG-2.

Depending on your delivery channel, you must consider the appropriate colour format. The RGB colour space, for example, is not represented in most video codecs, due to the way television emerged.

Video material (de-interlaced or interlaced) can be rendered either a full frame at a time, a progressive scan, or with every other line of the frame at a time—interlaced scan.
The two half-frames in interlaced video are referred to as the top and the bottom fields. One of the fields is the dominant field and should always be played back first.

When encoding material to be recorded on DVD and played back on a television, it is important that the dominant field is set as the first field. Even if you have edited the material to encode, it is important to know whether the dominance lies in the top or bottom field.

When encoding screen captures for educational purposes, you must be aware of many transcoding apps automatically de-interlacing footage. Particularly with screen captures, it’s important to check this setting and turn it off. If you don’t, your result will look the opposite of what you need.

Picture resolution and aspect ratio are important to consider when your output footage will be PAL (or NTSC) video, but your camera footage is High Definition. In this case, you will need to use resize filters (or settings) and a letterbox setting. It pays off to experiment with different vertical sizes in order to end up with the largest possible picture after the letterbox has been applied.

Constant Bit Rate (CBR) and Variable Bit Rate (VBR) are encoding options available in several video encoders. A Quality-Based VBR option is available in Telestream’s Episode.

A clip encoded in CBR mode has a relatively constant bit rate throughout its duration. CBR encoding is necessary when the content is distributed over networks or from devices that cannot handle peaks that are higher than the average bit rate.

However, encoding to CBR is difficult since it requires every encoded video frame to be exactly equal in size. This degrades visual quality. Different segments of a movie often require different bit rates in order to maintain constant quality. The quality delivered by most modern video encoders partly depends on the amount of motion and fine detail in the material.

This is why VBR is superior, while keeping the average rate at a desired level. VBR is more suitable for playback on devices with higher available bandwidth. Since the average rate is known, it is still possible to predict the resulting file size with good accuracy.

Workflows and even terminology used differs between the professional transcoding applications, so the best is to read the user guides carefully before encoding, and save the settings that work well into your own presets.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s