Balance Your Video

There are subtle variations to all these, but learn the basics before you try to mess with something advanced.

Some engineers say "don't touch" certain settings or you will screw it up. In some ways that's true. If you know the "what" and "why" you safely "can". Otherwise don't. People who mess with what they shouldn't end up getting slapped around for it. Keep that in mind.


This page describes how to balance the luma and chroma levels of your video so that it can closely come to the industry standard (if you could call it that). This can be used to fix washed out video (often old video), black and white movies that look gray, and so on.


Part 1: Levels

Histogram graphs are common in graphical computer applications since they are trivial to program. Unfortunately histograms can be a little hard to read, but with training can still be quite useful. Histograms are a simple graphical display count of the gray scale of the image from black to white. The very left of the graph represents pure black. The very right of the graph represents pure white. The very middle of the graph represents 50% gray...and so on. The higher the bar in the graph, the higher the pixel count for a particular color level. This is just a plot of the number of pixels per each shade of gray. A pure black screen would have a thin line at the very left of the graph with nothing else. A frame with a bright light in it would have a "hump" in the graph close to the right (white) side. A frame with a pure black to white gradient would have a FLAT (yes flat) histogram because all levels would be represented equally. In television production, a waveform monitor (for luma) and a vectorscope (for chroma) are normally used for level balancing. These are far easier to read...and shouldn't be hard to program...but the only program I've seen that has them is Cinelerra.

Hit "Show Preview" using VirtualDub's "levels" filter. This will open up the histogram/balancing window and a video window showing changes. Hit "Sample Frame" to see the histogram. This histogram is a true breakdown for the current frame...as in this has nothing to do with your monitor settings.

General usage. Start by looking at the black and white levels (the very ends of the histogram graph). Go through the video and sample several points to see where the levels fall. Find a black or white section that you know should be truly black or white and see if it shows up on the graph as a "bump". Take note to see if those levels go all the way to the ends of the graph or stop somewhere distant from the edges. Eventually you should see a pattern emerge where the graph won't go beyond. These edges will be the ends of the black and white levels.

Specific usage. Watch the histogram graph on the black and white ends. On a mostly black frame there will be a black spike in the graph. Take note of where that is as that should be close to pure black for that video. The same goes for white at the other end of the graph.

Slide the black and white triangles under those spikes to adjust the levels. Notice that the preview image will get darker and lighter depending on which one moves. This is expanding the video back to its full dynamic range.

Jump around and take several more readings. The "humps" should be in the same place. If they move a lot, adjust accordingly.

Darker scenes are usually a good choice for finding the black level. Outside scenes and explosions are good for finding the white level.

Notes and things to watch out for.

Sometimes the producers are sneaky and will put in a pure black frame at the beginning, end, or at breaks that won't match with the other black levels. This reading should be discarded.

Sometimes outdoors and explosions will be artifically reduced giving false readings. Many times it is better to find a light or bright reflection in a scene for the reading.

Sometimes explosions are intentionally over exposed and will give false readings. In this case it is best to leave them over exposed and not disturb the rest of the video settings. In the analog NTSC video world, things are a little different. Measurements are taken in IRE units that are essentially percentages for sake of discussion. Black is 7.5% and white is 100% (blacker than black being 0%). One of the problems is that white can be over exposed to 110% before it starts clipping. This can sometimes make encoding on a computer difficult. It won't hurt to smash a pure white frame since it is already white (same for pure black).

Smashed ends in the histogram graph will show a long bar on the very edge of the graph (typically indicating clipping). This can be for black or white. If the video isn't supposed to be smashed at that particular end, someone didn't pay attention and screwed it up. It may or may not be very fixable.

Video noise. In a histogram this is really only viewable with a "pure and solid" color. Black is the most common. A pure black screen should be a thin black line smashed up against the left edge of the graph with nothing else beside it. A noisy black scrreen will look like a tower, pyramid, or tent depending on how bad it is. The wider the base for that pure color, the more noise it has. Remember the histogram graph is reporting the different number of colors it is finding.

On really bad encodes, the levels will be inconsistent and everywhere. For these you will either have to render each scene separately (usually more trouble than it's worth) or use your best guess and set the levels at an appropriate average.

Fog, clouds, and mist are bad choices for setting levels. These levels are typically "smashed in the middle" of the graph to get the desired video effect.

Subtitles in foreign videos can also throw off the levels. Often time they will be pure white with pure black outlines that will give false readings. These readings will show "bumps" at each end of the graph (depending on the other video content, too). This is where having a properly balanced monitor comes in handy to see what you are truly getting.

After awhile you will learn how to read the histogram window by instinct and make faster and better level judgements.

A word on the brightness filter. It is evil. It will "slide" the histogram graph back and forth. If you slide it too far, you will smash the ends and lose data. This filter should never be used for common video adjustments. (There is a way to use brightness to slide black back to black and use contrast to expand white back to white, though, but this is rather complicated and beyond this scope.)

Keys: don't wash out the video and don't leave it in the mud (too dark). This is where the balanced monitor and art of it comes in.

Once the levels have been set, you are now using the full video dynamic range.


Part 2: Gamma

Gamma is discussed by many and argued by many. My argument is that if the brightness levels are properly set and the monitor is properly set, then adjust the gamma until the video becomes easy to watch. Simple, eh?

Gamma is like an "intelligent brightness" command. It will "smear" the dark gray levels higher so that details in the mud can become clearer and visible. Gamma will leave your black point anchored so black won't become gray (as opposed to brightness sliding the black point to gray).

Be warned that too high may actually show MPEG type blocking. Don't go that high. Most usable gamma ranges are 1.1 to 1.6. Some videos are smashed so much that permanent loss occurs and those ares are not recoverable.

DVD/VOB and MPEG2 in general tends to be dark and will typically need a 1.4 gamma boost. This probably has to do with television and evil automatic gain controls.

Side note. I'm not sure why broadcast video is so much in the mud. This also applies to MPEG2 and MJPEG. This is blatently wasting dynamic range and reducing the video quality. Come to think of it, I don't think I want to know why.

Find a darker scene that has detail in the background. Slide the gamma triangle left until it becomes clear. This may wash out color some, but don't worry as that can be easily fixed in the next step.

Artists make backgrounds to be seen, not to be black blobs on the video screen that are lost. Make the video clear, easily viewable, and pleasant to watch.

Don't adjust gamma too high as the white levels will start washing out. High gamma settings can also smash the white end of the histogram graph causing permanent quality loss.

Side note: in VirtualDub there is an "Output Levels" bar with the black and white triangles below it. NEVER smash the output video with this unless you really know what you are doing. This bar is designed to reduce the dynamic range of the video for special applications. If you run another histogram after the change, you will note that the graph has been compressed and this loses data and clarity.


Part 3: Color

Now that the levels have been properly set, color is probably washed out. Thankfully this is a trivial fix. Load a "saturation" type filter. Hit the preview button. Once again this is where a properly balanced monitor is necessary. Since most computer programs have no color intensity graphs (like a vectorscope) you will have to eye it.

The idea here is to push color up full but not go over.

Bright red is a really good choice since it bleeds easily and seems to have problems in both the analog and digital worlds. Increase the saturation levels until red starts to bleed then back it off. Play with it a little until you find a good point. Other colors will also work similar to this but will not be as pronounced. Always start with red if you can.

Also notice the surroundings. Background vegetation should look better. Faces should also be more balanced. The scene should look vivid now but not overly bleeding, bright, or messed up.

Just like with levels, scroll through the video and take several more readings to fine tune it.

Most saturation increases are from 1.2 to 1.5.


Finale

Congratulations....you have just properly balanced your video. :)

This is a part of video engineering few people truly understand.

It may take a little getting used to if you eyes aren't accustomed to it. Once you do get used to it, you will never go back and everyone else's unbalanced monitors and encodes again.

It also helps sometimes to get up and take a short walk around somewhere to let your eyes rest and readjust. Eye fatigue is common and not a good thing when trying to encode.

From this point on you can use your other filters to do cleaning, resizing, etc.