Introduction
MPL2 is a plain text subtitle format; Subtitle Edit calls the same layout MPlayer2. FFmpeg looks for it in .mpl2 and .txt files.
Structure
Each line holds one subtitle: a start time and an end time in square brackets, then the text. Times count in tenths of a second. The end time may be left empty. The file may start with a UTF-8 byte order mark.
[start][end]text
[start][]text
In Subtitle Edit, | breaks the text into lines and a leading / makes a line italic.
Not described
This page is a short summary. The full rules are not yet described here, and there is no viewer for MPL2 files.
Known, not yet covered
- Reference: how different players treat styling and missing end times.
- Viewer: reading and showing the subtitles.
Also used for
- EBCDIC text – IBM mainframe text, not based on ASCII: a space at 40, letters at 81 and C1.
- GB18030 text – China’s national encoding: one, two or four bytes a character, covering all of Unicode.
- ISO-2022 and HZ text – 7-bit Japanese, Korean and Chinese text, with escape sequences that switch character sets.
- Legacy code page text – A pre-Unicode code page (Windows-1252, Mac OS Roman, DOS 437, Shift_JIS …), guessed.
- OGM chapters – Plain text chapter times and names in the OGM tools' form.
- OpenAir Airspace – OpenAir airspace file under its older extension.
- Plain text – Characters and line endings, nothing more, in an encoding the file rarely names.
- TI-TXT hex file – Texas Instruments text format for memory images.
- TMPlayer subtitles – Plain text subtitles with one start time and its text per line.
- UTF-16BE text – Unicode in two or four bytes a character, high byte first.
- UTF-16LE text – Unicode in two or four bytes a character, low byte first; Windows’ “Unicode”.
- UTF-32BE text – Every character in four bytes, high byte first. Rare in files.
- UTF-32LE text – Every character in four bytes, low byte first. Rare in files.
- UTF-7 text – Unicode written as pure ASCII, with runs of Base64 holding UTF-16 units.
- UTF-8 text – Unicode in one to four bytes a character, with ASCII unchanged; the usual text today.
- UltraStar song – Karaoke game songs: header lines, then timed and pitched syllables.
Links
Software
- Subtitle Edit – subtitle editor that reads and writes this format
- FFmpeg – media toolkit with an MPL2 reader
Reference
- mpl2dec.c – FFmpeg's MPL2 reader
- MPlayer2.cs – Subtitle Edit's code for the format