Cookin’ with Keyframes

Simple editing is like warming up a can of soup: just drop a couple shots on a timeline and voila! But a master chef uses the tricks of the trade to embellish a video.

The keyframe is both extremely simple and extremely complicated at the same time. Perhaps it is a bit like cooking. You take something edible, apply heat and it’s cooked – simple. But then, when you realize the myriad ingredients and the uncountable variations in which you can join, prepare and cook them, the very thought of making a meal can seem overwhelming. Or perhaps boundless choices excite you as a cook or editor, your imagination being your only limitation. Let’s take a can opener to keyframes and see what we can cook up.

Mixing It Up

Although maybe not the most appetizing way to begin, let’s start with an explanation. In its simplest form, a keyframe is a set of exact values at a specific point in time. If I were “keyframed” right now, at 2:24pm on Saturday, I would be typing on my computer, both hands on the keyboard, sitting in a chair. If at 2:26pm I am in the same position, the exact values at that different time would be the same. But say at 2:26pm, two minutes later, I was standing five feet from my computer turning on the stereo. The “keyframe” or set of values for 2:26 is different from those at 2:24. I am now standing, I am five feet from my last location, and my body is engaged in a different action.

Let’s look at another analogy that will help us later. You have just finished an epic cross-country bike ride from the Pacific Ocean to the Atlantic. You left San Francisco and pedaled south to Death Valley, then across to Lake Powell, Utah; sweated your way over to Four Corners; crossed three more states to St. Louis; continued on to West Virginia, where you took a break from cycling for some whitewater rafting; and finally headed on to New York City. After the saddlesore pain wore off, you put a map of the USA on your wall and stuck a pushpin in each location you visited. Then you attached red yarn from your first pin in San Francisco to your second pin, third and so forth until you tied it off in New York City. The pins are a great representation of keyframes. The yarn represents something called rubber banding, which we will get to later.

A Pinch of Pan and Scan

All right, enough metaphor. How does this apply to video (and audio and graphics and even video compression)? We’ll use an example from the famous documentarian Ken Burns. Let’s say Mr. Burns cuts to a new scene in his famous Civil War film, framing a soldier’s face in a closeup that takes up most of the screen. The “camera” then slowly pulls out and pans to the right to reveal injured soldiers, cannons and burnt buildings. How did he do this? Keyframes. He imported an image bigger than the frame size, let’s say 2880×1920 pixels (four times the size of our 720×480-pixel Mini DV video in each direction), into the editing program. Using the motion parameters, he zoomed in and panned so that the soldier’s face occupied the entire frame, and he set a keyframe. This tells the program that, at this exact time on the timeline, this image is zoomed a certain percent. Let’s say he zoomed the scale to 250% and panned from center point 0x, 0y to 226x, 80y, which moves the “camera” across the image to the left and slightly up. He set the keyframe. Eight seconds later, in the future or down the timeline, he set a keyframe at scale 25% and center point 0x, 0y, which means the image was centered. The editing program assumes by default that he wants it to “tween” the motion. This means it will render, or build frame by frame, the difference in scale and center point, moving from point A to point B (the points being the two keyframes assigned). Can you do the math and figure out how many frames it has to build or render? Approximately 240 frames (about eight seconds times 20 frames). Each frame has a slightly different size and center point. He designated a starting keyframe and an ending keyframe, and let the computer and editing program do the math and build each of the frames in between (get it? in between). Ah, someone has built a machine to do the hard work.

In the example above, the editor adjusted the scale of the image and its center point, making it appear to zoom out and pan to the right. There are many, many parameters that can be adjusted, including rotation and opacity, and thousands to be found in the filters. Keyframing doesn’t just deal with animating motion; it can allow the user to change other image parameters (e.g., change the color saturation over time to have a video go from black and white to color). Once you dive in and start experimenting with these variables, you will see the power you have in manipulating your image using keyframes.

Toss In Some Graphics

But it is not only the video you can manipulate. How about a graphic? You can move a title across your frame, fade the opacity from translucent to opaque, or zoom from a size too small to see to one that fills your screen. When you are feeling daring, you can use more than two keyframes for multiple movements. Think of a ball that bounces from one word to the next in a karaoke-type subtitle. You do this with keyframes. You may set a keyframe for your ball at the low point in the center of the first word, then the high point halfway to the next word, then the low point centered above the next word, and so forth along the timeline, and the program tweens the frames, forming a fluid bouncing ball. Remember that one keyframe is about as useless as one telephone. You need at least two (a starting point and an ending point) to make the process work, to make a change over time.

Recipe for Sound

Keyframes become crucial with audio manipulation. Let’s say we have a song we are using as a sound bed under an interview. When the interviewee is speaking, we want to lower the gain of the music, and when the speaker is silent while b-roll is playing, we raise the gain of the music. For example, in the beginning of a video, we see a montage of images, without voiceover, so we have the music at a relatively loud -6dB of gain. Two seconds before the speaker utters her first words, we set a keyframe. We then forward the playhead two seconds to position the playhead a couple of frames before the speaker begins talking and set a second keyframe. Now we advance the playhead to a couple of frames after the speaker completes her monologue and place keyframe number three. We advance the playhead an additional two seconds and place our fourth keyframe. The line representing the level of the monologue or the woman speaking is a straight line with four keyframes on it. Now we take our selection “arrow” tool, click-n-hold keyframe number two, pull it down twelve decibels to -20dB and release it. We move the selection tool over to the third keyframe and do the same. We have now dropped the level of the music while the interviewee is talking and raised it again when she is finished. This is “rubber banding.” Imagine you had two pushpins stuck in a board, and you put a rubber band around them both, connecting them. Bring a third pin in between them, pull the rubber band down about an inch and push your pin in. Remember the map and the red yarn?

Keyframes pinpoint a group of variables not only with editing programs, but also with compositing programs such as After Effects and animation programs such as Flash. You will also see them used with compression, defining variables in a single frame to reference future frames, but this is an explanation for a more advanced article. So get into your editing “kitchen,” find the “cupboard” where your program stores your keyframable goodies – your video, graphics, filters and audio – and start cooking.

Contributing editor Morgan Paar is a nomadic producer, shooter and editor, making documentaries worldwide.

The Videomaker Editors are dedicated to bringing you the information you need to produce and share better video.

Related Content