GUIDE FOR GETTING YOUR SUBTITLES SYNCHRONE TO YOUR MOVIES

by fr0do 01/26/2001

You have downloaded some subtitles from the WWW and then discovered they are far but working synchrone to your movie or you can't even use the format for you AVI-Video player at all.
So this is a guide to fix those seemingly total screwed up subtitles but it can be also used for subtitles you ripped yourself and discovered that they are for what ever reason not synchron to your movie.

First a word on the software to use: There are basicaly only two programs available to give you full control of your subtitles: SubAdjuster (v1.41) by Frodo and SubAdjust (v1.55) by Psyche.

As I have written the SubAdjuster tool myself I will use this as the default tool but of course you can use also SubAdjust 1.51 for for the same job to do but the routines will still be the same.

>> Read more about
SUBTITLE RIPPING

1. Step: Convert to the required format

So you have a Subtitle-file but you don't know which format it is? Basically there are 5 main formats to be found (forgive me if your favorate is not included in this list ;-) :


My favorate one is MicroDVD because it's compact, powerful (even italic is possible) easy to manipulate and the MicroDVD player is the best one available for playing subtitles.

I will concentrate on MicroDVD with some hints for SubViewer because those are the most used ones.

How to identify which format you've got (please see examples)? Normaly you cannot trust that the files are correctly declared so have a look into them yourself:

MicroDVD*.*A compact textfile with start- and endframes in brackets {} in the beginnig of every line. Linebreakes are marked by |
SubViewer*.SUBSome information in the beginning about the movie. Start and end times given for each subtitle
SubViewer 2.0*.SUBDifference to the old SubViewer format is that the whole subtitle is written into one line and the linebrakes are marked with [br]
SubRip*.SRTA running number, end- and startime down to milliseconds given for each subtitle.
SubStationAlpha*.SSAFormated textfile with every subtitleline starting with 'Dialogue'
Sami*.SMIRare HTML-format with startframes given for each subtitle

Now try to find out what the actual framerate of your movie is about:
You can use VirtualDub (in the AVI-info option, very accurate), SubAdjust (accurate) or the media player (in the preference menu choose video rendering, less accurate) for it.
Let's assume from now on that the framerate OF YOUR MOVIE is 25 fps.

Converting the subtitle file to MicroDVD format:
To convert from SubViewer format you can run SubAdjuster by the command

SUB <your file> <new file> -R25 -CONV

Parameter -R specifies the framerate of your AVI-movie and it's VERY important to take the correct value here otherwise you might have to do a lot of work to correcting it later on.

You can also use SubAdjust for converting from/to different formats if it's really required.

After having done this you should run

SUB <your new file> <new file> -FIX

to get rid of all those small ripping errors like spelling errors (I's instead of l's), space errors (spaces between characters) etc...

(BTW: You can use the batchfile FIX.BAT for doing the converting and fixing in only one step, e.g. command FIX <filename> <framerate> )

Now you've created a perfect (?) subtitle file in MicroDVD-format with the framerate of your movie.

2. Step: Fixing strongly screwed up subtitles

But what are you going to do when the subtitles you got are not in SubViewer or SubRip format but in MicroDVD format and the framerate was not the same like you have in your movie?
Somehow everything seems to be screwed up completely....

Basically you have two choices:

If you decide to use the second option, follow this steps:

  1. Open the subtitle file (in MicroDVD format) and have a look at the first subtitle (it doesn't have to be the first but it is most accurate that way).
    Note down the frame when it is appearing, for example:

  2. {1025}{1110}The Age of Gods was closing.|Eternity had come to an end.

    The startframe is 1025.

  3. Check the last subtitle in the file (again it doesn't have to be the last one...) and note down when it appears, e.g.
  4. {171740}{171842}Lay down your head upon my breast,|and go to sleep, my love.

    The frame is 171740.

  5. Now watch your movie until the exact moment the first subtitle SHOULD appear (of course it should be the same sentence as in the subtitle file).
    Note down the seconds as exact as possible, e.g. 120.5 seconds.

  6. Now watch the end of the movie where the last subtitle (again the same sentence as in the file) SHOULD appear.
    Note down the exact seconds, e.g. 91 minutes, 40 seconds = 5500 seconds.

  7. Check the exact framerate OF YOUR MOVIE. You can do it for example with the help of VirtualDUB. Just open an AVI-file and check the information in the file-menu.
    E.g. it will be a 25 fps PAL movie.


  8. Now you got everything to give the command:

    SUB <sourcefile> <newfile> -1F1025 -2F171740 -1T120.5 -2T5500 -R25 -SYNCH

    The parameters are:
    -1F the frame of the first subtitles in the file (here 1025)
    -2F the frame of the last subtitles in the file (here 171740)
    -1T the time in seconds when the first subtitles should appear in the movie (here 120.5)
    -2T the time in seconds when the last subtitles should appear (here 5500)
    -R   the exact framerate of the AVI-movie (here 25)

    This will produce subtitles which should now be synchronized to your movie.

If you still discover some slight desynchronizations then you can continue with the instructions given in step 8.

If there are still a lot of irregularities then it might be that your parametervalues where not correct. Try again to find the exact values.

But if you're sure that everything was given correctly but the subs are still screwed up in some places (sometimes more - sometimes less) then it means that your movie is not compatible to the subtitles because some scenes where deleted either from the movie or from the subs. In this case it is quite hard to correct them.
But it's not impossible: It means you have first to find the scenes which were deleted and cut them out of the originaly (not changed) subtitle file and repeat step 2. See also step 9 for some hints.

It can be also useful in this case to use the synchronization procedure from step 3 on as this way it is easier to find the scenes which where deleted.

3. Step: Converting the framerate manually (only if the subtitles are in MicroDVD format)

This is a bit of a tricky one because the framerate can not exactly be taken out from the MicroDVD format file so we have to make a estimation calculation and round it to the closest common used framerate.

A good estimation can be made in the following way:

Check the length of your movie, let's say it's approximately 102 minutes long and then subtract the time in the beginning before the first spoken words (usualy some 2 minutes) and for the captions in the end of the movie after the last spoken words (a good estimation is 5 minutes). So here we have estimated 102 - 2 - 5 = 95 minutes = 5700 seconds. (Of course if you like you can really check the time of the first and last spoken words to get an 99% correct value for the framerate).

Now check the subtitle file:

The first line (which should be the same as the spoken words) is e.g.

{1025}{1110}The Age of Gods was closing.|Eternity had come to an end.

And the last spoken line (not the one with copyright information or similar)

{171740}{171842}Lay down your head upon my breast,|and go to sleep, my love.

So the difference of the frames is 171740 - 1025 = 170715

Now we can calculate the approx framerate: 170715 frames / 5700 seconds = 29.95 fps

Okey this is close enough to NTSC framerate 29.97 so let's assume this was the one they used when creating the subtitles.
All you have to do now is to create a new file with the new framerate. Use SubAdjust with command:

SUB <old file> <new file> -O29.97 -N25

This will create a new file with a framerate of 25 what we want to have for our movie (parameter -N stands for New and parameter -O for Old framerate). Other common used framerates you can try are:

But remember: Maybe the framerate was already correct in the subtitlefile but only delayed - then it might be better not to touch it and leave it unchanged. For instance:
If you calculated a framerate of 30 but your movie has a framerate of 29.97 then you should try first if the framerate is already fine for your video. In this case try step 4 - 6 and see if you get everything's in synch already.

4. Step: Calculation how much the subtitles are delayed

Start your movie and wait for the first spoken words. Note down the time when those first subtitle should appear, let's say it's about 32 seconds.

Stop the movie and have a look at the subtitle. The first subtitle should be the same like the one you have heard spoken in the movie.
Have a look at the timestamp (if it's SubViewer format)

00:00:41.00,00:00:44.40
The Age of Gods was closing.[br]Eternity had come to an end.

Or the framenumber (if it is in MicroDVD format)

{1025}{1110}The Age of Gods was closing.|Eternity had come to an end.

In SubViewer format it is ease to see directly the delay because the format for every timestamp is

hours:minutes:seconds.centiseconds

So you can see directly in the example that the delay is aprox 9 seconds. In MicroDVD format you have to calculate the time from the framerate:

1025 frames divided by 25 (in our case) frames per second = 41 seconds.

5. Step: Move the first subtitle to the correct correct position

Now it's time to use the tools for shifting the subtitles. If you use the MicroDVD format you can give the command

SUB <your file> <new file> -S-9 -R25

what means you will shift the subtitles for minus 9 seconds (let the subtitles start 9 second earlier).
Or you can give the exact frames you want to shift (9 seconds * 25 fps = 225 frames):

SUB <your file> <new file> -225

If you use the SubViewer format then you can use the SubAdjust tool for shifting.

6. Step: Finetuning the first subtitle

Now it's time to start your movie and watching the SHIFTED subtitles. Go to the position where the first subtitle appears and check that it is correct now.
If it still isn't good enough (normaly it's never 100% perfect for the first try) then just slightly shift the subtitles again in the required direction (means use minus values if the subs are to late or positive values if the subs are to early).

For example move the subs for 10 more frames:

SUB <your file> <new file> -235

Repeat this finetuning until you are satisfied with the result.

7. Step: Tuning the framerate

Okey now the first subtitles are fine but as more as the movie goes on as more the subtitles will be out of synch again. What am I going to do now?

The reason for this is that the framerate of the movie is not exactly the same as the one for the subtitles.

So now you should jump to a position where the movie and the subtitles are about one second different (off course you could choose also any other delay which suits you). Note down the time when this happens.
Let's say about 15 minutes = 900 seconds.

Let's create a new file now:
In 900 seconds it is one second delayed so use values 900 as old framevalue and 901 (+1 second) as a new framevalue if the subtitles are coming to early or 899 (-1 second) if the subtitles are coming to late:

SUB <latest file> <new file> -O900 -N901

Okey, use your new created file and watch the movie with the subtitles again. This should be much better now but propably still not perfect, especially not in the end of the movie.
So let's finetune it a bit more.

8. Step: Finetuning, finetuning and finetuning again....

Now comes the boring part. You have to try and error in shifting the frames and recalculating the framerate until the result will satisfy you.

First thing to do is to check if the first subtitle appearing in the movie is still in synch. If this is not the case (it can happen if the recalculation of the framerate in step 7 is giving a big difference) then you have to repeat step 6 but this time taking your latest subtitle file created in step 7 and shifting the frames just slightly for instance 10 frames:

SUB <latest file> <new file> 10

Repeat this until you are happy with the outcome.

Second thing to do is to check again where the subtitles are out of synch for about one second. Let's say this time it's after around one hour = 3600 seconds and the subtitles are comming to late. So create a new file by command:

SUB <latest file> <new file> -O3600 -N3599

Then check again and tune it a bit more until you're satisfied (don't forget you can use also fractions of a second so maybe the new framevalue 3599.23 brings the best result....)

If you still didn't gave up at this point then start again with step 6 - finetuning the delay and then the framerate until you are satisfied at last or your forehead is smashing on the keyboard when you fall asleep...

But relax: At the worst it takes about 1/2 an hour to fix up the worst screwed up subtitles if you are a bit experienced in this method. But normaly it takes me under 10 minutes to fix a subtitle. Or if I have subs ripped myself, then after the conversion and fixing process there is nothing to do but sometimes correcting a delay (for example if there was a trailer in the beginning of the VOB-file wich was cutted away).

9. Step : The subtitles are suddenly out of synch

What happens: Suddenly after some time of perfect synchronisity my subtitles are completely out of synch or there are even more subtitles than I need?

The reason is that someone has cencored the movie for your market and cutted out some scenes. So either in the subtitles (ripped from a different movieversion than your videosource) or in your movie there were deleted some (or one) scenes (this happens once to me yet).

So try to find the exact time when this happens and note it down.
If it's the case that the subtitles are having more text then necessary (or there hasn't to be text but the subtitles are having a long break) than you can use the command (example for if there has been a cut of a scene after 35 minutes for 10 seconds in a 25 fps movie):

SUB <latest file> <new file> 52500 52750 -CUT

to cut out those text from the file. The first value (52500) is the start- frame (35 minutes * 60 seconds per minute * 25 fps) and the second value is the endframe (52500 frames + 10 seconds * 25 fps).

If it the case that you are missing some subtitles then there is of course no way to bring them back out of nothing but you can try to get the remaining subtitles into synch again.

The way to do it is to split the subtitle file exactly at the postion where the scene was cut out and then shifting up the second file until it's synchrone again (try to find out the delay of the subtitle to the next spoken words and then shift the subs for that delay).
After this you can merge the files together again.

EPILOG

When I wrote down this quick guide I noticed it looks like a lot of work to get perfect synchronized subtitles so you might wondering if it's really worth the trouble.
Of course it depends on how important are subtitles for you but in my opinion they add a great value to a movie. Even if you are in the lucky (?) position that the movie is dubbed from english to your mother-language (like mine) and you wouldn't have a need for subs, it can be very useful for learning a language better this way. And to be honest - did dubbing ever improved the quality of a movie? I thinks movies let down a lot if you don't watch them in the original language (assumed you language skills are not to bad of course).
And after all creating subtitles is not such a long process and gets faster and faster every time you do it (one reason is because SubRip is 'learning' new characters and the other reason is that you're gaining experince). So even if it might look to complicate on the first glance you should give it a try.

EXAMPLES OF THE DIFFERENT SUBTITLE FORMATS:

Only some typical first few lines are given.

MicroDVD:

{1025}{1110}The Age of Gods was closing.|Eternity had come to an end.
{1375}{1460}The heavens shook as the armies|of Falis, God of Light...

SubRip:

1 00:02:26,407 --> 00:02:31,356
Detta handlar om min storebrors
kriminella beteende och foersvinnade.

2 00:02:31,567 --> 00:02:37,164
Vi talar inte laengre om Wade. Det aer
som om han aldrig hade existerat.

SubViewer:

[INFORMATION]
[TITLE]xxxxxxxxxx
[AUTHOR]xxxxxxxx
[SOURCE]xxxxxxxxxxxxxxxx
[FILEPATH]
[DELAY]0
[COMMENT]
[END INFORMATION]
[SUBTITLE]
[COLF]&HFFFFFF,[STYLE]bd,[SIZE]18,[FONT]Arial
00:00:41.00,00:00:44.40
The Age of Gods was closing.
Eternity had come to an end.

00:00:55.00,00:00:58.40
The heavens shook as the armies
of Falis, God of Light...

SubViewer 2.0:

[INFORMATION]
[TITLE]xxxxxxxxxx
[AUTHOR]xxxxxxxxxx
[SOURCE]xxxxxxxxxx
[PRG]
[FILEPATH]
[DELAY]0
[CD TRACK]0
[COMMENT]
[END INFORMATION]
[SUBTITLE]
[COLF]&H00FFFF,[STYLE]no,[SIZE]12,[FONT]Courier New
00:00:07.00,00:00:11.91
THERE IS A PLACE ON EARTH WHERE IT[br]IS STILL THE MORNING OF LIFE...

00:00:12.48,00:00:15.17
AND THE GREAT HERDS RUN FREE.[br]SO WHAT?!

SubStationAlpha:

[Script Info]
Title:
Original Script:
Original Translation:
Original Editing:
Original Timing:
Original Script Checking:
Synch Point:
Script Updated By:
Update Details:
ScriptType: v4.00
Collisions: Normal
PlayResY: 864
PlayDepth: 0
Timer: 100.0000

[V4 Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0

[Events]
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: Marked=0,0:02:32.85,0:02:34.33,*Default,1,0000,0000,0000,,Bio-readouts are all in the green. Looks like she's alive.

Sami:

<SAMI>
<HEAD>
<TITLE>Whatever</TITLE>
<STYLE TYPE="text/css">
<!--
P {margin-left:8pt; margin-right:8pt; margin-bottom:2pt; margin-top:2pt;
text-align:center; font-size:20pt; font-family:egal, sans-serif;
font-weight:normal; color:white;}
.KRCC {Name:Korean; lang:kr-KR; SAMIType:CC;}
#STDPrn {Name:Standard Print;}
#LargePrn {Name:Large Print; font-size:24pt;}
#SmallPrn {Name:Small Print; font-size:16pt;}
-->
</Style>
</HEAD>
<BODY>

<SYNC Start=30886><P Class=KRCC>
The Age of Gods was closing.
<SYNC Start=34037><P Class=KRCC>
The heavens shook as the armies of Falis,