Skip to main content
Participant
January 9, 2022
Question

How a composition can automatically fit to an audio?

  • January 9, 2022
  • 2 replies
  • 423 views

Hi guys,

 

I  would like to know how a composition duration can be changed automatically based on an audio duration. I am new to using After Effects, actually I am a software developer (sorry if I am asking something trivial question).

 

My Scenario: I have a template that is automatically rendered via cmd, using aerender.exe. So, for each new audio file that is linked to the template, I want the composition befitting its duration.

 

Ps.: I am struggling with this for almost two days and I would appreciate some advice.

 

Thanks in advance.

This topic has been closed for replies.

2 replies

Legend
January 9, 2022

I think with aerender command you have the option of specifying a start and end frame of the comp for the actual render.  You would need to calculate how many seconds the audio file is and then translate that into how many frames the composition should be according to the audio length.  You would need to know the composition's frame rate to calculate that amount of frames.  Then use that frame count as the "end" of where aerender should stop rendering.

 

Another option is to use the developer friendly extension, Templater for After Effects (http://dataclay.com/templater), to accomplish this.  It is licensed software, but it has a set of patented  techniques known as "Time Sculpting" that can auto-adjust the composition duration based on a layer that the user specifies.  With the correct configuration, each time Templater changes the source of the audio layer, it will change the duration of its containing composition.


See this documentation on it: https://support.dataclay.com/templater/content/concepts/time/time_sculpting.htm

 

More specifically you would want to read about the "Time Cropping" technique:

https://support.dataclay.com/templater/content/concepts/time/time_cropping.htm

Hope this helps!

 

 

 

 

Mathias Moehl
Community Expert
Community Expert
January 9, 2022

I hightly recommend Templater, too.

 

Another Ae features that you should be aware of is Responsive Design Time:

https://helpx.adobe.com/after-effects/using/responsive-design.html

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
OussK
Community Expert
Community Expert
January 9, 2022

You should create a script to do that