Page 1 of 1

Black box under subtitle

Posted: February 19th, 2008, 7:02 am
by Skydance
I'm changing the subtitles in a movie from Polish to English. The white letters often get lost when there is a white spot in the background. I'm going through each frame and adding a black box under the type and this is getting really boring. I'm using the text toll in AE. Could someone please help by writing a script that would do this for me? :)
Mabe there is another way and I don't know about it yet? Thanks for your time!

Re: Black box under subtitle

Posted: February 19th, 2008, 11:58 am
by Atomic
You could just add a drop shadow and blur it out quite a bit. Set its opacity to near 100% or whatever looks good.

If you are running CS3, you could use the new sample image function to detect the white space and adjust the drop shadow opacity automatically.

Re: Black box under subtitle

Posted: February 19th, 2008, 10:47 pm
by lloydalvarez
Here's a script I wrote quickly for a very similar task. The script is not really optimized at the moment as it scans every frame and sets keyframes at every frame, but it works. When I have some more time, I'll optimize it to only set keyframes where there's other keyframes.

-Lloyd

Code: Select all

//TextBackgroundBoxCreator
//©2008 Lloyd Alvarez http://aescripts.com
//
//to run this script, set your text on one text layer, switching the text using keyframes on the Source Text property.
//create a solid that is 1000x1000 with square pixel PAR, position it below the text layer and select both the text
// layer and the solid before running the script.
//
//



var error = "To run this script you must select both a 1000x1000 pixel solid and a text layer above it";

var myComp = app.project.activeItem;
var theLayer = myComp.selectedLayers;


if (theLayer.length != 2) {alert(error)}
else
{

var myWorkAreaInFrames = myComp.workAreaDuration * myComp.frameRate;
var myWorkAreaStartInFrames = myComp.workAreaStart * myComp.frameRate;

for (i=1; i < myWorkAreaInFrames; i++) {
var myTime= ((myWorkAreaStartInFrames-1) + i) / myComp.frameRate;

var boundsObject = theLayer[0].sourceRectAtTime(myTime, true);
//alert(boundsObject.width);

var myWidth = (boundsObject.width/10);
var myHeight = (boundsObject.height/10);
theLayer[1].anchorPoint.setValue([0,0]);
theLayer[1].scale.setValueAtTime(myTime,[myWidth,myHeight]);


writeLn("Processing frame " + i + " out of " + Math.round(myWorkAreaInFrames)); //write the progress to the info window
clearOutput(); //clear the line after it's written
}//close for loop

}

Re: Black box under subtitle

Posted: February 29th, 2008, 5:39 am
by Skydance
thx so much lloydalvarez :D