Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Automated Closed Caption Tweak?

  • Automated Closed Caption Tweak?

    Posted by Darryl Torke on February 20, 2015 at 12:19 am

    Hi, i’m using the code on this tutorial (pasted below). What it does is use the comments on the layer to display 5 words at a time for closed captions. This is great, however I have a monologue I’m trying to CC and there are many pauses – moments where the speaker is trying to take time – in her speech. The result of the expression below forces 5 words no matter what. So if the speaker says “Wait. (10 second pause) I’ve got something to say.” The CC will say “Wait. I’ve got something to” – “say”. Ideally, I’d like “Wait” to be on it’s own line and actually wait for the next line before showing up. Even if I have to do something manually I don’t mind, but currently it’s a real pain tricking it into breaking up pauses. Can anyone think of a tweak to this expression so I could modify it slightly?

    L = thisComp.layer("text");
    max = 5; // number of words to display
    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){
    base = Math.floor((n-1)/max)*max + 1;
    for (i = base; i < base + max; i++){
    if (i <= L.marker.numKeys){
    s += L.marker.key(i).comment + " ";
    }
    }
    }
    s

    Dan Ebberts replied 11 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 20, 2015 at 2:44 am

    That expression was just intended as a quick and simple demonstration for importing metadata from the speech transcription function of Premiere. I suppose you could create a script that would search for delays over a certain duration and create some extra markers with blank comments (or you could add them manually).

    Dan

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