I'm sure most of you have seen the stylized cartoon mouth animation popularized by Terry Gilliam in the original Monty Python series. Here's a good example (although the video itself is of very poor quality):
The concept is simple: take a still image of a person's face, and create a basic lip-sync animation by moving the image's mouth up and down in time with the audio track. (That concept has been updated recently to great effect in the popular Jib-Jab animations you've also probably seen.)
In this tutorial, we're going to show the basics of creating your own Monty Python-style mouth animations in After Effects. Let's get started.
First, you'll need an image and some audio to work with. I'm going to be using a straight-on shot of my face, showing a lot of teeth but with my mouth otherwise closed:
An image like this will be easiest to work with, at least for your first attempt at this. You'll also need some kind of voiceover audio to sync the mouth to; here's mine, but you can easily record your own with your computer's built-in mic:
When you record your audio, be sure to record at a good high level, and minimize any background sound. This will make it easier to locate your words in the waveform later.
Next, open After Effects, import your source files into your new project and set up a new composition, something like this:
Be sure to make your background color black, as we'll be seeing that when we do our animation. This black background will create the illusion of the inside of the mouth as it opens and closes.
Next, drag two copies of your face image into the Layer pane of the Timeline, starting at the same time and in exactly the same position. Drag your audio layer in as well:
Our next step is to mask our two layers to create a separate mouth we can animate. Basically, we need to have the part of the mouth we want to animate as a separate layer, while in the layer behind it, we need black in that area so that as the mouth layer moves the black will be revealed, creating the illusion of the inside of the mouth. So, we need to isolate just the mouth onto its own layer, while cutting a corresponding hole in the layer behind. We could do that in Photoshop, but it's easy to do in After Effects too, so we'll do it here.
First, double-click the top layer to open it in its own Layer Window. Select the Pen Tool (G), and draw a mask around the lower part of the mouth to isolate it from the rest of the image. You want the upper part of the mask to align with the separation between the upper and lower teeth, and the rest of the mask to outline just the corners of the mouth and a little of the bottom lip. Your image will vary, of course, but for my face here's the mask I'm using (I've zoomed in on it to make it easier to see):
Don't worry too much about smoothing out the mask's edges; in this kind of cut-out animation, straight lines are part of the look. I did make the upper center mask point a Bézier point by dragging on the point with the Pen tool when I placed it, so I could make it fit the curve of my teeth better, but you may not need or want to do that, depending on your image.
Next we need to mask the bottom layer to make a hole that will reveal the black background when the mouth moves. That's an easy one, because we can use the mask we just made. So, close the Layer Window, and make sure the mask you just made is selected by rolling down the properties for the top layer and clicking on the mask name (which will be "Mask 1" unless you've changed it or made other masks.)
Copy the mask, select the bottom layer, and paste the mask into it. You should just see the isolated mouth now, since both layers have the same mask. Now roll down the properties for the bottom layer and click the Inverted checkbox for the mask:
This will eliminate everything inside the mask area, instead of outside. You should see the entire face again, because we now have two identical layers with masks that are the inverses of each other, effectively canceling each other out. If you turn off the top layer, you should see a hole in the bottom layer corresponding exactly to the masked mouth:
Next, we're going to animate the mouth and synchronize its movements to our audio track. First, roll down all the property twirlies for the audio layer to reveal the audio waveform:
(Note that I slid my audio over a little later in time, so it doesn't start right at the beginning of the clip.) Now, if you take a look at the audio waveform, you should see the amplitude peaks where you speak each syllable, and the (relatively) silent valleys in between the syllables. You can also Command-drag the Current Time Indicator (CTI) along the timeline to manually scrub through the audio and identify those peaks and valleys. What we're going to do is simply animate the mouth layer down on the peaks, and back up again on the valleys.
So, select the mouth layer and type P to solo its Position property, then position your CTI just before the audio begins. Click the Position Property Time-Vary stop watch to set a position keyframe. Now move the CTI ahead to the first audio peak, and drag the Y Position property value down a bit to open the mouth:
How much you move the mouth is up to you, of course, but it will depend partly on your original mask shape, the mouth image itself, and how exaggerated an effect you want.
Next, move the CTI ahead to the next amplitude valley, select your first keyframe, copy it, and then paste it in at the new time. You should now have three keyframes—closed, open, closed—that correspond to your first syllable:
From here, it's a relatively simple matter to complete the animation: select the second and third keyframes you just made (opened-closed). Copy them, move the CTI to the next amplitude peak, and paste in the two keyframes. You'll probably need to adjust the position in time of the second (closed) keyframe, as the syllables will be of different lengths. Just drag each one so it lines up with an amplitude valley after you paste it. (It will probably help to zoom in on the timeline when you're working on this.)
Also remember that Command-dragging the CTI—scrubbing the audio—can help identify less obvious syllables. After longer pauses, you may also want to paste in another closed keyframe before a new peak, just so the mouth stays closed during the pauses.
Finish up by previewing your lip-sync and adjusting your keyframes in time as necessary, and when you're done, you should see something like this:
And that's that! As always, I encourage you to try your own variations on this technique, and above all, experiment and have fun!
There's more detailed After Effects animation training available:
After Effects CS5 303 - More Cartoon Animation Basics.