File Formats Wiki

SubStation Alpha

261pages on
this wiki
Add New Page
Talk0 Share
SubStation Alpha

Filename extension .ssa
Type Subtitle format
File formats category - v  e   edit

SubStation Alpha (SSA) is a subtitling / script format that supports text formatting, animation, graphics and karaoke.[1] It is also the name of the program that is able to read SSA files. Advanced SubStation Alpha (ASS) is a newer version of SSA (technically version 4+).

File specificationEdit

SSA and ASS files are plain DOS text files. ASS added Unicode support.

ASS (SSA V4+)Edit

ASS is an improvement upon the SSA V4 specification. ASS files have INI-style sections: each section is preceded by a line containing the sections name, in square brackets. Aside from this, each line is generally composed of: a line descriptor, which tells about what the line is about; a colon; and the line data itself. Any whitespace between these parts are allowed. Blank lines are also allowed. Hard comment lines are preceded by either a semicolon or !: (with "!" as the line descriptor).

Unrecognized and incorrect line formats are ignored.

Fields on the line data are separated by a comma and, with the exception of the Text field, which should be the last field, must not contain any commas.

Script Info sectionEdit

The Script Info section contains general information about the file. The following is a sample Script Info section:

[Script Info]
; Script generated by Aegisub 2.1.8
Title: ASS file
ScriptType: v4.00+
WrapStyle: 0
PlayResX: 848
PlayResY: 480
ScaledBorderAndShadow: yes
Last Style Storage: Awesome
Video Aspect Ratio: 0
Video Zoom: 5
Video Position: 35483
Original Translation: Hatsune Miku
Collisions: Normal

Descriptor name Description
A comment line.
A description of the script.
The version of the file format. For ASS, this is v4.00+.
Contributors to the production of the script.
Details regarding updates made to the script can be placed here.
Where in the video will the script begin playback
How collisions are managed. Possible values are: Normal - subtitles are stacked onto each other, and Reverse - subtitles are shifted to make way for new ones.
The resolution of the script.
The speed of the script. This value is a multiplier times 100 of the speed of the script playback.
0 - Smart wrapping, lines are evenly broken
1 - End of line word wrapping, hard breaks only.
2 - No word wrapping. Both line breaks allowed.
3 - Smart wrapping with lower lines wider.

Styles sectionEdit

The Styles section defines different preset styles that can be used to adjust the appearance of individual lines in the script. The actual name of the section depends on the file version, for ASS this is [V4+ Styles]. In the Events section, unrecognized styles are styled with the "Default" style. Unrecognized fonts are assigned to Arial - this may occur when the font is not installed in a target user's system. The following is a sample Styles section:

{{c|directive|[V4+ Styles]}}
{{c|key1|Format:}} Name{{c|key|,}} Fontname{{c|key|,}} Fontsize{{c|key|,}} PrimaryColour{{c|key|,}} SecondaryColour{{c|key|,}} OutlineColour{{c|key|,}} BackColour{{c|key|,}} Bold{{c|key|,}} Italic{{c|key|,}} Underline{{c|key|,}} StrikeOut{{c|key|,}} ScaleX{{c|key|,}} ScaleY{{c|key|,}} Spacing{{c|key|,}} Angle{{c|key|,}} BorderStyle{{c|key|,}} Outline{{c|key|,}} Shadow{{c|key|,}} Alignment{{c|key|,}} MarginL{{c|key|,}} MarginR{{c|key|,}} MarginV{{c|key|,}} Encoding
{{c|key1|Style:}} Default{{c|key|,}}Arial{{c|key|,}}28{{c|key|,}}&H00FFFFFF{{c|key|,}}&H1EFFFFFF{{c|key|,}}&H0048001C{{c|key|,}}&H7F000000{{c|key|,}}-1{{c|key|,}}0{{c|key|,}}0{{c|key|,}}0{{c|key|,}}100{{c|key|,}}100{{c|key|,}}0{{c|key|,}}0{{c|key|,}}1{{c|key|,}}1.5{{c|key|,}}0.5{{c|key|,}}2{{c|key|,}}10{{c|key|,}}10{{c|key|,}}10{{c|key|,}}1
Defines the format of subsequent Style lines. This is provided for backward-compatibility.
Defines a style. The style is subsequently identified by its Name field.
Field Description
Name Identifies the style. Case-sensitive.
Fontname The subtitle font as identified by operating systems.
Fontsize The point size of the font.
PrimaryColour The font color. See the Data types section for information on how color values are represented.
SecondaryColour A secondary font color. This may be used in subtitle collisions (SSA) or as the first color displayed in the karaoke.
OutlineColour (SSA uses TertiaryColor) The color used to outline the font.
BackColour The color of the subtitle shadow.
Underline (v4+)
Strikeout (v4+)
Text formatting that can be applied to the subtitle. Boolean value. (See Data types section.)
These are multipliers that can be used to scale the subtitle.
Angle (v4+) The rotation of the subtitle, in floating-point degrees. The rotation origin depends on the alignment of the subtitle.
BorderStyle 1 - Outline with shadow, 3 - Rendered with an opaque box.
Outline The width of the text outline, in pixels.
Shadow The depth of the text shadow, in pixels.
Alignment The alignment of the subtitle. See the Data types section.
MarginL Left margin.
MarginR Right margin.
MarginV Vertical margin.
Encoding A number representing the encoding to be used.

Events sectionEdit

This section contains the different objects to be displayed on screen, each having its corresponding properties, including timing.

The following are the fields available to ASS:

Field Description
Layer An integer indicating the layer the subtitle is in. Subtitles having different layer numbers will be ignored during collision detection. Lower layer numbers are drawn first.
Start The start time of the subtitle. See the Data types section.
End The end time of the subtitle.
Style The style to be used by the script. Styles are defined in the Styles section.
Name The person who spoke the dialog.
4-digit margin override.
Effect 0>;<y2|0>;<delay(1-100)>[;fadeawayheight], Banner;<delay(1-100)>[;lefttoright(0|1)][;<fadeawaywidth], Scroll down;<y1|0>;<y2|0>;<delay(1-100)>[;fadeawayheight]
Text The subtitle text. This is a special field in the sense that it must always be the last field, and can contain commas.

The following are the Event section descriptors:

Descriptor Description
Dialogue A normal subtitle line.
Comment A commented subtitle line. These will not be displayed on screen.
Picture Displays a picture with the path specified in the Text field.
Sound Plays a WAV file with the path specified in the Text field.
Movie Plays an AVI file with the path specified in the Text field.
Command Executes the program with the path specified in the Text field.

Style overridesEdit

The ASS format has an extensive set of overrides that can be used to modify parts of or whole specific subtitles. All override codes except for \N<code>, <code>\n and \h must be enclosed in curly brackets ({}). Consecutive override codes may be placed inside a single pair of brackets. Override codes typically affect only the text succeeding it, but some codes modify the whole line. All override codes are preceded by a backslash (\) and may contain a parameter, if it must be provided. If an override code requires 2 or more parameters, these are placed inside parentheses and are comma-delimited.

The following is a list of ASS override codes.

Override code Parameters Description
n Soft line break - the line may break here.
N Hard / forced line break
h Non-breaking space
Bold / italic / underline / strikethrough off (0) or on (1)
bord width Border
shad depth Shadow
be blur amount Outline blur ("blur edges")
fn Font name Changes the font.
fs size Font size
Percent Font scaling
fsp pixels Font spacing
degrees Rotation around the x/y/z-axes.
fe charset Encoding number
color Primary / secondary / outline / shadow colour
alpha value Primary / secondary / outline / shadow transparency
an alignment code Alignment
duration (x0.01s) The duration of time, in centiseconds, the succeeding text will be displayed, until the end of the line or the next k override code. This creates a karaoke effect.
q integer Wrapping style
r [style] Resets all previous override styles, applying the default style. To apply a different style, put it as a parameter.
t ([<start>, <end>,][<accel>,]<styles>) Applies a transition animation to the line. The start and end times are in milliseconds, and the styles can be any combination of the available animatable styles.
pos (x,y) Sets the position of the subtitle anchor, where 0,0 is the top-left corner. Note that the subtitle anchor also depends on the line's alignment.
move (x1,y1,x2,y2[,t1, t2]) Animates the subtitle position at the specified time or at the entirety of the subtitle time from point 1 to point 2. Time is in milliseconds, relative to the beginning of the subtitle. The subtitle anchor depends on the line's alignment.
org (x,y) Relocates the rotation origin of the subtitle. By default, the subtitle rotates about its anchor.
fade a1,a2,t1,t2,t3,t4 Creates a three-part fade animation.
fad fade in duration, fade out duration Sets a fade-in and fade-out duration. 0 will effectively disable the effect.
clip x1,y1,x2,y2 Clips a subtitle inside a rectangle.
clip [scale,] drawing Clips a subtitle inside a drawing.

File attachmentEdit

Files can be attached to scripts and are stored as plain text. The method used is a form of UUEncoding.

Data typesEdit

Color values are expressed in hexadecimal BGR format as &HBBGGRR& or ABGR (with alpha channel) as &HAABBGGRR&. Transparency (alpha) can be expressed as &HAA&. Note that in the alpha channel, 00 is opaque and FF is transparent.
Boolean values (Styles section)
-1 is true, 0 is false.
Alignment values are based on the numeric keypad. 1 - bottom left, 2 - bottom center, 3 - bottom right, 4 - center left, 5 - center center, 6 - center right, 7 - top left, 8 - top center, 9 - top right. In addition to determining the position of the subtitle, this also determines the alignment of the text itself.
Time is expressed as h:mm:ss:xx (xx being hundredths of seconds). The hour can only be a single digit.

SSA V1-4Edit

See the Multimedia Wiki link.


  1. SubStation Alpha - Multimedia Wiki

External linksEdit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.