Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was trying to make a tool that reads and edits subtitles, I started by reading and editing .SRT files the most common and it was easy but when I cam to the next file type .SUB files which has the format of {Showtime}{Hidetime}Text(e.g {1234}1235}Hello) I was unable to find out what does the value of showtime or hide time mean I tried to figure out by watching the movie timing and ended up dividing it by 25 to get seconds, well it worked and I could also save it as .SRT and that file worked on the movie with perfect timing but when I tried that with another movie it didn't work as the constant this time was 22!
So now I'm really confused about it, is the number related to the movie record length or am I just misleading in how to read it?
Any help would be appreciated.
That's a piece from the code:

C#
string showtimeStr = blockStr.Substring(blockStr.IndexOf('{') + 1, blockStr.IndexOf('}') - 1);
showtime = TimeSpan.FromSeconds(Convert.ToDouble(showtimeStr.Trim()) / 25);
Posted
Updated 8-Jun-10 5:55am
v2
Comments
OriginalGriff 9-Jun-10 3:42am    
"Do you mean that this value presents the index of the frame that the sub will show/hide at?
If so then I think that I will need the video itself to read the file but a program like Jet Audio is able to preview the subtitle with time even without the record how come then" A very quick Google says that the numbers are definately fr4ame number references - which makes sense. You will either need the video file itself, or at a minimum the FPS the file was encoded at.

1 solution

Check against frame number - 25FPS is pretty normal.
 
Share this answer
 
Comments
Hesham_h4 8-Jun-10 19:24pm    
Do you mean that this value presents the index of the frame that the sub will show/hide at?
If so then I think that I will need the video itself to read the file but a program like Jet Audio is able to preview the subtitle with time even without the record how come then!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900