Subtitles

class bv.subtitles.stream.SubtitleStream[source]

Bases: Stream

decode(packet: Packet | None = None) list[AssSubtitle] | list[BitmapSubtitle][source]
decode2(packet: Packet) SubtitleSet | None[source]
class bv.subtitles.subtitle.SubtitleSet

Bases: object

A SubtitleSet can contain many Subtitle objects.

Wraps AVSubtitle.

end_display_time
format
pts

Same as packet pts, in bv.time_base.

rects
start_display_time
class bv.subtitles.subtitle.Subtitle

Bases: object

An abstract base class for each concrete type of subtitle. Wraps AVSubtitleRect

type
class bv.subtitles.subtitle.AssSubtitle

Bases: Subtitle

Represents an ASS/Text subtitle format, as opposed to a bitmap Subtitle format.

ass

Returns the subtitle in the ASS/SSA format. Used by the vast majority of subtitle formats.

dialogue

Extract the dialogue from the ass format. Strip comments.

text

Rarely used attribute. You’re probably looking for dialogue.

class bv.subtitles.subtitle.BitmapSubtitle

Bases: Subtitle

height
nb_colors
planes
width
x
y
class bv.subtitles.subtitle.BitmapSubtitlePlane

Bases: object

buffer_size
index
subtitle