VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Dec 2008
    Location
    Ireland
    Search Comp PM
    Hello everybody
    I'm creating a small software for editing subtitles.
    I managed to load and shift the time from a srt file but I'm having troubles for what regards .sub files (the text one).

    For example:
    A srt file looks like this :

    Code:
    1
    00:01:13,020 --> 00:01:17,810
    3 billion human lives
    ended on August 29th, 1 997.
    
    2
    00:01:18,260 --> 00:01:23,015
    The survivors of the nuclear fire
    called the war Judgment Day.
    
    3
    00:01:23,460 --> 00:01:26,372
    They lived only
    to face a new nightmare,
    
    4
    00:01:26,660 --> 00:01:28,730
    the war against the machines.
    So it's easy understandable what you need to change when adjusting the time.

    But a .sub file looks like this:

    Code:
    {1895}{2008}Three billion human lives ended|on August 29, 1997.
    {2039}{2098}The survivors of the nuclear fire...
    {2099}{2168}called the war '"Judgment Day. '"
    {2169}{2248}They lived only to face|a new nightmare--
    {2249}{2300}the war against the machines.
    What does the numbers at the beginning of the sentence stand for? How could I translate them in normal time format?

    Thanks
    Quote Quote  
  2. Banned
    Join Date
    Jun 2007
    Location
    UNREACHABLE
    Search Comp PM
    Hi there.

    MicroDVD .sub files are based on framecounting and framerate.
    BTW, the very first line of a good .sub file does say what is the intended playback framerate.
    Quote Quote  
  3. Member
    Join Date
    Dec 2008
    Location
    Ireland
    Search Comp PM
    Originally Posted by Midzuki
    Hi there.

    MicroDVD .sub files are based on framecounting and framerate.
    BTW, the very first line of a good .sub file does say what is the intended playback framerate.
    Thank you for the reply mate
    Is there any way to convert it into datetime? For example with VobSub you can save a .sub into .srt would you know how this software is capable to calculate the framerate and convert it into time?
    Quote Quote  
  4. The problem is: You cannot calculate the framerate. As Midzuki already mentioned, this info is usually in the header line of a sub file. If you don't know the framerate, you have to guess. For a 'european' movie it is very likely 25 fps (PAL standard). For US material (NTSC) it is more complicated. It can be 29.97 or 23.976 fps. In addition there is the complexity of drop frame/non drop frame timecodes (I don't know which one is used by .srt files). For unknown material there is no other possibility than to test (calculate a few timecodes from the end of the movie and check if the position fits to the video/audio).
    Once you know the framerate the timecodes can be easily calculated.
    Example:
    {1895}{2008}Three billion human lives ended|on August 29, 1997.

    Assuming 25 fps the timecode is:
    1895/25=75.8 seconds=1 minute, 15 seconds and 800 msec
    or: 00:01:15,800
    2008/25=80,32 seconds=1 minute, 20 seconds and 320 msec
    or: 00:00:20,320
    As you see, the results are near your .srt example, but not exact:

    1
    00:01:13,020 --> 00:01:17,810
    3 billion human lives
    ended on August 29th, 1 997.
    Quote Quote  
  5. Member
    Join Date
    Dec 2008
    Location
    Ireland
    Search Comp PM
    Originally Posted by borax
    The problem is: You cannot calculate the framerate. As Midzuki already mentioned, this info is usually in the header line of a sub file. If you don't know the framerate, you have to guess. For a 'european' movie it is very likely 25 fps (PAL standard). For US material (NTSC) it is more complicated. It can be 29.97 or 23.976 fps. In addition there is the complexity of drop frame/non drop frame timecodes (I don't know which one is used by .srt files). For unknown material there is no other possibility than to test (calculate a few timecodes from the end of the movie and check if the position fits to the video/audio).
    Once you know the framerate the timecodes can be easily calculated.
    Example:
    {1895}{2008}Three billion human lives ended|on August 29, 1997.

    Assuming 25 fps the timecode is:
    1895/25=75.8 seconds=1 minute, 15 seconds and 800 msec
    or: 00:01:15,800
    2008/25=80,32 seconds=1 minute, 20 seconds and 320 msec
    or: 00:00:20,320
    As you see, the results are near your .srt example, but not exact:

    1
    00:01:13,020 --> 00:01:17,810
    3 billion human lives
    ended on August 29th, 1 997.
    Spot on you my dear friend
    Your reply was very usefull
    Quote Quote  
  6. Your welcome! I've just seen that I made some typing mistakes (00:00:20,320 instead of 00:01:20,320), but I think you got the idea nevertheless
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!