0

I need a professional advice for self-assessing among students. I am searching for a tool (script or scripts) that helps annotating very long videos in After Effects. I also would like to automate the process without repeating myself.

I have long speeches (narrations) of students with subtitles. Subtitles are edited in Subtitle Edit. In Subtitle Edit at the beginning of some words or sentences I add symbols like [#] or [$]. After importing video and subtitles (pt_ImportSubtitles) with added [#] and [$] symbols I would like a specific lower third (simple text annotation or feedback) to be automatically activated (appeared on screen) (for 3 sec) for each imported word or group of words (marker or timestamp) with specific symbols.

Let us say that I have two lower thirds. First lower third is associated with words starting with а [#] (valid argument ) symbol and other set of words are associated with any words starting with [$] (invalid argument).

Examples [#] Moscow is the capital of Russian Federation [$] Moscow is not a capital of Russian Federation

ScreenShot of Subtitle Edit

If [#] is repeated 30 times then the firt lower third must also be appeared 30 time. Same logic is for [$] symbol.

Texts for lower thirds preferably must be stored outside of AE in a spreadsheet for example (Text2Spreadsheet)

Please let me know if a tool (script or a set of scripts) that I am searching is indeed exists or not. If not. How can I do it manually with scripts that I mentioned above ? Thank you all

3
  • This can be done with scripting, but I doubt there's already a script that does what I think you want. Why not separate the subtitle process and the lower third process, it would make it much simpler.
    – stib
    Commented Sep 16, 2017 at 13:54
  • Lower thirds are completely speared from imported subtitles (timestamps) I just use subtitles timestamps (markers) to trigger lower thirds to be appeared when it is needed.
    – Question
    Commented Sep 16, 2017 at 18:49
  • Sorry. Not all subtitles timestamps but subtitles containing symbols like: # and & only. In the beginning of certain subtitles.
    – Question
    Commented Sep 16, 2017 at 19:07

2 Answers 2

0

As I've written on my blog, you can use the function evalFile to load the contents of an external file as data or executable code.

So if you have a file called titles.txt that looks like this

var titles={
    {startTime:1.23, endTime:2.23, textContent:"this is the first subtitle"},
    {timestamp:2.34, endTime:3.45, textContent:"this is the second subtitle"},
    {timestamp:4.56, endTime:5.55, textContent:"and so on…"}
}

…you can evaluate it as part of the source of the expression, so that the titles array is now available to the expression.

So you could do something like this with the source text property of a text layer:

try{
    myPath = “/path/to/my/titles.txt”; //obviously the path to the file
    $.evalFile(myPath);
    for (var i=0; i < titles.length; i++){
       if (time > titles[i].startTime && time < titles[i].endTime){
           titles[i].textContent;
       } else { ""; } //blank text
 }catch(err){
 “ERROR”;
} 

What that does is:

  • load up the subtitles file,
  • scan through the titles and look at each one to see if the current time is between its start and end points
  • if the time is right for the subtitle to display then it sets the source text to the subtitle content, if not sets it to a blank string.

Other layers could use the startTime and endTime variables to drive other properties such as opacity or anything else you can animate.

If your subtitle time stamps are represented as smpte timecode you'll have to add a converter to the expression. There's one here.

You can use a capable text editor (notepad++, atom, sublime text, vim etc) to reformat the subtitles file, or you could use JS text processing tools (eg. regex, string.split, string.replace etc) in the script to parse the subtitles file. I'd recommend against the latter, they're going to be a lot slower. Remember that the expression is evaluated every time the frame is rendered, which includes reading the subtitles file from disk. If you have motion blur on, that could mean dozens of times each frame.

2
  • Thank you for your help. I just wanted to make several lower thirds and apply them over (30 or 50) stamps which strings starts by [#] (symbol associated with first lower third) and then I apply second lower third to all stamps which strings starting with [$] (symbol associated with second lower third). Please see screenshot above. In your code, I do not see how to do that (search for strings starting with [#] or [$]). I am wrong ? Sorry. As you see, English is not my first language.
    – Question
    Commented Sep 17, 2017 at 10:44
  • Just save out your subtitles as an srt or whatever, then using a text editor like the ones I mentioned (all free) reformat them so that they look like the example above. You can use find-and-replace and regular expressions. You could add code to the expression that looks for the symbol, javascript has lots of string processing tools, most of which work in expressions (though they're not documented), but you'd be better off doing it in a text editor.
    – stib
    Commented Sep 18, 2017 at 3:34
0

Check out Marker Remap at www.aescripts.com/marker-remap . It takes the principles you mention above and adds a powerful After Effects panel to control marker additions and timing. You won't be able to customize it to your tags, but I think it offers the functionality you're looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.