Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Subtitle Expression

  • Subtitle Expression

    Posted by Luke Wilkins on April 14, 2014 at 1:27 pm

    Hi

    First post!

    I have created subtitles on a corporate video using the Metadata created from premiere.

    Its working well with the expression:

    L = thisComp.layer(“Thatcham_Corporate_Video WITH SCRIPT.wmv”);

    max = 7;

    gap = 2;

    n = 0;

    if (L.marker.numKeys > 0) {

    n = L.marker.nearestKey(time).index;

    if (L.marker.key(n).time > time) n–;

    }

    s = ” “;

    if (n> 0){

    if (time – L.marker.key(n).time < gap){

    curT = L.marker.key(n).time;

    i = n-1;

    while(i > 0){

    newT = L.marker.key(i).time;

    if (curT – newT > gap) break;

    curT = newT;

    i–;

    }

    i++;

    base = n – (n-i)%max;

    curT = L.marker.key(base).time;

    for (j = base; j < base+max; j++){

    if (j <= L.marker.numKeys){

    if (L.marker.key(j).time – curT > gap)break;

    s += L.marker.key(j).comment + ” “;

    curT = L.marker.key(j).time;

    }

    }

    }

    }

    s

    But I need it to end the line on a full stop as it looks strange starting with ‘difference. now we can…’

    anyone done this before?

    Luke

    Doyle Lewis replied 12 years, 4 months ago 4 Members · 3 Replies
  • 3 Replies
  • Roland R. kahlenberg

    April 15, 2014 at 3:39 am

    Luke, try posting in the COW’s AE Expression Forum –
    https://forums.creativecow.net/adobe_after_effects_expressions

    HTH
    RoRK
    Latest AE Workshop – MoGraph Intensity – Shapes & Text

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations

    Adobe After Effects CC ACE/ACI
    Imagineer Systems (mocha) Certified Instructor

  • Rebecca Metcalf

    April 21, 2014 at 2:59 am

    good idea!

  • Doyle Lewis

    April 21, 2014 at 8:51 pm

    First of all very neat Expression. I like it! Secondly to do what you are talking about automatically I am pretty sure you would need a script that was able to measure pixel distance because AE has no easy way (that I know of) to know how long across text is. My suggestion is to go into the comments that you have on the markers and break the subtitle up manually with the return key, or am I miss understanding the issue you are running into?

    Doyle Lewis, Assistant Videographer

    thinkck.com

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