Expand description
Parser and writer for subtitle files in the EBU STL format, specified in EBU Tech 3264.
A file consists of a GsiBlock with general information, followed by TtiBlocks with
the text and timing of the subtitles. A subtitle may span several TTI blocks, use
Stl::subtitles to get the complete subtitles.
§Example
use ebustl_parser::parse_stl_from_file;
let stl = parse_stl_from_file("stls/test.stl").expect("Parse stl from file");
let dfc = stl.gsi.disk_format_code();
for subtitle in stl.subtitles() {
let header = subtitle.header_block();
println!(
"{:?} --> {:?}: {}",
header.time_code_in(dfc),
header.time_code_out(dfc),
subtitle.text()
);
}Re-exports§
pub use crate::parser::ParseError;
Modules§
- parser
- Parsing of STL data in memory.
Structs§
- Date
- A date in the GSI block (CD, RD), stored as YYMMDD.
- GsiBlock
- General Subtitle Information (GSI) block, the first 1024 bytes of an STL file.
- Invalid
Field Value - A field value that is invalid according to the spec, with the value as stored in the file.
- Language
Code - Language code of the subtitle list (LC), Tech 3264 Appendix 3.
- Stl
- A subtitle list in the EBU STL format: a GSI block followed by TTI blocks.
- Subtitle
- A subtitle made up of one or more consecutive TTI blocks.
- Subtitles
- Iterator over the subtitles of an
Stl, seeStl::subtitles. - Time
- A time code: hours, minutes, seconds and frames.
- TtiBlock
- Text and Timing Information (TTI) block, 128 bytes with the text and timing of a subtitle.
- TtiFormat
- Presentation of a subtitle created with
Stl::add_suborTtiBlock::new. - Validation
Issue - A deviation from the spec, found by
Stl::validate.
Enums§
- Character
Code Table - Character Code Table (CCT), the character set of the Text Fields in the TTI blocks.
- Code
Page Number - Code Page Number (CPN), the code page of the text in the GSI block.
- Color
- A teletext color, used by
TeletextControl::AlphaColorandTeletextControl::MosaicColor. - Cumulative
Status - Cumulative Status (CS), whether a subtitle is part of a cumulative set of subtitles.
- Disk
Format Code - Disk Format Code (DFC), the frame rate of the time codes.
- Display
Standard Code - Display Standard Code (DSC).
- Justification
- Justification Code (JC), the horizontal alignment of a subtitle.
- Open
Control - A control code for open (in-vision) subtitles (80h-85h).
- Teletext
Control - A teletext control code (00h-1Fh), Tech 3264 Appendix 2, reproduced from EBU Tech 3240.
- Text
Element - A part of the decoded Text Field of a subtitle.
- Time
Code Status - Time Code: Status (TCS), whether the time codes in the GSI and TTI blocks are intended for use.
Functions§
- parse_
stl_ from_ file - Reads and parses an STL file.