Help - Search - Members - Calendar
Full Version: Making Subtitles Sync
Darkside_RG > Technical Discussions > Guides/How To > Video
greatbigdragon
I wrote this tutorial today as I refitted subtitles I downloaded to a DivX file I have of Superman: The Movie. I really like subtitles because I sometimes have trouble understanding what people in movies are saying - sometimes they speak too low, or sometimes what they say or how they say it is difficult to understand. I find a majority of people do not want to read and watch a movie at the same time, but I do it automatically. So for those of you who like to have subtitles, you may notice that having a media player such as Media Player Classic (MPC) to play your AVI files is handy, because you can load a subtitle file anytime you want. If your girlfriend doesn't like subtitles, you don't have to see them (the subtitles, I mean.)

I download a great deal of my subtitles from http://www.opensubtitles.org because they have most of what I'm looking for. If not, I Google for alternate sites from which I may download my subs. The coolest thing about opensubtitles.org, though, is you may even find the subtitles for the exact torrent you just downloaded - especially with aXXo releases. Bonus!

So, you found subs for your movie, you started MPC, loaded your subtitle... but something is wrong, isn't it? These are the two possible sync problems you may have with downloaded subtitles:

Problem 1 - You may have subtitles which start too early, or not early enough. This is a problem where the subtitles are out of sync for the same amount of time, throughout the movie, and is very easily fixed.

Problem 2 - You may have subtitles that get worse as the movie progresses. At first, they're a second or two off, but by the end of the movie, the subtitles are off by a few minutes or more. This takes a little more effort, but is just as easy when you follow the steps I have documented below.

If you find you have a combination of the two problems, you must address problem 2 first, to make sure everything goes right.

Subtitles come in a few different formats, I like to use .SRT files because they are plain text files, and therefore the syncing process is a little easier when converting the framerate of a subtitle file. Opensubtitles.org has mostly, if not only, .SRT files - and MPC uses this format as well.

Fixing problem 1

This problem is caused by the initial delay of the subtitles. The timing of the subtitles (a function of the framerate, which is the same thing as the framerate in the video file) is correct, but the initial delay (the time the first subtitle shows) is off, and so they are all off.

Using SubtitleCreator (see problem 2), you can load your subtitle file, go to the synchronize menu, and choose "set time delay (+/-)." A tiny window pops up with the number "+00:00:00,000." It goes, "hours:minutes:seconds,milliseconds". DO NOT USE YOUR MOUSE HERE, it only makes this harder.

Use the left and right arrow key to navigate from the plus/minus symbol on the left to the millisecond on the right and set each character by pressing the appropriate number key. For example, if you need to set the initial delay so that the subtitle starts twelve seconds earlier, make the number say, "-00:00:12,000". If all goes well, then you're all set. If you find the subtitles go out of sync later in the movie, undo this and try using the method under Problem 2 before coming back to this.

Fixing problem 2

The examples used here are from Superman - the Movie. The software used, all of it freely available at www.free-codecs.com, is as follows:

Media Player Classic - part of the K-Lite Codec Pack, or available to download by itself; it's an awesome player.

AVICodec - Tells you stuff about your .AVI files, including DivX and XviD and whatnot. If you use a different codec, then find an appropriate codec appliance which will provide you with an accurate framerate

SubtitleCreator - Lets you create and change subtitle files.

I also use Notepad and Calculator, which come with Windows. If you use a different OS, you probably know what to use instead of these.

We calculate our values from the last spoken line of the movie because it will yield the most accurate values for our calculations

Open the .SRT file in Notepad. Go to the end of the file and find the time of the last line. Calculate the time in seconds (I use Windows Calculator for this.) Example, if it's 02:17:55,240 then you get 8244 seconds (ignore milliseconds.) One handy thing to remember is that an hour = 3600 seconds (60 times 60.) This is value S1, the time at which the subtitle would appear.

Find the same line in the video (by watching it, and forwarding to the end.) In this case, the actual time that the line is spoken (remember, this is the last line in the movie) is 02:23:16, or 8596 seconds. This is value S2, the time at which the subtitle SHOULD appear.

Divide S2 by S1, like this:

S2/S1 = CR (Conversion Rate)

8596/8244 = 1.0426977

Round CR to the fourth decimal place:

CR = 1.0427

Use AVICodec to find the framerate of the video file (you load a file using the "select" button.) In this example, it shows 23.977 fps. This is FR2, the framerate to which you will convert the subtitles (unfortunately, the given fps value is between 23.976 and 23.978, which are both commonly used framerates - 23.977 is not, so it's probably averaged, or something. If one doesn't work, the other should.)

FR2 = 23.977 fps

Now for the killer math - we need FR1 - the framerate to convert from, aka the original framerate used to encode the subtitles:

FR2 * CR = FR1

23.977 * 1.0427 = 25.000817

Again, round it - to a commonly used framerate. In this example, 25 fps; I find a lot of subs which are encoded at this rate, but not so many video files. Commonly used framerates are in the drop-down lists in the framerate conversion tool in SubtitleCreator, if you need to reference them. So,

FR1 = 25 fps

Remember the unfortunate part about FR2 ? Now we try to get it right the first time - a little more killer math to use here:

FR1 / CR = FR2

25 / 1.0427 = 23.976215 fps

When we round this new FR2 to the nearest thousandth (3 decimal places,) we get a commonly used framerate - 23.976 fps.

So, we will convert the subtitles from 25 fps to 23.976 fps, and see what happens.

1. Open subtitle creator
2. Go to the file menu and load the subtitle file.
3. Under the synchronize menu, select "convert framerate"
4. Select the proper framerate in each drop-down box. In this example, it
will say 25 on the left, and 23.976 on the right. Hit "apply."
5. Under the file menu, choose "Save SRT As..." and save your work as a new file.
6. Test the new subtitle file using Media Player Classic or whatever you
like. The subtitles should be in sync throughout the entire movie,
from beginning to end. If it's all good, delete the original
subtitles and pat yourself on the back, but don't break your mousing
arm doing it.


The original text for this Problem 2 method is attached to this post, if you want it for reference.

Remember: if you find you are driving yourself crazy trying to sync subtitles because you're as stubborn as I am, the easiest thing you can do is DOWNLOAD A DIFFERENT SUBTITLE FILE AND START FROM SCRATCH.

- greatbigdragon
833P
Subtitle Workshop is the easiest way I have found to manipulate srt or sub files. It will highlight all the errors in a subtitle file and automatically correct them. If your subtitle and avi file are in the same derectory it will play them together, makes timings much easier to adjust. You can download it from urusoft.net
motom
It works prefectly. thanks so much for your guide!!!!! it helped me fix this bloody subtitle
thanks again devileek.gif
archer112575
thanx for d info bro. it really helps. but can you help me with my problem? i want 2 use my laptop 2 have videoke software i can use. I want 2 use my laptop the same way i use videoke machine where i can sing along and also use mic. Please help me. thanx
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.