summaryrefslogblamecommitdiff
path: root/readme.txt
blob: c9f9a8522aa788e61462c869a5841eb5b6e16ecc (plain) (tree)





































































































































































                                                                            
microAdjust 2.76 (C)2000-2001 Gringo
====================================


1.Introduction
--------------
This program was mainly written for changing duration time of subtitles,
but now it has more useful features like changing framerate, changing
offset, cutting, splitting and joining of subtitle files. It can be used
to change several parameters of subtitles. Program can operate with
MicroDVD and SAM subtitles. Output subtitle can be only MicroDVD subtitle
format.

2.How does it work
------------------
First program loads subtitle file and if something goes wrong program
displays appropriate warning or error message. Next can be made
calculations. Diagram below shows the order of the calculations:

          ---------------     ----------     ------------------
Input -->|if Framerate of|-->|  Offset  |-->| Time calculations|--> Output
file     |   changing    |   | changing |   | t=a*sqrt(n)+b+c*n|    file
          ---------------     ----------     ------------------

It is very important that framerate changing is made at the beginning of
calculation process. All time calculations depends on framerate (input and
output if they differ) so you have to set it if you want to make any
calculations. Because of MicroDVD subtitle format it is recommended to set
at least input framerate for all microAdjust operations (output framerate
parameter will be equal to input framerate value).

3.Usage
-------
micro [<options>] <input file> <output file>
micro -j <time> [<options>] <input file1> <input file2> <output file>
a.out -g <language> <subtitle file> <video file> <output file>
or
micro -i <input file>

<input file> : input MicroDVD or SAM subtitle file which will be processed
<output file> : output MicroDVD subtitle file 

Options:
-if <framerate> : framerate of input subtitle file (default 25 frames/s)
-of <framerate> : framerate of output subtitle file (default same as
                  input framerate). All time calculations refer to this
		  value (not to input framerate).
-i<X> : Force input format of subtitle. <X> = 1:MicroDVD format,
        2: SAM format (default is autodetect each line)
-o<X> : Set output format of subtitle. <X> = 1: MicroDVD format,
        2: SAM format (default is same as input)
-o <offset> : offset of output subtitle in seconds (default 0s). This
	      option allows move subtitles forward or backward in
	      timescale (subtitles start earlier or later than original)
-t <a> <b> <c> : time ratios which calculate duration of each subtitle
		 with formula time[s]=a*sqrt(n) + b + c*n
		 where n is length of each subtitle in chars (default
		 values are a=0, b=3, c=0.05)
		 Option allows change duration time of each subtitle.
-n : Disable time calculations (switch -t is ignored) 
-tt : Enable time tolerance during time calculations. If subtitle appears
      to short starttime of subtitle can be changed up to tolerance
      (tolerance value can be set by -tol switch)
-c <time1> <time2> : Cut subtitles from <time1> to <time2>. You should
                     notice that time2 > time1.Time can be inserted in 
                     format <minutes>:<seconds>
-s <time> : Split output subtitle into two files after specified period of
	    time. Time can be inserted in format <minutes>:<seconds>
	    (eg. 10:35.25 - 10 minutes 35.25 seconds). It's useful when
            you split movie and you want to split subtitle file too.
-j <time> : Join two subtitle files, where 2nd begins at time
            <time>. <time> variable should contain length of the first
            part of the movie. It's useful when you want join two parts of
            the movie including subtitles.
-m : Same as -m0 -m1 2 60 2
     Option used to compact files and to help fullfit time conditions made 
     by -t option. Option may change the structure of subtitles (two or
     more subtitles can be merged into one subtitle)
-m0 : Remove unnecessary chars (spaces,tabs) from subtitles
-m1 <lines> <chars> <pack> : Compact subtitles in <lines>*<chars> text box
                      if subtitles appears to short on the screen,
                      otherwise subtitle is unchanged. Option implies
                      time calculations. Option may change subtitle
		      structure (2 or more subtitles can be
		      merged). <pack> set the amount of subtitles
		      processed at a time (minimal value is 2)
-f : Force compact every subtitle into <a>*<b> text box if possible. It's
     useful if you want to "downsize" subtitle to specified dimensions.
-d : Disable same line removal detection function. When program detects
     two identical lines one after another than second is skipped.
-tol <a> <b>: Tolerance in seconds during <a> - time calculations (-t) and
              <b> - compacting subtitles (-m1). Default values are 0.5s
              for time calculations and 2.0s for compacting subtitles.
-e : Each subtitle has empty endtime (switch -t is ignored)
-g <language> : Generate startup file for MicroDVD. <language> is string
                that contains name of the language.
-v : Verbose mode (Display additional information)
-i : Display information about MicroDVD or SAM subtitle file
-l <a> <b>: Display subtitles with less/more than <a> chars or/and <b>
            subtitles. If you want to display 'more than' you should use
            positive value and if you want display 'less than' you should
            use negative value of parameter (10 - more than 10; -10 - less
            than 10)

4.Examples
----------
a) Subtitle is for 29.97 frames/s movie and we have movie with 25
frames/s. We also want to set duration of each subtitle to 4 seconds (if
possible!!)

micro -if 29.97 -of 25 -t 0 4 0 input.txt output.txt

b) Subtitle is for 25 frames/s movie, and we want to move the subtitle
2.5s back (each subtitle will be displayed 2.5s earlier) and split it
after 45 minutes 35.34 seconds. Output format will be SAM.

micro -if 25 -o1 -o -2.5 -n -s 10:35.34 input.txt output.txt

Switch '-if 25' can be omitted. We need '-n' switch to disable time
calculations. If first subtitle appears earlier than 2.5s program will
display appropriate error message. Output filenames are 'output.txt.1' for
first part and 'output.txt.2' for second part of subtitle file. Second
subtitle file time starts from 0. Option -o1 set output format to SAM 
subtitle format.

c) Compact subtitle and cut from 5:00 to 90:05.25. Source framerate is 25
frames/s and output should be 29.97 frames/s. Notice that input file time
isn't equal to output file time. All time calculations use output
timescale to make time calculations (after framerate conversions).

micro -of 29.97 -c 5:0 90:5.25 -m0 -m1 2 60 2 input.txt output.txt

We use simple (-m0 : remove unnecessary chars) and advanced (-m1 2 60 2
: compact subtitles into 60chars*2lines textbox with 2 subtitles
processing at a time) compacting. These are optimal settings for most of
the text compacting. The main idea of compacting is to increase duration
time of subtitle by compacting 2 subtitles into 1 or 3 into 2 etc.

d) Display line numbers of lines with more than 50 chars and information
about MicroDVD subtitle file.

micro -i -l 50 0 input.txt

e) Display line numbers with subtitles with less than 25 chars and with
more than 2 lines in subtitle.

micro -l -25 2 input.txt

f) Generate MicroDVD startup file (.mvd) for "Red planet.avi" movie file
and "Red planet.txt" Polish subtitle file.

micro -g Polish "Red planet.txt" "Red planet.avi" "Red planet.mvd"

After creation of "Red planet.mvd" you can double-click on "Red
planet.mvd" and movie will start automatically (You should associate .mvd
files with MicroDVD player first).

5.Credits and information
-------------------------
This program was completely written by 
Marcin Deranek <gringo@man.koszalin.pl>.
This program is a freeware and can be freely distributed. Any suggestions
or bug reports are welcome to the following e-mail address:
gringo@man.koszalin.pl
You can also visit my homepage (http://www.man.koszalin.pl/~gringo) for
possible program updates (click Software link).