ffmpeg:subtitles:ass_file_syntax
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ffmpeg:subtitles:ass_file_syntax [2024/12/30 23:02] – created peter | ffmpeg:subtitles:ass_file_syntax [2024/12/30 23:49] (current) – peter | ||
---|---|---|---|
Line 5: | Line 5: | ||
* SubStation Alpha (SSA) is a subtitling / script format that supports text formatting, animation, graphics and karaoke. | * SubStation Alpha (SSA) is a subtitling / script format that supports text formatting, animation, graphics and karaoke. | ||
- | ---- | ||
- | |||
- | ===== File Specification ===== | ||
- | |||
- | SSA and ASS files are plain text files. | ||
- | |||
- | * ASS added Unicode support. | ||
- | |||
- | ---- | ||
- | |||
- | ===== ASS (SSA V4+) ===== | ||
ASS is an improvement upon the SSA V4 specification. | ASS is an improvement upon the SSA V4 specification. | ||
Line 27: | Line 16: | ||
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. | 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. | ||
+ | |||
---- | ---- | ||
- | ===== Descriptors | + | ===== File Specification |
- | <td Original Script | + | SSA and ASS files are plain text files. |
- | Original Translation | + | |
- | Original Editing | + | * ASS added Unicode support. |
- | Original Timing | + | |
- | Script Updated By | + | |
- | (mostly optional) > | + | |
- | PlayResY >The resolution of the script. | + | |
---- | ---- | ||
- | A comment line. | + | ===== Scripts ===== |
- | A description of the script. | + | |
- | The version of the file format. For ASS, this is v4.00+. | + | See: [[https:// |
- | 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 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. | + | |
---- | ---- | ||
Line 71: | Line 49: | ||
{{c|key1|Style: | {{c|key1|Style: | ||
</ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE:** | ||
+ | |||
+ | * **Format**: | ||
+ | * **Style**: | ||
+ | |||
+ | </ | ||
---- | ---- | ||
- | Format | + | ===== Styles ===== |
- | Defines the format of subsequent Style lines. This is provided for backward-compatibility. | + | |
- | Style | + | |
- | Defines a style. The style is subsequently identified by its Name field. | + | |
- | + | ||
- | | + | |
^Field^Description^ | ^Field^Description^ | ||
Line 89: | Line 70: | ||
|OutlineColour|(SSA uses TertiaryColor) The color used to outline the font.| | |OutlineColour|(SSA uses TertiaryColor) The color used to outline the font.| | ||
|BackColour|The color of the subtitle shadow.| | |BackColour|The color of the subtitle shadow.| | ||
- | |Bold| | + | |Bold|Text formatting that can be applied to the subtitle. Boolean value. (See Data types section.)| |
- | |Italic | + | |Italic|:::| |
- | |Underline (v4+)| | + | |Underline (v4+)|:::| |
- | |Strikeout (v4+)|Text formatting that can be applied to the subtitle. Boolean value. (See Data types section.)| | + | |Strikeout (v4+)|::: |
- | |ScaleX| | + | |ScaleX|(v4+) These are multipliers that can be used to scale the subtitle.| |
- | |ScaleY| | + | |ScaleY|::: |
- | |(v4+) 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.| | |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.| | |BorderStyle|1 - Outline with shadow, 3 - Rendered with an opaque box.| | ||
Line 106: | Line 86: | ||
|Encoding|A number representing the encoding to be used.| | |Encoding|A number representing the encoding to be used.| | ||
+ | ---- | ||
+ | |||
+ | ===== Events section ===== | ||
+ | |||
+ | 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.| | ||
+ | |MarginL|4-digit margin override.| | ||
+ | |MarginR|::: | ||
+ | |MarginV|::: | ||
+ | |Effect|An effect or special directive associated with the line. Possible values are:| | ||
+ | |::: | ||
+ | |::: | ||
+ | |::: | ||
+ | |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 overrides ===== | ||
+ | |||
+ | 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, \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| | ||
+ | |b|0 1|Bold; off (0) or on (1)| | ||
+ | |i|0 1|Italic; off (0) or on (1)| | ||
+ | |u|0 1|Underline; | ||
+ | |s|0 1|Strikethrough; | ||
+ | |bord|width|Border| | ||
+ | |shad|depth|Shadow| | ||
+ | |be|blur amount|Outline blur ("blur edges" | ||
+ | |fn|Font name|Changes the font.| | ||
+ | |fs|size|Font size| | ||
+ | |fscx|Percent|Font scaling| | ||
+ | |fscy|::: | ||
+ | |fsp|pixels|Font spacing| | ||
+ | |fr/ | ||
+ | |frx|::: | ||
+ | |fry|::: | ||
+ | |fe|charset|Encoding number| | ||
+ | |c/ | ||
+ | |2c|::: | ||
+ | |3c|::: | ||
+ | |4c|::: | ||
+ | |alpha/ | ||
+ | |2a|::: | ||
+ | |3a|::: | ||
+ | |4a|::: | ||
+ | |an|alignment code|Alignment| | ||
+ | |k|duration (x0.01s)|The duration of time, in centiseconds, | ||
+ | |kf/ | ||
+ | |ko|::: | ||
+ | |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|([< | ||
+ | |pos|(x, | ||
+ | |move|(x1, | ||
+ | |org|(x, | ||
+ | |fade|a1, | ||
+ | |fad|fade in duration, fade out duration|Sets a fade-in and fade-out duration. 0 will effectively disable the effect.| | ||
+ | |clip|x1, | ||
+ | |clip|[scale, | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== File attachment ===== | ||
+ | |||
+ | Files can be attached to scripts and are stored as plain text. The method used is a form of UUEncoding. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Data types ===== | ||
+ | |||
+ | * **Color**: | ||
+ | * Transparency (alpha) can be expressed as & | ||
+ | * **Boolean values (Styles section)**: | ||
+ | * **Alignment**: | ||
+ | * 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**: | ||
+ | * The hour can only be a single digit. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | https:// |
ffmpeg/subtitles/ass_file_syntax.1735599767.txt.gz · Last modified: 2024/12/30 23:02 by peter