Opens in a new tab
Tutorial

How to Make an After Effects Comp Match Its Content Length Automatically

Published October 16, 2026Last modified October 21, 2026

To make an After Effects comp match its content length, you give Templater two markers inside the comp: one layer’s In-Point to say where the comp starts, and one layer’s Out-Point to say where it ends. When the footage in your data changes length, those markers move, and the comp follows. This is called time cropping, and it is one of four techniques in what we call Time Sculpting.

The rest of this article explains why a fixed comp length breaks a data-driven template, how to set up time cropping step by step, and when to reach for shifting, stretching or trimming instead. It also covers the limits our documentation states, so you know where the technique stops. Everything here assumes you already use Templater to pair a template with data. If you do not, start with our Templater page.

Why a fixed comp length breaks a data-driven template

A hand-built After Effects comp has a length that someone chose. Maybe it is fifteen seconds, because the clip inside it was fifteen seconds. That works because you made one video and you looked at it.

Data-driven video changes the situation. You build one master composition and let a data source produce many versions. In every version the text changes, and in many of them the footage changes too. A customer clip, an interview, a product demo or a sports highlight will each have its own running time. The comp does not know that. It keeps its original length, so a short clip leaves dead air at the end, and a long clip gets chopped off. Neither is acceptable in a finished video, and fixing it by hand defeats the reason you automated.

Time Sculpting is Templater’s answer. In our documentation’s words, it is a method for making After Effects composition timelines dynamic. You configure layers with time-based rules that account for differences in source durations when Templater processes your data. The rules help Templater preserve layer timing and the overall duration of the compositions. For example, as layers get updated, Templater can adjust the duration of a composition for you if needed.

There are four techniques, and each solves a different timing problem:

  • Time cropping sets the start and end of the composition itself.
  • Time shifting slides a whole layer earlier or later so it lines up with another layer.
  • Time stretching changes a layer’s playback speed so it fits a window.
  • Time trimming moves a layer’s In-Point and Out-Point to meet another layer.

One rule applies to all four, and it catches people the first time. You must set a target composition to use any of the Time Sculpting features. If your timing rules seem to do nothing, check that first. A rule without a target composition has nothing to act on.

This article focuses on cropping, because the question people ask is how to make the comp itself match the content. We describe the other three afterward, since they usually work alongside cropping and not in place of it. Our earlier post on time sculpting with Dataclay Templater is a good companion read.

Setting up time cropping, step by step

Time cropping uses the In-Point of any layer in the composition to mark the beginning of the composition, and the Out-Point of any layer to mark the end. The In-Point and Out-Point can sit on the same layer or on different layers. Use only one In-Point and one Out-Point for cropping a composition’s timeline. That limit is the single most important thing to remember, and we come back to it below.

The setup uses the Templater Settings effect, and the steps below use it on two layers or one. Here are the steps from our documentation, in order.

  1. Apply the Templater Settings effect to a layer.
  2. In the Effect Controls, in the Time section, check the Comp Starts at In-Point box.
  3. Set the In-Point of that layer in the timeline. The In-Point of the layer is where its containing composition will begin.
  4. Create another layer in the composition and apply the Templater Settings effect to it.
  5. In the Effect Controls, in the Time section, check the Comp Ends at Out-Point box.
  6. Set the Out-point of that second layer in the timeline. The Out-point of the layer is where its containing composition will end.

That is the whole setup. The pairing is deliberate. One checkbox says the comp starts here. The other says the comp ends there. Each belongs to a layer whose timing you control, so you decide which layer owns the beginning and which owns the end.

There is a shortcut. You can set both the In-Point and the Out-Point with a single dynamic layer. As the footage duration of that layer updates during Templater’s processing, the In-Point and Out-Point adjust with it. When one clip drives the video, the clip comes in at whatever length it has, and the comp matches it.

Our documentation shows four cropping outcomes, and it helps to picture them as choices you make:

  • The comp crops so it starts at the In-Point of the footage layer.
  • The comp crops so it ends at the Out-Point of the footage layer.
  • The comp crops to both the In-Point and the Out-Point of the footage layer.
  • The comp crops to the In-Point of the footage layer and to the Out-Point of a different layer.

The fourth choice is the interesting one. Suppose your template has a branded outro layer that should always finish the video. You can crop the start to the customer’s footage and crop the end to the outro layer. The footage decides when the video begins and the outro decides when it ends. Mixing layers this way is allowed because the In-Point and Out-Point can sit on different layers.

When should you pick each of the four outcomes? Crop only the start when the front of the footage is the part that varies, for example when a clip arrives with a lead-in you want the comp to skip. Crop only the end when the comp should run until the footage runs out. Crop to both when the footage layer alone should define the video, start to finish. Use the mixed choice when a second layer, such as a closing graphic, owns the ending. In every case the question is the same: which layer in this template knows how long the video should be?

A few checks save time before you run a batch. Confirm that a target composition is set. Confirm that the boxes you checked are on the layers you meant, because the Time section sits in the effect controls of each layer separately. Confirm that no third layer also carries a start or end box. Then preview a row with the longest footage and a row with the shortest. These checks take little effort, and they match the limits our documentation states.

Now picture a worked scenario, built from these steps and not from a customer story. You have a template with one footage layer and a title. The data source supplies a clip URL and a name for each row. The clips run different lengths. You use the single dynamic layer setup for both the In-Point and the Out-Point, and you set the target composition. When Templater processes row after row, each version of the comp takes the running time of its own clip. The short clips produce short videos and the long clips produce long ones, and nobody opens After Effects to retime anything. For more on bringing remote footage into a template, see our post on smart URL processing for remote footage.

Nested compositions work too. You can create nested compositions that have dynamic durations. Templater will adjust the duration of any composition that has time cropping applied, no matter how deeply nested it is in the project. That matters for complex templates, where the footage may sit two or three comps down from the one you render. You do not have to hunt for the outer comp and set it by hand.

Now the limit. We do not recommend using more than two layers to specify the In-Point and Out-Point for time cropping. Using more than two layers can give unexpected results. The practical advice is simple. The comp has one start and one end, so keep it to one In-Point and one Out-Point, whether those come from one layer or two.

Shifting, stretching and trimming: the other three

Cropping fixes the length of the comp. The other three techniques fix what happens to the layers inside it. Most real templates need at least one of them. Each of the three uses a sibling layer as a target, and each lets you overlap the layer with its target by a number of frames.

Time shifting moves a whole layer in time. All of its properties move by the same amount and in the same direction. You pick a sibling layer as the shift target, then choose whether the layer shifts by its In-Point or its Out-Point to meet the target’s In-Point or Out-Point. That gives four combinations: In to In, In to Out, Out to In, and Out to Out. Shifting is the right tool when something must start the instant something else ends. A lower third that should appear right after a clip finishes is a good picture of it. The layer’s own length does not change. Only its position does.

Time stretching changes a layer’s duration by changing its playback speed. You would use it when you set aside a period of time for a layer and want footage of different lengths to fit exactly into that period. Here is the trade-off, and we want to be plain about it. Because stretching adjusts playback speed, the footage will speed up or slow down in the final rendered video. A ten-second clip stretched to fill twenty seconds plays at half speed. In our judgment, that looks wrong for a talking head or a scene with natural motion, and matters less for a background loop or an abstract graphic. Choose stretching only when a change in speed is acceptable for the content.

For each layer that will stretch, you pick a sibling layer as its stretch target. The layer stretches to the target’s In-Point, to the target’s Out-Point, or to the end of its containing composition, depending on your setting. Note that a layer always stretches from its In-point. You can also overlap the layer with its target by a specified number of frames.

Time trimming moves the In-Point and Out-Point of a layer without changing its speed. For each layer you want to trim, specify a sibling layer as its In-Point target or its Out-Point target. The In-Point target says where the layer’s In-Point trims to. The Out-Point target says where its Out-Point trims to. You can trim both ends, or trim one end without touching the other. There are four combinations here too: the layer’s In-Point trims to the target’s In-Point or Out-Point, and the layer’s Out-Point trims to the target’s In-Point or Out-Point.

Trimming has one setting that deserves care, which is how much of the footage you keep. Select Preserve Beginning to keep the start of a footage source. Select Preserve Ending to keep the end. Select both to preserve the full duration of the footage source. Pick the one that matches the story of your content. If the first seconds of a clip carry the message, preserve the beginning and let the end be cut. If the closing line matters most, preserve the ending.

Our documentation includes an honest warning about this. If your source footage durations vary widely from one iteration to the next, you may need a combination of time trimming, time stretching or time shifting to make sure the beginning or the end of a footage source stays visible. In other words, one technique alone may not cover every row in your data. Test your template against the shortest clip and the longest clip you expect before you run the whole batch.

How do you choose among them? Ask what should stay fixed. If the content must keep its natural speed and the comp length can flex, crop. If a layer must appear at a certain moment relative to another, shift. If the content has to fill a window exactly and a speed change is fine, stretch. If a layer needs to start or end at certain points and you want to control what gets cut, trim. You can combine them. Cropping can set the overall length, and trimming or shifting can handle the layers inside.

Timing is only one of the things that change from row to row. Text length changes too, and our posts on managing text expansion across languages and on reading speed budgets and language-aware timing look at related problems. If you are new to the whole idea, the complete guide to automating After Effects from data shows how the pieces fit.

And when should you skip all this? If every clip in your data runs the same length, you do not need dynamic timing. Set the comp once and move on. If you only make one or two versions, hand editing is faster than rigging rules. Time Sculpting pays off when footage length varies and the number of versions is large enough that retiming by hand would cost you more than the setup does.

The short version

Set a target composition first. Apply the Templater Settings effect to a layer and check Comp Starts at In-Point. Apply it to a layer and check Comp Ends at Out-Point, or use one dynamic layer for both. Use only one In-Point and one Out-Point. Add shifting, stretching or trimming for the layers inside the comp, and remember that stretching changes playback speed, while trimming lets you choose to preserve the beginning, the ending or both.

Test with your shortest and longest footage before you render the batch. That one habit surfaces timing problems while they are still cheap to fix. Here are the questions people ask about this technique.

Frequently Asked Questions

How do I make a comp end where its footage ends?

Apply the Templater Settings effect to the footage layer, and in the Effect Controls, in the Time section, check Comp Ends at Out-Point. Then set the layer’s Out-point in the timeline, because that Out-point is where the containing composition will end. As the footage duration updates during Templater’s processing, the Out-point adjusts dynamically. You must also set a target composition for any Time Sculpting feature to work.

Can one layer set both the start and the end of the comp?

Yes. You can set the In-Point and Out-Point with one dynamic layer. As the footage duration of that layer updates during Templater’s processing, the In-Point and Out-Point adjust dynamically. You can also use two separate layers, one with Comp Starts at In-Point checked and one with Comp Ends at Out-Point checked. Do not use more than two layers, because that can give unexpected results.

Does time cropping work on nested compositions?

Yes. You can create nested compositions that have dynamic durations. Templater adjusts the duration of any composition that has time cropping applied, no matter how deeply nested it is in the project. You do not need to find the outermost comp and change its length by hand when the footage deep inside it varies from row to row.

What is the difference between time trimming and time stretching?

Trimming moves a layer’s In-Point and Out-Point to meet a target layer and does not change playback speed, so you can choose to preserve the beginning, the ending or the full footage source. Stretching changes the layer’s duration by adjusting its playback speed, so the footage speeds up or slows down in the final video. Use stretching when a speed change is acceptable, and trimming when it is not.

Why isn’t my Time Sculpting rule doing anything?

The first thing to check is the target composition. You must set a target composition to use any of the Time Sculpting features, including cropping, shifting, stretching and trimming. If a target is set and the results still look odd, check how many layers specify the In-Point and Out-Point. More than two layers can give unexpected results, so reduce it to one start and one end.

What if my footage lengths vary a lot between rows?

One technique may not be enough. When source footage durations vary widely for each iteration, you may need a combination of time trimming, time stretching or time shifting to make sure the beginning or the end of a footage source remains visible. Test with the shortest and longest clip you expect before you run the whole batch.

Can I overlap layers when they shift, stretch or trim?

Yes. Time shifting, stretching and trimming each let you overlap a layer with its target by a specified number of frames. That helps when you want one layer to begin slightly before the previous one ends. Cropping works differently, since it sets the start and end of the composition itself and does not move layers relative to each other.

Leave the first comment

Sign up

Stay up to date with Datclay's newsletter. We won't spam your inbox.

Newsletter Signup
Name
Name
First
Last

By submitting your email, you agree to our Terms and Privacy Policy. You can opt out at any time.