-->
Save your seat for Streaming Media NYC this May. Register Now!

Media Cleaner Pro Tutorial, Part I

Getting Started

Media Cleaner Pro has evolved into a powerful application over the years and decidedly owns the title, "industry standard" for dynamic media compression. A significant amount of experience with the application is required to tap into the depth of its functionality. That's why we've written this tutorial for all those entrepreneurs and do-it-yourselfers wanting to compress their project for the web. This tutorial is Part I of a three part series, divided into the following categories:

  • Part I. Preprocessing Audio and Video for the Web
  • Part II. Compression Parameters for Web Codecs
  • Part III. Batch Processing and Productivity Tips for Compression

Wizard settings and a simple interface for adding source files make it easy to get started with Media Cleaner Pro (MCP). The application opens with a Process Window (figure 1), allowing you to set up the compression session parameters. Simply drag a file from the desktop into this window and an entry will be made for its compression. Choose the wizard settings by clicking on the pop-up window under the settings column of the Process Window (bottom of Figure 1). When you click on a movie's settings entry in the process window, the wizard will begin to interview you about the desired compression type. This is a great way to review compression results quickly and get a feel for quality issues and constraints you may encounter over a particular connection.

You'll quickly discover that default wizard settings will not take advantage of all the key features within MCP. This tutorial is designed to take you to the next level. It covers all the major features of the Advanced Settings option -- which you toggle on the Process Window's pop-up box (see Figure 1).


Figure 1. The main Process Window in Media Cleaner Pro.

Part I. Preprocessing Audio and Video for the Web

Introduction

Preprocessing the audio and video content prior to actually compressing it allows you to control what information you feed to the codecs. This part of the tutorial covers the following topics in order to fully prepare your content for the web.

1. Getting the Proper Image Parameters

  • Cropping
  • Scaling
  • Deinterlace
  • Field Dominance
  • Inverse Telecine
  • Noise Reduction and Two-Dimensional Filtering
2. Adjusting Color and Brightness
  • Gamma Correction
  • Black and White Restore
3. Audio preprocessing
  • Filtering for Noise Removal
  • Enhancing the Audio Signal

In general, these processing steps apply regardless of your codec choice or the type of content you are serving.

Getting the Proper Image Parameters

Knowing your target audience, including platforms and connection speeds, is an integral step for achieving quality video and audio for the Web. Additionally, setting reasonable frame sizes and frame rates will reduce the amount of data the codec must compress, offering higher quality content for every bit that counts.

You'll begin preparing the frames for compression under MCP's Advanced Settings (image panel in figure 2).


Figure 2. The Advanced Settings Window with the Image tab selected, showing many of the video preprocessing options available in MediaCleanerPro.

Cropping

You'll want to crop your image if there is tearing or black bands around any of the frame edges. These anomalies occur during the video capture and create unnecessary pixels that can waste precious bandwidth.

Media Cleaner Pro offers two cropping options, "Manual" and "Numeric". Manual cropping offers more control over individual movies, while numeric helps to fix standard digitizing problems. With Manual Cropping selected, open the source video window by clicking on the filename or icon in the Process window. Click and drag within the video window to define the rectangle you want to crop to.

In order to assist the manual cropping operation, MCP allows you to constrain the rectangle you choose. You can maintain the original Aspect Ratio and/or keep the dimensions to multiples of 4. If you need to scale the image to a particular window frame, 160x120 for example, ensure the cropping is the same aspect ratio of these two dimensions, or 4:3. On the other hand, many codecs divide images into blocks of 4x4 or 16x16 pixels. Keeping the dimensions to multiples of 4 will assure that the codec doesn't try to resize the image to fit its inherent constraints.

Image Size.

Video is typically captured into your computer at full screen or perhaps 320x240. If you are only offering content to the broadband market and want large frames, check the Source Tab here and the compressed video frame will match your captured size.

In order to improve image quality and achieve higher frame rates, especially at lower connection speeds, you may want to scale your video even more. The pull-down Scaling Quality option allows you to choose Fast, Normal or Accurate scaling. Unless you're under time constraints, use the Accurate function. This selection applies the most complex filtering to the image prior to scaling it - thereby reducing or eliminating aliasing or jagged edges.

Deinterlace.

The methods by which your content has been captured will determine if and how you need to deinterlace it. Rather than displaying all 480 lines progressively down the screen in 1/30th of a second, our television standard breaks the frame up into two fields and displays each field in 1/60th of a second. Each field consists of either the odd or even lines of the frame, as depicted in Figure 3.


Figure 3. Scan lines of standard television signals are displayed in an alternating pattern, creating two fields. Each field contains half the lines, displayed in 1/60th of a second. a) The horizontal and vertical view of interlaced lines. b) The vertical and temporal view of interlaced lines.

Because the fields are separated in time, simply putting them together causes jagged lines at the edges of moving objects. You can choose to blur these lines together by selecting the blend option. This may help smooth out high motion sequences for better compression.

You can also choose to select only one field or the other. It doesn't matter which field unless you have small details, like single lines, occurring on one of the fields in each frame.

Field Dominance Change

Go to the bottom of the Settings Window. Field Dominance is the property that defines whether the odd fields or the even fields come first in the interlace pattern of figure 3. If you're having problems with single lines separated from the edges of objects, or severely jagged, moving edges (even after a dropped field deinterlace operation), experiment with this setting. Otherwise, it can be ignored.

Inverse Telecine.

Under the Deinterlace pull-down, you also have the option to do an inverse telecine operation on your source video. If the original video came from film, shot at 24 fps, frames have been inserted to create the 30 fps necessary for television. These are repeated in a 3-2 pattern, creating unnecessary information to be removed before compression. Sometimes this step is referred to as 3-2-pulldown.

Two-dimensional Filtering Options

Just as audio processing applies one-dimensional filters to the audio signal (see "Audio for the Web" tutorial), two-dimensional filters can be applied to images to improve the final compression. The principles are the same -- just more difficult to visualize. You can apply low-pass, bandpass or high-pass filters which are simply a series of fractional coefficients multiplied with the pixels of an image. The result is summed as the output for a single, central pixel.

A simple, two dimensional, low-pass filter operation is depicted in figure 4. Note that passing the low-pass filter across an edge will spread that edge out over several pixels. Since many codecs look at and code differences, this reduces the required bit rate because differences are smaller.


Figure 4. A simple two-dimensional lowpass filter used for blurring an image.

There are three instances of filtering options in the Image Panel: Blur, Unsharp Mask and Adaptive Noise Reduction. Blur applies the low pass filter across the entire image, while Adaptive Noise Reduction only applies it to flat areas, so edges aren't affected. It's better to apply the latter unless you're looking for a softer focus effect.

With Adaptive Noise Reduction checked, you have several other options for filtering as shown in the pop-up window in figure 5. You can remove single stray pixels either alone in, or in combination with, the flat field filter. You can also customize the filter characteristics as shown in the figure. Here you can specify how flat an area needs to be by adjusting the number in the "Blur where difference < " box (larger numbers offer more filtering). The Stray filter is customized by adjusting the number in the "Median where difference > " box (both numbers are percentages from 0 to 100). If you have serious noise artifacts in your video, experiment with these settings -- otherwise it's faster to usethe preset filters.


Figure 5. Adaptive Noise Reduction options in Media Cleaner Pro.

Unsharp Mask is a sharpening filter for edges, whereby a high-pass filter is applied and added back onto the original. The options, as shown in Figure 6, allow you to adjust the radius of the filter coefficients as well as the "Opacity" of the filter in the "Amount" slider. For example, at 100% you will be adding back the full amplitude of the filter, whereas at 50% you are only applying half the amplitude.

The last three options in the Image Panel will be discussed in Section 3, as they relate to specific types of content, codecs, and delivery platforms.


Figure 6. Unsharp Mask options in MediaCleanerPro.

Adjusting Color and Brightness in Media Cleaner Pro

You have full control of your image parameters under the Adjust Tab. To use it efficiently, open up the Dynamic Preview window under the Windows pull-down. Brightness, Contrast, Hue, and Saturation are often subjective settings and highly dependent on the source and the way it is captured. For instance, a slight color shift can be compensated for using the Hue slider. Brightness and contrast will change the entire range of luminance values in a linear fashion. Sometimes it is better to work with the Gamma function instead. Again, experimentation and knowing your customer preferences are key to applying these functions to your video.

Gamma Correction

Gamma is an important consideration for delivering video to Mac and PC platforms --which have inherently different gamma characteristics. This parameter applies a non-linear function to the amplitude values of the pixels, helping to create more whites without brightening the entire range or more darks without affecting the bright areas. Figure 7 shows two sample gamma function curves. Again, experimentationwith the dynamic preview is key to applying the proper gamma to your video.


Figure 7. Gamma functions for non-linear adjustment of video levels.

Black and White Restore

If you just want to adjust the very white or very black portions of the image, use the Black and White Restore options shown in Figure 8. These force values to pure black or pure white. The Amount slider determines what values will be fully affected by the restore operation while the Smoothness slider adjusts blacks or whites near the transition point. It's best to adjust the Amount first and then use the Smoothness factor to reduce sharp jumps in contrast. Black and White Restore can help reduce noise in flat areas of the picture, like credits on a black background.

Note: The last entry, specific to Quicktime, will be covered in another tutorial.


Figure 8. Black and White restore functions showing how smoothness will effect the characteristic of the curve.

Audio Preprocessing in Media Cleaner Pro

The "Audio for the Web, Part One" tutorial by Steve Cunningham will help explain some of the technical aspects of audio preprocessing and offer some excellent tips on how to prepare your audio for the web. In this section we'll go over the options relevant to Media Cleaner Pro (as shown in Figure 9) and how they relate to the terms introduced in Steve Cunningham's tutorial.

Filtering for Noise Removal

Just like video, it's important to hand-off the cleanest signal possible for the encoder to efficiently use the limited bit rate. Noise removal is accomplished in MCP using the General Noise Removal filter, or the more specific Low Pass, High Pass, and Notch options shown in Figure 9. If you have specific frequencies or noise patterns in your signal, target them with these specialized filters. For instance, the Notch filter removes 60 Hz or 50 Hz line noise associated with the AC power lines of a particular region.


Figure 9. The Audio Processing Tab in Media Cleaner Pro with some of the filtering options shown.

A general Noise Removal filter often works well. This is an adaptive filter operating on the signal based on a noise threshold value. The Custom Settings pull-down allows you to set your own threshold or you can select the Mild, Moderate, or Extreme preset values built into the application.

The Noise Gate removes background noise during silent portions of an audio track. It cannot be used if there is background music running continuously in your content. The operation of the gate is shown in figure 10 where quiet sections of the audio are suppressed completely. Again, MCP offers Mild, Moderate, or Extreme presets as well as custom settings. You can also set the Threshold and the Duration on the Gate (figure 11). Make sure you don't set the Threshold too high -- as you can cut off the beginning or end of someone's speech.


Figure 10. Example of how a noise gate affects the audio in quiet sections of the track.


Figure 11. Options for noise gating in Media Cleaner.

Enhancing the Audio Signal

Media Cleaner Pro provides three other options to prepare audio for compression. You can adjust the volume of the signal either by a straight gain factor (using the Adjust slider in Figure 12a) or a Normalization factor (as shown in Figure 12b). If your signal was recorded low or hot, boost or cut it using the Adjust slider -- being careful not to clip the highs or lows with this technique. Generally, it's a good idea to normalize the signal instead and the default setting of 70% is a good place to start.


Figure 12. The Volume adjustments in MCP use a a) straight gain factor, or b) a Normalization factor.

For more control over the Dynamic Range in specific parts of the audio track, use the custom setting of this option (as shown in Figure 13). Here you can boost up the low levels without affecting higher amplitudes and causing clipping. The Lookahead factor determines what length of segment the processing will take into account. Again a good starting point is the presets, either "Limit to 70%" or "Narrow Range". The "Hotter" setting is not recommended for web audio. If you use the Dynamic Range control, there's no need to normalize the signal under the Volume control.


Figure 13. Dynamic Range options on MCP.

Reverb is an effect that can add some richness to an audio signal. Because it is adding frequencies, it may make the content harder to compress. Experimentation is the key to getting good results. More technical information on audio effects and some samples can be found in Audio for the Web, Part Two: Effects.

Wrapping Up

As explained throughout this first MCP tutorial installment, there are crucial components to audio and video compression before your content even hits the codec. The features described in this section can make a significant difference in the quality of streaming media you deliver to customers -- no matter what format you are delivering.

Next Week: Media Cleaner Pro, Part II: Compression parameters for Web codecs

Streaming Covers
Free
for qualified subscribers
Subscribe Now Current Issue Past Issues