-
Source Text Expression for Subtitles
Hello,
I found a tutorial on how to bring in the speech/text metadata from premier to AE and then assign an expression to display the text 5 words at a time.
The good news is that I got the script to work and work very well. The bad news is that the script will look for and display 5 words at a time. But there are pauses and music in between some scenes. I need to either add or adjust the script so that I can either have it look for some kind of end cap or notation so that it will, for example, show only 3 words. Stop displaying any text until it sees a second notation that tells it to start displaying it again.Any help would be appreciated! If not I will have to copy and paste the script for like 20 videos!
Here is a link to the tutorial – https://www.realeyes.com/blog/2010/03/05/caption/
And a copy of the script (adjusted for CS6 and per the instructions in the tutorial)
L = thisComp.layer(“Module1.mov”);
max = 9;
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 + ” “;
}
}
}
sThank you!
Jennifer Arani