Forums › Adobe After Effects › Expression to use meta data from adobe encoder to make subtitles in After Effects
Expression to use meta data from adobe encoder to make subtitles in After Effects
Nick McIntyre
January 24, 2013 at 5:29 pmHey all – I am using the below expression to use meta data from some analyzed text in adobe media encoder to make subtitles for a video. It works perfectly by the way. The only problem I am having is this expression only has one line of text and I would like 2 lines so more text can be at the bottom of the video. This specific expression says to play 5 words at a time. I would prefer to have 2 lines with 5 words on each line. Does anyone know how to add a carriage return in to this script and make it 2 lines at a time (ie 10 words on screen)? Thanks in advance!
here is what the expression does: (one line of text)
https://dl.dropbox.com/u/8046/Screenshots/0y.pnghere is what I would like it to do: (two lines of text)
https://dl.dropbox.com/u/8046/Screenshots/0z.pnghere is the script:
L = thisComp.layer(“name of your video. extension”);
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 + ” “;
}
}
}
sNeed a video made? Check out my site at http://www.WeMakeVideos.net
Kevin Camp
January 24, 2013 at 5:39 pmi assume this is applied to a text layer in ae. if so, use paragraph text rather than point text.
in ae i don’t think there is a way to just convert point text to paragraph text like there is in photoshop, but if you create a new text layer with the text tool by clicking and dragging a rectangle it will create a text block (paragraph text) that will wrap when the text reaches the width of the box.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCWNick McIntyre
January 24, 2013 at 5:46 pmOMG! I have been searching all over for this answer. I though i tried that already, but evidentally I did not set my variable high enough for it to wrap. Thanks so much.
Need a video made? Check out my site at http://www.WeMakeVideos.net
Jamaal Jackson
April 25, 2013 at 2:02 amSo what exactly did you end up doing to get this to work?
Log in to reply.