Quantcast
Channel: Adobe Community : Popular Discussions - After Effects Expressions
Viewing all articles
Browse latest Browse all 47983

Subtitle Expression

$
0
0

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


Viewing all articles
Browse latest Browse all 47983

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>