SUB to SSA

SubRip/MicroDVD substitles
to
Sub Station Alpha scripts conversion utility







Latest program version: 2.0
 
 Contents
 



General info
 
If you usually convert DivX AVIs in VCD or SVCD and have subtitles in text files (usually in SubRip or MicroDVD format that is commonly used with DivX) and want to encode subtitles within VCD/SVCD video using VirtualDub frameserving and Sub Station Alpha v2.x/4.x subtitling plugin for VirtualDub, this tool will help you to convert subtitles from text files to appropriate Sub Station Alpha (SSA) scripts that VirtualDub SSA plugin can process.

SUBtoSSA has many advanced options like setting auto-sizing  mode where you can have automatic size adjustment for different fonts (to fit on screen), it can find longest text line from subtitle file for selected font styles so you can easily check will font fit on screen with your style settings, it support style savings for later useage in different material (with several predefined styles for different viewing modes I made), advanced options where you can change font settings for particular segment and part of text, saving complete work into project file for later modifications and more ...

Useage and features are optimized to make rather standardized subtitles and SSA scripts for useage in VirtualDub subtitler plugin so, some SSA features that are not relevant for subtitling and which are not supported by VirtualDub SSA plugin are not included and some features that are not SSA standard but supported by VirtualDub Subtitler are added.

This version support SubRip SRT native time-based subtitle format and MicroDVD frame-based subtitle format. If you have subtitles in any other format (SubViewer, SAMI etc.), use some of conversion tools to convert them to one of supported formats (I recommend SRT SubRip because it is more precise especially if source is already in time-based format).

Program is pretty much self-explanatory and have "hint help" but let's explain what it can do:
 
 
 
File options
 
First you need to select input and output files. For input you can chose between SubRip SRT subtitles, MicroDVD SUB subtitles, SUBtoSSA project file (.S2S - for details, see Projects) ... You can use "Open" button or drag&drop file from Windows Explorer.

For selecting output file, click "Select" button and enter filename or select one.

Note that conversion will not start until you hit "Convert to .SSA".
 

1. SRT (SubRip format)

SubRip SRT subtitle format is time based subtitle format which means that appearance and dissapearance of subtitle is represented with exact time. This example shows SRT file structure:

385
01:04:27,000 --> 01:04:31,000
Dajete kupcu ono što traži.

386
01:04:32,000 --> 01:04:36,000
Potaknite malo tu potrebu
da biste stimulirali tržište

387
01:04:36,000 --> 01:04:39,000
...i uskoro kupci ovise o vama.
Doista vas trebaju.


Here is what each line represents:
Index of segment (starts from 1)....................... 
Time (show --> dissapear).............................. 
Text line 1....................................................... 
Text line 2.......................................................
386
01:04:32,000 --> 01:04:36,000
Potaknite malo tu potrebu
da biste stimulirali tržište

 

2. SUB (MicroDVD format)

MicroDVD subtitle format is frame-based subtitle file format where appearance and dissapearance of subtitles are represented with video frames. This means that text will be displayed when required moment of video (video frame) shows up and dissapear when other defined frame come. Example:

{899}{943}BRZI  I  ŽESTOKI
{1075}{1119}Premjesti ga ovdje.
{1425}{1516}Upravo je natovarena roba.|Stiže u tvom pravcu.
{1525}{1627}Moj èovjek je pored kamiona,|ne zaboravite na moj dio dogovora.
{3777}{3820}Hej!|Pazite!


Here is what each line represents:

Show Dissapear Text line 1 | Text line 2
{899}
{1075}
{1425}
{1525}
{3777}
{943}
{1119}
{1516}
{1627}
{3820}
BRZI  I  ŽESTOKI
Premjesti ga ovdje.
Upravo je natovarena roba.|Stiže u tvom pravcu.
Moj èovjek je pored kamiona,|ne zaboravite na moj dio dogovora.
Hej!|Pazite!

In this format, both lines are in the same row but diversed with sign |. Frames are within { }.

Because SSA requires time-based structure, by loading MicroDVD titles you need to set video framerate so SUBtoSSA will convert frames into appropriate timestamps.

If you have appropriate AVI in the same folder where subtitle file is (AVI which subtitle you load and which have the same name as subtitle except with extension SUB - note that this is common way of AVI and SUB distribution because players automatically get subtitles if they filename are the same as AVI filename), you don't need to setup anything because SUBtoSSA will find it and get framerate from it automatically - you just need to confirm values you get !

Also, it is possible to select AVI (which subtitle you load) manually and SUBtoSSA will get framerate from it.

Finally, you can setup that value by yourself (if you know it).

Be aware that incorrect framerate value can cause wrong time values so title will not be displayed when it should be and can show up later or before actually spoken text !

For example, you have AVI with 25.000 fps with subtitle made for that framerate and you choose 23.976 instead 25.000 - and subtitles will be displayed with delays of 2-3 seconds.

So, I recommend to use framerate from appropriate AVI.

3. General rules

Both formats can have 3 lines of text (so called "3-liners").

VirtualDub subtitler supports more than 2 lines in SSA - but SUBtoSSA does not support it !
SUBtoSSA works only with 2 lines per subtitle ! If some subtitle segment contains 3 lines of text, second and third line will be "connected" to one. Do not use subtitles with more than 3 lines of text because they will be incorrectly interpreted in this version of SUBtoSSA !

Leading and trailing blanks will be removed from text upon loading from both formats because VirtualDub SSA plugin will ingore them anyway. But, you can still keep blanks by selecting "Do not trim blanks in SRT files" (in "Options").

Subtitle files might have different extensions than SRT and SUB (like .TXT etc. ...) - basically, common extension is SUB for all formats (SubRip format commonly have SUB extension too) but you can open any of them as long as files contains subtitles in SubRip or MicroDVD format (SUBtoSSA will auto-detect source format).
 
 
 
Select and manage styles
 
Program allows you to define style (font, size, color, encoding ...) of resulting subtitles and select main style settings which will be used for displaying text. All values are represented as they will be writen in SSA script for easy understanding and possible manual editing within script. You can save style for later useage with different videos. Subtitles will be shown using this settings (using currently active style - the one that is loaded) unless you use "Override style settings" where you can override with one of predefined styles you made here or set specific font settings for particular line, set of lines or part of text in desired line.
 

1. Subtitle font settings

Here you can font name, size, encoding, style, color, perform auto sizing etc.

  • Select font
  • Open font selection and settings dialog using Select font button.

    Then you can select:

    ANSI_CHARSET  0 ANSI characters
    DEFAULT_CHARSET 1 Font is chosen based solely on Name and Size. If the described font is not available on the system, Windows will substitute another font
    SYMBOL_CHARSET 2 Standard symbol set
    MAC_CHARSET 77 Macintosh characters
    SHIFTJIS_CHARSET 128 Japanese shift-jis characters
    HANGEUL_CHARSET 129 Korean characters (Wansung)
    JOHAB_CHARSET 130 Korean characters (Johab)
    GB2312_CHARSET 134 Simplified Chinese characters (mainland china)
    CHINESEBIG5_CHARSET 136 Traditional Chinese characters (taiwanese)
    GREEK_CHARSET 161 Greek characters
    TURKISH_CHARSET 162 Turkish characters
    VIETNAMESE_CHARSET 163 Vietnamese characters
    HEBREW_CHARSET 177 Hebrew characters
    ARABIC_CHARSET 178 Arabic characters
    BALTIC_CHARSET 186 Baltic characters
    RUSSIAN_CHARSET 204 Cyrillic characters
    THAI_CHARSET 222 Thai characters
    EASTEUROPE_CHARSET 238 Includes diacritical marks for eastern european countries
    OEM_CHARSET 255 Depends on the codepage of the operating system
  • Auto adjust size
  • Notes:
    This is experimental option - don't expect perfect results !
    Also, this option might cause wrong results in final size if it is used together with "Use playback resolution to resize fonts''. In that case, size which will ''auto adjust'' give might be too big/small in final video when using PlayResY.
    So, it is not recommended to use it if you use "playback resolution to resize fonts".

    This option is a "helping hand" while selecting fonts and sizes. It is very usefull if you setup entire font style (you selected font, size, color ...) and you want to try different font. By turning this option ON, when select new font, size will be automaticaly recalculated so new font will fit automatically and occupy the same space as old font: when you check this option, SUBtoSSA will remember current font size (will be written within option name: "Auto adjust: NN" where NN will be size on which recalculation is based). Then, after you change font properties (style, name ...) it will set new size based on remembered value so subtitle text in new font will ocuppy approx. the same space on screen as it was occupied in old font (note that, in this mode, size you select in font selection dialog will be ignored).

    This example will explain clearly how it works:

    You set "Arial Narrow" font with size 40 and subtitle nicely fit in movie:

    Now you want to use new font - "Arial". If you do not use "Auto adjust size" and leave size 40 from "Arial Narrow" settings, text will now occupy more space on screen and, maybe even "bleed" on borders or wrap if not fit on longer lines - because "Arial"  in 40 pixels is bigger than "Arial Narrow" in 40 pixels. Here's how subtitle looks in "Arial", size 40:

    So, you need to change size manually and experiment to have it fit to screen - or you can use "Auto adjust size" before selecting "Arial" and SUBtoSSA will automaticaly change size from 40 to new value which will force text in "Arial" to occupy the same space as "Arial Narrow" in 40 (in this example, adjusted size was 31):

    This still can't assure that all lines of text will fit to screen because subtitle contains lot of text with different length. So, you can use Find longest line to find longest line of text in subtitle file.
     

  •  Subtitle color
  • Here you can define primary subtitle color by selecting one from color dialog box. After selection, you can view numeric representation of selected color which will be used in SSA script.

    Note that you select only primary color (subtitle text color in witch the subtitles appears normally) here !

    Setting up other colors that SSA use; secondary color (in which the subtitles will appear if the primary color is the same as the background image at a specific moment), tertiary color (in witch the subtitles will appear only if the primary and secondary colors interfere with the background image) and back color are not supported in this release.

    So, secondary and tertiary colors will be set to primary color value by default and back color will be black (suitable for standard subtitle look).

    All font settings and colors (except font size) you set can be seen in simple preview panel on preview text that contains 2 lines with text and some additional special characters.
     

    2. Distance and alignment of subtitle

    Subtite can be placed on top or bottom part of screen, horizontally centered or aligned left or right. Here you define how much pixels you want to have between text and left, right and bottom parts of screen and desired alignment. Recommended values are defaults:

    Left: 1            Bottom: 16            Right: 1
    Alignment: 2 (bottom center)

    This means that margin for displaying text on screen will be 1 pixel from left and right and 16 pixels from bottom border of screen. Text will be centered at bottom of screen (standard subtitle position):
     
     

    Sample:
    Left: 1 
     

    ...i uskoro kupci ovise o vama.
    Doista vas trebaju.
     

    Right: 1 
    Bottom: 16  

    Margin values are fixed pixel sizes or relative if you use "Use playback resolution to resize fonts"

    Note that, by setting this values too high, text might wrap automatically if it can't fit within set boundaries. I recommend to leave left/right values on defaults and change bottom distance if you need to have subtitle lower or higher.
     

    3. Playback resolution and font size

    Note:  this option might cause wrong results in final size if it is used together with "Auto adjust size". In that case, final subtitle font size might be too big/small. So it is recommended not to use it if you resize fonts using "Auto adjust size".

    Commonly, every font size you select represents fixed pixel value which will be used to display text. Things works that way if
    "Use playback resolution to resize fonts" option is off. If you turn it on, font sizes will be treated differently - in this case, font size you choose will be relative to resolution defined in PlayResY command.

    Basically, font size you selected will be scaled by SSA filter in VirtualDub so text will be finally resized according to value entered in PlayResY. For all information about this, please refer to README.TXT file that comes with "Subtitler - Sub Station Alpha v2.x/4.x subtitling plugin for VirtualDub", Copyright (C) 2000-2002 Avery Lee, All Rights Reserved.

    Using this option it is possible to achieve proprotional font resizing in final video. Do not confuse this with "Auto adjust size" - it is not the same thing ! "Auto adjust size" will try to change size and fit new font in previously defined size and this option will proportionally resize font based on playing resolution - also, once again, useage of both options are not recommended.
     

    4. Predefined styles

    SUBtoSSA comes with several several predefined styles (including deafult one) that are made for adding subtitles in different video formats:

    For reproduction on NTSC resolution (NTSC TV format), using fonts in eastern Europe encoding:

    NTSC 4:3, EASTEUROPE_CHARSET
    NTSC 1.85:1 (16:9), EASTEUROPE_CHARSET
    NTSC 2.35:1, EASTEUROPE_CHARSET
    Source video is 4:3
    Source video is 1.85:1 (16:9)
    Source video is 2.35:1

    For reproduction on PAL resolution (PAL TV format), using fonts in eastern Europe encoding:

    PAL 4:3, EASTEUROPE_CHARSET
    PAL 1.85:1 (16:9), EASTEUROPE_CHARSET
    PAL 2.35:1, EASTEUROPE_CHARSET
    Source video is 4:3
    Source video is 1.85:1 (16:9)
    Source video is 2.35:1


    You can modify or delete any predefined style, add new one or mark one to open automatically on start:

    If you save you current style settings for later useage, program saves following values: Als saved styles can be used for overridings:



    Override style settings
     
    This section allows to view entire subtitle file and make some changes and overridings of currently active style. It is pretty usefull if you want that some part of subtitle be shown in different color, font, size, style, different alignment etc.  ... (e.g. movie title in bigger size and different color, lines that have quoting can be in italic, shouting can be bold etc. whatever what is usuall and unusuall in subtitle world :)).
    Basically, here you can override settings from selected active style (in rest of text, we will call it "main style" also). You can use completely different style you already made and saved in "Select and manage styles" option and override active with it, or you can manually change font, size, encoding, color, style of selected row or rows ... also, it is possible to save all overridings into a file, edit text and add bold/italic directly into text line, copy&paste overrided settings, find longest line between all settings etc. ...

    Simply, here you can do two basic things:

    By selecting style or manual overriding mode (using "Select style for overrides" where you can choose between predefined styles, active style and manual settings) you can override active style in row or set of rows - here is quick info how this can be done:

    1. Overriding rows with predefined style settings

    You can override currently active style settings for selected row/set of rows with some already created and saved style (from "Select and manage styles"). This is usefull way because then you can change style properties in "Select an manage style" and after saving changes, they will be automatically applied on all rows that are overrided with that style.

    - select row or rows which active style want to to override with some predefined style.
    - choose style you want to set from "Select style for overrides" list (you can choose "<Active style>" to remove overrides with predefined styles or select some style from list to override active)
    - hit "Apply to selection" to override.

    2. Overriding rows with manual style settings

    Using manual overriding mode, you can set font and style properties in "Manual style overrides/current settings". Procedure is simmilar to "Overriding with predefined styles" but you must select "<Manual settings>" in "Select style for overrides"  to achieve this and set desired font, alignment and other properties in "Manual style overrides/current settings".
     

    3. Set overriding bold/italic attributes for some part of line

    Upon all things, you can even set some part of line to bold or italic and override all previously overrided settings.
     

    4. Rules about overriding:

    Generally, upon start, you have active style (the one loaded in "Select and manage styles") valid for entire subtitle file. You can override it with predefined styles. If you manually change font settings, you will override overridings with styles for lines where you made manual settings. And, finally, if you use bold/italic to enhance pat of text withint text line, those attributes will override all overridings - check some simple example - it is presented in "Edit text line" section of this manual.

    Here are some details about options and its useage :
     

    1. Subtitle list - text lines and styles

    Here you can see entire subtitle file in a SubRip SRT form of list. Each subtitle segment contains 2 lines of subtitle text (differently colored for easy navigation). Columns contain:


    With right-click you can activate popup menu with basic options that will be explained later.
     

    2. Manual style overrides/current settings

    Here you can manually select font name, encoding, size, style,color,alignment which will be used in selected rows. As you navigate through list, these values will represent current style settings of currently selected row (acts like preview of currently active/overrided style from selected line). Little preview box contains text from currently selected row (or active if there is more that one line selected) in selected style (overriding or active - depends what was done on selected line),

    Here is what you can override in main style settings. Overridings will affect entire selected line or entire set of selected lines:

    For details, see Main style settings
     

    3. Apply and reset changes

    All overridings will be processed on selected row or set of rows after using "Apply to selection" or "Apply all" buttons:

    Also, you can remove all manual settings using: Note that style overrides with predefined styles will be intact - this only affects manual settings if exists !


    4. Find longest line

    Commonly, when setting font properties, you can't be sure that subtitle will fit on screen because it contains text of different length and some text might be too long for your settings  and it will possibly "bleed"  from screen edges or SSA plugin will wrap it into more than 2 lines which is bad and might be very annoying to watch (and it is not common thing).

    So, if you are not sure will subtitle fit on screen with style settings you made, you can use this option to find longest line in subtitle file and check will it fit - because, if it (the longest line) fits, other lines will fit too ...

    SUBtoSSA will not just count number of letters in each line to find which is longest but it will find longest line based on each line's current font settings (more accurate for final result). As a result you will get complete segment with longest line: you will get index, time when lines will show and dissapear and all lines of text for that segment where longest will be marked red.

    Here you can:

    Now you can preview how this line looks in VirtualDub with your style settings by simply positioning to time point you get here (use "Copy time to clipboard" and simply paste time into VirtualDub - see "Copy time" option for details).
     

    5. Find text/index

    Using Find text/index you can search for a specific text or part of text forward, backward through subtitles and also, can jump to desired segment using index value.
     

    6. Edit text line (with bold/italic overridings)

    If you want to change something in text or maybe to put some part of text in bold or italic style, you can do it using Edit text line option (also can be activated by doubleclick on selected row). You will get small window where you can select and edit text and add/remove bold/italic attributes and even manually add SSA tags directly in text. Also here you will see how your settings will be written in SSA script (using SSA tags for bold/italic attributes).

    Note that useage of '{' and '\' characters in text are allowed and will be automatically converted to '\{' and '\\' according to VirtualDub subtitler specifications.

    All bold/italic changes made on parts of text here, overrides already overrided (or active) style for that pat of text defined for selected row - example:

    Active stlye is: Font "Arial", Style: bold and  nonitalic:
     

    We have text in active style - bold, not italic: Testing, testing, 123 !
    After overriding of selected line (with nonbold and italic changes), using font overrides, entire line will be: Testing, testing, 123 !
    Now, apply bold to selected part of text ('123') in "Edit text line" - note that we override all style settings for that part of text only: Testing, testing, 123 !
     
     
    7. Edit time

    Using this option, it is possible to change timestamp of current subtitle segment. For example, if you want some subtitle longer on screen or maybe to shpw up later/before - here you can adjust both times: when it will show and when it will dissapear.
     

    8. Copy/Paste style overrides

    Using Copy style and Paste style it is possible to copy manual style overrides (all values that can be set in "Style overrides/current settings" will be copied) from one and paste to another row. Just select row from which you want to copy style and hit Copy style button then select target row and hit Paste style.

    Alignment settings will be pasted only if you paste into main line.

    Note that copied values does not go into Windows Clipboard so you can use it for other purposes.
     

    9. Copy time

    If you want to test exact part of subtitle in VirtualDub (to preview how it will look), you can copy time to Windows Clipboard with this option. SUBtoSSA will copy time when subtitle from selected row need to be shown ("From" or "Show" time - see "File options (supported input and output formats)" for details). Now, you can easily paste into "Go to" option in VirtualDub (in "Edit" submenu select "Go to", select "Jump to frame at time:" and paste time related field).



    Projects
     
    Your current work can be saved for later modification using "Save project" button. Program will save complete subtitle file with all lines and overrided style settings into SUBtoSSA project file with .S2S extension, together with active style and its current settings.

    Project files can be loaded using "Open" button (see "File options (supported input and output formats)" for details).

    NOTE:
    You can use project files from older versions of SUBtoSSA but project files saved with this version cannot be loaded in previous versions of SUBtoSSA.



    Conversion
     
    By clicking on "Convert to .SSA" subtitles will be converted into SSA script with all defined styles and changes. If SSA file already exists, it will be overwritten.

    Before conversion, and if you used overriding with predefined styles, SUBtoSSA will check does all styles you used still exists - this is important because you could use some styles that no longer exists because you deleted them in "Select and manage styles" for some reason. In that case, SUBtoSSA will use active style for all styles that does not exists in its configuration files.



    Options
     
    Here you can configure some basic program options:



    Tips and tricks
     
    I strongly recommend to check results in VirtualDub before final encoding.

    Always use "Find longest line" to be sure that longest subtitle text will fit correctly with your settings - it is better to know that before several hours of encoding when you can finaly realize that subtitles "bleeds" of the screen.

    You can easily modify resulting SSA scripts in Notepad or any other text file editor but every new conversion will overwrite manual changes.



    Version history
     

    Version Date Description
    2.0 02.04.2002 - Added support for MicroDVD frame-based subtitle files with nice way of getting framerate (automatically or manually from corresponding AVI or manually by entering value)
    - Now it is possible to override active style with predefined styles and manual settings
    - Possibility to change "show" and "dissapear" times
    - "Save new" renamed to "Save to ..." (sounds better :) )
    - Fixed "Load on start" - now it will not be checked "randomly"
    - When loading projects, active style settings will be restored too
    - Fixed loading of 3-liners (subtitle files with 3 lines) - now it will join second and third line into one
    - "Find" function added (can find text, part of text or segment index)
    - Splash screen added
    - Updated help
    1.0 20.03.2002  - First release


    About
     

    SUB to SSA

    Version 2.0
    Freeware

    (C)2002 Copyright m&g Software, by Arminio Grgic


    DISCLAIMER

    Program is freeware but copyrighted.

    YOU MAY NOT SELL OR CHANGE THIS PROGRAM OR ANY OTHER PART
    OF THIS PROGRAM OR DOCUMENTATION !

    DISTRIBUTION OF THIS PROGRAM MUST BE FREE AND IN ORIGINAL FORM
    WITH ALL FILES INCLUDED AND INTACT IN ORIGINAL ZIP ARCHIVE.

    Every effort has been made to ensure that no problems occur with its
    usage but the author makes no warranties about it and accepts no
    responsibility for any data loss or other system trouble that may
    occur from its useage.

    Please report any ideas, remarks, bugs etc.

    Thanks for using SUBtoSSA !


    AUTHOR

    Arminio Grgic,
    Pozega,
    Croatia

    E-mail:
    Arminio Grgic@Yahoo.com

    WWW:
    http://www.geocities.com/agrgic.geo/arminio.htm
    http://www.geocities.com/agrgic.geo/sub2ssa.htm