Documentation
¶
Index ¶
Constants ¶
const ASSHeader = "[Script Info]\n; Script generated by Ether\nScriptType: v4.00+\nPlayResX: 384\nPlayResY: 288\nScaledBorderAndShadow: yes\nYCbCr Matrix: None\n\n" +
"[V4+ Styles]\nFormat: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\n" +
"Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1\n\n" +
"[Events]\nFormat: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n"
ASSHeader is the script header RenderASS writes: FFmpeg's own header for a converted text track (PlayRes 384x288, one "Default" style), so a player that restyles "Default" (Plex Web's subtitle colour, size and position settings) treats it like the converted stream PMS sends.
Variables ¶
This section is empty.
Functions ¶
func AcceptsUploadFormat ¶
AcceptsUploadFormat is the Plex Web upload format check: case-sensitive on the wire. PMS accepts srt/ass/ssa/smi/txt/psb; Ether also accepts vtt.
func CleanCueText ¶
CleanCueText folds cue text to the markup the cue model carries: <i>, <b>, <u> and <font color="…">. WebVTT class (<c.white>), voice (<v …>) and language (<lang …>) spans, ruby markup, in-cue timestamp tags, ASS override blocks and every other tag are dropped, keeping the text they wrapped (a ruby annotation's own text goes with its tags). Without this, an SRT converted from WebVTT captions — Netflix-derived OpenSubtitles files are the common case — serves its <c.…> tags literally to SRT players that know nothing of WebVTT classes (#616).
func FormatASSTimestamp ¶
FormatASSTimestamp formats a duration as an ASS timestamp, H:MM:SS.cc.
func HasForeignTags ¶
HasForeignTags reports whether stored subtitle text carries markup the named format ("srt" or "vtt") must not be served with: any tag outside that format's set, or an in-cue WebVTT timestamp tag. Cached files written before cue text was cleaned at parse time are caught by this on read and re-rendered, so no migration pass is needed (#616).
func RenderASS ¶
RenderASS renders cues as an ASS script with ASSHeader: <i>, <b> and <u> become override tags, other markup is dropped and line breaks are \N.