Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
napy84
Posts: 1
Joined: Mon Aug 02, 2010 11:18 am

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

Mon Aug 02, 2010 11:23 am

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?

richard.ozuna4
Posts: 2
Joined: Fri Aug 06, 2010 12:18 pm

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

Fri Aug 06, 2010 12:31 pm

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

ixquic
Posts: 73
Joined: Wed Aug 23, 2006 4:39 pm

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

Fri Aug 06, 2010 8:25 pm

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.

ixquic
Posts: 73
Joined: Wed Aug 23, 2006 4:39 pm

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

Fri Aug 13, 2010 6:16 pm

http://pastie.org/1090657
I cheated with the duration of the last subtitle. Didn't want to do any math.

Return to “General talk”

Who is online

Users browsing this forum: No registered users and 4 guests