Skip to content

vtsi_mat

Classes:

Attributes:

AUDIO_FORMAT_AC3 module-attribute

AUDIO_FORMAT_AC3 = 0

AUDIO_FORMAT_LPCM module-attribute

AUDIO_FORMAT_LPCM = 4

AudioAttr dataclass

AudioAttr(audio_format: int, language: str)

Attributes:

audio_format instance-attribute

audio_format: int

language instance-attribute

language: str

VTSIMat dataclass

VTSIMat(reader: SectorReadHelper)

Attributes:

Source code
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
def __init__(self, reader: SectorReadHelper):
    vb0, vb1, = reader._seek_unpack_byte(0x0200, 1, 1)

    # beware http://www.mpucoder.com/DVD/ifo.html#vidatt
    # does not match libdvdread picture_size is at different position
    mpeg_version = (vb0 & 0b11000000) >> 6
    video_format = (vb0 & 0b00110000) >> 4
    picture_size = (vb1 & 0b00001100) >> 2

    self.vts_video_attr = VTSVideoAttr(mpeg_version, video_format, picture_size)
    self.vts_audio_attr = list[AudioAttr]()

    num_audio, = reader._seek_unpack_byte(0x0202, 2)

    for _ in range(num_audio):
        buf = reader.ifo.read(8)

        lang_type = (buf[0] & 0b1100) >> 2
        audio_format = (buf[0] & 0b11100000) >> 5

        if lang_type:
            lang = chr(buf[2]) + chr(buf[3])
        else:
            lang = 'xx'

        self.vts_audio_attr.append(AudioAttr(audio_format, lang))

vts_audio_attr instance-attribute

vts_audio_attr: list[AudioAttr] = list[AudioAttr]()

vts_video_attr instance-attribute

vts_video_attr: VTSVideoAttr = VTSVideoAttr(
    mpeg_version, video_format, picture_size
)

VTSVideoAttr dataclass

VTSVideoAttr(mpeg_version: int, video_format: int, picture_size: int)

Attributes:

mpeg_version instance-attribute

mpeg_version: int

picture_size instance-attribute

picture_size: int

video_format instance-attribute

video_format: int