By Jeremy Swan
“The Arts” column, we created time-lapse videos in both Photoshop and After Effects. Now, let’s add a “time stamp” to show the precise time each image was captured. Spoiler: It involves keyframes and nesting. In this article, we present a ten-step process for adding timecode.In our last two articles of
“Nesting—Not Just for the Birds, But Fish Too” is required reading before continuing with this article. Caught up? Great!
Click on any image to enlarge.
Setting up to add timecode to a time-lapse video
First off, let’s grab our example video, which can be downloaded here: timelapse-after-effects.mp4
Drag the video into the “Project” window to add it to your project.
Right click on the video and choose “New Composition from Selection”
This makes a composition that automatically has the same frames per minute, length of time, height, and width of the video file.
It’s time to add a timecode label.
Step 1: Adding text to the time-lapse
On the top menubar, click: Layer > New > Text
|b.||Begin typing to place text on the layer.|
Step 4: Finding the right font for timecode-specific text
For a timecode layer of text, I’d recommend using “Crystal” (available as freeware here: http://www.fontspace.com/allen-r-walden/crystal).
If you would like to use a different font for the time, be sure that the font is “fixed width.” This means that the characters are all the same width, so that the text will not jump around as the clock progresses. (Note: The “Crystal” font is for all-caps and numbers only, so if your text contains lowercase letters, they will be displayed with another font.)
Step 5: Create the “stop watch” effect
Open your “Effects and Presets” window and open “Expression Controls”
Drag “Slider Control” over your text, or onto the text layer in the timeline, to apply the effect. You should now be able to click the arrows to see “Slider Control” in your timeline.
Hold the Option key down while clicking on the stopwatch icon to display the expression editor on the right.
Paste the following code into the expression editor:
This code is shared on GitHub.
Step 7: Setting the length of the timeline
We will set a “Keyframe” at the beginning and the end of the timeline. Keyframes are used to define the start and end points of a transition, so that the frames in between can be calculated automatically for a smooth transition between each keyframe. With the playhead still at the beginning of the timeline, click the stopwatch icon. This will add a keyframe at the playhead, which is represented by a blue diamond shape. Note: Clicking the Stopwatch icon a second time will remove all keyframes.
Now, let’s move the playhead to the end of the video (50 seconds) and change the slider value to 86400. A new keyframe will automatically be inserted in the timeline.
Step 10: Hiding the last two digits
We can use a mask to cut off the last two digits by right-clicking on the timecode layer and choosing “New Mask.”
Click the handles and move them around to exclude the “seconds” column.
Your movie should be ready for export! You can follow the instructions from the previous article or click File > Export > Add to render queue. Your result should look something like this: timelapse-timecode-after-effects.mp4.