Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to get AV Layer’s duration using script?

  • How to get AV Layer’s duration using script?

    Posted by Renata Klimiato on May 15, 2016 at 2:02 pm

    I have a layer in my comp, which is a video file and I need to get it’s duration using script. Can anyone help me? myComp.duration shows me duration of comp, however myComp.layer(2).duration isn’t working…

    Xavier Gomez replied 10 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Xavier Gomez

    May 15, 2016 at 7:13 pm

    Layers don’t have a duration attribute. Only AVItems do (things in the project panel).
    You can get the duration of the layer itself from its inPoint and outPoint, or the duration of its source by: layer.source.duration (not all layers have a source though).

    Xavier

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy