Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions scale diff size media to a constant value

  • scale diff size media to a constant value

    Posted by Antony Dupsta on September 11, 2015 at 12:03 am

    Howdy,

    Just curious if someone, (Dan) can point me to a solution for scaling footage to a fixed size.

    I have 6k, 4k, HD, footage… My current script scales footage to 25% of it original.
    .property (“Scale”).setValue([25,25]);

    The problem here is this is a ratio rather than a fixed size.
    So the result of the Poster image varies. 25% of the original.

    Can you suggest a way to set the resolution to a fixed Resolution. Something like 720×407. The constant is the aspect ratio, as it will always be 1.1:78 16×9.

    So any size footage (assuming 1:78) will scale to a fixed 720×407.

    Thanks for you help! Hope I explained that OK?

    Antony Dupsta replied 10 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 11, 2015 at 2:43 am

    It might be as simple as something like this:

    var s = (720/myLayer.width)*100;
    myLayer.property(“Scale”).setValue([s,s]);

    Dan

  • Antony Dupsta

    September 11, 2015 at 3:14 am

    It is pretty cool you can do that…

    This works perfect and I like how you only set the width property to a value. This way I guess it does not matter what the aspect ratio is, this will maintain it with out squeezing it. Thanks!

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