ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to use meta data from adobe encoder to make subtitles in After Effects

COW Forums : Adobe After Effects

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Nick McIntyre
Expression to use meta data from adobe encoder to make subtitles in After Effects
on Jan 24, 2013 at 5:29:45 pm

Hey 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)
http://dl.dropbox.com/u/8046/Screenshots/0y.png

here is what I would like it to do: (two lines of text)
http://dl.dropbox.com/u/8046/Screenshots/0z.png

here 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 + " ";
}
}
}
s

Need a video made? Check out my site at http://www.WeMakeVideos.net


Posts IndexRead Thread 


Current Message Thread:





© 2020 CreativeCOW.net All Rights Reserved
[TOP]