﻿
-----------
HELP / INFO
-----------

"srtshift" is a command-line tool used to adjust the subtitles of .srt file to a specific movie file by increasing or decreasing the time stamps of this file.
"srtrate" is the same kind of tool, but it adjusts the subtitles depending on a given frame rate.
"udvdshift" is the same as srtshift for MicroDVD files (.sub files).
"udvd2srt" converts MicroDVD subtitles into SubRip format

Those tools are useful, for instance, if a subtitles file you've got in your language doesn't match the video stream.
You just have to adjust the whole content of the file step by step using those tools until it matches exactly the movie.

Type the name of the binary without any parameter to get help.
Official web page : http://sourceforge.net/projects/subtools/



--------------
NOTES ON USAGE
--------------

Standard input and output support is included only for batching convenience ; it's not really usefull in interactive command-line mode.
The advantage of using stdin and stdout is the ability to chain commands to make several operations on the same command line.
One could for instance call :

	srtrate 25 23.976 "rw.srt" | srtshift -00:00:13,000 - > "Hotel Rwanda_en.srt"

It is NOT recommended to redirect the standard output to the source file (e.g. "adjustsrt a.srt > a.srt") : the result is undefined.
If you really want to alter the source file, use the same node for source and destination file (e.g. "adjustsrt matrix.srt matrix.srt").

srtshift
--------

Beware to keep every time stamp between the limits.
No time stamp will be decreased under "00:00:00,000" nor increased over "99:59:59,999".
If one or more time stamps have reached the limits, that means that they have been blocked by the program.
You cannot retrieve the old value, so keep the original file safe by never writing over it.
If you see that a time stamp has the minimum value in the generated file, it may be because additional informations were inserted at the very beginning of the file (like the author's name for instance); you will have to correct this by hand.
If you see that a time stamp has the maximum value, it's likely that you gave a wrong "time stamp" parameter to the program (most movies are less than 99 hours long ;).

srtrate
-------

Use a lower destination frame rate if the subtitles are earlier and earlier during the movie, and a higher one if they're becoming late.
If you don't know the original frame rate of the subtitles files (which is the usual case), you can test the following common frame rates : 23.976, 25.0, 29.976.



-----
FILES
-----

CHANGELOG.TXT : changes corresponding to major updates
LICENSE.TXT   : what kind of license for this tool (a reminder is written on the top of main source file(s))
Makefile      : basic Makefile provided for unices (everybody can do that, but it's quicker to have it already written)
README.TXT    : this file
setup.py      : script for building .exe versions of the Python scripts
TODO.TXT      : reminder for developers
subtools.c    : C source for srtrate, srtshift
udvdshift.py  : udvdshift Python script
udvd2srt.py   : Python script to convert MicroDVD files to SubRipper ones


---------------------
BUILDING / INSTALLING
---------------------

There's only one source file for both srtrate and srtshift executables.
You have to flag the compiler with one of the following defines to make one or the other tool :
	SRTSHIFT
	SRTRATE
The Makefile already contains the right compilation commands.


Unices (should work for most of them)
-------------------------------------

Assuming unix users are more experienced than windows ones ;), they'll have to convert themselves the files from the windows format to the unix one (CR/LF).
This can be achieved by typing	something like:

	tr -d "\r" < dosfile > unixfile.

Actually most of the modern editing applications get rid of this insignificant matter.

The Makefile is here mainly for a comprehension matter but is really not a requirement.
It contains the common targets : "all" "install" "clean" "distclean".
Just try "make" and look into the "/dist/" directory.


Windows
-------

Depends on what compiler you use.

With Visual C++, just create a new "Win32 Console App" and add subtools.c as the only source file.
Or you can just type "cl subtools.c" in a DOS box (recommended), with the correct flags.

With djgcc & cygwin just do as for Unix (and you can read the manual), but don't forget to put the cygwin1.dll library in your PATH.

Anyway, you should find a ready-to-use .exe version of each program in the "/dist/" directory.


Python programs on Windows (udvd2srt.exe and udvdshift.exe)
-----------------------------------------------------------

This chapter applies if you don't have Python installed on your computer.
If you have Python already installed, you can run directly the .py scripts so you don't need to use the .exe versions of the programs.

If you choose to use the .exe versions of the Python programs (namely udvd2srt.exe and udvdshift.exe), you will need to have all provided libraries in the same directory (or in a directory already in the PATH environment variable) in order to run them :

    MSVCRT71.dll - A system library ; you might have it already on your system
    python25.dll - The Python interpreter
    w9xpopen.exe - This is needed on Win9x platform

Make sure you also have the following files on your local Windows installation :

    ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
    USER32.dll - C:\WINDOWS\system32\USER32.dll
    SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
    KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll

Since those files are part of the operating system, you are not likely to miss them.

You can also check http://www.python.org/doc/faq/windows/#how-do-i-run-a-python-program-under-windows to know more about running Python programs under Windows.

If you wish to install Python on Windows, let me recommend you the following good free products :

	http://python.org/download/
	http://www.activestate.com/Products/activepython/index.mhtml

---------
REPORTING
---------

Any comment is welcome to cbonar@users.sf.net, especially for improvements and bugs.



----------------
SOME NICE QUOTES
----------------

"Never trust a software you don't have the source for."
"It was written on the box : requires Windows95, NT or better ; so I bought Linux."
From CVS book "hacking away like there's no tomorrow" , "to code as one possessed by spirits" ... LOL
