Subtitle Script?

jeremyk wrote on 7/26/2003, 5:09 PM
I'm faced with the prospect of editing several opera videos, each with about 450 subtitles.

This will be my first time using Vegas for this process. In the past I've used Cinestream. Cinestream lets you save a custom title in its effects set, so I would generate prototype one- and two-line titles. To insert the title, I'd drag the prototype to the timeline, open it, switch to my word processor, copy the title line (or 2 lines) from the current position of the file, switch back to Cinestream, select the title text, and paste in the new title info. After a few hundred times this gets old.

Could there be a script that would automate this? I was thinking maybe two scripts. The first would take a file of subtitles (separated by blank lines, since titles can be one or two lines) and build a sequence of subtitle events on a special video track. (Can scripts even read external files?) A second script could snag the next subtitle event from the track and put it in the timeline at the current position. I'd then be able to drag it to the proper length.

One mild complication is that the one- and two-line titles have slightly different vertical positions, so need different prototypes. If possible, it would be nice to be able to take text characteristics like font and italicization from the original text.

Can any of this be done? I've just started using Vegas, and I'm really excited about its power, but it'll be a long time before I know enough to answer this question.



jeremyk wrote on 7/26/2003, 7:11 PM
Oh, foo. Never mind.

After I posted this I found the Vegas Scripting FAQ, which says a script can't change the text in a text event.

Maybe someday, I hope.

SonyPJM wrote on 7/28/2003, 8:54 AM

True, the text data cannot be changed via script in 4.0x but I do
think a script can streamline your work quite a bit.

For example, a script could add a text event under the current
selection that is assigned one of several presets depending on the
number of lines in the next subtitle. The preset won't give you the
exact text you need but placement, color, font, etc. could be given
appropriate default values. The script could also put the appropriate
text (or even RTF) data on the clipboard so that it is ready to be
pasted easily. The script can read the subtitles from a plain text
file, XML file, or whatever... If you're using Word, it too is
scriptable so you might be able to work well with it.
johnmeyer wrote on 7/28/2003, 12:24 PM
I would think what you REALLY want is true subtitles in a DVD that can be turned on and off. If you use the substitle feature of the DVD spec, you could not only let the user turn the subtitles on and off, you could even provide subtitles in different languages.

Unfortunately, neither Vegas nor DVD Architect yet have this feature. Someday I'm sure they will. When they do, hopefully you will be able to take a single file that contains the script for the movie (or opera, play, etc.), and simply drop markers down as you play or scroll through the movie. Each marker would then attach itself to the next paragraph in the text (or bookmark or some other marker). Properly done, such a feature would let you subtitle even something as long as a Wagner opera!
jeremyk wrote on 7/28/2003, 6:50 PM
Well, yeah, of course you’re right. I eagerly await the day when Vegas and DVD Architect have this feature. I see you can do subtitles with ReelDVD, but (for one thing) it's out of my price range.

Meanwhile, I was hoping to streamline the on-screen subtitle process with a script. SonicPJM's suggestion sounds good, though. At some point when I have some free time to study up on Javascript and the Vegas (and Word, arrgh) APIs I may take a crack at it.
demister wrote on 8/1/2003, 9:02 AM
it is indeed a shame when Vegas has such brilliant support for closed captions that subtitles are such a pain.

It seems to me that a script could insert subtitle texts from a delimited file by inserting them into a text generator preset file - put the clip on the time line and then re-write the preset file for the next subtitle. You can do this in a text processor with Vegas running and it doesn't seem to care. Having got 450 subtitles on to the time line, you can then put down 450 markers by pressing the M key where you want the subs. In the edit details window copy the marker times and paste them on the subtitles. If you prepared the subtitles in a spreadsheet, you can give them names or numbers, calculate how long to display them from the character length and paste these values into the edit details as well! Even without the benefit that a script would bring, you can copy a blank, preformatted subtitle 450 times on the time line (but don't link them!) and then drag and drop text into them. Font and attributes like bold and italics drag with it. If your preset is justified centre bottom, a cr after single line texts mean they line up with double line ones.
If you are subtitling for DVD you could check out DVD junior at, it's a lot less than you'd expect. Good luck.
jeremyk wrote on 8/2/2003, 12:36 PM
Thanks for the suggestions!

I do think that DVD subtitles are the way to go, so I will look further into DVD Junior. Its current price is US$99, which is great if it works for me.

If it doesn't, I like the idea of making a bunch of subtitles in the timeline and setting their start times from markers. Unfortunately, dragging text onto text events doesn't seem to work -- I have to open up the event's Generated Media and then copy and paste from the word processor.
jeremyk wrote on 8/15/2003, 1:26 PM
FWIW, I was unable to get the free trial version of DVD Jr to work. Anyway, the user interface is actively hostile, the documentation is not actually written in English, though all the words are English words, and the subtitle capability is somewhat limited (must all be in the same font and style, so no discretionary italics). I decided not to risk $99 on the "real" version.

So I hope DVD Architect will add subtitling to its features soon. (One can always hope...)
colinbr wrote on 8/20/2003, 7:20 AM
Jeremy, have a look at the subtitling programs at Doom9

You will need to scroll down to the "subtitles" section.

There are lots of programs listed there for creating subtitle scripts which can be fed into various DVD authoring packages. Some of the programs are just for conversion, but AFAIR some will help you to create subtitles (although it has been a while since I looked at this). This would be done outside the NLE, but the subtitle file produced would be fed into a DVD authoring program along with your final video footage.

I found your post here while trying to find out what scripting support various NLEs have because I want to automatically import a subtitling file (with timstamps and text) into a titles track of an NLE.

Looks like it really isn't possible to do this in a NLE.