Subtitler:File Format
Subtitler files are well formed XML files with text-encoding UTF-8. From the UTF-8 characterset, control characters (asc 0-31) may not be used in the file except TAB (asc 9), LF (asc 10) and CR (asc 13). Preferred line-ending is CR, but a reader must support all variants (CR, LF, CRLF).
The root node xmldict contains an array of key-value pairs which can be in any order. The keys have the tag key and are strings containing letters and numbers, but no spaces. The values can have various tags depending on their type:
- string: A string of any length up to 2 GB
- integer: A signed integer from -2 billions to 2 billions
- real: A double precision floating point value
- true/
- false/
- color: A 24bit RGB color value in hex notation, eg #FFFFFF
- date: notation YYYY-MM-DD HH:MM:SS
- array: A nested array with values (currently not used)
- dict: A nested dictionary with other key-value pairs
- null/
Following the structure of the subtitler nodes
- document
- creator: string. Must be SICT
- type: string. Must be STLI
- version: real. Must be 1.4 or higher
creationdate: date
- modificationdate: date
- mainleft: integer. Window left, optional
- maintop integer. Window top, optional
- mainwidth: integer. Window width, optional
- mainheight: integer. Window height, optional
- exportformat: string. PICT, PICT-alpha, TIFF, TIFF-RLE or TIFF-DVD, optional.
- style: optional
- standard: string. PAL, PAL 16:9, NTSC, HD etc.
- framerate: string
- height: integer
- width: integer
- widthreal: integer (square-pixel width)
- interlaced: boolean
- antialiasing: integer. must be 4.
- font: string
- size: integer
- spacing: integer
- leading: integer
- bold: boolean
- italic: boolean
- underline: boolean
- halign: integer (0 left 1 center 2 right)
- valign: integer (0 top 1 center 2 bottom)
- left: integer
- right: integer
- vertical: integer
- wrapmethod: integer (0 no wrap, 1 simple wrap,2 smart wrap)
- textcolor: color
- textalpha: real. 1.0 is opaque
- textsoft: integer
- bordercolor: color
- borderalpha: real
- bordersoft: integer
- borderwidth: integer
- shadowcolor: color
- shadowalpha: real
- shadowsoft: color
- shadowx: integer
- shadowy: integer
- rectcolor: color
- rectalpha: real
- rectsoft: color
- rectform: integer (1 1 box, 2 2 box, 3 fixed)
- folderpath: string
- prefix: string
- moviepath: string
- movieoffset: string (formatted timecode)
- pagesetup: string
- titlelist: string
Titellist format
The titlelist is saved exactly as it is shown in the program. The titlelist is the source file to create the subtitles. Spotting, title-level style and filenaming are embedded within the titlelist and written directly by the users.
Subtitles are separated by double line endings.
Any line starting with slash / (except double slash) is a comment. All other lines are textlines. Only the first two lines are processed.
Note: Because of simple and smart wrapping, a single line in the titlelist can already represent two lines of subtitles. In this case, only this line will be processed.
The following comments are processed:
- /tc 00:00:00:00 00:00:00:00: Spotting information. Second timecode is out-point, eg. the frame after the subtitle disappears. Spotting is optional.
- /file filename: Filename of the exported file. The filename will be completed by the prefix defined in the file and by the file extension defined in the exportformat and in the preferences (eg .tif or .tiff). Filenames are optional. If they are not defined, serial numbering is used.
- /style plain italic bold underline left center right color(255,255,255) vertical(n) boxlevel(n): Optional title level styles
In the subtitle text, also character-level styles are supported, using html-style tags.
- < b >bold< /b >
- < i >italic< /i >
- < u >underline< /u >
Character level styles may not be nested.
Testing
The offline version of Belle Nuit Subtitler is available for download. Third party developers can open and save Subtitler files with this version without restrictions.
Format history
The current Subtitler file format was introduced with version 1.4 and replaced a binary format. The format is backwards and forwards compatible between all Subtitler versions with some restrictions:
- Later versions may introduce properties that are not known than former versions. These properties are ignored by the former version and are lost when saving the file.
- The physical interpretation of some values may change over time. For example, the border thickness has changed between two versions
- The titlelist is source text with comments. New comments like /tc have been introduced which have no meaning in older versions.