Page 1 of 1

How to generate a subtitle form a text file as it...

Posted: Mon Aug 02, 2010 11:23 am
by napy84
Hi! How can I generate a sub from a text file as it:

Code: Select all

00:00 (Music playing.) 00:03 Hi! I am Joe Marini. 00:05 I would like to welcome you to jQuery Essential Training. 00:07 In this course, I'll show how to use jQuery, a free JavaScript Library, to 00:11 dramatically reduce the amount of code that you to write in order to build web 00:15 pages that are modern responsive and automatically work across browsers. 00:19 You'll see how jQuery can be used to extract information from web pages using a 00:24 variety of simple CSS like statements. 00:26 We'll explore how jQuery makes the creation of content manipulation and event 00:31 handling code work across browsers. 00:33 I'll show you how to use jQuery to provide advanced user interface elements 00:36 to your website users, and build smooth effects that used to require plug-ins to accomplish. 00:40 Whether you are new to writing JavaScript code or a grizzled veteran web 00:45 developer looking to improve your productivity and reduce browser specific code, 00:49 you'll find jQuery to be a great tool to create web pages that are 00:52 polished, professional, and engaging. 00:55 There is a reason they call jQuery the "write less, do more" library. 00:59 So if you are ready to take your websites to the next level of interactivity, 01:02 while dramatically reducing the amount of code you have to write in order to get there, 01:06 then let's get started with jQuery Essential Training.
Someone can help me?

Re: How to generate a subtitle form a text file as it...

Posted: Fri Aug 06, 2010 12:31 pm
by richard.ozuna4
There are so many application available for make a subtitle from text.I have suggest some application than you can made a subtitle from text...You can use VisualSubSync to create a srt file using the audio stream of your DVD.Then use SubtitleCreator to convert the srt to sup and add it to your DVD

Re: How to generate a subtitle form a text file as it...

Posted: Fri Aug 06, 2010 8:25 pm
by ixquic
That's a strange format. But you can convert it in a text editor (for example UltraEdit) using regular expression substitution:
substitute all

Code: Select all

^(\d+):(\d+) +
with

Code: Select all

0:\1:\2.000:
so that it looks like this:

Code: Select all

0:00:00.000:(Music playing.) 0:00:03.000:Hi! I am Joe Marini. ...
Then you have subtitles in "Simple Time Format" that you can import in a subtitles editor such as SubCreator and export as SRT. The SRT looks like this:

Code: Select all

1 00:00:00,000 --> 00:00:03,000 (Music playing.) 2 00:00:03,000 --> 00:00:05,000 Hi! I am Joe Marini. ...
Or actually, if you're interested in Javascript, why don't you try to write a little script for the job? It's not so hard.

Re: How to generate a subtitle form a text file as it...

Posted: Fri Aug 13, 2010 6:16 pm
by ixquic
http://pastie.org/1090657
I cheated with the duration of the last subtitle. Didn't want to do any math.