Log in

View Full Version : What subtitle format is this?


tin3tin
7th August 2006, 09:58
If you know this subtitle format(syntax) - could you tell me whats it called?

0
00:00:00:00
00:00:00:08
TITLE

1
10:00:32:07
10:00:38:04
First subtitle.

2
10:00:38:07
10:00:45:19
<Next subtitle>

< and > will make the text italic.

leiming2006
12th August 2006, 11:24
You can try this program to make it "SRT".


;PureBasic4 Source Code
src.s="input the filename of this file here"
dst.s="input the filename you want to output"
OpenFile(1,src)
CreateFile(2,dst)
Repeat
WriteStringN(2,ReadString(1)+"0")
tmp.s=ReadString(1)
WriteString(2,Mid(tmp.s,1,8)+","+Mid(tmp.s,10,2)+" --> ")
tmp.s=ReadString(1)
WriteStringN(2,Mid(tmp.s,1,8)+","+Mid(tmp.s,10,2))
Repeat
tmp.s=ReadString(1)
WriteStringN(2,tmp.s)
Until Trim(tmp.s)=""
Until Eof(1)
CloseFile(1)
CloseFile(2)


I don't know what format is it. But if you just want to make it possible to display you can try this way.

tin3tin
13th August 2006, 00:19
Thanks leiming2006 for your help!

Unfortunately srt uses ',' instedad of ':' as the last separator and I really don't know how to change these?

In srt:
1
00:00:00,000 --> 00:00:02,000
first

2
10:00:32,000 --> 10:00:34,000
second

3
10:00:38,000 --> 10:00:40,000
third

And srt is not using frames as last number in the timecodes. But I guess that can be worked around by:

WriteStringN(2,ReadString(1))
WriteString(2,ReadString(1)+"0 --> ")
WriteStringN(2,ReadString(1)+"0")

But thanks again for your help! :)

Tin2tin

leiming2006
13th August 2006, 01:23
Would you like to try again?
The codes has been updated.
Using "mid" and "+" to replace the ":" with ",".

It's my mistake. I didn't notice the ":".

tin3tin
13th August 2006, 08:44
Thanks a lot! :) I've added the '0's and now it works.

PureBasic looks very nice. Never tried it before.

Thanks

Tin2tin