Subtitles

class av.subtitles.stream.SubtitleStream

Bases: Stream

A SubtitleStream can contain many SubtitleSet objects accessible via decoding.

decode(Packet packet=None)

Decode a Packet and return a list of SubtitleSet.

Return type:

list[SubtitleSet]

See also

This is a passthrough to CodecContext.decode().

class av.subtitles.subtitle.SubtitleSet

Bases: object

A SubtitleSet can contain many Subtitle objects.

end_display_time
format
pts
rects
start_display_time
class av.subtitles.subtitle.Subtitle

Bases: object

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

type
class av.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 av.subtitles.subtitle.BitmapSubtitle

Bases: Subtitle

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

Bases: object

buffer_size
index
subtitle