Avutil.SubtitleSubtitles.
One subtitle: a native FFmpeg subtitle with its rectangles and their bitmaps and texts. The value owns all of it, is immutable, and is released when it is collected.
The kinds of subtitle rectangle (none, bitmap, text, ASS), generated from FFmpeg's headers at build time.
The flags of a subtitle rectangle, generated from FFmpeg's headers at build time.
A default ASS script header: a [Script Info] section, a [V4+ Styles] section with one style named Default, and the Format line of the [Events] section. Every line ends with CR LF.
The bitmap of a rectangle.
x, y: position of the top left corner.w, h: width and height.nb_colors: number of colours of the palette.planes: (data, linesizes), the 4 planes and their 4 line sizes. Both arrays have exactly 4 elements; an absent plane is an empty bigarray. The size of plane i is fixed by the other fields: AVPALETTE_SIZE bytes for plane 1 of a rectangle of type bitmap, which is its palette; otherwise h * linesizes.(i) when both are positive; otherwise 0.type rectangle = {pict : pict option;flags : subtitle_flag list;rect_type : subtitle_type;text : string;ass : string;}One rectangle of a subtitle.
pict: the bitmap, when the rectangle has one.text: plain text, or the empty string when there is none.ass: an ASS event line, or the empty string when there is none.type content = {format : int;start_display_time : int;end_display_time : int;rectangles : rectangle list;pts : int64 option;}The whole content of a subtitle, as plain OCaml data.
format: FFmpeg's subtitle format field, 0 for graphics. It fits an unsigned 16-bit integer.start_display_time: when the display starts, in milliseconds relative to pts. From 0 to 2^32 - 1.end_display_time: when the display ends, in the same unit and range.pts: presentation timestamp in units of time_base (microseconds), or None for no timestamp.create_frame content builds a subtitle that holds a copy of content: the texts and every non-empty plane are copied, and an empty text or ass is stored as absent. get_content (create_frame content) equals content.
get_content frame returns a fresh copy of the content of frame. A rectangle has pict = Some _ exactly when it has a first plane. Each plane is a new bigarray managed by the OCaml runtime; changing it does not change frame.
val get_pts : frame -> int64 optionThe presentation timestamp of the subtitle: the pts field of get_content, without copying the rest.